Azzera filtri
Azzera filtri

warning supression under parfor?

12 visualizzazioni (ultimi 30 giorni)
I've written a parfor loop that appears to function correctly except that a specific warning I've suppressed still appears. The loop is simple, just a single line with a call to polyfit. The specific warning I suppressed, 'MATLAB:polyfit:RepeatedPointsOrRescale', was suppressed correctly in the loop's previous life as a for loop. "lastwarn" returns this same warning. The obvious cop-out, "warning('off', 'all')", didn't appease it. I suspect that I need to inform each worker that this warning should be suppressed, but am unclear how to proceed.
Example warning output:
Warning: Polynomial is badly conditioned. Add points with distinct X values, reduce the degree of the polynomial, or try centering and scaling as described in HELP POLYFIT. > In polyfit at 76 In pickgui>(parfor body) at 1148 In parallel_function>make_general_channel/channel_general at 879 In remoteParallelFunction at 31
Thanks,
Joe

Risposta accettata

Sean de Wolski
Sean de Wolski il 9 Mag 2012
This is because the warning is being thrown from the workers which have not seen the "warning off" suppression.
To turn it off on the workers use:
pctrunonall warning_off_etc
and
doc pctrunonall

Più risposte (0)

Categorie

Scopri di più su Parallel for-Loops (parfor) in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by