I have been searching around for a while, and perhaps I'm just using the wrong terminology, but I haven't found a way to do this.
I have a mathematica notebook converted and saved as nobel_test.m, which runs perfectly on my own computer. Because it takes about an hour to run, I'm trying to run multiple at one time on a computer cluster that can have 100 instances going at once (named nobel). I converted my original notebook by making everything InputForm, ending with Exit[], etc, and changing outputs so that they are saved in external text files instead of printing into the notebook.
When I tested this, it ran fine by itself - the script ran, read the correct contents, created and printed the files it needed to, etc. I used the command
math -noprompt -run "<<nobel_test.m"
I also tried
math -noprompt -script "nobel_test.m"
which also works for single cases.
However, the banner opens ("The following versions are available...mathematica-8.0.4.." etc.), and while no In[1]:= or anything like that prints, it seems to enter an input-less front end that can't be closed (without quitting the kernel). It automatically closes about an hour later when the notebook finishes evaluating.
Because of this, I can only run sequentially, rather than in parallel. I thought -noprompt was supposed to prevent the banner from opening, so that you could just submit job after job to the max of your licenses; but because it opens and holds there, I have to wait until the current job is done before starting a new one.
Is there a way to quit that section without closing the kernel, or other good ways to execute several mathematica scripts at once?
Again, apologies if this is commonly asked, I'm probably not searching the correct things. Any help would be greatly appreciated!
module load mathematica/9.0.1
) $\endgroup$MathKernel
and putting the command in the background using '&' ? For example :MathKernel -script myscript.m &
. The commands you want to run in the m file are marked as initialisation cells ? $\endgroup$