elephant.parallel.ProcessPoolExecutor

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

The wrapper of Python built-in concurrent.futures.ProcessPoolExecutor class.

ProcessPoolExecutor is recommended to use if you have one physical machine (laptop or PC).

Parameters:
max_workersint or None

The maximum number of processes that can be used to execute the given calls. If None or not given then as many worker processes will be created as the machine has processors. Default: None

__init__(max_workers=None)[source]

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).