Abort computation on any message
- To: mathgroup at smc.vnet.net
- Subject: [mg124887] Abort computation on any message
- From: Szabolcs <szhorvat at gmail.com>
- Date: Fri, 10 Feb 2012 05:59:12 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
Messages are never fatal in Mathematica, regardless of whether they indicate errors, warnings or they're just informative. Evaluations continue even after messages are generated. Question: How can I get Mathematica to abort immediately as soon as a message is generated? I need the following behaviour: 1. if a message would be printed, always abort. 2. if no message would be printed, don't abort. 3. do print the first message so I have a hint about what went wrong 4. the mechanism should work with parallel computations and should abort the full evaluation (i.e. main kernel and all parallel kernels) Difficulties are caused by the many ways to control message printing: On/Off, Quiet, etc. My code does use Quiet, but I am quieting only certain messages. I have already asked this here: http://mathematica.stackexchange.com/q/1512/12 but the two answers I got (at the time of writing this) do not completely satisfy the requirements from above. I found an older MathGroup thread about this, which also doesn't solve the problem completely: http://forums.wolfram.com/mathgroup/archive/2005/Apr/msg00127.html
- Follow-Ups:
- Re: Abort computation on any message
- From: Fred Simons <f.h.simons@tue.nl>
- Re: Abort computation on any message