Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. from ExternalPythonFile import ExternalFunction
  2.  
  3. valuelist = []
  4. for a,b in tuplelist:
  5. value = ExternalFunction(a,b)
  6. # more functions here
  7. valuelist.append(value)
  8. print(len(valuelist))
  9.  
  10. from ExternalPythonFile import ExternalFunction
  11. from joblib import Parallel, delayed, parallel_backend
  12. import multiprocessing
  13.  
  14. valuelist = []
  15.  
  16. def TupleFunction(a,b):
  17. value = ExternalFunction(a,b)
  18. # more functions here
  19. valuelist.append(value)
  20.  
  21. with parallel_backend('multiprocessing'):
  22. Parallel(n_jobs=10)(delayed(TupleFunction)(a,b) for a,b in tuplelist)
  23.  
  24. print(len(valuelist))
  25.  
  26. srun --ntasks=1 --ncpus-per-task=10 python3 MainFileJoblib.py
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement