How to use fetchNext correctly?
Mostra commenti meno recenti
Hey,
I have to functions which I want to calculate on a parrallel pool.
The input of the second function is the output of the first function.
So right now it looks like this:
seeds=NaN(num_pts,3,volume/4);
for i=1:volume/4
pts(i)=parfeval(@partial_seeder,1,min_grain,num_pts);
wait(pts)
ptRads(i) = parfeval(@seeder,1,pts(i).OutputArguments{1});
wait(ptRads)
seeds(:,1:2,i)=pts(i).OutputArguments{1};
seeds(:,3,i)=ptRads(i).OutputArguments{1};
end
But this way i have to wait for all partial_seeder functions to finish until I can start to continue with the results. How is it possible to directly continue with the results(i) in the next parfeval funtion, even if results (j) or results (k) aren't finished in the first parfeval yet.
I am not sure how to use fetchNext correctly in this case? I would have to call fetchNext volume/4 times but what if I call it too fast and the jobs arent finished yet?
Many Thanks in advance,
Best regards
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Background and Parallel Processing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!