code: def worker_main(
      slots_per_node, num_nodes, cross_rank, chief_ip, rank, local_rank
  ):
      # In the absence of a distributed training framework that might define the
      # rank/local_rank/cross_rank, you can derive them from the ClusterInfo API.
      distributed = det.core.DistributedContext(
          rank=rank,
          size=num_nodes * slots_per_node,
          local_rank=local_rank,
          local_size=slots_per_node,
          cross_rank=cross_rank,
          cross_size=num_nodes,
          chief_ip=chief_ip,
      )
  
      with det.core.init(distributed=distributed) as core_context:
          main(
              core_context=core_context,
              latest_checkpoint=latest_checkpoint,
              trial_id=trial_id,
              increment_by=hparams["increment_by"],
          )
  
file_path: determined/examples/tutorials/core_api/4_distributed.py
imports: import logging
  import pathlib
  import queue
  import subprocess
  import sys
  import threading
  import time
  import determined
label_desc: Use image node_id 5 for calling a global function with example usage: worker_main(slots_per_node, num_nodes, cross_rank, chief_ip, rank, local_rank) without return types