From bfea67e742240016f127c48a611f1e110772cdd4 Mon Sep 17 00:00:00 2001
From: Franck Dary <franck.dary@lis-lab.fr>
Date: Mon, 4 May 2020 13:00:42 +0200
Subject: [PATCH] Fixed bug in script detecting number of used gpu on oar

---
 UD_any/launchBatches.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/UD_any/launchBatches.py b/UD_any/launchBatches.py
index 8355460..40ef243 100755
--- a/UD_any/launchBatches.py
+++ b/UD_any/launchBatches.py
@@ -182,7 +182,13 @@ def getOarNbUsedGpuPerNode() :
     cores = 1
     gpunum = 1
     if "core=" in ressources :
-      cores = int(ressources.split("core=")[-1].split('/')[0])
+      coresStr=""
+      coresStrBase = ressources.split("core=")[-1]
+      for symbol in coresStrBase :
+        if symbol < '0' or symbol > '9' :
+          break
+        coresStr = coresStr + symbol
+      cores = int(coresStr)
     if "gpunum=" in ressources :
       gpunum = int(ressources.split("gpunum=")[-1].split(',')[0])
 
-- 
GitLab