code: def make_distributed_train_program(args, model_dict):
      device_ids = get_cuda_places()
      train_opt = copy.deepcopy(
          static.default_main_program()._fleet_opt
      )
  
      # print("train opt = ", train_opt)
  
      model_dict.startup_program = static.default_startup_program()
      model_dict.train_program = static.default_main_program().clone()
      model_dict.train_program._fleet_opt = train_opt
      model_dict.train_program._fleet_opt["worker_places"] = device_ids
  
      with open("join_main_program.pbtxt", "w") as fout:
          fout.write(str(model_dict.train_program))
      with open("join_startup_program.pbtxt", "w") as fout:
          fout.write(str(model_dict.startup_program))
  
file_path: PGL/apps/PGLBox/src/distributed_program.py
imports: import copy
  import paddle
  import paddle.static
  from place import get_cuda_places
label_desc: Use image node_id 1 for calling a global function with example usage: make_distributed_train_program(args, model_dict) without return types