From 5a1acd54316a63078e7a7893b3ac4684169f8d6b Mon Sep 17 00:00:00 2001
From: Thomas Witkowski <thomas.witkowski@gmx.de>
Date: Fri, 12 Dec 2008 10:26:16 +0000
Subject: [PATCH] * Added memory usage to schedule script

---
 AMDiS/other/scripts/schedule | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/AMDiS/other/scripts/schedule b/AMDiS/other/scripts/schedule
index f11de344..f1a6c70a 100755
--- a/AMDiS/other/scripts/schedule
+++ b/AMDiS/other/scripts/schedule
@@ -18,6 +18,9 @@ SERVER=mars
 # Expected runtime of one execution, the format is hh::mm
 WTIME=1:00
 
+# Memory usage of the program in MByte
+MEM=4000
+
 # Define the output file to which all output (standard and error) will be written.
 OUTFILE=out
 
@@ -72,7 +75,7 @@ case "$1" in
   -c )
     date > $OUTFILE 2>&1
     printf "Schedule-Skript: Submitted programm to the batch system\n" >> $OUTFILE 2>&1
-    bsub -n $NUMBER_PROC -W $WTIME $SCRIPT_NAME -rs >> $OUTFILE 2>&1
+    bsub -n $NUMBER_PROC -W $WTIME -R "rusage[mem=$MEM]" $SCRIPT_NAME -rs >> $OUTFILE 2>&1
     if [ $? -eq 0 ] ; then
       printf "Submitted program to the batch system!\n"
       printf "Submitted program to the batch system!\n" >> $OUTFILE 2>&1
@@ -87,7 +90,7 @@ case "$1" in
     # First scheduling of the program
     date > $OUTFILE 2>&1
     printf "Schedule-Skript: Submitted programm to the batch system\n" >> $OUTFILE 2>&1
-    bsub -n $NUMBER_PROC -W $WTIME $SCRIPT_NAME -s >> $OUTFILE 2>&1
+    bsub -n $NUMBER_PROC -W $WTIME -R "rusage[mem=$MEM]" $SCRIPT_NAME -s >> $OUTFILE 2>&1
     if [ $? -eq 0 ] ; then
       printf "Submitted program to the batch system!\n"
       printf "Submitted program to the batch system!\n" >> $OUTFILE 2>&1
@@ -106,7 +109,7 @@ if [ $ERROR_CODE -eq $SCHEDULE_ERROR_CODE ] ; then
   # Error code indicates that the program has been terminated in order to be rescheduled.
   date >> $OUTFILE 2>&1
   printf "Schedule-Skript: Submitted programm to the batch system\n" >> $OUTFILE 2>&1
-  bsub -n $NUMBER_PROC -W $WTIME $SCRIPT_NAME -rs >> $OUTFILE 2>&1
+  bsub -n $NUMBER_PROC -W $WTIME -R "rusage[mem=$MEM]" $SCRIPT_NAME -rs >> $OUTFILE 2>&1
   exit 0
 elif [ $ERROR_CODE -eq 0 ] ; then
   # The program terminated successfully.
-- 
GitLab