On Wed, 6 Aug 2003 Nils.Stritzel_at_[hidden] wrote:
> [hello world program snipped]
> me_at_computer:~>mpirun n0-3 a.out
> hello
> hello
> hello
> hello
>
> I had this problem in a bigger program so this is just an abstraction I
> create to see where my thinking is wrong. Can anybody help?
This is correct behavior.
More to the point, the MPI standard does not specify what happens before
MPI_Init. In LAM/MPI, we actually fork/exec a new process for every MPI
process, and they all therefore enter via their own main().
Other MPI implementations may not do the same thing -- it is permissable,
for example, to simply fork threads during MPI_Init. In this case, there
would likely be only one entry via main, but several "MPI processes" after
MPI_Init.
--
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/
|