Easy parallel loops in Python, R, Matlab and Octave (blog.dominoup.com) 6 points by earino 11y ago ↗ HN
[–] earino 11y ago ↗ Includes sample code for Python using joblib, in R using the Parallel language, and in Matlab/Octave using the parfor construct!
[–] techdragon 11y ago ↗ Parallel looping is one of those things I wish was easier to use. Countless times I've stared at my python code weighing the cost of using the available primitives to optimise the loop. I just wish it was as simple as parallel_for x in range(10): myFunc(x) But we can't have everything. [–] DominoDataLab 11y ago ↗ The joblib packages gets you pretty close: num_cores = multiprocessing.cpu_count() Parallel(n_jobs=num_cores)( delayed(myFunc)(x) for x in range(10))
[–] DominoDataLab 11y ago ↗ The joblib packages gets you pretty close: num_cores = multiprocessing.cpu_count() Parallel(n_jobs=num_cores)( delayed(myFunc)(x) for x in range(10))
3 comments
[ 2.8 ms ] story [ 14.7 ms ] thread