On Feb 1, 2005, at 6:05 PM, Aamir Shafi wrote:
> My question is regarding cartesian topology functions though i've to
> admit it isn't directly related to LAM/MPI.
>
> MPI_CART_CREATE(comm_old, ndims, dims, periods, reorder, comm_cart)
> 1. Is there any restriction on the value of ndims. Is it possible to
> have ndims > 3 ?
The only requirement on the ndims parameter is that it be greater than
0.
> 2. If its fine to have ndims > 3, then does LAM/MPI support it ?
Yes and yes.
One note - the group size (basically, number of processes in the passed
communicator) must be larger than the grid size. So if you specify a
grid that has 2 dimensions, each with 2 processes, it would be an error
to pass a communicator containing fewer than 4 processes. LAM will
error with an error like the one below if you run with too few
processes.
MPI_Cart_create: invalid dimension argument: Invalid argument (rank 0,
MPI_COMM_WORLD)
Rank (0, MPI_COMM_WORLD): Call stack within LAM:
Rank (0, MPI_COMM_WORLD): - MPI_Cart_create()
Rank (0, MPI_COMM_WORLD): - main()
> MPI_CART_SHIFT(comm, direction, disp, rank_source, rank_dest)
> 3. Lets suppose ndims=3 [cube(x,y,z)], then disp variable would allow
> to shift parameters (find neighbours) on x and y axis of the cube, is
> it possible to shift parameters (find neighbours) on z-axis ?
The direction argument is actually the argument that provides the
"axis" along which the the displacement occurs. So if you wanted to
find neighbors on the z axis (and assuming you label the axis as x, y,
z so that z is the third dimension), you would use the argument 2 as
the direction.
Hope this helps,
Brian
--
Brian Barrett
LAM/MPI developer and all around nice guy
Have an LAM/MPI day: http://www.lam-mpi.org/
|