4
$\begingroup$

I am looking for a solution to run a Mathematica calculation in a separate process (separate kernel) and cancel the computation after a given time. If it cannot be cancelled, then just kill that process gracefully.

There are two easy ways to evaluate code in a separate kernel: parallel kernels and LocalSubmit. What I am looking for is a mechanism to gracefully kill the kernel after a timeout if a soft-abort does not work.

The SageMath system has a feature like this: see @fork.

$\endgroup$
  • $\begingroup$ There are ways I can think of to do this, but they would all require me to re-implement the inter-kernel communication myself, which is a lot of work. I posted this question to see if there are some built-in ways that are simpler and what I missed. $\endgroup$ – Szabolcs Oct 30 '19 at 12:13
  • 1
    $\begingroup$ You can be interested in: (1), (2). $\endgroup$ – Alexey Popkov Oct 30 '19 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.