MPI on beowulf - problem with dynamically loaded libraries

MPI on beowulf - problem with dynamically loaded libraries

Post by Ron » Thu, 07 Jun 2001 10:09:06



I have an application that make use of dynamically loaded libraries
(using dlopen/dlsym).  The application calls MPI_Init and then make MPI
calls.  No problem with that.  Then the app loads a library and call a
function in that library, which makes some MPI calls, and it complains
MPI is not initialized.  And when the function returns and the program
go back to the main body, then MPI stops complaining.

Is this a bug with MPI?  Or am I missing something?  I tried calling
MPI_Init in the library as well but I get SIGSEGV

This is running on
Linux 2.2.17-33.beo i686

and the MPI I'm running is
beompi-1.0.14-1

The following exhibits the problem

// test.cc

#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
#include <dlfcn.h>

void main(int argc, char **argv) {

  MPI_Init(&argc, &argv);
  int test;
  MPI_Initialized(&test);
  if (test) {
    cerr << "MPI initialized in main" << endl; cerr.flush();
  } else {
    cerr << "MPI not initialized in main" << endl; cerr.flush();
  }

  void *handle=dlopen("/home/rchoy/test/pptest.pp",RTLD_LAZY);
  if (!handle) {
     printf("dlopen: %s\n", dlerror());
  } else {
    void (*func)(void) =dlsym(handle, "testfunc__Fv");
    if (!func) {
      printf("dlsym: %s\n", dlerror());
    } else {
      func();
    }
    dlclose(handle);
  }  
  MPI_Finalize();

Quote:}

// pptest.cc
#include <mpi.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>

void testfunc();
void testfunc() {
  int test;
  MPI_Initialized(&test);
  if (test) {
    cerr << "MPI is initialized in testfunc" << endl; cerr.flush();
  } else {
    cerr << "MPI is not initialized in testfunc" << endl; cerr.flush();
  }

Quote:}

if I do

mpiCC -c pptest.cc
mpiCC -shared -o pptest.pp pptest.cc
mpiCC test.cc
mpirun -np 4 ./a.out

I get

MPI is not initialized in testfunc
MPI is not initialized in testfunc
MPI is not initialized in testfunc
MPI is not initialized in testfunc

Any help would be appreciated.  Thanks.

--
----------------------------------------------------------------

Supercomputing Technologies,             Remove NOSPA to reply
Laboratory for Computer Science, MIT

 
 
 

1. Load balancing in Beowulf (esp. MPI)?

        Has anyone developed (or does anyone know of) a load balancing
facility for Beowulf in general, and specifically for MPI-based Linux
cluster computing systems?

        Our research group is building a Linux/Pentium-based cluster
with some SMP machines and some single-processor machines.  The codes
we are developing interface Java and C/C++ with a distributed wrapper
that is currently implemented in PVM.  I am trying to assess whether
there is anything to be gained by using MPI, and whether this is worth
the potential loss of load balancing features (if they are indeed
unavailable).  Thus, I am specifically looking for analogues of PVM's
auto-balance facility.

        I would most appreciate links to online source archives,
references, or FAQs on load balancing for Beowulf, and will follow up
with a summary if anyone is interested.

Thanks,
William Hsu

=======================================================
William H. Hsu, Ph.D.
Research Scientist, Automated Learning Group
National Center for Supercomputing Applications (NCSA)

http://www.ncsa.uiuc.edu/People/bhsu   ICQ: 28651394
=======================================================

--

Archive: http://www.hensa.ac.uk/parallel/internet/usenet/comp.parallel

2. JOBS IN DALLAS - GemStone and Smalltalk Developers needed!!!

3. The problem on MPI program on Scyld Beowulf PC cluster!

4. SDE download

5. (PVM AND/OR MPI) AND/OR (MOSIX AND/OR BEOWULF) ?

6. Quick Guide to NEXTSTEP information on the Internet

7. non-scientific projects using beowulf (mpi)

8. >> Software Developer, C/C++, UNIX, OOA/D/P, SQL, TCP/IP (PW104504-10006PW)

9. Beowulf, LAM MPI and MPICH

10. problem running simple code using mpi library

11. Problem loading the Sleepycat library in TCL on Windows

12. REPOST: how to dynamically load a color in excel spread sheet

13. how to dynamically load a color in excel spread sheet