[petsc-users] Vec entries altered incorrectly

Juha Jäykkä juhaj at iki.fi
Mon Dec 19 13:18:03 CST 2011

> I guarantee you this is not a bug. This stuff is used by thousands of
> people every day.

That's what I thought, too.

> Its very simple and old code. There is a misunderstanding somewhere in your
> code about how this mechanism works. I suggest stripping down the code until
> there are just two vectors and you alter one.

Stripping it down will take a while, it is a relatively long piece, but I did 
notice something that strikes me as odd:

What is the correct Fields.hdr.state at the point before calling 
DAGlobalToLocalBegin()? My two vectors have a different value there and I 
suspect that might be the reason. (The other vec has state 4, the other has 

If that is so, how can that happen? I have checked quite a few times that all 
DAGlobalToLocalBegin's have the corresponding End-call, that I pair every 
DAVecGetArray with DAVecRestoreArray, and every DAGetLocalVector with 
DARestoreLocalVector. Does the order in which I process the vectors matter 
here? The order of DAGetLocalVector, DAGlobalToLocalBegin/End, and 
DAVecGetArray for each vector obviously matters.


		| Juha Jäykkä, juhaj at iki.fi			|
		| http://www.maths.leeds.ac.uk/~juhaj		|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111219/c9e44e31/attachment.pgp>

More information about the petsc-users mailing list