code: def testReduceScatterBlock(self):
      size = self.COMM.Get_size()
      rank = self.COMM.Get_rank()
      for array, typecode in arrayimpl.loop():
          # segfault as of OpenMPI 4.1.1
          if unittest.is_mpi_gpu("openmpi", array):
              continue
          for op in (MPI.SUM, MPI.MAX, MPI.MIN, MPI.PROD):
              if skip_op(typecode, op):
                  continue
              for rcnt in range(size):
                  if op == MPI.PROD:
                      rbuf = array([rank + 1] * rcnt * size, typecode)
                  else:
                      rbuf = array([rank] * rcnt * size, typecode)
                  self.COMM.Ireduce_scatter_block(
                      MPI.IN_PLACE, rbuf.as_mpi(), op
                  ).Wait()
                  max_val = maxvalue(rbuf)
                  for i, value in enumerate(rbuf):
                      if i >= rcnt:
                          if op == MPI.PROD:
                              self.assertEqual(value, rank + 1)
                          else:
                              self.assertEqual(value, rank)
                      else:
                          if op == MPI.SUM:
                              redval = sum(range(size))
                              if redval < max_val:
                                  self.assertAlmostEqual(value, redval)
                          elif op == MPI.PROD:
                              redval = prod(range(1, size + 1))
                              if redval < max_val:
                                  self.assertAlmostEqual(value, redval)
                          elif op == MPI.MAX:
                              self.assertEqual(value, size - 1)
                          elif op == MPI.MIN:
                              self.assertEqual(value, 0)
  
imports: from mpi4py import MPI
  import mpiunittest
  import arrayimpl
  from functools import reduce
label_desc: Use image node_id 7 for calling the BaseTestCCOBufInplace obj's underlying member method code with example usage: obj.testReduceScatterBlock() without return types