Some folks and me are trying to make a simulation of an amusement park and we have almost everything done except one thing: we need to implement a barrier for sync but we need a comunicator fot that, and it needs to encompass evey process except the one with rank zero. I'm using MPI_Group_excl() to tell that a group should not have process zero. Here is a fragment of my code that creates the group and the comunicator:
MPI_Group nonzero_group, world;
MPI_Comm_group(MPI_COMM_WORLD,&world);
int zero[1];
zero[0]=0;
MPI_Group_excl(world,1,zero,&nonzero_group);
MPI_Comm nonzero;
MPI_Comm_create(MPI_COMM_WORLD,world,&nonzero);
But when I test my program using a MPI_Bcast() from process 1 to all process in 'nonzero' communicator, process zero performs the broadcast and gets the buffer.
How can I make a group that has all proces from 1 to N without process zero?