[petsc-users] Is there a bug in VecRestoreSubVector?

Eric Chamberland Eric.Chamberland at giref.ulaval.ca
Thu Oct 9 09:00:30 CDT 2014


Hi,

I noticed it because I got a strange behavior when computing y=Ax with 
(a wrongly) non-contiguous stride in parallel.  Normally, the 
VecRestoreSubVector should have exited with an error ("Unhandled case, 
values have been changed and need to be copied back into X) but didn't, 
resulting in a silently wrong result (ouch).

I corrected my code to define a contiguous stride, which "bypass" the 
bug in VecRestoreSubVector and now I hopefully compute the correct result.

You may be interested by:

 
https://bitbucket.org/placasse/petsc/commits/4e4323587ad9148c29ba9101e5030629f073700c

By the way, if I have no local unknowns on a process, shall the stride 
*always* be considered locally contiguous? (this is my initial error on 
how to define a stride when no unknowns are locally owned).

Thanks,

Eric


More information about the petsc-users mailing list