Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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!

share|improve this question
    
I can't follow the second part of your question. I've never seen a message like "The following versions are available...mathematica-8.0.4..". Can you elaborate on that a bit more and show exactly what happens? Is it possible that it is not Mathematica itself that gives that message but some version selector software specific to your HPC cluster? –  Szabolcs Apr 17 '13 at 18:40
    
(On out HPC cluster I need to explicitly make available the specific version of a program I want to use by doing something like module load mathematica/9.0.1) –  Szabolcs Apr 17 '13 at 18:48
1  
It looks like the mathematica launch script was modified on your system. That message is not printed by mathematica itself. –  Szabolcs Apr 17 '13 at 19:21
1  
Hi there, are you running on linux? If so have you tried using 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 ? –  image_doctor Apr 18 '13 at 10:28
1  
This question appears to be off-topic because it relates to the operation of shells on Unix/Linux in general, rather than to Mathematica itself. –  Oleksandr R. Jan 8 at 14:18
show 8 more comments

1 Answer

From image_docter's comment:

If you are running on Linux then you may try using MathKernel and putting the command in the background using '&' ? For example :

MathKernel -script myscript.m & 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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