[mpich-discuss] change the rank ordering

Rolf Kuiper kuiper at mpia-hd.mpg.de
Fri Jul 3 15:31:36 CDT 2009


Hi MPICH-users,

to merge to applications I have to create a communicator with  
coordinates in a reversed ordering of the coordinates than the default  
in MPI.
E.g.: The default MPI layout sets the ranks of the communicators to  
first in z than in y than in x direction, like:

y
^
| 2-4-6
| 1-3-5
|--------> x

Now I want to change the ordering to loop first in x than in y, like:

y
^
| 4-5-6
| 1-2-3
|--------> x

So far I can create a cartesian communicator and test its coords with
int dims[3] = {0,0,0};
int ndims=3;
MPI_Dims_create(NumberOfProcessors, ndims, dims);
int false = 0; int true = 1;
int periods[3] = { false, false, true };
int reorder = true;
MPI_Comm MyComm;
MPI_Cart_create(MPI_COMM_WORLD, ndims, dims, periods, reorder, &MyComm);
MPI_Cart_coords(MyComm, LocalRank, ndims, coords);

But how can I get access to change either the current rank or the  
associated coords?

Thanks for your help in advance,
Rolf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20090703/66c7e8a4/attachment.htm>


More information about the mpich-discuss mailing list