[petsc-users] Debugging MatAssemblyEnd

Jed Brown jedbrown at mcs.anl.gov
Fri Aug 26 07:53:25 CDT 2011


On Fri, Aug 26, 2011 at 04:19, Dominik Szczerba <dominik at itis.ethz.ch>wrote:

> I seem to have had a classical deadlock, A was being assembled while
> some threads lurked around elsewhere. Adding some barriers seems to
> fix the problem, at least with the cases I currently have.
>

Barriers should never affect the correctness of a pure MPI code that doesn't
do weird things like communicate through the filesystem. We use the barriers
for debugging, but they can generally be removed once the underlying issue
is sorted out.

Also, when you say "threads", are you referring to MPI processes, or are you
using actual threads (e.g. pthreads or OpenMP)?


>
> What I still miss is what would be the advantage of
> MPI_Barrier(((PetscObject)A)->comm) over
> MPI_Barrier(PETSC_COMM_WORLD).
>

I don't know whether all processes on PETSC_COMM_WORLD are supposed to pass
through this assembly. If A was on a subcommunicator, then only those
processes should be calling assembly. Note that these communicators are the
same for many users.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110826/fdefdf56/attachment.htm>


More information about the petsc-users mailing list