LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Brian Barrett (brbarret_at_[hidden])
Date: 2006-02-04 11:38:23


On Feb 3, 2006, at 6:47 PM, Ross Boylan wrote:

> The man page for mpirun (7.1.1, Sept 2004) has a discussion of I/O
> redirection with many references to the "local node" or "the node that
> invoked mpirun."
>
> Should "the session of rank 0" be read in all those cases?
> Potentially
> several sessions could be running on the node from which you ran
> mpirun,
> and having them share stdin sounds impossible and sharing stdout
> undesirable.
>
> Then again, maybe rank 0 doesn't need to be on the same node as the
> one
> used to execute mpirun, so my alternate formulation seems to have some
> holes too.

LAM/MPI uses a neat Unix trick for its standard input redirection,
passing the stdin file descriptor from mpirun to rank 0 of the
launched MPI application. This only works if mpirun and rank 0 are
on the same node (hence the references in the documentation). If
mpirun and rank 0 are on different nodes, LAM is unable to pass the
file descriptor for stdin and no standard input redirection is
available.

Since there is essentially a one-to-one mapping between MPI
applications and invocations of mpirun (with the exception of
singleton applications), each rank 0 that meets the requirements
above has its mpirun's stdin file descriptor and each therefore has a
separate standard input stream.

By the way, Open MPI deals with standard input the same way it treats
standard output (and indeed, the same way LAM deals with standard
output). It doesn't matter on which nodes mpirun and rank 0 reside
-- each job will have rank 0 wired up to mpirun's standard input stream.

Hope this helps. This is always a bit more confusing than it really
should be, so if I didn't answer your question, please let me know.

Brian

-- 
   Brian Barrett
   LAM/MPI developer and all around nice guy
   Have a LAM/MPI day: http://www.lam-mpi.org/