class_docstr: Context manager for `MPIPoolExecutor`.
  
  This context manager splits a MPI (intra)communicator in two
  disjoint sets: a single master process and the remaining worker
  processes. These sets are then connected through an intercommunicator.
  The target of the ``with`` statement is assigned either an
  `MPIPoolExecutor` instance (at the master) or ``None`` (at the workers).
  
  Example::
  
      with MPICommExecutor(MPI.COMM_WORLD, root=0) as executor:
          if executor is not None: # master process
              executor.submit(...)
              executor.map(...)
class_docstr_tok: ["Context","manager","for","`","MPIPoolExecutor","`",".","This","context","manager","splits","a","MPI","(","intra",")","communicator","in","two","disjoint","sets",":","a","single","master","process","and","the","remaining","worker","processes",".","These","sets","are","then","connected","through","an","intercommunicator",".","The","target","of","the","``","with","``","statement","is","assigned","either","an","`","MPIPoolExecutor","`","instance","(","at","the","master",")","or","``","None","``","(","at","the","workers",")",".","Example",":",":","with","MPICommExecutor","(","MPI.COMM_WORLD",",","root=0",")","as","executor",":","if","executor","is","not","None",":","#","master","process","executor.submit","(","...",")","executor.map","(","...",")"]
docstr: Shutdown `MPIPoolExecutor` instance at the root.
docstr_tok: ["Shutdown","`","MPIPoolExecutor","`","instance","at","the","root","."]
code: def __exit__(self, *args):
      """Shutdown `MPIPoolExecutor` instance at the root."""
      executor = self._executor
      self._executor = None
  
      if executor is not None:
          executor.shutdown(wait=True)
          return False
      else:
          return True
  
imports: import sys
  import time
  import functools
  import itertools
  import threading
  from ._base import Future
  from ._base import Executor
  from ._base import as_completed
  from .None import _core
label_desc: Use image node_id 3 for calling the MPICommExecutor obj's underlying member method code with example usage: obj.__exit__() and returns: False, True