LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Ross Boylan (ross_at_[hidden])
Date: 2006-02-04 12:23:44


On Sat, Feb 04, 2006 at 10:38:23AM -0600, Brian Barrett wrote:
> 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

The references in the documentation also seem to cover non-rank 0
processes running on the node that invoked mpirun. Am I correct that
meaning is not intended?

So stdin redirection only applies to a process which is both rank 0
and on the node from which mpirun was invoked. And your description
below implies that in OpenMPI the restriction is relaxed: rank 0
anywhere gets the special treatment. Right?

And all processes everywhere share stdout on the node invoking
mpirun. Does that apply to spawned processes as well?

> 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.

Thanks for the info.