Basic HTML version of Foils prepared 19 September 98

Foil 59 Defining a Cartesian Topology

From MPI Message Passing Interface Computational Science for Simulations -- Fall Semester 1998. by Geoffrey C. Fox, Nancy McCracken


The routine MPI_Cart_create creates a Cartesian decomposition of the processes, with the number of dimensions given by the ndim argument. It returns a new communicator (in comm2d in example below) with the same processes as in the input communicator, but different topology.
ndim = 2;
dims[0] = 3; dims[1] = 4;
periods[0] = 0; periods[1] = 0; // periodic is false
reorder = 1; // reordering is true
ierr = MPI_Cart_create (MPI_COMM_WORLD, ndim,
dims, periods, reorder, &comm2d);
  • where reorder specifies that it's o.k. to reorder the default process rank in order to achieve a good embedding (with good communication times between neighbors).



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 11 1999