This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from joblib import Parallel, delayed | |
import multiprocessing | |
import warnings | |
DEDICATED_CORE_NUMBER = max(multiprocessing.cpu_count() - 2, 1) | |
def multiProcess(f, argumentsList, coreNumber=DEDICATED_CORE_NUMBER, prt=1): | |
"""Takes a function, a list of parameter sets for the function, and a number of cores to use as parameters. | |
Executes the function in parallel across all parameter sets (using 'coreNumber' cores) | |
Returns the list of function returns. |