warning supression under parfor?

1 次查看(过去 30 天)
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

采纳的回答

Sean de Wolski
Sean de Wolski 2012-5-9
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by