Skip to content
Snippets Groups Projects
Commit 9071eb15 authored by Franck Dary's avatar Franck Dary
Browse files

launchBatches now detects nodes that are not alive

parent 7c0b8667
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,7 @@ def launchTrainOar(mode, expName, arguments, nbHours) :
command += " -l walltime=%d:00:00"%nbHours
command += " \'" + "./train.sh %s bin/%s %s --silent"%(mode,expName,arguments) + "\'"
os.system(command)
subprocess.Popen(command, shell=True).wait()
###############################################################################
###############################################################################
......@@ -85,7 +85,7 @@ def launchEvalOar(mode, expName, nbHours) :
command += " -l walltime=%d:00:00"%nbHours
command += " \"" + "./evaluate.sh %s bin/%s --silent"%(mode,expName) + "\""
os.system(command)
subprocess.Popen(command, shell=True).wait()
###############################################################################
###############################################################################
......@@ -123,14 +123,23 @@ def getOarNbUsedGpuPerNode() :
return res
###############################################################################
###############################################################################
def getOarNotAliveNodes() :
return subprocess.Popen("oarnodes | grep -B 2 'state : [^A]' | grep 'network_address' | sort --unique | awk '{print $3}'", shell=True, stdout=subprocess.PIPE).stdout.read().decode("utf8").split('\n')
###############################################################################
###############################################################################
def getOarNbFreeGpuPerNode() :
gpus = getOarNbGpuPerNode()
notAlive = getOarNotAliveNodes()
usedGpus = getOarNbUsedGpuPerNode()
for gpu in gpus :
gpus[gpu] -= usedGpus[gpu] if gpu in usedGpus else 0
for host in notAlive :
gpus[host] = 0
return gpus
###############################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment