On Nov 22, 2005, at 12:20 PM, Anthony Chan wrote:
This is not a bug just wonder if this can be improved. I have been
running openmpi linked program with command
<openmpi-install-dir>/bin/mpirun --prefix <openmpi-install-dir> \
--host A -np N a.out
My understanding is that --prefix allows extra search path in addition
to
PATH and LD_LIBRARY_PATH, correct me if I am wrong.
Sort of. It actually uses an absolute pathname to launch various
executables (as opposed to launching executables with relative
filenames and letting the $PATH figure it out).
Assuming that openmpi's install directory structure is fixed, would it
possible for
mpirun to search <openmpi-install-dir> automatically for libmpi.so &
friends so to avoid the redundant --prefix <openmpi-install-dir> to
mpirun ?
Yes and no.
For the launched processes, yes, we set PATH and LD_LIBRARY_PATH so
that you don't have to in your shell startup files.
But for mpirun itself, no we cannot, because of unix linker/shell
semantics. When you type "mpirun", mpirun itself won't launch until
liborte.so can be found (one of our support libraries). So if the unix
linker can't find liborte.so when you try to launch mpirun, there's
nothing we can do about it -- mpirun isn't even launched, so there's no
code that we can have to set LD_LIBRARY_PATH. That being said, the
rpath in mpirun should be set such that liborte.so should be found
automatically (i.e., without you having to set LD_LIBRARY_PATH).
Hence, the unix linker should be able to find liborte.so regardless of
what you have in LD_LIBRARY_PATH.
The --prefix option is to set LD_LIBRARY_PATH for the started
executables because, at least at the moment, we are not setting the
rpath in user-compiled MPI executables via the wrapper compilers. This
is on the to-do list, but it didn't happen for 1.0.
--
{+} Jeff Squyres
{+} The Open MPI Project
{+} http://www.open-mpi.org/