4
$\begingroup$

I have a fairly large calculation to map an electric field over large areas (square kilometers). This runs for a fairly long time.

Are there ways to serialize the current state of a running calculation - so that a calculation may be paused.

And can a calculation be deserialized and continued?

$\endgroup$
2
  • $\begingroup$ Please add detail (esp. code) to make this question answerable and potentially useful for future visitors. $\endgroup$ Commented Jan 21, 2015 at 14:34
  • $\begingroup$ Possibly related: mathematica.stackexchange.com/questions/59542/… $\endgroup$ Commented Jan 22, 2015 at 0:18

1 Answer 1

4
$\begingroup$

There's no built-in automated way to interrupt a calculation, quit Mathematica, then resume the calculation at a later time.

It is however often possible to implement something like this yourself. I have done this several times when the problem was simple enough to allow it. But it needs to be done manually. You need to store the state of the calculation explicitly in some variable. You can then Export this variable to the MX format, quit Mathematica, then reload the variable later in a different session.

Caveat: In version 10 MX files are not portable between 32 bit and 64 bit platforms, but they are portable between different operating systems. In Mathematica 9 they are not even portable between different operating systems.

There are other formats than MX that support general Mathematica expressions.

$\endgroup$
2
  • $\begingroup$ Szabolcs - Thanks very much - this is what I think this is what I am looking for. $\endgroup$ Commented Jan 21, 2015 at 22:38
  • $\begingroup$ @Szabolcs would you recommend reopening? $\endgroup$ Commented Jan 22, 2015 at 6:15

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.