warning supression under parfor?

1 visualización (últimos 30 días)
Joseph MacGregor
Joseph MacGregor el 9 de Mayo de 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

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 9 de Mayo de 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 comentario
Joseph MacGregor
Joseph MacGregor el 9 de Mayo de 2012
Thanks! Exactly what I needed to know.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by