code: def next(self):
      #
      group = self.win.Get_group()
      size = group.Get_size()
      rank = group.Get_rank()
      group.Free()
      #
      incr = _array("i", [1])
      vals = _array("i", [0]) * size
      self.win.Lock(0)
      self.win.Accumulate(
          [incr, 1, MPI.INT], 0, [rank, 1, MPI.INT], MPI.SUM
      )
      self.win.Get([vals, 1, self.dt_get], 0, [0, 1, self.dt_get])
      self.win.Unlock(0)
      #
      vals[rank] = self.myval
      self.myval += 1
      nxtval = sum(vals)
      #
      return nxtval
  
imports: from mpi4py import MPI
  from array import array
  import struct
label_desc: Use image node_id 3 for calling the Counter obj's underlying member method code with example usage: obj.next() and returns: nxtval