|
ctools 2.1.0
|
Functions | |
| nthreads (cls) | |
| process (nthreads, function, args) | |
| mpfunc (args) | |
| cscripts.mputils.mpfunc | ( | args | ) |
Multiprocessing function
Parameters
----------
args : tuple
Tuple comprised of class, function name and function argument
Returns
-------
result, info : tuple
Tuple of function result and information
Definition at line 121 of file mputils.py.
| cscripts.mputils.nthreads | ( | cls | ) |
Determines the number of parallel processes to use
The number is based on the user parameter "nthreads" and the availability
of the multiprocessing module.
Parameters
----------
cls : `~ctools.cscript`
cscript class
Returns
-------
nthreads : int
Number of threads
Definition at line 26 of file mputils.py.
| cscripts.mputils.process | ( | nthreads, | |
| function, | |||
| args ) |
Execute function in parallel
Parameters
----------
nthreads : int
Number of parallel threads
function : Python function
Function to be executed in parallel
args : list of tuples
Function arguments for each evaluation
Returns
-------
results : list of dicts
List of function evaluation results
Definition at line 77 of file mputils.py.