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: 2005-07-08 14:34:26


On Jul 8, 2005, at 12:54 PM, Bharath Ramesh wrote:

> I am trying to load a shared library written by me for my mpi
> application. But when I call mpirun its unable to locate the shared
> library. The shared library does exist in the path. I have also set
> the
> LD_LIBRARY_PATH. As you can see from the output of ldd its able to
> locate the library.
>
> I am attaching the output
>
> $ ldd ./test
> libdsm.so.1 => ./libdsm.so.1 (0x0000002a9566c000)
> liblamio.so.4 => /usr/lib/liblamio.so.4 (0x0000002a95772000)
> liblam.so.4 => /usr/lib/liblam.so.4 (0x0000002a9589e000)
> libutil.so.1 => /lib/libutil.so.1 (0x0000002a95aa8000)
> libdl.so.2 => /lib/libdl.so.2 (0x0000002a95bac000)
> libpthread.so.0 => /lib/libpthread.so.0 (0x0000002a95caf000)
> libc.so.6 => /lib/libc.so.6 (0x0000002a95dc3000)
> /lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
> (0x0000002a95556000)
>
> $ lamnodes
> n0 compute1:1:origin,this_node
> n1 compute2:1:
>
> $ mpirun -v N ./test
> 30269 ./test running on n0 (o)
> 26474 ./test running on n1
> ./test: error while loading shared libraries: libdsm.so.1: cannot open
> shared object file: No such file or directory
> ----------------------------------------------------------------------
> -------
> It seems that [at least] one of the processes that was started with
> mpirun did not invoke MPI_INIT before quitting (it is possible that
> more than one process did not invoke MPI_INIT -- mpirun was only
> notified of the first one, which was on node n0).
>
> mpirun can *only* be used with MPI programs (i.e., programs that
> invoke MPI_INIT and MPI_FINALIZE). You can use the "lamexec" program
> to run non-MPI programs over the lambooted nodes.
> ----------------------------------------------------------------------
> -------

The launched executable is going to have the LD_LIBRARY_PATH of the
lamd that started it, not the LD_LIBRARY_PATH of mpirun. So you need
to make sure that you re-lamboot after setting up your shell to
properly set your LD_LIBRARY_PATH for non-interactive logins.

The other option is to have mpirun push it's LD_LIBRARY_PATH as part
of the environment "test" will run under. Something like:

   mpirun -v -xLD_LIBRARY_PATH N ./test

should do the trick.

Brian

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