@echo off
SETLOCAL

:createdir1
IF EXIST nij_metrics GOTO createdir2
mkdir nij_metrics

:createdir2
IF EXIST nij_metrics\logs GOTO postinit
mkdir nij_metrics\logs

:postinit

SET OPTS=c:\python27\python.exe -O extract_nij_metrics.py /pianos4-nij -u "user%%" -c -o nij_metrics/ -t nij_metrics/logs/extract_trial_
IF "%1"=="chained" GOTO chained
IF "%1"=="serialized" GOTO serialized
GOTO all

:all
rem VERSION 1: all at the same time (lots of GB of RAM needed)
start "Trial 01" %OPTS%01.log -e "Trial 01" 
start "Trial 02" %OPTS%02.log -e "Trial 02" 
start "Trial 03" %OPTS%03.log -e "Trial 03" 
start "Trial 04" %OPTS%04.log -e "Trial 04" 
start "Trial 05" %OPTS%05.log -e "Trial 05" 
start "Trial 06" %OPTS%06.log -e "Trial 06" 
start "Trial 07" %OPTS%07.log -e "Trial 07" 
start "Trial 08" %OPTS%08.log -e "Trial 08"
start "Trial 09" %OPTS%09.log -e "Trial 09" 
start "Trial 10" %OPTS%10.log -e "Trial 10" 
start "Trial 11" %OPTS%11.log -e "Trial 11" 
start "Trial 12" %OPTS%12.log -e "Trial 12" 
start "Trial 13" %OPTS%13.log -e "Trial 13" 
start "Trial 14" %OPTS%14.log -e "Trial 14" 
start "Trial 15" %OPTS%15.log -e "Trial 15"
goto end

:chained
rem VERSION 2: "only" 8 at the same time
start "Trials 01 and 09" %OPTS%01_09.log -e "Trial (01|09)"
start "Trials 02 and 10" %OPTS%02_10.log -e "Trial (02|10)"
start "Trials 03 and 11" %OPTS%03_11.log -e "Trial (03|11)"
start "Trials 04 and 12" %OPTS%04_12.log -e "Trial (04|12)"
start "Trials 05 and 13" %OPTS%05_13.log -e "Trial (05|13)"
start "Trials 06 and 14" %OPTS%06_14.log -e "Trial (06|14)"
start "Trials 07 and 15" %OPTS%07_15.log -e "Trial (07|15)"
start "Trial 08" %OPTS%08.log -e "Trial 08"
goto end

:serialized
rem VERSION 3: one by one
%OPTS%01.log -e "Trial 01" 
%OPTS%02.log -e "Trial 02" 
%OPTS%03.log -e "Trial 03" 
%OPTS%04.log -e "Trial 04" 
%OPTS%05.log -e "Trial 05" 
%OPTS%06.log -e "Trial 06" 
%OPTS%07.log -e "Trial 07" 
%OPTS%08.log -e "Trial 08"
%OPTS%09.log -e "Trial 09" 
%OPTS%10.log -e "Trial 10" 
%OPTS%11.log -e "Trial 11" 
%OPTS%12.log -e "Trial 12" 
%OPTS%13.log -e "Trial 13" 
%OPTS%14.log -e "Trial 14" 
%OPTS%15.log -e "Trial 15"
goto end

:end
ENDLOCAL
