Skip to content

Commit

Permalink
add overhead to walltime and mem in the bash script, see fieldtrip/fi…
Browse files Browse the repository at this point in the history
  • Loading branch information
robertoostenveld committed Aug 28, 2023
1 parent 5a896fa commit 3fe17d7
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions schedule-batch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ umask 0022

DASHBOARDDIR=$(dirname $(readlink -f $0))

# load some bash helper functions
source tobytes.sh
source togb.sh
source toseconds.sh
source tohms.sh

# this overhead is added to the job requirements
MEMOVERHEAD=2000000000
WALLTIMEOVERHEAD=1800

if [ "$#" -ge 1 ]; then
FIELDTRIPDIR=$1
else
Expand Down Expand Up @@ -70,13 +80,21 @@ for TEST in `find $FIELDTRIPDIR -path "*test/test_*.m"` ; do
WALLTIME=`grep WALLTIME $TEST | cut -d ' ' -f 3`
MEM=`grep MEM $TEST | cut -d ' ' -f 3`

# set a loose mem and walltime if the matlab files do not specify them
if [ -z "$WALLTIME" ] ; then WALLTIME="23:59:00" ; fi
# set the mem and walltime if the matlab files do not specify them
if [ -z "$WALLTIME" ] ; then WALLTIME="12:00:00" ; fi
if [ -z "$MEM" ] ; then MEM="16gb" ; fi

WALLTIME=$( toseconds $WALLTIME )
WALLTIME=$(( $WALLTIME + $WALLTIMEOVERHEAD ))
WALLTIME=$( tohms $WALLTIME )

MEM=$( tobytes $MEM )
MEM=$(( $MEM + $MEMOVERHEAD ))
MEM=$( togb $MEM )

# the following lines allow for a temporary override
# WALLTIME=23:59:00
# MEM=8gb
# MEM=16gb

# Create temp file for job submission with so-called "here document":
BASHSCRIPT=`mktemp $LOGDIR/test_XXXXXXXX.sh`
Expand Down

0 comments on commit 3fe17d7

Please sign in to comment.