Parallel
distribute(simulation_fn, spaces, n_cores=None, shuffle=False)
Distribute a function over a list of parameters in parallel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
simulation_fn |
Callable
|
function to be distributed |
required |
spaces |
List[List[float]]
|
list of lists of parameters |
required |
n_cores |
int
|
number of cores to use. |
None
|
Returns:
Type | Description |
---|---|
tuple index (int): Index of the parameters in the spaces list, multiple dims. simulation_fn output (any): The output of the simulation function. index - index of the parameters in the spaces list, multiple dims. |
Source code in cmtj/utils/parallel.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|