[Trilinos-Users] Epetra_MpiComm::Barrier(): how to synchronize more than once?

Joachim Wuttke j.wuttke at fz-juelich.de
Tue Jun 20 06:17:02 EDT 2017


 From the docs:
Epetra_MpiComm::Barrier() causes each processor in the
communicator to wait until all processors have arrived.

Empirical finding:
Must be called only once.

So this works:

   MPI_Init(..)
   Epetra_MpiComm Comm( MPI_COMM_WORLD );
   ..
   Comm.Barrier();
   ..
   MPI_Finalize();

But not:

   MPI_Init(..)
   Epetra_MpiComm Comm( MPI_COMM_WORLD );
   ..
   Comm.Barrier(); # mark 1
   ..
   Comm.Barrier(); # mark 2
   ..
   MPI_Finalize();

Empirically, I find that processors will not
wait until all processors have arrived at mark #2.

How to enforce the desired behavior?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5110 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20170620/1801c5bf/attachment.p7s>


More information about the Trilinos-Users mailing list