[mpich-discuss] best/fastest way to get a node communicator
Pavan Balaji
balaji at mcs.anl.gov
Tue Jan 17 17:56:25 CST 2012
If you don't mind being MPICH2 >= 1.5.x specific, you can use
MPIX_Comm_split_type with MPI_COMM_TYPE_SHARED.
-- Pavan
On 01/17/2012 01:24 PM, Jeff Hammond wrote:
> I'm interested in being able to create a communicator for each node.
> I have custom APIs for this on Blue Gene and Cray, but that doesn't
> help on clusters.
>
> I was thinking of doing the following:
> - call gethostname on each rank
> - gather these values to root
> - sort the array and assign a different color number for each unique
> value in a new array
> - scatter the color array and call comm_split
>
> Does anyone know of a better/faster way to do this? I assume that the
> sort is rarely necessary, i.e. the ranks are ordered by node already,
> but I don't want to assume this.
>
> Are there settings where gethostname is not specific enough to
> distinguish nodes?
>
> Thanks,
>
> Jeff
>
--
Pavan Balaji
http://www.mcs.anl.gov/~balaji
More information about the mpich-discuss
mailing list