code: def test_submit_jobs():
      class Args:
          pass
  
      args = Args()
  
      with tempfile.TemporaryDirectory() as test_dir:
          num_machines = 8
          ip_config = os.path.join(test_dir, "ip_config.txt")
          with open(ip_config, "w") as f:
              for i in range(num_machines):
                  f.write("{} {}\n".format("127.0.0." + str(i), 30050))
          part_config = os.path.join(test_dir, "ogb-products.json")
          with open(part_config, "w") as f:
              json.dump({"num_parts": num_machines}, f)
          args.num_trainers = 8
          args.num_samplers = 1
          args.num_servers = 4
          args.workspace = test_dir
          args.part_config = "ogb-products.json"
          args.ip_config = "ip_config.txt"
          args.num_server_threads = 1
          args.graph_format = "csc"
          args.extra_envs = ["NCCL_DEBUG=INFO"]
          args.num_omp_threads = 1
          udf_command = "python3 train_dist.py --num_epochs 10"
          clients_cmd, servers_cmd = submit_jobs(
              args, udf_command, dry_run=True
          )
  
          def common_checks():
              assert "cd " + test_dir in cmd
              assert "export " + args.extra_envs[0] in cmd
              assert f"DGL_NUM_SAMPLER={args.num_samplers}" in cmd
              assert (
                  f"DGL_NUM_CLIENT={args.num_trainers*(args.num_samplers+1)*num_machines}"
                  in cmd
              )
              assert f"DGL_CONF_PATH={args.part_config}" in cmd
              assert f"DGL_IP_CONFIG={args.ip_config}" in cmd
              assert f"DGL_NUM_SERVER={args.num_servers}" in cmd
              assert f"DGL_GRAPH_FORMAT={args.graph_format}" in cmd
              assert f"OMP_NUM_THREADS={args.num_omp_threads}" in cmd
              assert udf_command[len("python3 ") :] in cmd
  
          for cmd in clients_cmd:
              common_checks()
              assert "DGL_DIST_MODE=distributed" in cmd
              assert "DGL_ROLE=client" in cmd
              assert "DGL_GROUP_ID=0" in cmd
              assert (
                  f"python3 -m torch.distributed.run --nproc_per_node={args.num_trainers} --nnodes={num_machines}"
                  in cmd
              )
              assert "--master_addr=127.0.0" in cmd
              assert "--master_port=1234" in cmd
          for cmd in servers_cmd:
              common_checks()
              assert "DGL_ROLE=server" in cmd
              assert "DGL_SERVER_ID=" in cmd
  
file_path: dgl/tests/tools/test_launch.py
imports: import json
  import os
  import tempfile
  import unittest
  from launch import *
label_desc: Use image node_id 1 for calling a global function with example usage: test_submit_jobs() without return types