code: def get_world_rank_from_launcher():
      # DeepSpeed launcher will set it so get from there
      rank = os.environ.get("RANK")
  
      if rank is None:
          rank = os.environ.get("OMPI_COMM_WORLD_RANK")
  
      # Make it a single process job and set rank to 0
      if rank is None:
          rank = 0
  
      return int(rank)
  
file_path: DeepSpeed/deepspeed/comm/utils.py
imports: import os
  import inspect
  from deepspeed.utils import get_caller_func
label_desc: Use image node_id 2 for calling a global function with example usage: get_world_rank_from_launcher() and returns: int