typedef struct topoentry_t { topoType_t topoType; /* e.g., unknown, torus, mesh, bus, tree */ int dim; /* number of dimensions in topology */ int nranks; /* number of ranks (in MPI_COMM_WORLD) within this item. Only valid for NODE */ int *ranks; /* Ranks within this item; Only valid for NODE */ topoCoord_t coords; /* coordinates in topology */ topoCoord_t maxtopocoords; /* maximum value of valid coordinate in topology */ topoCoord_t maxcoords; /* maximum value of valid coordinates */ topoCoord_t mincoords; /* minimum value of valid coordinates */ struct topoentry_t *next; } topoentry_t;
Each level may have siblings (e.g., cores on the same chip), children (e.g., cores of the chip), and parents (e.g., the node hosting a chip). Coordinates are provided to identify siblings. For simple arrangements, such as cores on a chip, this is just a numbering starting from zero; specifically, a one-tuple. For a TOPO_MESH or TOPO_TORUS topology, the coordinates will be an n-tuple, for an n-Dimensional mesh.
The source code for the routine topoPrint shows how to use some of the fields in this structure.