Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UEABS
ueabs
Commits
b0ed3607
Commit
b0ed3607
authored
Jun 30, 2021
by
Charles Moulinec
Browse files
Upload CS_collect_timing.sh (for V7.0.0)
parent
d0f2ac54
Changes
1
Hide whitespace changes
Inline
Side-by-side
code_saturne/CS_collect_timing.sh
0 → 100644
View file @
b0ed3607
#!/bin/bash
#
# Read file timer_stats.csv
#
#
export
FILE_LENGTH
=
`
wc
-l
< timer_stats.csv
`
#
## echo "Number of lines $FILE_LENGTH"
#
export
TAIL_LINE_NUMBER
=
"
$((
$FILE_LENGTH
-
4
))
"
#
## echo $TAIL_LINE_NUMBER
#
tail
-
$TAIL_LINE_NUMBER
timer_stats.csv
>
timer_1st.tmp
#
##more timer_1st.tmp
#
awk
'{print $2}'
timer_1st.tmp
>
timer_2nd.tmp
#
sed
's/,//g'
timer_2nd.tmp
>
timer_1st.tmp
#
export
FILE_LENGTH
=
`
wc
-l
< timer_1st.tmp
`
#
## echo "Number of lines $FILE_LENGTH"
#
export
FILE_LENGTH
=
$((
$FILE_LENGTH
-
1
))
#
export
HEAD_LINE_NUMBER
=
"-
$FILE_LENGTH
"
#
head
$HEAD_LINE_NUMBER
timer_1st.tmp
>
timer_2nd.tmp
#
export
sum_of_lines
=
`
awk
'{s+=$1}END{print s}'
timer_2nd.tmp
`
## echo "Sum of the lines of the file: $sum_of_lines"
#
##more timer_2nd.tmp
#
export
average_timing
=
`
echo
"
$sum_of_lines
/
$FILE_LENGTH
"
| bc
-l
`
echo
"Averaged timing for the
$FILE_LENGTH
entries:
$average_timing
"
#
rm
-rf
*
.tmp
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment