How to use fetchNext correctly?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Background and Parallel Processing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!