bluepyparallel.parallel¶
Parallel helper.
Functions
|
Return the desired instance of the parallel factory. |
Classes
|
Parallel helper class using dask.dataframe. |
|
Parallel helper class using dask. |
|
Parallel helper class using ipyparallel. |
|
Parallel helper class using multiprocessing. |
|
Class that represents a MultiProcessing nested pool. |
|
Class that represents a non-daemon process. |
|
Abstract class that should be subclassed to provide parallel functions. |
|
Factory that do not work in parallel. |
- class bluepyparallel.parallel.DaskDataFrameFactory(batch_size=None, chunk_size=None, scheduler_file=None, address=None, dask_config=None, **kwargs)¶
Bases:
DaskFactoryParallel helper class using dask.dataframe.
It is possible to pass a custom dask configuration in several ways. The simplest way is to pass a dictionary to the dask_config argument. Another way is to create a YAML file containing the configuration and then set the DASK_CONFIG environment variable to its path. Note that this environment variable must be set before dask is imported and can not be updated afterwards. Also, it is possible to use the SHMDIR or the TMPDIR environment variable to specify the directory in which the dask internals will be created. Note that this value will be overridden if a dask configuration is given. If no config is provided, the following is used:
{ "distributed": { "admin": { "tick": { "limit": "1h" } }, "worker": { "memory": { "pause": 0.8, "spill": false, "target": false, "terminate": 0.95 }, "profile": { "enabled": false }, "use_file_locking": false } } }
- get_mapper(batch_size=None, chunk_size=None, **kwargs)¶
Get a Dask mapper.
If
progress_bar=Trueis passed as keyword argument, a progress bar will be displayed during computation.
- class bluepyparallel.parallel.DaskFactory(batch_size=None, chunk_size=None, scheduler_file=None, address=None, dask_config=None, **kwargs)¶
Bases:
ParallelFactoryParallel helper class using dask.
It is possible to pass a custom dask configuration in several ways. The simplest way is to pass a dictionary to the dask_config argument. Another way is to create a YAML file containing the configuration and then set the DASK_CONFIG environment variable to its path. Note that this environment variable must be set before dask is imported and can not be updated afterwards. Also, it is possible to use the SHMDIR or the TMPDIR environment variable to specify the directory in which the dask internals will be created. Note that this value will be overridden if a dask configuration is given. If no config is provided, the following is used:
{ "distributed": { "admin": { "tick": { "limit": "1h" } }, "worker": { "memory": { "pause": 0.8, "spill": false, "target": false, "terminate": 0.95 }, "profile": { "enabled": false }, "use_file_locking": false } } }
- get_mapper(batch_size=None, chunk_size=None, **kwargs)¶
Get a Dask mapper.
- shutdown()¶
Close the scheduler and the cluster if it was created by the factory.
- class bluepyparallel.parallel.IPyParallelFactory(batch_size=None, chunk_size=None, profile=None, **kwargs)¶
Bases:
ParallelFactoryParallel helper class using ipyparallel.
- get_mapper(batch_size=None, chunk_size=None, **kwargs)¶
Get an ipyparallel mapper using the profile name provided.
- shutdown()¶
Remove zmq.
- class bluepyparallel.parallel.MultiprocessingFactory(batch_size=None, chunk_size=None, processes=None, **kwargs)¶
Bases:
ParallelFactoryParallel helper class using multiprocessing.
- get_mapper(batch_size=None, chunk_size=None, **kwargs)¶
Get a NestedPool.
- shutdown()¶
Close the pool.
- class bluepyparallel.parallel.NestedPool(processes=None, initializer=None, initargs=(), maxtasksperchild=None, context=None)¶
Bases:
PoolClass that represents a MultiProcessing nested pool.
- Process¶
alias of
NoDaemonProcess
- class bluepyparallel.parallel.NoDaemonProcess(group=None, target=None, name=None, args=(), kwargs={})¶
Bases:
ProcessClass that represents a non-daemon process.
- property daemon¶
Get daemon flag.
- class bluepyparallel.parallel.ParallelFactory(batch_size=None, chunk_size=None)¶
Bases:
objectAbstract class that should be subclassed to provide parallel functions.
- abstractmethod get_mapper(batch_size=None, chunk_size=None, **kwargs)¶
Return a mapper function that can be used to execute functions in parallel.
- mappable_func(func, *args, **kwargs)¶
Can be used to add args and kwargs to a function before calling the mapper.
- shutdown()¶
Can be used to cleanup.
- class bluepyparallel.parallel.SerialFactory(batch_size=None, chunk_size=None)¶
Bases:
ParallelFactoryFactory that do not work in parallel.
- get_mapper(batch_size=None, chunk_size=None, **kwargs)¶
Get a map.
- bluepyparallel.parallel.init_parallel_factory(parallel_lib, *args, **kwargs)¶
Return the desired instance of the parallel factory.
The main factories are:
None: return a serial mapper (the standard
map()function).multiprocessing: return a mapper using the standard
multiprocessing.dask: return a mapper using the
distributed.Client.ipyparallel: return a mapper using the
ipyparallellibrary.