Parpool local too slow
이전 댓글 표시
Why does it take so long to start a parallel pool on a local profile? It's only 10 seconds or so, but for a job that should simply thread across the cores of the host machine's CPU it should be nearly instantaneous.
I spent some time reworking a bit of code we use frequently to run in parallel. The runtime went from 10 seconds to around 2 which I was very happy with. Our use case, though, only requires running a few jobs at a time. Over time it would add up to a pretty nice time savings except that every time the user runs the code they need to wait for parpool to run. The 15 seconds there means that it's only worth using the parallel code I worked so hard on if they're going to be running more than a handful of jobs at a time which is rare. The result is that my time producing parallel code was wasted because Matlab inexplicably needs time to set up a pool of workers on the host machine that Matlab itself is running on. Is there any way around this because it makes no sense?
댓글 수: 3
Adam
2014년 11월 19일
I have also sometimes run into a situation where my code would be faster to parallelise if a pool is already open, but not worth doing so if I have to open the pool in order to do it. Thee things are all testable of course and, as Matt J, pointed out, you can leave the parallel pool open, but it can add needless complexity to code
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!