Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Python Binding problem with openmpi-1.3.2
From: Neil Ludban (nludban_at_[hidden])
Date: 2009-07-13 15:59:59


> Date: Mon, 13 Jul 2009 14:27:13 -0400
> From: Rainer Keller <keller_at_[hidden]>
> Subject: Re: [OMPI users] Python Binding problem with openmpi-1.3.2
> To: users_at_[hidden]
> Cc: "Evans, Thomas M." <evanstm_at_[hidden]>
> Message-ID: <200907131427.13656.keller_at_[hidden]>
> 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());
   }