LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2005-03-29 16:57:40


On Mar 29, 2005, at 4:30 PM, Kumar, Ravi Ranjan wrote:

> Infact I am printing out the 'rank' and 'time' step just before
> calling the
> MPI_Barrier. When all the ranks except 1 and 6 reach 250th time step,
> rank 1 & 6 just reaches 100th time step. Is this just because of the
> printing order or am I doing some mistake in implementing what I want
> from code? Also I am using MPI_Allreduce which should also enfore
> parallel stepping of all the processes. isn't it? Pls clarify.

Yes, you cannot rely on the ordering of this output, even with barriers
-- particularly if your iteration is really short. Output can get
buffered for a while on a remote node before it is sent over to mpirun,
for example.

Allreduce should also do a pretty good job of enforcing
synchronization, since, by definition, every process needs to get
result (specifically: it meets the same definition of barrier in this
case -- assuming that every process contributes data [i.e., count>0],
no process can leave allreduce until all processes have entered
allreduce). So your barrier is actually redundant in this situation.

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/