Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [interruption]

Interrupting calculations, preventing interrupts and recovering data from aborts.

2
votes
1answer
90 views

Abort long evaluation and show intermediate results

I am doing a time-intensive calculation and I would like to have the option to stop the calculation but obtain the current (last) result. Generally, I do some groundwork as what can be done before ...
0
votes
0answers
46 views

How to keep remote Mathematica GUI running when the connection is lost

I am running Mathematica on a remote Linux cluster using X11/SSH. I'm using the GUI and not the kernels in remote because this is the only way they let me use it. I have a long notebook that I open ...
7
votes
1answer
61 views

Abort but keep what was already calculated

This is a very general question I have about aborting a running computation but keeping what was already generated. Let's say that I perform a numerical optimization over a list of parameters. ...
3
votes
1answer
67 views

Saving a log file if an error occurs

I am running a program that adds a message to a list after each completed cycle (about 5k cycles). Upon completion, the program saves the list to disk so I can review it. However, if the program ...
0
votes
1answer
90 views

Catching and reacting to a warning [closed]

I have a program which can lead in certain cases to a division by zero. I would like to know if there is a way in Mathematica to make a conditional statement like the following one: ...
5
votes
2answers
123 views

How to collect results even if AceFEM analysis diverges?

Sometimes (implicit) finite element analysis with AceFEM diverges and solution procedure is aborted before reaching the final time/load step. I have followed the method shown in documentation for ...
1
vote
1answer
104 views

Does Abort not work for ParallelTable with SetSharedVariable?

I find that often Abort (command-. on Mac) sometimes does not work if ParallelTable is running. Here's a simple example: ...
1
vote
1answer
49 views

Access variable middle of the run [duplicate]

I execute a Table[] that need large time to be finished. If I abort it I loose what evaluated until now. Does it possible to stop running and save what evaluated ...
3
votes
0answers
401 views

Interrupt evaluation of script with exit code 1 [closed]

I am running a Mathematica script I wrote as a batch job from a terminal, running it many times inside a loop inside a Bash script. Sometimes I want to abort the job. I can of course do ...
7
votes
1answer
120 views

Mathematica suspends long calculation [closed]

I have the following weird problem: I am performing some monte carlo simulations through a simple do loop, where each round takes about 1-5 minutes. I was running 1000 or so overnight, and realized ...
4
votes
0answers
90 views

Why does the debugger not stop when a message is generated?

I am on version 10.1. I have enabled the debugger and I have checked the box in front of "Break at Messages" in the Debugger Tools Window. However most the time the debugger does not stop when a ...
8
votes
2answers
401 views

Can I automatically stop operation that is too slow?

I need to write code like this: Do operation 1, but if it takes more that 5 seconds then stop it and do operation 2. Is it possible to do this somehow without manual interruption?
5
votes
3answers
8k views

How do I interrupt (abort) a computation in Mathematica?

Sometimes I (inadvertently or naively) write a code that would take Mathematica a long time to compute on my laptop or any computer for that matter. For example: Table[Length[Select[Permutations[n], #[...
8
votes
1answer
1k views

Resume/continue interrupted evaluation

I interrupted an evaluation to quickly do something else. How do I resume the interrupted evaluation? I cannot open the "Interrupt evaluation" window, as it is disabled. There is no "Resume" button to ...
0
votes
0answers
61 views

Interrupting FactorInteger automatically when it takes a very long time [duplicate]

Sometimes when I use FactorInteger[] with certain very big integers, it takes a very long time, and I have to interrupt the operation manually to try another ...
3
votes
1answer
294 views

How to catch an interrupt (Control-C) in a script?

If a user hits Control-C when a script is running, they get an Interrupt> prompt, where they have to type exit or ...
6
votes
1answer
2k views

How can I save the current evaluation state of a notebook and start from it later?

I currently have a nested Table command running (in Mathematica 9), with two progress bars to track the variables. I have to shut down or hibernate the computer in ...
12
votes
1answer
395 views

TimeConstrained dynamic change of maximum time

I would like to run a time consuming function: TimeConstrained[f[x],maxseconds] and be able to change maxseconds during running (increasing or decreasing max ...
4
votes
3answers
1k views

Stop Computation - Is Exit[] overkill?

The following example either finds a factor of the number $n$ or returns a message saying that the number in question is prime (I specifially wrote this to demonstrate my question below). ...
5
votes
0answers
75 views

At what point should MLSetMessageHandler() be called?

I have an Installable MathLink program written in C. I would like to use a custom message handler. At which point in the C source code should I call ...
5
votes
1answer
282 views

Is it possible to save an interrupted computation?

I've got this really time consuming factoring problem. To decouple things a bit, I decided to start Mathematica using the command line interface (under screen). ...
7
votes
1answer
254 views

How can I have interruptible computations inside a manipulate?

Here's a perfect example of my problem: Manipulate[Pause[n], {n, {1, 10}, ContinuousAction -> False}, SynchronousUpdating -> False] It is illustrated by ...
19
votes
4answers
1k views

Recovering intermediate results from a Table after an interruption

I am interested in knowing if it is possible to recover intermediate results from a Table after an interruption. Let us say I want to produce a really useful table ...
10
votes
2answers
733 views

Abort not aborting

I have a relatively simple bit of code that looks like the following: ---some code here--- If[statement, Abort[]]; ---more code following--- However, while ...
74
votes
6answers
4k views

How to abort on any message generated?

Mathematica is a bit unusual as a programming language because it never stops on messages, regardless of whether the message is an error, a warning or just an informative message. It simply prints the ...