now correctly reporting the actual stack and heap size, not the intended one

This commit is contained in:
Martin Diehl 2014-05-19 09:10:01 +00:00
parent 880f0a0c48
commit 72e7dfa5af
1 changed files with 9 additions and 9 deletions

View File

@ -31,6 +31,13 @@ freeMem=`free -k | grep Mem: | awk '{print $4;}'`
heap=`expr $freeMem / 2` heap=`expr $freeMem / 2`
stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2` stack=`expr $freeMem / $DAMASK_NUM_THREADS / 2`
# http://superuser.com/questions/220059/what-parameters-has-ulimit
ulimit -s $heap 2>/dev/null # maximum stack size (kB)
ulimit -d $stack 2>/dev/null # maximum heap size (kB)
ulimit -c 2000 2>/dev/null # core file size (512-byte blocks)
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 # disable output in case of scp
if [ ! -z "$PS1" ]; then if [ ! -z "$PS1" ]; then
echo echo
@ -53,17 +60,10 @@ if [ ! -z "$PS1" ]; then
echo "FFTW $FFTW_ROOT" echo "FFTW $FFTW_ROOT"
echo "HDF5 $HDF5_ROOT (for future use)" echo "HDF5 $HDF5_ROOT (for future use)"
echo echo
echo "heap size/kB $heap" echo "heap size/kB `ulimit -d`"
echo "stack size/kB $stack" echo "stack size/kB `ulimit -s`"
fi fi
# http://superuser.com/questions/220059/what-parameters-has-ulimit
ulimit -s $stack 2>/dev/null # maximum stack size (kB)
ulimit -d $heap 2>/dev/null # maximum heap size (kB)
ulimit -c 2000 2>/dev/null # core file size (512-byte blocks)
ulimit -v unlimited 2>/dev/null # maximum virtual memory size
ulimit -m unlimited 2>/dev/null # maximum physical memory size
export DAMASK_NUM_THREADS export DAMASK_NUM_THREADS
export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH export PYTHONPATH=$DAMASK_ROOT/lib:$PYTHONPATH