I have some problems with MPI_COMM_CREATE.
I want to get an new process group with all ranks of the original group
excepts the last one to make a collective i/o call with the new
communicator.
I start my program with:
mpiexec -n 2 test : - n 1 test2
During the execution of the program, it hangs at the call of
MPI_COMM_CREATE and when i press ctrl+c
i get the following call trace:
MPI_Recv: process in local group is dead (rank 1, MPI_COMM_WORLD)
Rank (1, MPI_COMM_WORLD): Call stack within LAM:
Rank (1, MPI_COMM_WORLD): - MPI_Recv()
Rank (1, MPI_COMM_WORLD): - MPI_Bcast()
Rank (1, MPI_COMM_WORLD): - MPI_Allreduce()
Rank (1, MPI_COMM_WORLD): - MPI_Comm_create()
Rank (1, MPI_COMM_WORLD): - main()
When i start only start the "test" program with mpirun -np 3 test it
works and i get a new communicator!
Program:
{
MPI_Group mygroup;
MPI_Group smallgroup;
MPI_Comm mycomm;
int ranks[] = {0,1};
int rank0, rank1, size0;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank0);
MPI_Comm_size(MPI_COMM_WORLD, &size0);
MPI_Comm_group(MPI_COMM_WORLD, &mygroup);
MPI_Group_incl(mygroup, 2, ranks, &smallgroup);
MPI_Comm_create(MPI_COMM_WORLD, smallgroup, &mycomm);
}
|