[petsc-dev] changes coming to PETSc master branch
Barry Smith
bsmith at mcs.anl.gov
Thu Jan 29 11:32:23 CST 2015
I have implemented Jed's excellant VecLockPush/Pop() idea into a branch and will be merging it into next today and then eventually into master.
VecLockPush() puts a vector into read only state which can only be undone by the appropriate number of VecLockPop()s. Routines such as VecSetValues() and VecGetArray() check the read only state and generate errors when it is set.
This means that everyone must be much more careful when using VecGetArray() and friends and default to VecGetArrayRead() and friends unless they are specifically changing the values. It also means that many more array variables need to be marked as const (which is always a good thing). I have updated the core PETSc with all these changes but users will need to change code and any outstanding branches may need these changes also to work cleanly with next.
Barry
It is a minor headache now but is a good move going forward. Why I didn't do it in 1994 I'll never know.
More information about the petsc-dev
mailing list