code: def print_rank_last(message):
      """If distributed is initialized, print only on last rank."""
      if torch.distributed.is_initialized():
          if is_last_rank():
              print(message, flush=True)
      else:
          print(message, flush=True)
  
file_path: megatron-lm/megatron/utils.py
imports: import sys
  import torch
  from megatron import get_args, get_adlr_autoresume
  from megatron.core import DistributedDataParallel
  from megatron.core import mpu
  from megatron.core.tensor_parallel import param_is_not_tensor_parallel_duplicate
  from megatron.model import Float16Module
  from megatron.model.module import param_is_not_shared
label_desc: Use image node_id 11 for calling a global function with example usage: print_rank_last(message) without return types