Weird error happens after suppress warnings in parfor workers

17 vues (au cours des 30 derniers jours)
Owen Zhang
Owen Zhang le 9 Mai 2019
Commenté : Chien-Han Su le 10 Sep 2020
I searched online for how to suppress warnings in parfor workers, and i got the code like:
pctRunOnAll warning('off', 'all'); % supress warnings on all workers
and I added this statement in my function to start to parpool:
function startParpool()
% import parallel profile and startup parpool workers
if isempty(gcp('nocreate'))
if isdeployed
setmcruserdata('ParallelProfile', fullfile(ctfroot, '\config\MyDefaultProfile.settings'));
end
parpool(20); % matches # of cores on ARMS server
end
pctRunOnAll warning('off', 'all'); % supress warnings on all workers
end
Everything is fine in Matlab IDE and the warnings during parfor are perfectly suppressed.
But after I compiled the program into application (using application compiler), I got this weird error when I run the application in command line:
what is the error Undefined function or variable 'parallel.internal.pool.interPPromptFcn' ??
(if i removed the above statement, the error will be gone, but the warnings are not suppressed.)

Réponse acceptée

Owen Zhang
Owen Zhang le 10 Mai 2019
i worked it out, i don't know why pctRunOnAll warning('off', 'all'); is not working.
but just simply add warning('off', 'all'); at the beginning of parfor loop.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by