smpl.parallel¶
Simplified parallelization.
Submodules¶
Package Contents¶
Functions¶
|
|
|
Generates parallel execution list generator. |
|
Parallel execution of f on each element of args and kwargs |
|
Parallel execution of f on each element of args |
|
Parallel evaluation of the list generator from |
Attributes¶
- smpl.parallel.par(f, *args, **kwargs)[source]¶
Parallel execution of f on each element of args and kwargs
Examples¶
>>> par(lambda x : x**2, range(0,5)) [0, 1, 4, 9, 16]
- smpl.parallel.partitioned_parallel(f, arr, n_jobs=None)[source]¶
Parallel execution of f on each element of args
Examples¶
>>> partitioned_parallel(lambda x : x**2, range(0,5)) [0, 1, 4, 9, 16]
- smpl.parallel.res(a)[source]¶
Parallel evaluation of the list generator from
gen().Return parallel executed values.
Examples¶
>>> def twice(x): ... return x+x >>> for r in [calc(twice,i) for i in range(0,5)]: ... print(res(r)) 0 2 4 6 8 >>> res([calc(lambda x : x**3, i) for i in range(0,5)]) [0, 1, 8, 27, 64]