Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] MPI_Comm_split
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2010-11-29 16:30:36

On Nov 24, 2010, at 4:55 PM, Hicham Mouline wrote:

> The tree is not symmetrical in that the valid values for the 10th parameter
> depends on the values selected in the 0th to 9th parameter (all the ancestry
> in the tree), for e.g., we may have a lot of nodes in the left of the tree
> than in the right, see attachment ( I hope they're allowed )
> The depth of the tree of course is the same everywhere, but not all nodes at
> some level have the same number of children.
> Is it better to just list vertically all the possible branches (n-tuples) at
> the master level and split that list uniformly over the slaves?

Yes, you certainly can MPI_COMM_SPLIT this way. As Bill mentioned, if you do the splits at the beginning of a long computation, the cost of them is irrelevant. I would expect for 128 MPI processes, doing 7-8 MPI_COMM_SPLITs will take far less than a second (although that's a total SWAG). So if it helps your coding and you're going to be running for a little while, go ahead and do them.

Bill mentioned one good reason for splitting communicators: distinct sub groups for MPI collectives. Another good reason is for message separation. If you want to do a parameter sweep in a specific set of procs, you can give them their own communicator in order to guarantee that you have "private" communications between them (e.g., that tag X will never collide with tag X on another process).

That being said, if all your communications will solely be within that subset of processes, then making new communicators may not be necessary. I.e., you'll never have colliding tags, so you don't need to create a private communication space.

That being said, it may be useful to have all your subgroups be able to have a starting rank of 0 and be able to use MPI_COMM_SIZE to find how many peers are in your subgroup. Having distinct sub-communicators is helpful here.

That being said... (this can go on ad nauseam -- it just depends on your app and whether you want to do the splitting or not; there's no universally right answer here)

Jeff Squyres
For corporate legal information go to: