diff --git a/UD_any/launchBatches.py b/UD_any/launchBatches.py index b7d8c4b00aa07960a414e49edf2393850ad1f89a..5712af141a668dae2c1bc15e1ebb65ffd45cfbdd 100755 --- a/UD_any/launchBatches.py +++ b/UD_any/launchBatches.py @@ -21,6 +21,10 @@ def prepareExperiment(lang, template, expName) : def launchTrain(mode, expName, arguments, launcher) : if launcher == "bash" : launchTrainBash(mode, expName, arguments) + elif launcher == "oar" : + launchTrainOar(mode, expName, arguments) + else : + printUsageAndExit() ############################################################################### ############################################################################### @@ -30,10 +34,30 @@ def launchTrainBash(mode, expName, arguments) : shell=True, stdout=open("%s.stdout"%expName,'w'), stderr=open("%s.stderr"%expName,'w')) ############################################################################### +############################################################################### +def launchTrainOar(mode, expName, arguments) : + devScore = "--devScore" + + command = "oarsub" + command += " -t besteffort" + command += " -n train:%s"%expName + command += " -E %s.stderr"%expName + command += " -O %s.stdout"%expName + command += " -p \"gpu IS NOT NULL\"" + command += " -l walltime=96:00:00" + command += " \"" + "./train.sh %s bin/%s %s --silent %s"%(mode,expName,arguments,devScore) + "\"" + + os.system(command) +############################################################################### + ############################################################################### def launchEval(mode, expName, launcher) : if launcher == "bash" : launchEvalBash(mode, expName) + elif launcher == "oar" : + launchEvalOar(mode, expName) + else : + printUsageAndExit() ############################################################################### ############################################################################### @@ -42,6 +66,20 @@ def launchEvalBash(mode, expName) : shell=True, stdout=open("%s.stdout"%expName,'a'), stderr=open("%s.stderr"%expName,'a')) ############################################################################### +############################################################################### +def launchEvalOar(mode, expName) : + command = "oarsub" + command += " -t besteffort" + command += " -n eval:%s"%expName + command += " -E %s.stderr"%expName + command += " -O %s.stdout"%expName + command += " -p \"gpu IS NOT NULL\"" + command += " -l walltime=2:00:00" + command += " \"" + "./evaluate.sh %s bin/%s --silent"%(mode,expName) + "\"" + + os.system(command) +############################################################################### + ############################################################################### if __name__ == "__main__" : if len(sys.argv) != 4 :