On Tue, 2009-03-24 at 07:03 -0800, Eugene Loh wrote:
> > Perhaps there is a better way of accomplishing the same thing however,
> > MPI_Barrier syncronises all processes so is potentially a lot more
> > heavyweight than it needs to be, in this example you only need to
> > syncronise with your neighbours so it might be quicker to use a
> > send/receive for each of your neighbours containing a true/false value
> > rather than to rely on the existence of a message or not. i.e. the
> > barrier is needed because you don't know how many messages there are,
> > it may well be quicker to have a fixed number of point to point
> > messages rather than a extra global synchronisation. The added
> > advantage of doing it this way would be you could remove the Probe as
> > well.
> I'm not sure I understand this suggestion, so I'll say it the way I
> understand it. Would it be possible for each process to send an "all
> done" message to each of its neighbors? Conversely, each process would
> poll its neighbors for messages, either processing graph operations or
> collecting "all done" messages depending on whether the message
> indicates a graph operation or signals "all done".
Exactly, that way you have a defined number of messages which can be
calculated locally for each process and hence there is no need to use
Probe and you can get rid of the MPI_Barrier call.