11#! /bin/bash
22# this script assumes it is being run in Verification
33is_benchmark=" no"
4- while getopts ' Ad:po:t ' OPTION
4+ while getopts ' Ad:p:o:tT: ' OPTION
55do
66case $OPTION in
77 A)
@@ -19,6 +19,9 @@ case $OPTION in
1919 t)
2020 dummy=1
2121 ;;
22+ T)
23+ dummy=1
24+ ;;
2225esac
2326done
2427shift $(( $OPTIND - 1 ))
5962 CPU_TIME=` cat " $cpufile " | awk ' {if(NR>1)print}' | awk -F' ,' ' {print $(NF)}' `
6063 for j in $CPU_TIME
6164 do
62- jafter=` echo ${j} | sed -e ' s/[ eE]+*/\\*10\\^/ ' `
63- jafter=` echo " $jafter " | bc`
64- TOTAL_CPU_TIME=` echo " $TOTAL_CPU_TIME +$jafter " | bc`
65+ jafter=` echo ${j} | sed ' s/\([0-9.]\+\)[ eE][+]\?\([0-9-]\+\)/\1*10^\2/g ' `
66+ jafter=` echo " $jafter " | bc -l `
67+ TOTAL_CPU_TIME=` echo " $TOTAL_CPU_TIME +$jafter " | bc `
6568 done
69+ TOTAL_CPU_TIME=$( echo " $TIMING_CPU_TIME " | sed ' s/0*$//; s/\.$//' )
70+ if [ " $TOTAL_CPU_TIME " == " " ]; then
71+ TOTAL_CPU_TIME=0.0
72+ fi
73+ CPU_TIME=$TOTAL_CPU_TIME
6674
6775 # Grep for number of cells in each dimension
68- X_CELLS=` grep -H " Cells in the X" $outfile | awk -F' ' ' {print $NF}' `
76+ X_CELLS=" ` grep -H " Cells in the X" $outfile | awk -F' ' ' {print $NF}' ` "
77+ set -- $X_CELLS
78+ let numx=$#
6979 Y_CELLS=` grep -H " Cells in the Y" $outfile | awk -F' ' ' {print $NF}' `
7080 Z_CELLS=` grep -H " Cells in the Z" $outfile | awk -F' ' ' {print $NF}' `
71-
7281 # Sum over the number of cells (for multi-mesh cases)
73- for j in $X_CELLS
74- do
75- let NUM_TOTAL_CELLS+=` echo " $X_CELLS * $Y_CELLS * $Z_CELLS " | bc`
82+ NUM_TOTAL_CELLS=0
83+ for i in $( seq 1 $numx ) ; do
84+ XI=` echo $X_CELLS | awk -v var=" $i " ' {print $var}' `
85+ YI=` echo $Y_CELLS | awk -v var=" $i " ' {print $var}' `
86+ ZI=` echo $Z_CELLS | awk -v var=" $i " ' {print $var}' `
87+ sumxyz=` echo " $XI * $YI * $ZI " | bc`
88+ NUM_TOTAL_CELLS=` echo " $NUM_TOTAL_CELLS + $sumxyz " | bc`
7689 done
7790
7891 # Grep for number of time steps
0 commit comments