MPI_Cart_shift

Returns the shifted source and destination ranks, given a shift direction and amount

Synopsis

#include "mpi.h"
int MPI_Cart_shift ( comm, direction, displ, source, dest )
MPI_Comm  comm;
int       direction;
int       displ;
int      *source;
int      *dest;

Input Parameters

comm communicator with cartesian structure (handle)
direction coordinate dimension of shift (integer)
disp displacement (> 0: upwards shift, < 0: downwards shift) (integer)

Output Parameters

rank_source rank of source process (integer)
rank_dest rank of destination process (integer)

Notes

The direction argument is in the range [0,n-1] for an n- dimensionalCartesian mesh.