topoMeshHopDistance

Computing the distance from the calling process to the process with the given rank

Synopsis

int topoMeshHopDistance(topodist_t *dt, int rank, int *dist)

Input Parameters

dt
Pointer to a valid topodist_t structure
rank
Rank of the process to determine the distance to. See notes.

Output Parameter

dist
distance in hops to the process with rank rank

Return value

0 on success, non-zero otherwise. -1 if the topology does not include a mesh or torus.

Notes

rank must belong to one of the send ranks used to initialize the topodist_t dt. Thus, this routine is not collective and may be used by any process at any time once dt has been initialized.

The distance is computing in hops: this is the 1-norm or Manhatten distance between the calling process and the process with rank in a mesh or torus topology.