From: Duge de Bernonville Rodolphe <dugedebe@info.enserb.u-bordeaux.fr>
Newsgroups: comp.parallel.mpi
Subject: Re: membership test for group/communicator
Date: Mon, 26 Apr 1999 15:49:13 +0200
Organization: Universite Bordeaux I
Message-Id: <37246ED9.2A06@info.enserb.u-bordeaux.fr>
References: <7fqvoq$o9c@henrici.Stanford.EDU>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
MNNTP-Posting-Host: spendius.enserb.u-bordeaux.fr
Xref: ukc comp.parallel.mpi:4987


Erik Boman wrote:
> 
> Does anybody know how to test for membership in a group or communicator?
> My situation is a communicator is passed into my subroutine.
> Possibly there are processes that are not in this communicator,
> so I need to find out which processes belong to it and which don't.
> 
> I couldn't find any suitable query function in the MPI 1.1 standard,
> so I thought maybe I could use MPI_Comm_rank to figure it out.
> Unfortunately MPICH aborts if I call MPI_Comm_rank with processes that are
> not in the communicator :-(
> 
> Any suggestions? I'm sure others must have encountered this problem.
> 
> Thanks,
> Erik Boman
> boman@cs.stanford.edu

- To test membership in a group : MPI_Group_rank returns MPI_UNDEFINED
if the process is not a member (integer).

- To test membership in a communicator : its quite strange but its true
that MPI_Comm_rank always return MPI_SUCCESS. 
So maybe you can try this : MPI_Comm_group to have the group of the
communicator and so MPI_Group_rank.

Well, I hope it will work ?

