warning supression under parfor?

1 vue (au cours des 30 derniers jours)
Joseph MacGregor
Joseph MacGregor le 9 Mai 2012
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

Réponse acceptée

Sean de Wolski
Sean de Wolski le 9 Mai 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
  1 commentaire
Joseph MacGregor
Joseph MacGregor le 9 Mai 2012
Thanks! Exactly what I needed to know.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by