[petsc-users] race conditions in VecSetValue(s)

Barry Smith bsmith at mcs.anl.gov
Mon Aug 1 16:05:48 CDT 2011


On Aug 1, 2011, at 2:59 PM, Dominik Szczerba wrote:

> What will happen if VecSetValue(s) called from different processes
> want to update the value at the same position in the global MPI
> vector?
> Is there a some sort of queue/lock

   No

> or will a race condition result?

  No.

> It's not discussed in the documentation.

   Yes it is :-)


   If ADD_VALUES is used then the location will always get the correct sum. 

   If INSERT_VALUES is used then one of the values set will be used but it is not defined which one.

   Barry

> 
> Thanks for any clarification,
> Dominik



More information about the petsc-users mailing list