For MPI_Comm_create -all- processes in the communicator must make the call,
not just those that are in the subgroups. The 2.2 standard states that
"The function is collective and must be called by all processes in the
group of comm."
However, this is a common misconception about the MPI_Comm_create
interface, and has encouraged the MPI Forum standardization body to
consider an additional interface that just requires those processes in the
specified groups to make the call.
If you are interested in that proposal below are a few links that you might
The ticket includes a link to an EuroMPI paper regarding the prototype, and
the specific language being proposed.
2012/1/20 Jens Jørgen Mortensen <jensj_at_[hidden]>
> On 20-01-2012 15:26, Josh Hursey wrote:
> That behavior is permitted by the MPI 2.2 standard. It seems that our
> documentation is incorrect in this regard. I'll file a bug to fix it.
> Just to clarify, in the MPI 2.2 standard in Section 6.4.2 (Communicator
> Constructors) under MPI_Comm_create it states:
> "Each process must call with a group argument that is a subgroup of the
> group associated with comm; this could be MPI_GROUP_EMPTY. The processes
> may specify different values for the group argument. If a process calls
> with a non-empty group then all processes in that group must call the
> function with the same group as argument, that is the same processes in the
> same order. Otherwise the call is erroneous."
> Thanks for reporting the man page bug.
> Thanks for the quick reply.
> Is it also allowed to call MPI_Comm_create only on those processes that
> are in the sub-group? This seems to work also. Or must one always call
> MPI_Comm_create on all processes in comm - as the description says.
> Jens Jørgen
> -- Josh
> 2012/1/20 Jens Jørgen Mortensen <jensj_at_[hidden]>
>> For a long time, I have been calling MPI_Comm_create(comm, group,
>> newcomm) with different values for group on the different processes of
>> comm. In pseudo-code, I would create two sub-communicators from a world
>> with 4 ranks like this:
>> if world.rank < 2:
>> comm = world.create([0, 1])
>> comm = world.create([2, 3])
>> Now I read from the MPI_Comm_create description that this way of calling
>> MPI_Comm_create is erroneous:
>> "The call is erroneous if not all group arguments have the same value"
>> So, I guess I have just been lucky that it has worked for me? Or is it
>> OK to do what I do?
>> Jens Jørgen
>> users mailing list
> Joshua Hursey
> Postdoctoral Research Associate
> Oak Ridge National Laboratory
> users mailing list
Postdoctoral Research Associate
Oak Ridge National Laboratory