-
-
Save korymath/49542788abf60a6e90ca to your computer and use it in GitHub Desktop.
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 | |
inputs = range(100000) | |
def processInput(i): | |
return i * i | |
num_cores = multiprocessing.cpu_count() | |
print str(num_cores) | |
results = Parallel(n_jobs=num_cores)(delayed(processInput)(i) for i in inputs) | |
print results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment