code: def __init__(self, comm):
      # duplicate communicator
      assert not comm.Is_inter()
      self.comm = comm.Dup()
      # start counter thread
      self.thread = None
      rank = self.comm.Get_rank()
      if rank == 0:
          self.thread = Thread(target=self._counter_thread)
          self.thread.start()
  
file_path: mpi4py/demo/nxtval/nxtval-threads.py
imports: from mpi4py import MPI
  from array import array
  from threading import Thread
label_desc: Use image node_id 1 to create a new Counter object  with example: obj = Counter(comm)