Newsgroups: comp.parallel.mpi
From: dwalker@thud.cs.utk.edu (David Walker)
Subject: Re: Cart_Shift
Keywords: topology
Organization: Computer Science Dept, University of Tennessee, Knoxville
Date: 14 Apr 1995 16:27:37 GMT
Message-ID: <3mm7pqINNrbn@CS.UTK.EDU>

In article <3lspk7$ri7@controversy.math.lsa.umich.edu>, joelp@icarus.astro.lsa.umich.edu (Joel Parriott) writes:
|> I'm using a 2D cartesian communicator, and would like to use the 
|> MPI_CART_SHIFT function.  I'm unclear on what I need to enter for the
|> direction argument.  I've looked at the "manual" and the "Using MPI"
|> book, and can't find a clear description.  The "manual" just says, "...
|> coordinate dimension of shift."  In other words, what integers correspond
|> to above, below, left, right?  Also, it returns the source rank; shouldn't
|> that just be the calling process?
|> 
|> help.
|> 
|> thanks,
|> 
|> joel p.

"direction" refers to the coordinate dimension of the shift, just as the
manual says. For example, if you have a d-dimensional topology with dims(i)
processes in coordinate direction number i (where dims is the array you
pass to mpi_cart_create), then direction j refers to the coordinate direction
with dims(j) processes (or dims(j+1) in Fortran). For an example of
the use of mpi_cart_shift you should take a look at my Laplace equation
solver which is available on the web at

http://www.epm.ornl.gov/~walker/mpi/applications.html

Regards,
David

