code: def _CreateBarrierNet(model, init_net, name_prefix, timeout_sec):
      log.info("Creating barrier net")
      assert (
          model._rendezvous["engine"] == "GLOO"
      ), "Engine does not support barrier"
      comm_world = _CreateOrCloneCommonWorld(
          init_net,
          name_prefix + "_barrier_cw",
          rendezvous=model._rendezvous,
          timeout_sec=timeout_sec,
      )
      barrier_net = core.Net(name_prefix + "_barrier_net")
      barrier_net.Barrier(
          inputs=[comm_world],
          outputs=[],
          engine=model._rendezvous["engine"],
      )
      return barrier_net
  
imports: from collections import OrderedDict
  import logging
  import copy
  from multiprocessing import cpu_count
  from caffe2.python import model_helper, dyndep, scope, workspace, core, memonger, utils
  from caffe2.proto import caffe2_pb2
  import numpy
  import warnings
label_desc: Use image node_id 13 for calling a global function with example usage: _CreateBarrierNet(model, init_net, name_prefix, timeout_sec) and returns: barrier_net