Changeset 5313 for branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh
- Timestamp:
- 2015-05-29T11:46:03+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh
r5312 r5313 12 12 # ../TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh 13 13 # 14 set -u e14 set -u 15 15 # 16 16 echo "check for all *90 files contained in "$( pwd )" and its subdirectories" 17 17 # 18 for ff in $( grep -il wrk_nemo_2 $( find . -name "*90" ) )18 for ff in $( grep -il "^ *use *wrk_nemo" $( find . -name "*90" ) $( find . -name "*h90" ) ) 19 19 do 20 21 20 # number of lines with wrk_alloc 22 n1=$( grep -ic "call *wrk_alloc *(" $ff ) 23 # replace wrk_alloc with wrk_dealloc and count the lines 24 n2=$( sed -e "s/wrk_alloc/wrk_dealloc/" $ff | grep -ic "call *wrk_dealloc *(" ) 25 # we should get n2 = 2 * n1... 26 [ $(( 2 * $n1 )) -ne $n2 ] && echo "problem with wrk_alloc in $ff" 27 28 # same story but for wrk_dealloc 29 n1=$( grep -ic "call *wrk_dealloc *(" $ff ) 30 n2=$( sed -e "s/wrk_dealloc/wrk_alloc/" $ff | grep -ic "call *wrk_alloc *(" ) 31 [ $(( 2 * $n1 )) -ne $n2 ] && echo "problem with wrk_dealloc in $ff" 32 21 n1=$( grep -ic "call *wrk_alloc *(" $ff ) 22 # number of lines with wrk_dealloc 23 nn1=$( grep -ic "call *wrk_dealloc *(" $ff ) 24 25 if [ $(( $n1 + $nn1 )) -ne 0 ] 26 then 27 # replace wrk_alloc with wrk_dealloc and count the lines 28 n2=$( sed -e "s/wrk_alloc/wrk_dealloc/" $ff | grep -ic "call *wrk_dealloc *(" ) 29 # we should get n2 = 2 * n1... 30 [ $(( 2 * $n1 )) -ne $n2 ] && echo "problem with wrk_alloc in $ff" 31 32 # same story but for wrk_dealloc 33 nn2=$( sed -e "s/wrk_dealloc/wrk_alloc/" $ff | grep -ic "call *wrk_alloc *(" ) 34 [ $(( 2 * $nn1 )) -ne $nn2 ] && echo "problem with wrk_dealloc in $ff" 35 fi 36 33 37 done
Note: See TracChangeset
for help on using the changeset viewer.