Olá Gus

 Álvaro would be a better name for me... Oh GRRRRRRRR Eterno!

 ;)

On Sat, 14 Nov 2009, Gus Correa wrote:

I think MPI doesn't ensure that the output will come ordered
according to process rank, as in your expected output list.
Even MPI_Barrier doesn't sync the output, I suppose.
It syncs only the communication among the processes,
but you actually have no communication on your code!
(Other than the barrier itself, of course.)

The definition of barrier is

Blocks the caller until all group members have called it; the call returns at any process only after all group members have entered the call.

You have a different stdout buffer for each process,
and the processes probably compete for access
to the (single) output file,
when they hit "call flush", I would guess.

There is not a diferent stdout for each process, I'm testing in the same machine. The stdout is the console. When in the cicle, they should all sync at the BArrier. As only one of them is allowed, by the if, to print and then is forced to flush, there is only one process for each main iteration with access to stdout.

Note that both lists you sent have exactly the same lines,
though in different order.
I think this is telling that there is nothing wrong
with MPI_Barrier or with your code.

No, the problem is that they are in different order. My small inner cicle should guarantee they would be outputing in the right order

Also, on your outer loop istep runs from 1 to 4,
and process rank zero prints an asterisk at each outer loop iteration.
Hence, I think four asterisks, not three, should be expected, right?
Four asterisks is what I see on your first list (the shuffled one),
not on the ordered one.

Yes, your right, there should be 4 * . But that is not my main worry about this code output.

One way would be to send everything to process 0,
and let it order the messages, `a la mode de "hello_world",
but this would be kind of cheating.
Maybe there is a solution with MPI-IO,
to concatenate the output file they way you want first,
then flush it.

Yes, I know. But this should function if the Barrier would be working has supposed. I've seen it working previously and I'm seing it working in other MPI implementations (mvapich)

So, what's the catch?

Grande abraço a um conhecedor de Pessoa e habitante do país de Walt Whitman,


 Ricardo Reis

 'Non Serviam'

 PhD candidate @ Lasef
 Computational Fluid Dynamics, High Performance Computing, Turbulence
 http://www.lasef.ist.utl.pt

 Cultural Instigator @ Rádio Zero
 http://www.radiozero.pt

 Keep them Flying! Ajude a/help Aero Fénix!

 http://www.aeronauta.com/aero.fenix

 http://www.flickr.com/photos/rreis/

Reply via email to