code: def testAllreduce(self):
      size = self.COMM.Get_size()
      rank = self.COMM.Get_rank()
      for op in (
          MPI.SUM,
          MPI.PROD,
          MPI.MAX,
          MPI.MIN,
          MPI.MAXLOC,
          MPI.MINLOC,
          MPI.REPLACE,
          MPI.NO_OP,
      ):
          if op == MPI.OP_NULL:
              continue
          if op in (MPI.MAXLOC, MPI.MINLOC):
              sendobj = (rank, rank)
          else:
              sendobj = rank
          value = self.COMM.allreduce(sendobj, op)
          if op == MPI.SUM:
              self.assertEqual(value, cumsum(range(size)))
          elif op == MPI.PROD:
              self.assertEqual(value, cumprod(range(size)))
          elif op == MPI.MAX:
              self.assertEqual(value, size - 1)
          elif op == MPI.MIN:
              self.assertEqual(value, 0)
          elif op == MPI.MAXLOC:
              self.assertEqual(value[1], size - 1)
          elif op == MPI.MINLOC:
              self.assertEqual(value[1], 0)
          elif op == MPI.REPLACE:
              self.assertEqual(value, size - 1)
          elif op == MPI.NO_OP:
              self.assertEqual(value, 0)
  
imports: from mpi4py import MPI
  import mpiunittest
  from functools import reduce
label_desc: Use image node_id 8 for calling the BaseTestCCOObj obj's underlying member method code with example usage: obj.testAllreduce() without return types