Skip to content

Commit 58bfaa5

Browse files
authored
corrections to timing script that prevented parallel cases from being included in list of cases with long run times (#15530)
* Revert "scripts: correct getopt parameters in timing_stats.sh script" This reverts commit a41c530. * firebot: add T: to timings.sh getopt parameter list * firebot: corrections to timing_stats.sh script
1 parent 56ed2d1 commit 58bfaa5

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

Utilities/Scripts/timing_stats.sh

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# this script assumes it is being run in Verification
33
is_benchmark="no"
4-
while getopts 'Ad:po:t' OPTION
4+
while getopts 'Ad:p:o:tT:' OPTION
55
do
66
case $OPTION in
77
A)
@@ -19,6 +19,9 @@ case $OPTION in
1919
t)
2020
dummy=1
2121
;;
22+
T)
23+
dummy=1
24+
;;
2225
esac
2326
done
2427
shift $(($OPTIND-1))
@@ -59,20 +62,30 @@ fi
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

Comments
 (0)