code: def testReduce(self):
      size = self.COMM.Get_size()
      rank = self.COMM.Get_rank()
      for array, typecode in arrayimpl.loop():
          for op in (MPI.SUM, MPI.PROD, MPI.MAX, MPI.MIN):
              if skip_op(typecode, op):
                  continue
              for root in range(size):
                  sbuf = array(range(size), typecode)
                  rbuf = array(-1, typecode, size)
                  self.COMM.Reduce(
                      sbuf.as_mpi(), rbuf.as_mpi(), op, root
                  )
                  max_val = maxvalue(rbuf)
                  for i, value in enumerate(rbuf):
                      if rank != root:
                          check = arrayimpl.scalar(-1)
                          self.assertEqual(value, check)
                          continue
                      if op == MPI.SUM:
                          if (i * size) < max_val:
                              self.assertAlmostEqual(value, i * size)
                      elif op == MPI.PROD:
                          if (i**size) < max_val:
                              self.assertAlmostEqual(value, i**size)
                      elif op == MPI.MAX:
                          self.assertEqual(value, i)
                      elif op == MPI.MIN:
                          self.assertEqual(value, i)
  
imports: from mpi4py import MPI
  import mpiunittest
  import arrayimpl
  from functools import reduce
label_desc: Use image node_id 8 for calling the BaseTestCCOBuf obj's underlying member method code with example usage: obj.testReduce() without return types