[MPICH] a problem with MPI

Anna Mereu anna.mereu at diee.unica.it
Mon Sep 24 11:32:40 CDT 2007


Hi, i have a problem concerning the implementation of a program in a 
parallel way. I don't know if this is the  right forum, but i don't know 
any other forum that can help me.
Inside my program i have  a procedure that must be parallel. So at the 
beginning and at the end of it, there are the MPI_Init and MPI_Finalize 
commands. At this point all seems to go correctly.
But the fact is that i have to run this procedure a lot of times 
subsiquently, and i do it with a for cycle.
The problem that occurs to me is that, while during the first iteration 
the process ids go from 0 to nproc-1 (so i can simpy identify them and 
assign different jobs to them), during the next iterations the ids are 
different and in particular they seem to be random. In this way i cannot 
identify a job (for instance the master) from another.
In practice inside the procedure i have something like...

if(myid==0) then......
else.....

How can i face this problem?

Thank you in advance for the help

Anna




More information about the mpich-discuss mailing list