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

Jed Brown jed at jedbrown.org
Thu Oct 9 10:41:16 CDT 2014


Hi, Eric.  Fabian reported this a couple days ago (all, petsc-users is
preferred so that people can see recent discussion).

Thanks for linking to Patrick's report.  I have extended it to simplify
the code a bit and reduce synchronization, but I don't have a test case
handy and I'm about to board a plane.  Could you try 'next' (or
'placasse/VecGetSubVector' in petsc.git, which has my follow-up commits)
to let me know if it works for you.

https://bitbucket.org/petsc/petsc/issue/75/vecrestoresubvector-silently-ignores-non

Eric Chamberland <Eric.Chamberland at giref.ulaval.ca> writes:

> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141009/9df09a25/attachment.pgp>


More information about the petsc-users mailing list