LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Chris Hoge (hoge_at_[hidden])
Date: 2005-07-25 15:28:53


Hi,

I've been working on an MPI validation suite. My test code for
MPI_Intercomm_create looks like this (ripped right out of "Using
MPI", although I have written other code that also fails):

#include <mpi.h>

#include <iostream>

main(int argc, char **argv)
{
     MPI_Init( &argc, &argv );

     int id, size, remote_leader_rank;
     MPI_Comm worldComm, myComm, interComm;
     std::cout << "duplicating" << std::endl << std::flush;
     MPI_Comm_dup( MPI_COMM_WORLD, &worldComm );
     std::cout << "ranking" << std::endl << std::flush;
     MPI_Comm_rank( worldComm, &id );
     std::cout << "sizing" << std::endl << std::flush;
     MPI_Comm_size( worldComm, &size);

     int server = size - 1;
     int color = (server == 0 );
     std::cout << "splitting" << std::endl << std::flush;
     MPI_Comm_split( worldComm, color, id, &myComm );

     if ( !color ) remote_leader_rank = server;
     else remote_leader_rank = 0;

     std::cout << "creating intercomm" << std::endl << std::flush;
     MPI_Intercomm_create( myComm, 0, worldComm, remote_leader_rank,
         10, &interComm );

     std::cout << "done" << std::endl;

      MPI_Finalize();
}

On a Mac, running the dmg version of lammpi on OS 10.4, this test
program deadlocks. Does anyone have any ideas as to what is going on?
It seems to work just fine on other mpi implementations.

Thanks,
Chris