diff --git a/DSSC.py b/DSSC.py index 0adf64b4cbb21ad5d1f56ee23788b4446e3d4522..5aebd93d58574d08da0eb57754bdd6caed525a36 100644 --- a/DSSC.py +++ b/DSSC.py @@ -1,4 +1,4 @@ -import multiprocessing +from joblib import Parallel, delayed, parallel_backend from time import strftime import tempfile import shutil @@ -330,8 +330,10 @@ class DSSC: timestamp = strftime('%X') print(f'start time: {timestamp}') - with multiprocessing.Pool(self.Nworker) as pool: - module_data = pool.map(process_one_module, jobs) + with parallel_backend('loky', n_jobs=self.Nworker): + module_data = Parallel(verbose=20)( + delayed(process_one_module)(job) for job in tqdm(jobs) + ) print('finished:', strftime('%X'))