Can Mathematica do two evaluations at the same time?
You have a few options depending on your precise needs:
- many kinds of expressions can be evaluated in parallel;
- long evaluations can often be paused and you can enter a Dialog where you can examine current values and evaluate other expressions (exit with
Return[]
) - the same FrontEnd can control multiple kernels, so for example you can have 2+ notebooks being handled by 2+ different kernels; these are completely separate instances so definitions won't be shared unless you've done something to make that happen (look toward the bottom of the Evaluation menu)
- you can also run multiple instances of the FrontEnd; usually I find one FE with multiple kernels easier, but in some instances this option makes sense
Evaluation -> Kernel Configuration Options -> Add "kernel2"->
make new notebook -> Evaluation -> Start Kernel-> "kernel2"
note: in Ubuntu you can just open a second instance of mathematica. Hit the window key to open the launcher and type mathematica and hit enter. It opens a second mathematica instance on my Ubuntu machine.
Also I have found that there doesn't seem to be a limit on how many wolfram scripts you can run simultaneously.
#!/home/conor/mathematica/WolframScript -script
Print["hello world from a wolfram script"]
Maybe they are all executed on the same kernel? But they seem to run fast and at the same time.
If it is just something very short, you can just press F7 (Evaluate in Subsession) instead of Shift+Enter, which will evaluate the expression as a dialog.
This can also be used to launch new parallel kernels during the evaluation of a long parallel table for instance.