diff --git a/music21/common/parallel.py b/music21/common/parallel.py index f05ceeb46..658fd1d63 100644 --- a/music21/common/parallel.py +++ b/music21/common/parallel.py @@ -116,6 +116,7 @@ def runParallel(iterable, unpackIterable=unpackIterable, updateSendsIterable=updateSendsIterable) + numCpus = cpus() iterLength = len(iterable) totalRun = 0 if updateFunction is None: @@ -147,7 +148,6 @@ def callUpdate(ii): callUpdate(0) from joblib import Parallel, delayed # type: ignore - numCpus = cpus() with Parallel(n_jobs=numCpus) as para: delayFunction = delayed(parallelFunction) while totalRun < iterLength: