Going back to this thread from earlier this calendar year...

Ganesh wrote:
Hi Dick,

Jeff paraphrased an unnamed source as suggesting that: "any MPI program that relies on a barrier for correctness is an incorrect MPI application." . That is probably too strong.

How about this assertion?

If there are no wildcard receives - every MPI_Barrier call is semantically irrelevant.

This depends on what 'semantically irrelevant' means.  It is clear that one can write a wildcard-free program that will deadlock if you insert a barrier incorrectly, but that removing the barrier will avoid the deadlock. (Imagine P1 doing a Send; Barrier and P2 doing a Barrier; Receive(nonwildcard)).

So a wildcard-free program may still deadlock (semantically noticeable effect) by having barriers. I'm sure you did not mean to include this degenerate nit-pick - but yes otherwise you are right!
And similarly (to disprove Jeff's original assertion), if there are wildcards, then an MPI_Barrier call could be semantically relevent.

E.g., let's say P0 and P1 each send a message to P2, both using the same tag and communicator.  Let's say P2 does two receives on that communicator and tag, using a wildcard source.  So, the messages could be received in either order.  One could introduce barriers to order the messages.  E.g.,

P0:
  Send
  Barrier
P1:
  Barrier
  Send
P2:
  Recv
  Barrier
  Recv

Reply via email to