code: def testReduceScatter(self):
      size = self.COMM.Get_size()
      rank = self.COMM.Get_rank()
      for array, typecode in arrayimpl.loop():
          for op in (MPI.SUM, MPI.MAX, MPI.MIN, MPI.PROD):
              if skip_op(typecode, op):
                  continue
              rcnt = list(range(1, size + 1))
              if op == MPI.PROD:
                  rbuf = array([rank + 1] * sum(rcnt), typecode)
              else:
                  rbuf = array([rank] * sum(rcnt), typecode)
              self.COMM.Reduce_scatter(
                  MPI.IN_PLACE, rbuf.as_mpi(), rcnt, op
              )
              max_val = maxvalue(rbuf)
              for i, value in enumerate(rbuf):
                  if i >= rcnt[rank]:
                      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 8 for calling the BaseTestCCOBufInplace obj's underlying member method code with example usage: obj.testReduceScatter() without return types