Effacer les filtres
Effacer les filtres

fetchOutputs() results in an error when the preceding parfeval() was called using the backgroundPool

13 vues (au cours des 30 derniers jours)
I have a code piece that works fine:
function [ServerVersInfo,VersInfoObtained,ExcInfo]=GetVersionInfoFromServer(URL)
%init outputs
try
%access server, update outputs accordingly
catch ME
%set fall-back values for outputs
end
end
%calling code
p = gcp('nocreate');
if isempty(p)
p = parpool('local',1);
end
FunHandle = parfeval(p,@GetVersionInfoFromServer,3,StoredUrl);
% wait until FunHandle.State is 'finished'...
[LatestVersInfo,VersInfoObtained,ExcInfo]=fetchOutputs(FunHandle);
When I just replace the pool from the parallel computing toolbox with the backgroundPool, the fetchOutputs throws a MATLAB:parallel:future:ExecutionErrors failure. What's the difference?
(P.S. I tried the backgroundPool because starting the pool from the parallel computing toolbox takes a huge amount of time...)
  2 commentaires
Edric Ellis
Edric Ellis le 20 Déc 2021
Can you show us the full error message you get from fetchOutputs? The error identifier you mention is a generic one that "wraps" all errors that happen on the workers. It's probable that the code you're trying to run on the workers isn't supported for thread-based pools - see the doc for more.
Lionel Pöffel
Lionel Pöffel le 20 Déc 2021
The failure message is the quite generic "One or more futures resulted in an error".
But you're right, the limitations described in the documentation will probably affect my use case as well.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by