topoToArray
Convert a topoinfo structure into a array of coordinates
Synopsis
int topoToArray(topoinfo_t *topoinfo, int mycoords[], int maxcoords[],
int *nlevels, int *nodeidx, int maxdim)
Input Parameters
- topo
- Pointer to topology information
- maxdim
- Maximum size of arrays mycoords and maxcoords
Output Parameters
- mycoords
- a nonnegative integer giving a value for each level of the
topology, starting from the smallest (typically a processor core)
- maxcoords
- The maximum value of the coordinate for this level
- nlevels
- The number of levels of the topology.
- nodeidx
- The index of the first level of the topology above that of
a node.
Notes
This routine provides a way to convert a topoinfo structure into an array of
coordinates that can be used map calling processes onto the physical
topology. mycoords[i] contains a coordinate for the calling process at the
ith level, with the finest level at i=0. Levels between 0 and nodeidx-1 are
within a single node. Level nodeidx (if less than nlevels) is the first
level of the interconnect between nodes. If the interconnnect is a mesh,
there will be a separate level for each dimension of the interconnect.