Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:14

0001 #!/bin/bash -l 
0002 usage(){ cat << EOU
0003 NP_delete_test.sh
0004 ===================
0005 
0006 ~/opticks/sysrap/tests/NP_delete_test.sh 
0007 
0008 * either CLEAR or DELETE or both all look the same wrt RSS effects. 
0009 * with neither CLEAR or DELETE get monotonic growth 
0010 * seems RSS ends up at not the largest allocation but the second largest, 
0011   it does not go back down to the initial value 
0012 
0013 CONCLUSION : SHOULD NOT WORRY TOO MUCH ABOUT RSS VALUE (THE SYSTEM IS 
0014 MANAGING MEMORY ALLOCATIONS ACCORDING TO ITS ALGORITHMS) 
0015 JUST MAKE SURE RSS IS NOT ALWAYS GOING UP : AVOID FIREHOSE "LEAK" 
0016 BY NOT OMITTING TO DELETE LARGE ARRAYS. 
0017 
0018 EOU
0019 }
0020 
0021 name=NP_delete_test 
0022 
0023 TMP=${TMP:-/tmp/$USER/opticks}
0024 export FOLD=$TMP/$name
0025 mkdir -p $FOLD
0026 bin=$FOLD/$name
0027 
0028 cd $(dirname $BASH_SOURCE)
0029 
0030 defarg="build_run_cat_ana"
0031 arg=${1:-$defarg}
0032 
0033 #export CLEAR=1
0034 export DELETE=1 
0035 export TEST=t2
0036 
0037 if [ "${arg/build}" != "$arg" ]; then 
0038     gcc $name.cc -std=c++11 -lstdc++ -I.. -o $bin 
0039     [ $? -ne 0 ] && echo $BASH_SOURCE : build error && exit 1 
0040 fi
0041 
0042 if [ "${arg/run}" != "$arg" ]; then 
0043     $bin
0044     [ $? -ne 0 ] && echo $BASH_SOURCE : run error && exit 2
0045 fi 
0046 
0047 if [ "${arg/cat}" != "$arg" ]; then 
0048     cat $FOLD/run_meta.txt
0049     [ $? -ne 0 ] && echo $BASH_SOURCE : cat error && exit 3
0050 fi 
0051 
0052 if [ "${arg/ana}" != "$arg" ]; then 
0053     ${IPYTHON:-ipython} --pdb -i $name.py 
0054     [ $? -ne 0 ] && echo $BASH_SOURCE : ana error && exit 3
0055 fi 
0056 
0057 exit 0
0058 
0059