elephant.parallel.MPIPoolExecutor

class elephant.parallel.MPIPoolExecutor(max_workers=None)[source]

The MPIPoolExecutor class uses a pool of MPI processes to execute calls asynchronously.

MPIPoolExecutor is recommended to use on cluster nodes which support MPI-2 protocol.

Notes

-m mpi4py.futures command line option is needed to execute Python scripts with MPI:

mpiexec -n numprocs python -m mpi4py.futures pyfile [arg] ...

For more information of how to launch MPI processes in Python refer to https://mpi4py.readthedocs.io/en/stable/mpi4py.futures.html#command-line

__init__(max_workers=None)

Methods

__init__([max_workers])

execute(handler, args_iterate, **kwargs)

Executes the queue of [handler(arg, **kwargs) for arg in args_iterate] in multiple processes within one machine (ProcessPoolExecutor) or multiple nodes (MPIPoolExecutor and MPICommExecutor).