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):
                  if rank == root:
                      buf = array(range(size), typecode)
                      sbuf = MPI.IN_PLACE
                      rbuf = buf.as_mpi()
                  else:
                      buf = array(range(size), typecode)
                      buf2 = array(range(size), typecode)
                      sbuf = buf.as_mpi()
                      rbuf = buf2.as_mpi()
                  StartWaitFree(
                      self.COMM.Reduce_init(sbuf, rbuf, op, root)
                  )
                  if rank == root:
                      max_val = maxvalue(buf)
                      for i, value in enumerate(buf):
                          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 5 for calling the BaseTestCCOBufInplace obj's underlying member method code with example usage: obj.testReduce() without return types