> Date: Mon, 13 Jul 2009 14:27:13 -0400 > From: Rainer Keller <kel...@ornl.gov> > Subject: Re: [OMPI users] Python Binding problem with openmpi-1.3.2 > To: us...@open-mpi.org > Cc: "Evans, Thomas M." <evan...@ornl.gov> > Message-ID: <200907131427.13656.kel...@ornl.gov> > Content-Type: Text/Plain; charset=iso-8859-1 > > Hi Tom, > as discussed, the following threads may help You? > > http://www.open-mpi.org/community/lists/users/2009/02/8158.php > http://www.open-mpi.org/faq/?category=running#loading-libmpi-dynamically
We ran into this a few months ago with the bcMPI interpreter bindings and I forgot to post our code for possible inclusion in the FAQ. (Having never used dlopen before, it took some trial and error to get it to work right.) The C code below was put in a separate extension *not* linked against MPI and called before any MPI extension functions. Note we didn't bother with a matching dlclose since the program is expected to exit, this hasn't been a problem so far. #include <dlfcn.h> void *handle; handle = dlopen("libmpi.so", RTLD_LAZY|RTLD_GLOBAL); if (handle == NULL) { fprintf(stderr, "%s\n", dlerror()); }