Speeding up a batching process that takes too long

3 次查看(过去 30 天)
I have been using the batch() function to run a needy process in the background using multiple workers in a local pool. The problem I'm finding is that the execution of batch() in my case actually takes a very long time, in some cases almost as long as it would take the process itself to finish. I've tried to re-write it so that the batching process (which takes a while) is called in a script, and that script is then itself batched. What I end up with is an error saying that workers cannot submit jobs to the local cluster. Does anyone know if there is a way to support parallel batching done in the background?

采纳的回答

Edric Ellis
Edric Ellis 2015-7-27
You can use parfeval on top of a parallel pool to do this. (Note that by opening a parallel pool of workers, you're actually reducing the number of workers available to run batch jobs - workers can work on either parallel pool things ( parfor, parfeval, and spmd ), or batch - but not both at the same time).
The programming interface to parfeval is broadly similar to batch, so it should not be too difficult to adapt your code to use that instead. parfeval has the advantage of lower overheads once your parallel pool is set up ( batch has to launch a new MATLAB worker process for each task that it executes).

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Parallel Server 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by