Re: [MPI #2507] Creating Communicators

Shane Hebert (shane@ERC.MsState.Edu)
Mon, 23 Jun 1997 10:07:10 -0500 (CDT)

Hi Mark,

Is this even a correct program?
Rank 1 executes two MPI_COMM_CREATEs on COMM_WORLD
while Rank 0 executes only one MPI_COMM_CREATE on
COMM_WORLD. I think I would expect this one to hang
with Rank 1 in the second MPI_COMM_CREATE.

Shane

Mark Fallon previously wrote:
>|
>| Hi,
>|
>| When looking at the best way to create communicators for
>| my own implementation I came across the following in the
>| MPICH code. The code I was looking at was v1.1 but I have
>| only tested this up to version 1.0.13. The following
>| segment of code causes the system to hang.
>|
>| #include <mpi.h>
>|
>| void main(int argc, char *argv[]){
>| MPI_Comm NewComm, NewComm2;
>| MPI_Group Group, Group2;
>| MPI_Status status;
>| int MyRank,Dest;
>|
>| MPI_Init(&argc,&argv);
>| MPI_Comm_rank(MPI_COMM_WORLD, &MyRank);
>| if (MyRank == 1){
>| MPI_Comm_group(MPI_COMM_SELF,&Group2);
>| MPI_Comm_create(MPI_COMM_WORLD,Group2,&NewComm2);
>| }
>| MPI_Comm_group(MPI_COMM_WORLD,&Group);
>| MPI_Comm_create(MPI_COMM_WORLD,Group,&NewComm);
>| if (MyRank == 0)
>| MPI_Send(&MyRank,1,MPI_INT,1,99,NewComm);
>| else
>| MPI_Recv(&Dest,1,MPI_INT,0,99,NewComm,&status);
>| MPI_Finalize();
>| }
>|
>| (The code should be run on two processors)
>|
>| The reason for this is that the value of NewComm is different
>| on rank 1 from rank 0. I would be very interested to find
>| out if this an error in my interpretation of the standard or
>| an error in MPICH. I would love to be able to avoid global
>| communication on MPI_Comm_create.
>|
>| Regards,
>|
>| Mark.
>| _________________________________________________________________
>| Mark Fallon
>| Researcher
>| Hitachi Dublin Laboratory
>| O'Reilly Institute, Tel : +353-1-6798911
>| Trinity College, Fax : +353-1-6798926
>| Dublin Email : mark.fallon@hdl.ie
>| Ireland
>| __________________________________________________________________
>|