Run Multiple Inputs

170 views
Skip to first unread message

Arielle Miller

unread,
Mar 15, 2017, 8:09:17 PM3/15/17
to SCALE Users Group
I have several hundred runs i need to do.  I know it is possible to write scripts to get SCALE to run all of these either in parallel or in series without me having to manually do this.  I just don't know the syntax to write the script and I don't know how to get SCALE to start the run (i assume it has to be via the c:\ prompt) the script.  I'm running SCALE 6.2.1.

Can anyone help me with this?

Rob Lefebvre

unread,
Mar 15, 2017, 8:47:08 PM3/15/17
to SCALE Users Group
Hi Arielle,

You could run jobs serially via a simply Windows Batch script file. A warning is that the script will not stop until the jobs are done or the script has been terminated. So attempting to terminate the SCALE jobs will not stop the next SCALE job from starting. You will need to find the Batch file in you task manager and terminate it.

Copy the contents of the script below into a file locally on your machine and update the paths to SCALE and your inputs.

SerialRunAll.bat:
for %%F in (C:\SCALE-6.2.1\playground\inputs\*.inp) do C:\SCALE-6.2.1\bin\scalerte.exe %%F

You will need to update C:\SCALE-6.2.1\playground\inputs\*.inp to be the location of your input files and C:\SCALE-6.2.1\bin\scalerte.exe to be the path to your SCALE installation. 

A simple way to increase throughput is to copy the SerialRunAll.bat to the number of cores on your machine and update the inputs to be different, e.g., C:\SCALE-6.2.1\playground\inputs\coreN\*.inp  
When N is 1 through 4 or 8, etc.. 

Hope this helps.

Best regards,
Rob Lefebvre
SCALE Code System

Arielle Miller

unread,
Mar 24, 2017, 8:16:49 PM3/24/17
to SCALE Users Group
I tried.  It didn't work.  I attached the file (as a .txt not a .bat).  I'm not sure what i'm doing wrong.
SerialRunAll.txt

Rob Lefebvre

unread,
Mar 24, 2017, 8:50:36 PM3/24/17
to SCALE Users Group
Hi Arielle,
When you state it didn't work, what occurred?

Looking at your script the only issue appears to potentially be the whitespace in your directory path. These can confuse batch scripts as the script sees two arguments, whitespace separated.

I suggest renaming the directory and replacing the whitespace with an underscore. Additionally, you should be able to wildcard your file names into a single for loop expression:
for %%F in (C:\Users\mille\Documents\Paper\Plutonium_Nitrate\punitrate*.inp) do C:\SCALE-6.2.1\bin\scalerte.exe %%F

Please note the Plutonium_Nitrate has been updated to include an underscore. Also the '*' wildcard character will match the same names you have listed. 

Arielle Miller

unread,
Mar 24, 2017, 9:38:10 PM3/24/17
to SCALE Users Group
I got a command prompt to run but it didn't result in the output file or other files that keno should produce.  I know the files themselves don't have any errors b/c i have run them individually.  I'll try getting rid of the white space.

Arielle Miller

unread,
Mar 26, 2017, 10:06:59 AM3/26/17
to SCALE Users Group
I got it work.  Thanks!  I put the bat file in the c:\SCALE-6.2.1 folder and ran it from the \playground\input\core2 folder i setup.  Ran perfectly behind the scenes.  :-)
Reply all
Reply to author
Forward
0 new messages