On Wed, 2006-08-23 at 18:22 +0800, Aidaros Dev wrote:
> The all Do A,B,C and D is almost take same time,
> when i run: mpirun -nolocal -np 2 machinefile -machines ./out
> the output:
>
> Doing C finish
> Doing D finish
> myid 1 end
> Doing A finish
> Doing B finish
> myid 0 end
>
> Why the myid 0 doenst start untill myid 1 finish and vice versa? these
> two processors should work at the same time ,not in serial.
> Why the MPI_Barriar has been skipped? one processor should wait until
> other call it.
>
> Any one can tell me what im missing.
What you're missing is that there's no guarantee of ordering for
standard output between ranks in MPI. Depending on how I/O forwarding
is implemented, your program could have a number of different output
sequences -- all of which are correct.
The only ordering guarantee LAM makes regarding standard output is that
order is maintained from a given rank. So "Doing C" will always come
before "Doing D", but nothing is said about "Doing C" relative to "Doing
A". Also, because standard output can be buffered in a number of
places, it's incorrect to assume that your output suggests barrier isn't
working. All it suggests is that rank 0's output got buffered somewhere
for a little while.
Brian
|