Weird error happens after suppress warnings in parfor workers

2 views (last 30 days)
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.)

Accepted Answer

Owen Zhang
Owen Zhang on 10 May 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.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!