From da8cadea9a0de8541272606c346cfe350f2dcded Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 12 Jul 2017 12:50:59 +0200 Subject: [PATCH] limiting stack/heap causes ocansionally problems. apparently, unlimited will not cause any problems. --- env/DAMASK.csh | 14 +++++--------- env/DAMASK.sh | 20 +++++++------------- env/DAMASK.zsh | 21 +++++++++++---------- 3 files changed, 23 insertions(+), 32 deletions(-) diff --git a/env/DAMASK.csh b/env/DAMASK.csh index 819b263ef..bf728c2db 100644 --- a/env/DAMASK.csh +++ b/env/DAMASK.csh @@ -26,15 +26,11 @@ if ( "x$DAMASK_NUM_THREADS" == "x" ) then set DAMASK_NUM_THREADS=1 endif -# according to http://software.intel.com/en-us/forums/topic/501500 -# this seems to make sense for the stack size -if ( `which free` != "free: Command not found." ) then - set freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` - set heap=` expr $freeMem / 2` - set stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2` - # http://superuser.com/questions/220059/what-parameters-has-ulimit - limit datasize $heap # maximum heap size (kB) - limit stacksize $stack # maximum stack size (kB) +# currently, there is no information that unlimited causes problems +# still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it +# http://superuser.com/questions/220059/what-parameters-has-ulimit +limit datasize unlimited # maximum heap size (kB) +limit stacksize unlimited # maximum stack size (kB) endif if ( `limit | grep memoryuse` != "" ) then limit memoryuse unlimited # maximum physical memory size diff --git a/env/DAMASK.sh b/env/DAMASK.sh index 3e9889fec..c0dbe64ef 100644 --- a/env/DAMASK.sh +++ b/env/DAMASK.sh @@ -36,19 +36,13 @@ PROCESSING=$(which postResults || true 2>/dev/null) [ "x$DAMASK_NUM_THREADS" == "x" ] && DAMASK_NUM_THREADS=1 -# according to http://software.intel.com/en-us/forums/topic/501500 -# this seems to make sense for the stack size -FREE=$(type -p free 2>/dev/null) -if [ "x$FREE" != "x" ]; then - freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}') - # http://superuser.com/questions/220059/what-parameters-has-ulimit - ulimit -d unlimited 2>/dev/null \ - || ulimit -d $(expr $freeMem / 2) 2>/dev/null # maximum heap size (kB) - ulimit -s unlimited 2>/dev/null \ - || ulimit -s $(expr $freeMem / $DAMASK_NUM_THREADS / 2) 2>/dev/null # maximum stack size (kB) -fi -ulimit -v unlimited 2>/dev/null # maximum virtual memory size -ulimit -m unlimited 2>/dev/null # maximum physical memory size +# currently, there is no information that unlimited causes problems +# still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it +# http://superuser.com/questions/220059/what-parameters-has-ulimit +ulimit -d unlimited 2>/dev/null # maximum heap size (kB) +ulimit -s unlimited 2>/dev/null # maximum stack size (kB) +ulimit -v unlimited 2>/dev/null # maximum virtual memory size +ulimit -m unlimited 2>/dev/null # maximum physical memory size # disable output in case of scp if [ ! -z "$PS1" ]; then diff --git a/env/DAMASK.zsh b/env/DAMASK.zsh index c662e6aee..5f510dabb 100644 --- a/env/DAMASK.zsh +++ b/env/DAMASK.zsh @@ -22,20 +22,21 @@ unset -f set [ "x$DAMASK_BIN" != "x" ] && PATH=$DAMASK_BIN:$PATH SOLVER=`which DAMASK_spectral || True 2>/dev/null` +[ "x$SOLVER" == "x" ] && SOLVER='Not found!' + PROCESSING=`which postResults || True 2>/dev/null` +[ "x$PROCESSING" == "x" ] && PROCESSING='Not found!' + [ "x$DAMASK_NUM_THREADS" = "x" ] && DAMASK_NUM_THREADS=1 # according to http://software.intel.com/en-us/forums/topic/501500 -# this seems to make sense for the stack size -if [ "`which free 2>/dev/null`" != "free not found" ]; then - freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` - - # http://superuser.com/questions/220059/what-parameters-has-ulimit - #ulimit -d `expr $freeMem / 2` 2>/dev/null # maximum heap size (kB) - ulimit -s `expr $freeMem / $DAMASK_NUM_THREADS / 2` 2>/dev/null # maximum stack size (kB) -fi -ulimit -v unlimited 2>/dev/null # maximum virtual memory size -ulimit -m unlimited 2>/dev/null # maximum physical memory size +# currently, there is no information that unlimited causes problems +# still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it +# http://superuser.com/questions/220059/what-parameters-has-ulimit +ulimit -d unlimited 2>/dev/null # maximum heap size (kB) +ulimit -s unlimited 2>/dev/null # maximum stack size (kB) +ulimit -v unlimited 2>/dev/null # maximum virtual memory size +ulimit -m unlimited 2>/dev/null # maximum physical memory size # disable output in case of scp if [ ! -z "$PS1" ]; then