limiting stack/heap causes ocansionally problems.

apparently, unlimited will not cause any problems.
This commit is contained in:
Martin Diehl 2017-07-12 12:50:59 +02:00
parent bc15313677
commit da8cadea9a
3 changed files with 23 additions and 32 deletions

14
env/DAMASK.csh vendored
View File

@ -26,15 +26,11 @@ if ( "x$DAMASK_NUM_THREADS" == "x" ) then
set DAMASK_NUM_THREADS=1 set DAMASK_NUM_THREADS=1
endif endif
# according to http://software.intel.com/en-us/forums/topic/501500 # currently, there is no information that unlimited causes problems
# this seems to make sense for the stack size # still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it
if ( `which free` != "free: Command not found." ) then # http://superuser.com/questions/220059/what-parameters-has-ulimit
set freeMem=`free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}'` limit datasize unlimited # maximum heap size (kB)
set heap=` expr $freeMem / 2` limit stacksize unlimited # maximum stack size (kB)
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)
endif endif
if ( `limit | grep memoryuse` != "" ) then if ( `limit | grep memoryuse` != "" ) then
limit memoryuse unlimited # maximum physical memory size limit memoryuse unlimited # maximum physical memory size

16
env/DAMASK.sh vendored
View File

@ -36,17 +36,11 @@ PROCESSING=$(which postResults || true 2>/dev/null)
[ "x$DAMASK_NUM_THREADS" == "x" ] && DAMASK_NUM_THREADS=1 [ "x$DAMASK_NUM_THREADS" == "x" ] && DAMASK_NUM_THREADS=1
# according to http://software.intel.com/en-us/forums/topic/501500 # currently, there is no information that unlimited causes problems
# this seems to make sense for the stack size # still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it
FREE=$(type -p free 2>/dev/null) # http://superuser.com/questions/220059/what-parameters-has-ulimit
if [ "x$FREE" != "x" ]; then ulimit -d unlimited 2>/dev/null # maximum heap size (kB)
freeMem=$(free -k | grep -E '(Mem|Speicher):' | awk '{print $4;}') ulimit -s unlimited 2>/dev/null # maximum stack size (kB)
# 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 -v unlimited 2>/dev/null # maximum virtual memory size
ulimit -m unlimited 2>/dev/null # maximum physical memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size

17
env/DAMASK.zsh vendored
View File

@ -22,18 +22,19 @@ unset -f set
[ "x$DAMASK_BIN" != "x" ] && PATH=$DAMASK_BIN:$PATH [ "x$DAMASK_BIN" != "x" ] && PATH=$DAMASK_BIN:$PATH
SOLVER=`which DAMASK_spectral || True 2>/dev/null` SOLVER=`which DAMASK_spectral || True 2>/dev/null`
[ "x$SOLVER" == "x" ] && SOLVER='Not found!'
PROCESSING=`which postResults || True 2>/dev/null` PROCESSING=`which postResults || True 2>/dev/null`
[ "x$PROCESSING" == "x" ] && PROCESSING='Not found!'
[ "x$DAMASK_NUM_THREADS" = "x" ] && DAMASK_NUM_THREADS=1 [ "x$DAMASK_NUM_THREADS" = "x" ] && DAMASK_NUM_THREADS=1
# according to http://software.intel.com/en-us/forums/topic/501500 # according to http://software.intel.com/en-us/forums/topic/501500
# this seems to make sense for the stack size # currently, there is no information that unlimited causes problems
if [ "`which free 2>/dev/null`" != "free not found" ]; then # still, http://software.intel.com/en-us/forums/topic/501500 suggest to fix it
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 # maximum heap size (kB)
# http://superuser.com/questions/220059/what-parameters-has-ulimit ulimit -s unlimited 2>/dev/null # maximum stack size (kB)
#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 -v unlimited 2>/dev/null # maximum virtual memory size
ulimit -m unlimited 2>/dev/null # maximum physical memory size ulimit -m unlimited 2>/dev/null # maximum physical memory size