class_docstr: Manages the mapping of n-dimensional Cartesian coordinates to linear
  indices. This mapping is used to map the rank of processes to the grid
  for various forms of parallelism.
  
  Each axis of the tensor is accessed by its name. The provided ordering
  of the axes defines the layout of the topology. ProcessTopology uses a "row-major"
  layout of the tensor axes, and so axes=['x', 'y'] would map coordinates (x,y) and
  (x,y+1) to adjacent linear indices. If instead axes=['y', 'x'] was used, coordinates
  (x,y) and (x+1,y) would be adjacent.
  
  Some methods return ProcessCoord namedtuples.
class_docstr_tok: ["Manages","the","mapping","of","n-dimensional","Cartesian","coordinates","to","linear","indices",".","This","mapping","is","used","to","map","the","rank","of","processes","to","the","grid","for","various","forms","of","parallelism",".","Each","axis","of","the","tensor","is","accessed","by","its","name",".","The","provided","ordering","of","the","axes","defines","the","layout","of","the","topology",".","ProcessTopology","uses","a","``","row-major","''","layout","of","the","tensor","axes",",","and","so","axes=","[","'","x","'",",","'","y","'","]","would","map","coordinates","(","x",",","y",")","and","(","x",",","y+1",")","to","adjacent","linear","indices",".","If","instead","axes=","[","'","y","'",",","'","x","'","]","was","used",",","coordinates","(","x",",","y",")","and","(","x+1",",","y",")","would","be","adjacent",".","Some","methods","return","ProcessCoord","namedtuples","."]
docstr: Return the coordinate owned by a process rank.
  
  The axes of the returned namedtuple can be directly accessed as members. For
  example:
      >>> X = ProcessTopology(axes=['x', 'y'], dims=[2,3])
      >>> coord = X.get_coord(rank=1)
      >>> coord.x
      0
      >>> coord.y
      1
code: def get_coord(self, rank):
      """Return the coordinate owned by a process rank.
  
      The axes of the returned namedtuple can be directly accessed as members. For
      example:
          >>> X = ProcessTopology(axes=['x', 'y'], dims=[2,3])
          >>> coord = X.get_coord(rank=1)
          >>> coord.x
          0
          >>> coord.y
          1
      """
      for coord, idx in self.mapping.items():
          if idx == rank:
              return coord
      raise ValueError(f"rank {rank} not found in topology.")
  
imports: from deepspeed import comm
  from collections import namedtuple
  from itertools import product
label_desc: Use image node_id 6 for calling the ProcessTopology obj's underlying member method code with example usage: obj.get_coord(rank) and returns: coord