[Beowulf] use a MPI library thought a shared library

Mathieu Gontier mg.mailing-list at laposte.net
Wed Dec 5 00:15:17 PST 2007


Sorry. Indeed, the included <mpi.h> should not be here: it is a relic of 
some flags added to understand the problem. Then, the test case is 
correct without this include.
So, Peter, you well understand morphmpi.h ;-)

Mathieu Gontier
Core Development Engineer

Read the attached v-card for telephone, fax, adress
Look at our web-site http://www.fft.be
 



Peter St. John wrote:
> Mathieu,
> I didn't spot why you included <mpi.h>? It seems you work thru 
> morph_mpi.h wrappers, right? Perhaps I misunderstand?
> Peter
>
> On Dec 4, 2007 2:03 PM, Mathieu Gontier <mg.mailing-list at laposte.net 
> <mailto:mg.mailing-list at laposte.net>> wrote:
>
>     Hi all,
>
>     I am currently working with a project named MorphMPI. Its main purpose
>     is to offer a generic interface for the developers of parallel
>     applications, and chose the MPI library/interconnect at the runtime by
>     rebuilding a shared morph library against the desire MPI library. (The
>     final application is linked against a shared morph library instead of
>     the real MPI library.)
>     For more information about that, you can follow these links:
>     - http://www.clustermonkey.net//content/view/213/32/
>     <http://www.clustermonkey.net//content/view/213/32/>
>     - http://sourceforge.net/projects/morphmpi
>
>     So, I meet a little problem whatever the MPI library used (I tried
>     with
>     MPICH-1.2.5.2, MPICHGM and IntelMPI).
>     When MorphMPI is  linked statically with my parallel application,
>     everything is ok; but when MorphMPI is  linked dynamically with my
>     parallel application, MPI_Get_count return a wrong value.
>
>     I concluded it is difficult to use a MPI library thought a shared
>     library. I wonder if someone have more information about it (in this
>     case, you're welcome ;-) )
>
>     Thank you for your support,
>     Mathieu.
>
>     PS: my problem happens in the the following example,
>
>     #  include<morphmpi.h>
>
>     #  include <mpi.h>
>
>     #include<stdio.h>
>
>
>     int main( int argc, char* argv[] )
>
>     {
>
>      int np, me, ier, flag=0, msglen=-1 ;
>
>      MorphMPI_Request request ;
>
>      MorphMPI_Status status ;
>
>      int buf[1] ; buf[0]=-1 ;
>
>
>      ier = MorphMPI_Init( &argc, &argv ) ;
>
>      ier = MorphMPI_Comm_size( MorphMPI_COMM_WORLD, &np ) ;
>
>      ier = MorphMPI_Comm_rank( MorphMPI_COMM_WORLD, &me ) ;
>
>
>      if( me > 1 ) printf( "I am the useless processor #%d on %d\n",
>     me, np ) ;
>
>      else printf( "I am the working processor #%d on %d\n", me, np ) ;
>
>
>      ier = MorphMPI_Barrier( MorphMPI_COMM_WORLD ) ;
>
>
>     printf( "<<< %d >>>\n", &status ) ;
>
>
>      if( ! me ) {
>
>        buf[0] = 69 ;
>
>        ier = MorphMPI_Isend( buf, 1, MorphMPI_INT, 1,1,
>     MorphMPI_COMM_WORLD, &request ) ;
>
>        ier = MorphMPI_Wait( &request, &status ) ;
>
>      }
>
>
>      ier = MorphMPI_Barrier( MorphMPI_COMM_WORLD ) ;
>
>
>      if( me == 1 ) {
>
>        ier = MorphMPI_Irecv( buf, 1, MorphMPI_INT, 0, 1,
>     MorphMPI_COMM_WORLD, &request ) ;
>
>        ier = MorphMPI_Wait( &request, &status ) ;
>
>        ier = MorphMPI_Get_count( &status, MorphMPI_INT, &msglen ) ;
>
>
>        if( msglen != 1 ) printf( "ERROR: The lengh of the message is
>     not 1\n" ) ;
>
>        else printf( "SUCCESS !\n" ) ;
>
>      }
>
>
>      ier = MorphMPI_Finalize() ;
>
>     }
>
>
>
>     --
>     Mathieu Gontier
>     Core Development Engineer
>
>     Read the attached v-card for telephone, fax, adress
>     Look at our web-site http://www.fft.be <http://www.fft.be/>
>
>
>     _______________________________________________
>     Beowulf mailing list, Beowulf at beowulf.org <mailto:Beowulf at beowulf.org>
>     To change your subscription (digest mode or unsubscribe) visit
>     http://www.beowulf.org/mailman/listinfo/beowulf
>
>



More information about the Beowulf mailing list