code: def testAcceptConnect(self):
      comm_self = MPI.COMM_SELF
      comm_world = MPI.COMM_WORLD
      wrank = comm_world.Get_rank()
      group_world = comm_world.Get_group()
      group = group_world.Excl([0])
      group_world.Free()
      comm = comm_world.Create(group)
      group.Free()
      if wrank == 0:
          self.assertEqual(comm, MPI.COMM_NULL)
      else:
          self.assertNotEqual(comm, MPI.COMM_NULL)
          self.assertEqual(comm.size, comm_world.size - 1)
          self.assertEqual(comm.rank, comm_world.rank - 1)
      if wrank == 0:
          port = MPI.Open_port()
          comm_world.send(port, dest=1)
          intercomm = comm_self.Accept(port)
          self.assertEqual(intercomm.remote_size, comm_world.size - 1)
          self.assertEqual(intercomm.size, 1)
          self.assertEqual(intercomm.rank, 0)
          MPI.Close_port(port)
      else:
          if wrank == 1:
              port = comm_world.recv(source=0)
          else:
              port = None
          intercomm = comm.Connect(port, root=0)
          self.assertEqual(intercomm.remote_size, 1)
          self.assertEqual(intercomm.size, comm_world.size - 1)
          self.assertEqual(intercomm.rank, comm.rank)
          comm.Free()
      if wrank == 0:
          message = TestDPM.message
          root = MPI.ROOT
      else:
          message = None
          root = 0
      message = intercomm.bcast(message, root)
      if wrank == 0:
          self.assertIsNone(message)
      else:
          self.assertEqual(message, TestDPM.message)
      intercomm.Free()
  
file_path: mpi4py/test/test_dynproc.py
imports: from mpi4py import MPI
  import mpiunittest
label_desc: Use image node_id 2 for calling the TestDPM obj's underlying member method code with example usage: obj.testAcceptConnect() without return types