code: def testFetchAndOp(self):
      typemap = MPI._typedict
      group = self.WIN.Get_group()
      size = group.Get_size()
      rank = group.Get_rank()
      group.Free()
      self.WIN.Fence()
      blen = MPI.INT.Get_size()
      obuf = MPI.Alloc_mem(blen)
      memzero(obuf)
      rbuf = MPI.Alloc_mem(blen)
      memzero(rbuf)
      try:
          try:
              self.WIN.Fetch_and_op(
                  [obuf, 1, MPI.INT], [rbuf, 1, MPI.INT], rank
              )
              self.WIN.Fence()
          finally:
              MPI.Free_mem(obuf)
              MPI.Free_mem(rbuf)
      except NotImplementedError:
          self.skipTest("mpi-win-fetch_and_op")
      self.WIN.Fence()
      for array, typecode in arrayimpl.loop():
          with arrayimpl.test(self):
              if unittest.is_mpi_gpu("openmpi", array):
                  continue
              if unittest.is_mpi_gpu("mvapich2", array):
                  continue
              if typecode in "?":
                  continue
              if typecode in "FDG":
                  continue
              obuf = array(+1, typecode)
              rbuf = array(-1, typecode, 2)
              datatype = typemap[typecode]
              for op in (
                  MPI.SUM,
                  MPI.PROD,
                  MPI.MAX,
                  MPI.MIN,
                  MPI.REPLACE,
                  MPI.NO_OP,
              ):
                  for rank in range(size):
                      for disp in range(3):
                          with self.subTest(disp=disp, rank=rank):
                              with win_lock(self.WIN, rank):
                                  self.WIN.Fetch_and_op(
                                      obuf.as_mpi(),
                                      rbuf.as_mpi_c(1),
                                      rank,
                                      disp * datatype.size,
                                      op=op,
                                  )
                              self.assertEqual(rbuf[1], scalar(-1))
      big = bytearray(MPI.INT.Get_size())
      buf1 = bytearray(1)
      buf2 = bytearray(1)
      with win_lock(self.WIN, rank):
          self.WIN.Fetch_and_op(buf1, buf2, rank, op=MPI.NO_OP)
      with self.assertRaises(ValueError):
          with win_lock(self.WIN, rank):
              self.WIN.Fetch_and_op(big, buf2, rank, op=MPI.NO_OP)
      with self.assertRaises(ValueError):
          with win_lock(self.WIN, rank):
              self.WIN.Fetch_and_op(buf1, big, rank, op=MPI.NO_OP)
      with self.assertRaises(ValueError):
          with win_lock(self.WIN, rank):
              self.WIN.Fetch_and_op(
                  buf1, [big, MPI.INT], rank, op=MPI.NO_OP
              )
  
imports: from mpi4py import MPI
  import mpiunittest
  import contextlib
  import arrayimpl
  import sys
label_desc: Use image node_id 6 for calling the BaseTestRMA obj's underlying member method code with example usage: obj.testFetchAndOp() without return types