class_docstr: MpiCommunicatorBase
  
  Implementation of communicator interface defined by
  :class:`CommunicatorBase`. This communicator assumes MPI4py and
  all ChainerMN processes are invoked by ``mpirun`` (``mpiexec``)
  command. Although this lacks several important methods such as
  ``multi_node_mean_grad`` to be impelmented with speficic algorithm. See
  hierarchical communicator or pure_nccl communicator for example.
docstr: A primitive of inter-process broadcast communication.
  
  This method tries to invoke broadcast communication within the
  communicator. All processes in the communicator are expected to
  invoke ``broadcast()``. This method relies on mpi4py fast communication
  optimized for numpy arrays, as well as ``send()`` and ``recv()``.
  
  If ``bcast()`` is invoked with cupy array in the root process,
  the returned array will be placed at current device
  (``https://docs-cupy.chainer.org/en/stable/tutorial/basic.html#current-device``)
  regardless of which device the argument is placed at remote nodes.
  
  Args:
      x (numpy/cupy array): Array to be broadcasted.
      root (int): Rank of root process.
  
  Returns:
      ys (tuple of numpy/cupy array): Received arrays.
docstr_tok: ["A","primitive","of","inter-process","broadcast","communication",".","This","method","tries","to","invoke","broadcast","communication","within","the","communicator",".","All","processes","in","the","communicator","are","expected","to","invoke","``","broadcast","(",")","``",".","This","method","relies","on","mpi4py","fast","communication","optimized","for","numpy","arrays",",","as","well","as","``","send","(",")","``","and","``","recv","(",")","``",".","If","``","bcast","(",")","``","is","invoked","with","cupy","array","in","the","root","process",",","the","returned","array","will","be","placed","at","current","device","(","``","https",":","\/\/docs-cupy.chainer.org\/en\/stable\/tutorial\/basic.html","#","current-device","``",")","regardless","of","which","device","the","argument","is","placed","at","remote","nodes",".","Args",":","x","(","numpy\/cupy","array",")",":","Array","to","be","broadcasted",".","root","(","int",")",":","Rank","of","root","process",".","Returns",":","ys","(","tuple","of","numpy\/cupy","array",")",":","Received","arrays","."]
code: def bcast(self, x, root=0):
      """A primitive of inter-process broadcast communication.
  
      This method tries to invoke broadcast communication within the
      communicator. All processes in the communicator are expected to
      invoke ``broadcast()``. This method relies on mpi4py fast communication
      optimized for numpy arrays, as well as ``send()`` and ``recv()``.
  
      If ``bcast()`` is invoked with cupy array in the root process,
      the returned array will be placed at current device
      (``https://docs-cupy.chainer.org/en/stable/tutorial/basic.html#current-device``)
      regardless of which device the argument is placed at remote nodes.
  
      Args:
          x (numpy/cupy array): Array to be broadcasted.
          root (int): Rank of root process.
  
      Returns:
          ys (tuple of numpy/cupy array): Received arrays.
      """
      chainer.utils.experimental(
          "chainermn.communicators.MpiCommunicatorBase.bcast"
      )
  
      is_master = self.mpi_comm.rank == root
  
      if is_master:
          msgtype = _MessageType(x)
          _check_dtype("bcast", msgtype)
  
          if msgtype.is_tuple:
              raise TypeError("Tuple data cannot be broadcasted")
  
          msgtype = self.mpi_comm.bcast(msgtype, root)
          shape = msgtype.shapes[0]
          buf = _memory_utility.array_to_buffer_object(
              x, _get_mpi_type(msgtype)
          )
          self.mpi_comm.Bcast(buf, root)
          return x
      else:
          msgtype = self.mpi_comm.bcast(None, root)
          xp = msgtype.get_array_module()
          shape = msgtype.shapes[0]
          buf = xp.empty(
              [chainer.utils.size_of_shape(shape)], dtype=msgtype.dtype
          )
          buftype = _get_mpi_type(msgtype)
          self.mpi_comm.Bcast(
              _memory_utility.array_to_buffer_object(buf, buftype), root
          )
          return buf.reshape(shape)
  
imports: import mpi4py
  import numpy
  import chainer
  import chainer.backends
  import chainer.utils
  from chainer.utils import collections_abc
  from chainermn.communicators import _communication_utility
  from chainermn.communicators._communication_utility import chunked_bcast_obj
  from chainermn.communicators import _memory_utility
  from chainermn.communicators import communicator_base
  import chainerx
label_desc: Use image node_id 14 for calling the MpiCommunicatorBase obj's underlying member method code with example usage: obj.bcast(x, root) and returns: x, buf