|
1 | 1 | #!/bin/bash |
2 | 2 | # this script assumes it is being run in Verification |
3 | 3 | is_benchmark="no" |
4 | | -while getopts 'Ad:po:tT:' OPTION |
| 4 | +while getopts 'Ad:p:o:tT:' OPTION |
5 | 5 | do |
6 | 6 | case $OPTION in |
7 | 7 | A) |
|
62 | 62 | CPU_TIME=`cat "$cpufile" | awk '{if(NR>1)print}' | awk -F',' '{print $(NF)}'` |
63 | 63 | for j in $CPU_TIME |
64 | 64 | do |
65 | | - jafter=`echo ${j} | sed -e 's/[eE]+*/\\*10\\^/'` |
66 | | - jafter=`echo "$jafter" | bc` |
67 | | - 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 ` |
68 | 68 | 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 |
69 | 74 |
|
70 | 75 | # Grep for number of cells in each dimension |
71 | | - 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=$# |
72 | 79 | Y_CELLS=`grep -H "Cells in the Y" $outfile | awk -F' ' '{print $NF}'` |
73 | 80 | Z_CELLS=`grep -H "Cells in the Z" $outfile | awk -F' ' '{print $NF}'` |
74 | | - |
75 | 81 | # Sum over the number of cells (for multi-mesh cases) |
76 | | - for j in $X_CELLS |
77 | | - do |
78 | | - 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` |
79 | 89 | done |
80 | 90 |
|
81 | 91 | # Grep for number of time steps |
|
0 commit comments