warning supression under parfor?

1 view (last 30 days)
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

Accepted Answer

Sean de Wolski
Sean de Wolski on 9 May 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

More Answers (0)

Categories

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

Community Treasure Hunt

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

Start Hunting!