How to make cula and mpi work together?

I’m using pgi workstation 2010 on centos 5.5 X64. I want compile MPI and cula together, when these two lib work separately, they are ok. When i complie it, there’s also nothing wrong. But when run the program using command

 mpirun -np 2 ./mpihello
/root/Desktop/mpi/./mpihello: error while loading shared libraries: libcula_pgfortran.so: cannot open shared object file: No such file or directory
p0_15819:  p4_error: Child process exited while making connection to remote process on localhost: 0
p0_15819: (2.128906) net_send: could not write to fd=14, errno = 32

I don’t know how this happened, I add cula lib using the way mentioned on http://www.pgroup.com/lit/articles/insider/v2n3a5.htm
and if only using 1 node, let np=1, there will be ok. How to fix this problem? Thanks.[/url][/code][/quote]

Hi siwuxie,

This is a general issue when a remote node does not have an executable’s dependent shared libraries installed or the executable can’t find them.

The solution is to copy the shared libraries to all nodes of your cluster. Preferably, you copy them to the same location as your head node. (tip: use the 'ldd " command on the head node to see the dependent shared libraries and their locations). If you can not copy the libraries to the same location, then you will need to set the environment variable “LD_LIBRARY_PATH” to the locations of the libraries. Some versions of mpiexec allow you to pass this environment variable, otherwise you may need to set this in your shell’s RC file. Please see the documentation for your version of MPI for details.

Hope this helps,
Mat