Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8457

Abort computation on any message

From Szabolcs <szhorvat@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Abort computation on any message
Date 2012-02-10 11:03 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jh2ti3$tc$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Abort computation on any message Szabolcs <szhorvat@gmail.com> - 2012-02-10 11:03 +0000
  Re: Abort computation on any message David Bailey <dave@removedbailey.co.uk> - 2012-02-12 09:59 +0000
    Re: Abort computation on any message David Bailey <dave@removedbailey.co.uk> - 2012-02-13 08:40 +0000

csiph-web