code: def build_complied_prog(train_program, model_loss):
      num_threads = int(os.getenv("CPU_NUM", 10))
      trainer_id = int(os.getenv("PADDLE_TRAINER_ID", 0))
      exec_strategy = F.ExecutionStrategy()
      exec_strategy.num_threads = num_threads
      # exec_strategy.use_experimental_executor = True
      build_strategy = F.BuildStrategy()
      build_strategy.enable_inplace = True
      # build_strategy.memory_optimize = True
      build_strategy.memory_optimize = False
      build_strategy.remove_unnecessary_lock = False
      if num_threads > 1:
          build_strategy.reduce_strategy = (
              F.BuildStrategy.ReduceStrategy.Reduce
          )
  
      compiled_prog = F.compiler.CompiledProgram(
          train_program
      ).with_data_parallel(loss_name=model_loss.name)
      return compiled_prog
  
file_path: PGL/legacy/examples/distribute_graphsage/cluster_train.py
imports: import argparse
  import time
  import os
  import math
  import numpy
  import paddle.fluid
  import paddle.fluid.layers
  from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import fleet
  from paddle.fluid.transpiler.distribute_transpiler import DistributeTranspilerConfig
  import paddle.fluid.incubate.fleet.base.role_maker
  from pgl.utils.logger import log
  from model import GraphsageModel
  from utils import load_config
  import reader
label_desc: Use image node_id 3 for calling a global function with example usage: build_complied_prog(train_program, model_loss) and returns: compiled_prog