Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] defining different values for same environment variable
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2009-03-02 08:41:17

On Mar 2, 2009, at 4:02 AM, Nicolas Deladerriere wrote:

> > I think you missed Matt's point -- he was suggesting writing a
> single script that just reacts accordingly to which host it is on
> and sets > the environment variable before launching your back-end
> MPI executable.
> I got it, but I would like to be able to do it without creating/
> copying new script on all nodes.

Don't you already need to make your MPI executable available on all

You could also use OMPI's "filem" mechanism to copy the script out to
all nodes. I actually never remember the details on this; Josh -- can
you fill in here?

> > Additionally, note that mpirun's -x option *can* set environment
> variable.
> yes but with the following syntax, the $HOST environment variable is
> interpretated on all first node (where mpirun command is launched)
> and then exported to all other nodes.
> mpirun -np 2 -x FOO="yow_$HOST"
> Is there another syntax to use ?
> I could then use similar syntax than your previous example, but it
> is not really conveniant for 128 nodes ! :
> mpirun -np 1 -x FOO="yow_n001" : -np 1 -x FOO="yow_n002" .......

You can do a similar syntax in a file -- instead of using :'s to
delimit the stanzas, you put each stanza on a separate line.

Jeff Squyres
Cisco Systems