code: def testSplitTypeResourceGuided(self):
      try:
          MPI.COMM_SELF.Split_type(MPI.COMM_TYPE_SHARED).Free()
      except NotImplementedError:
          self.skipTest("mpi-comm-split_type")
      if MPI.COMM_TYPE_RESOURCE_GUIDED == MPI.UNDEFINED:
          self.skipTest("mpi-comm-split_type-resource_guided")
      split_type = MPI.COMM_TYPE_RESOURCE_GUIDED
      #
      comm = self.COMM.Split_type(split_type)
      self.assertEqual(comm, MPI.COMM_NULL)
      comm = self.COMM.Split_type(split_type, info=MPI.INFO_NULL)
      self.assertEqual(comm, MPI.COMM_NULL)
      info = MPI.Info.Create()
      comm = self.COMM.Split_type(split_type, info=info)
      self.assertEqual(comm, MPI.COMM_NULL)
      info.Set("foo", "bar")
      comm = self.COMM.Split_type(split_type, info=info)
      self.assertEqual(comm, MPI.COMM_NULL)
      info.Set("mpi_hw_resource_type", "@dont-thread-on-me@")
      comm = self.COMM.Split_type(split_type, info=info)
      self.assertEqual(comm, MPI.COMM_NULL)
      info.Free()
      #
      restype = "mpi_hw_resource_type"
      shmem = "mpi_shared_memory"
      info = MPI.Info.Create()
      info.Set(restype, shmem)
      comm = self.COMM.Split_type(split_type, info=info)
      self.assertNotEqual(comm, MPI.COMM_NULL)
      self.assertEqual(info.Get(restype), shmem)
      comm.Free()
      size = self.COMM.Get_size()
      rank = self.COMM.Get_rank()
      for root in range(size):
          if rank == root:
              split_type = MPI.COMM_TYPE_RESOURCE_GUIDED
          else:
              split_type = MPI.UNDEFINED
          comm = self.COMM.Split_type(split_type, info=info)
          self.assertEqual(info.Get(restype), shmem)
          if rank == root:
              self.assertNotEqual(comm, MPI.COMM_NULL)
              self.assertEqual(comm.size, 1)
              self.assertEqual(comm.rank, 0)
              comm.Free()
          else:
              self.assertEqual(comm, MPI.COMM_NULL)
      info.Free()
  
imports: from mpi4py import MPI
  import mpiunittest
label_desc: Use image node_id 20 for calling the BaseTestComm obj's underlying member method code with example usage: obj.testSplitTypeResourceGuided() without return types