Is there a way to use deep clones in Mathematica?

Maybe by making lots of different kernels. In order to execute multiple notebooks I need more than one kernel, is there a way to make them using C# code?

  • 4
    $\begingroup$ What do you mean by "deep clone"? $\endgroup$ – C. E. Nov 17 '19 at 16:54
  • $\begingroup$ @C.E. I edited my question $\endgroup$ – Jan Nov 17 '19 at 17:02
  • 3
    $\begingroup$ Still not nearly enough info. $\endgroup$ – Henrik Schumacher Nov 17 '19 at 17:24
  • 3
    $\begingroup$ @Jan Notice that you have not addressed the key question here, i.e. what is a "deep clone"? $\endgroup$ – MarcoB Nov 17 '19 at 20:26

If you need to make a variable available for many threads in parallel computing, you should check out DistributeDefinitions.

If you need parallel processing, you should first try built-in parallel functions like ParallelTable before running many copies of the whole Mathematica.

In case you need dedicated kernels called from external software, consider running Wolfram Language scripts (.m files instead of Notebooks .nb) with dedicated kernels invoked from the command line.

If you really need to talk to a live kernel from external applications, there is MathLink.

If by deep clone you just mean to have another independent variable with the same value, then almost all variables in Mathematica can be considered deep copies (you do not need to know how the underlying memory is actually handled for you by the kernel) (an exception is delayed evaluation).


Not the answer you're looking for? Browse other questions tagged or ask your own question.