code: def start_sparse_worker(rank, world_size, test, args):
      print("start sparse worker {}".format(rank))
      dist_init_method = "tcp://{master_ip}:{master_port}".format(
          master_ip="127.0.0.1", master_port="12345"
      )
      backend = "gloo"
      device = F.ctx()
      if device.type == "cuda":
          device = th.device(rank)
          th.cuda.set_device(device)
      th.distributed.init_process_group(
          backend=backend,
          init_method=dist_init_method,
          world_size=world_size,
          rank=rank,
      )
  
      test(device, *args)
      th.distributed.barrier()
      th.distributed.destroy_process_group()
  
file_path: dgl/tests/python/pytorch/nn/test_sparse_emb.py
imports: import multiprocessing
  import os
  import unittest
  import backend
  import pytest
  import torch
  from dgl.nn import NodeEmbedding
  from dgl.optim import SparseAdam
label_desc: Use image node_id 4 for calling a global function with example usage: start_sparse_worker(rank, world_size, test, args) without return types