Parallel¶
This module contains some tools to perform parallel procedures using the python multiprocessing package
- mppi.Utilities.Parallel.loop(func, pars, *args, ntasks=4, verbose=True, **kwargs)[source]¶
Perform a parallel loop over the values of the pars array and compute the values of the function func, using ntasks parallel processes
- Parameters:
func (function) – a function that returns a value for each element of pars
pars (
array) – array with the values iterate by the loopntask (
int) – number of parallel tasksverbose (
bool) – determine the amount of information provided on terminalargs – arguments and keyword arguments passed to func
kwargs – arguments and keyword arguments passed to func