diff --git a/ReleaseNotes/release_notes.md b/ReleaseNotes/release_notes.md index 2283f1b7..67201efb 100644 --- a/ReleaseNotes/release_notes.md +++ b/ReleaseNotes/release_notes.md @@ -9,7 +9,9 @@ 1. suppress `ostap.core.config.config_goodby` prints for non-interactive sessions 1. add the most primitive splitter `ostap.utils.utils.splitter` 1. modify `point-to-point-dissimilarity` GoF method: split into chubnks for large datasets, use parallel processing for permutations - + 1. add keyword arguments to `WorkManager.iexecute` method + 1. add an option to run parallel permutations using `WorkManager` parallelisation instead of `joblib` + ## Backward incompatible ## Bug fixes diff --git a/ostap/stats/gof_np.py b/ostap/stats/gof_np.py index dcd5322c..c2eeb367 100644 --- a/ostap/stats/gof_np.py +++ b/ostap/stats/gof_np.py @@ -243,7 +243,7 @@ def __call__ ( self , N , silent = True ) : if jl : # ===================================================================== # ========================================================================= ## Run NN-permutations in parallel using joblib - def jl_run ( self , NN , silent = True ) : + def joblib_run ( self , NN , silent = True ) : """ Run NN-permutations in parallel using joblib """ nj = 4 * numcpu () + 4 lst = splitter ( NN , nj ) @@ -260,11 +260,28 @@ def jl_run ( self , NN , silent = True ) : # return counter - PERMUTATOR.run = jl_run + PERMUTATOR.run = joblib_run # ========================================================================= else : # ====================================================================== # ========================================================================= - PERMUTATOR.run = None + ## Run NN-permutations in parallel using WorkManager + def pp_run ( self , NN , silent = True ) : + """ Run NN-permutations in parallel using WorkManager""" + nj = 4 * numcpu () + 4 + lst = splitter ( NN , nj ) + ## + from ostap.parallel.parallel import WorkManager + manager = WorkManager ( silent = silent ) + counter = EffCounter() + ## + ## use the bare interface + for result in manager.iexecute ( self , lst , progress = not silent , njobs = nj ) : + counter += result + # + return counter + + PERMUTATOR.run = pp_run + # ========================================================================= # ============================================================================= ## @class PPD