Created
December 3, 2015 18:58
-
-
Save ftessier/ce46e990139f70b54352 to your computer and use it in GitHub Desktop.
EGSnrc Windows batch script to manually run jobs in parallel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM ################################################################################# | |
REM | |
REM usage: | |
REM egs-parallel.bat (or double-click on this file) | |
REM | |
REM ################################################################################# | |
REM # ask about command and number of processes | |
echo. | |
set /p egscommand=Enter the EGSnrc command you want to run: | |
set /p nstr=Enter number of parallel jobs: | |
set /a n=%nstr% | |
REM # Ready? | |
echo. | |
choice /N /M "Ready to run %egscommand% using %n% jobs [YN] ? " | |
if errorlevel 2 exit /b | |
REM ### launch $n EGSnrc jobs in parallel, in the background | |
echo. | |
for /l %%j in (1,1,%n%) do ( | |
echo LAUNCHING job %%j of %n%: %egscommand% -b -P %n% -j %%j -f 1 | |
start /b %egscommand% -b -P %n% -j %%j -f 1 >NUL 2>&1 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment