File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
monte-cover/src/montecover Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1212import numpy as np
1313import pandas as pd
1414import yaml
15- from joblib import Parallel , delayed
15+ from joblib import Parallel , delayed , parallel_backend
1616
1717
1818class BaseSimulation (ABC ):
@@ -111,9 +111,10 @@ def run_simulation(self, n_jobs=None):
111111
112112 else :
113113 self .logger .info (f"Starting parallel execution with n_jobs={ n_jobs } " )
114- results = Parallel (n_jobs = n_jobs , verbose = 10 )(
115- delayed (self ._process_repetition )(i_rep ) for i_rep in range (self .repetitions ) if not self ._stop_simulation ()
116- )
114+ with parallel_backend ("loky" , inner_max_num_threads = 1 ):
115+ results = Parallel (n_jobs = n_jobs , verbose = 10 )(
116+ delayed (self ._process_repetition )(i_rep ) for i_rep in range (self .repetitions ) if not self ._stop_simulation ()
117+ )
117118
118119 # Process results from parallel execution
119120 for worker_results in results :
You can’t perform that action at this time.
0 commit comments