I have an "embarrassingly" parallel Matlab problem I am looking to "parallelize" and I was just thinking about the various strategies. I've tried all three of the approaches mentioned in the question title and would just be curious to get some more experienced Matlab users thoughts. Essentially I am just running the same function with different data, and collecting the results.
In my experiments I've noticed that creating multiple batches incurs a significant startup time vs. creating a job with multiple tasks. The only reason I was even considering a multiple batches approach is I was thinking there might be a certain robustness in this approach, in the sense that if one batch fails due to bad data (or a node going offline, etc, etc…), you would still have the results from the other batches. One could then resubmit the batches that failed. Can a job/tasks approach be made equally robust? What happens if a task irrecoverably fails or hangs? Is there some way to recover the results from the other tasks?
As for parpool, is there an advantage to this approach that I'm missing beyond the automatic slicing of variables? Variable slicing is something I could accomplish manually using jobs/tasks or multiple batches.
Regardless of which approach is taken the job will be accomplished via a submitted batch (or batches), as it will likely take quite some time to run and being able to exit out of Matlab on the submitter machine will be nice.
Best Answer