| 647a6db4 | 22-Feb-2019 |
Junchao Zhang <jczhang@mcs.anl.gov> |
Always use const data as key to look up links in SF
With this modification, we can have a VecScatter implementation that in VecScatterBegin(..,x,y,..), one only accesses the read-only vector x and d
Always use const data as key to look up links in SF
With this modification, we can have a VecScatter implementation that in VecScatterBegin(..,x,y,..), one only accesses the read-only vector x and does not access y - the vector to write. Access to y is pushed to VecScatterEnd(..,x,y,..).
The benefit is that we can get rid of VecGet/RestoreArray(y,..) in VecScatterBegin(). For vectors that are on GPU or not petsc native (e.g., VecNest), getting/restoring arrays are quite expensive.
In other words, we do lazy data access -- we only access data when we need it. This discussion also applies to PetscSFXxxBegin/End.
show more ...
|