code: def get_world_size_from_launcher():
      # DeepSpeed launcher will set it so get from there
      size = os.environ.get("WORLD_SIZE")
      rank = os.environ.get("RANK")
  
      if size is None:
          size = os.environ.get("OMPI_COMM_WORLD_SIZE")
  
      # Make it a single process job and set size to 1
      if size is None:
          size = 1
  
      if rank == 0:
          print(f"set world size to {size}")
  
      return int(size)
  
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 3 for calling a global function with example usage: get_world_size_from_launcher() and returns: int