class_docstr: MPI-based asynchronous executor.
class_docstr_tok: ["MPI-based","asynchronous","executor","."]
docstr: Initialize a new MPIPoolExecutor instance.
  
  Args:
      max_workers: The maximum number of MPI processes that can be used
          to execute the given calls. If ``None`` or not given then the
          number of worker processes will be determined from the MPI
          universe size attribute if defined, otherwise a single worker
          process will be spawned.
      initializer: An callable used to initialize workers processes.
      initargs: A tuple of arguments to pass to the initializer.
  
  Keyword Args:
      python_exe: Path to Python executable used to spawn workers.
      python_args: Command line arguments to pass to Python executable.
      mpi_info: Mapping or iterable with ``(key, value)`` pairs.
      globals: Mapping with global variables to set in workers.
      main: If ``False``, do not import ``__main__`` in workers.
      path: List of paths to append to ``sys.path`` in workers.
      wdir: Path to set current working directory in workers.
      env: Environment variables to update ``os.environ`` in workers.
      use_pkl5: If ``True``, use pickle5 out-of-band for communication.
docstr_tok: ["Initialize","a","new","MPIPoolExecutor","instance",".","Args",":","max_workers",":","The","maximum","number","of","MPI","processes","that","can","be","used","to","execute","the","given","calls",".","If","``","None","``","or","not","given","then","the","number","of","worker","processes","will","be","determined","from","the","MPI","universe","size","attribute","if","defined",",","otherwise","a","single","worker","process","will","be","spawned",".","initializer",":","An","callable","used","to","initialize","workers","processes",".","initargs",":","A","tuple","of","arguments","to","pass","to","the","initializer",".","Keyword","Args",":","python_exe",":","Path","to","Python","executable","used","to","spawn","workers",".","python_args",":","Command","line","arguments","to","pass","to","Python","executable",".","mpi_info",":","Mapping","or","iterable","with","``","(","key",",","value",")","``","pairs",".","globals",":","Mapping","with","global","variables","to","set","in","workers",".","main",":","If","``","False","``",",","do","not","import","``","__main__","``","in","workers",".","path",":","List","of","paths","to","append","to","``","sys.path","``","in","workers",".","wdir",":","Path","to","set","current","working","directory","in","workers",".","env",":","Environment","variables","to","update","``","os.environ","``","in","workers",".","use_pkl5",":","If","``","True","``",",","use","pickle5","out-of-band","for","communication","."]
code: def __init__(
      self, max_workers=None, initializer=None, initargs=(), **kwargs
  ):
      """Initialize a new MPIPoolExecutor instance.
  
      Args:
          max_workers: The maximum number of MPI processes that can be used
              to execute the given calls. If ``None`` or not given then the
              number of worker processes will be determined from the MPI
              universe size attribute if defined, otherwise a single worker
              process will be spawned.
          initializer: An callable used to initialize workers processes.
          initargs: A tuple of arguments to pass to the initializer.
  
      Keyword Args:
          python_exe: Path to Python executable used to spawn workers.
          python_args: Command line arguments to pass to Python executable.
          mpi_info: Mapping or iterable with ``(key, value)`` pairs.
          globals: Mapping with global variables to set in workers.
          main: If ``False``, do not import ``__main__`` in workers.
          path: List of paths to append to ``sys.path`` in workers.
          wdir: Path to set current working directory in workers.
          env: Environment variables to update ``os.environ`` in workers.
          use_pkl5: If ``True``, use pickle5 out-of-band for communication.
  
      """
      if max_workers is not None:
          max_workers = int(max_workers)
          if max_workers <= 0:
              raise ValueError("max_workers must be greater than 0")
          kwargs["max_workers"] = max_workers
      if initializer is not None:
          if not callable(initializer):
              raise TypeError("initializer must be a callable")
          kwargs["initializer"] = initializer
          kwargs["initargs"] = tuple(initargs)
  
      self._options = kwargs
      self._shutdown = False
      self._broken = None
      self._lock = threading.Lock()
      self._pool = None
  
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 1 to create a new MPIPoolExecutor object from inherited base classes: Executor with example: obj = MPIPoolExecutor(max_workers, initializer, initargs)