Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm new to Mathematica and am trying to adapt a pre-existing notebook, designed for manual evaluation of individual simulation outputs, to batch process the outputs of multiple simulations. Currently, I'm just trying to find a way to execute the notebook's contents from the command line. I'm using a bash script to execute the notebook for each $simID.

The original method, executing the cells of the notebook using the interface, takes approximately 2 min to run.

Calling the notebook from the command line is dramatically slower (>15 min). I've used the following approaches:

MathKernel -noprompt -run < myScript.m $simID
MathKernel < myNotebook.nb $simID
MathKernel -script myScript.m $simID

where myScript.m is the myNotebook.nb after conversion in Mathematica to a script (and with all the inline graphics text removed).

I'm puzzled by the difference but don't have a deep understanding of Mathematica or the notebook to script conversion. I'd be grateful for any suggestions, because the current calculation time is way too slow for batch processing.

Edit: It might be useful to know that the notebook mainly produces figures and saves them to pdf. It performs some simple optimizations (e.g., FindClusters[]). I'm using Mac OS X 10.6.

share|improve this question
Welcome to Mathematica.SE, Sarah! Could you please post a minimal working example that reproduces the problem? What you describe sounds unusual. To be able to help, we first need to be able to reproduce the problem. – Szabolcs Apr 22 '12 at 20:21

migrated from stackoverflow.com Apr 22 '12 at 17:56

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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