code: def testReduce(self):
      rank = self.INTERCOMM.Get_rank()
      size = self.INTERCOMM.Get_size()
      rsize = self.INTERCOMM.Get_remote_size()
      for op in (MPI.SUM, MPI.MAX, MPI.MIN, MPI.PROD):
          for color in [0, 1]:
              if self.COLOR == color:
                  for root in range(size):
                      if root == rank:
                          value = self.INTERCOMM.reduce(
                              None, op=op, root=MPI.ROOT
                          )
                          if op == MPI.SUM:
                              self.assertEqual(
                                  value, cumsum(range(rsize))
                              )
                          elif op == MPI.PROD:
                              self.assertEqual(
                                  value, cumprod(range(rsize))
                              )
                          elif op == MPI.MAX:
                              self.assertEqual(value, rsize - 1)
                          elif op == MPI.MIN:
                              self.assertEqual(value, 0)
                      else:
                          value = self.INTERCOMM.reduce(
                              None, op=op, root=MPI.PROC_NULL
                          )
                          self.assertIsNone(value)
              else:
                  for root in range(rsize):
                      value = self.INTERCOMM.reduce(
                          rank, op=op, root=root
                      )
                      self.assertIsNone(value)
      badroots = {-3, -2, -1, rsize}.difference(
          {MPI.ROOT, MPI.PROC_NULL}
      )
      for root in badroots:
          with self.assertRaises(MPI.Exception) as cm:
              self.INTERCOMM.reduce(None, op=MPI.NO_OP, root=root)
          ierr = cm.exception.Get_error_class()
          self.assertEqual(ierr, MPI.ERR_ROOT)
  
imports: from mpi4py import MPI
  import mpiunittest
  from functools import reduce
label_desc: Use image node_id 9 for calling the BaseTestCCOObjInter obj's underlying member method code with example usage: obj.testReduce() without return types