Is it possible to call parfeval from within a parfor loop
Show older comments
I have a time consuming analysis task I'm trying to speed up, on a beefy workstation with lots of cores.
Currently, code constists of an outer parfor loop, which let's say is loading an input file, then calling several functions which each do some independant processing, and output a file.
Obviously, the easiest approach is just to parfor the outer loop -- but since there are often only a small # of input files to analyze (say, 3), this doesn't make good use of the cores.
Alternatively, I could parfor the time consuming functions, but since there are small # of these functions, it also ends up using a small # of cores. (The functions could be non-communicating, fire and forget, since they can just output files, results are not used within the loop ).
Ideally, it seems like I'd want to be able to have an outer parfor, and then have each parfor kick off some separate tasks or parfeval's for the work going on inside the loop. However, in Matlab 2021, "Workers cannot submit jobs to a local cluster." , and "Workers cannot execute parfeval or parfevalOnAll."
Is there any way to run parfeval from within parfor? Or any sort of equivalent construct using the lower level job/task controls?
Accepted Answer
More Answers (0)
Categories
Find more on Background and Parallel Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!