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.
code: def allgather(self, x):
      chainer.utils.experimental(
          "chainermn.communicators.MpiCommunicatorBase.allgather"
      )
  
      msgtype = _MessageType(x)
      _check_dtype("allgather", msgtype)
  
      msgtypes = self.mpi_comm.allgather(msgtype)
      _check_dtypes_are_same(msgtypes)
  
      # Type check.
      for msgtype in msgtypes:
          if msgtype.is_tuple:
              raise TypeError("allgather cannot handle tuple data")
  
          assert len(msgtype.shapes) == 1
  
      # Collective communication.
      xp = chainer.backend.get_array_module(x)
      shapes = [msgtype.shapes[0] for msgtype in msgtypes]
      sbuf = _memory_utility.array_to_buffer_object(
          x, _get_mpi_type(msgtype)
      )
      rlens = [chainer.utils.size_of_shape(s) for s in shapes]
      rbuf = xp.empty([sum(rlens)], dtype=msgtype.dtype)
      if xp is not numpy:
          chainer.cuda.Stream.null.synchronize()
      self.mpi_comm.Allgatherv(
          sbuf,
          [
              _memory_utility.get_device_memory_pointer(rbuf),
              (rlens, _cnt_to_dsp(rlens)),
              _get_mpi_type(msgtype),
          ],
      )
      ys = [
          rbuf[i : i + l].reshape(s)
          for i, l, s in zip(_cnt_to_dsp(rlens), rlens, shapes)
      ]
  
      return tuple(ys)
  
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 16 for calling the MpiCommunicatorBase obj's underlying member method code with example usage: obj.allgather(x) and returns: tuple