From c8adb6bc0d5dfadec34190e32a44e5e5d1cefb6a Mon Sep 17 00:00:00 2001
From: Michael <m.langguth@fz-juelich.de>
Date: Mon, 28 Feb 2022 16:04:05 +0100
Subject: [PATCH] Adapt convert_runscript.sh to set project on JSC's
 HPCsystems.

---
 .../runscript_generator/convert_runscript.sh      | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/video_prediction_tools/utils/runscript_generator/convert_runscript.sh b/video_prediction_tools/utils/runscript_generator/convert_runscript.sh
index a2c0607a..a5ab4188 100755
--- a/video_prediction_tools/utils/runscript_generator/convert_runscript.sh
+++ b/video_prediction_tools/utils/runscript_generator/convert_runscript.sh
@@ -93,13 +93,14 @@ fi
 if [[ `grep "#SBATCH --error=" ${target_script}` ]]; then
   sed -i "s|#SBATCH --error=.*|#SBATCH --error=${log_str}-err\.%j|g" ${target_script}
 fi
-# set correct e-mail address in Batch scripts on Juwels and HDF-ML
+# set correct e-mail address (only when jutil-tool is available)
+if ! [[ -z `command -v jutil` ]]; then
+  USER_EMAIL=$(jutil user show -o json | grep email | cut -f2 -d':' | cut -f1 -d',' | cut -f2 -d'"')
+else
+  USER_EMAIL=""
+fi
+sed -i "s/--mail-user=.*/--mail-user=$USER_EMAIL/g" ${target_script}
 if [[ "${HOST_NAME}" == hdfml* || "${HOST_NAME}" == *juwels* ]]; then
-  if ! [[ -z `command -v jutil` ]]; then
-    USER_EMAIL=$(jutil user show -o json | grep email | cut -f2 -d':' | cut -f1 -d',' | cut -f2 -d'"')
-  else
-    USER_EMAIL=""
-  fi
-  sed -i "s/--mail-user=.*/--mail-user=$USER_EMAIL/g" ${target_script}
+  sed -i "s/--account=.*/--mail-user=deepacf/g" ${target_script}
 fi
 # end
-- 
GitLab