get_rank

dragon.distributed.get_rank(group=None)[source]

Return the rank of current process.

If group is None, return the world rank. Otherwise, return the rank in the group.

Parameters:
  • group (ProcessGroup, optional) The optional process group.
Returns:

int The rank.