JCuda and MPI (MPJ Express)

Hi, All!

I try use JCuda and Java MPI implementation (http://mpj-express.org/).
If I start several program instances on one computer with JCuda-0.2.3 on gentoo 64 bit then get error:
Error while loading native library with base name “JCudaDriver”
Operating system name: Linux
Architecture : amd64
Architecture bit size: 64
java.lang.UnsatisfiedLinkError: Native Library /mnt/windata/My/Projects/MicroS/Micros64/MicroSeism/JCudaLib64/libJCudaDriver-linux-x86_64.so already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1768)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at jcuda.LibUtils.loadLibrary(LibUtils.java:53)
at jcuda.driver.JCudaDriver.(JCudaDriver.java:82)

If I start several program instances on one computer with JCuda-0.3.0a on gentoo 64 bit then get error:
Error while loading native library with base name “JCudaDriver”
Operating system name: Linux
Architecture : amd64
Architecture bit size: 64
and program hang.

Help, please.

Hello

I have no experience with MPI/MPJ, but maybe you’ll find this site helpful: http://bibrak.blogspot.com/2010/02/mpj-cuda.html (if you not already found it yourself).

I did a websearch on the error message, and it seems that you have to assure that the JCuda class is loaded only once, by a System Classloader (see http://onjava.com/pub/a/onjava/2004/06/30/classloader2.html?page=1 at the bottom, for example). However, since I don’t know the exact mechanisms of MPJ and how the class loading is managed, I can not give more specific information. The User Guide of MPJ does not seem to say anything about Classloaders, though -_-

How do you start these instances? Running two instances in two JVMs should be no problem, of course, but I’m not sure at which point MPJ comes in…

bye
Marco