Skip to content

Commit

Permalink
replace bc with awk for float math
Browse files Browse the repository at this point in the history
  • Loading branch information
ajschmidt8 committed Jan 31, 2022
1 parent 15db02f commit d678ab7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ if buildAll || hasArg libcudf; then
if [[ "$BUILD_REPORT_INCL_CACHE_STATS" == "ON" && -x "$(command -v sccache)" ]]; then
COMPILE_REQUESTS=$(sccache -s | grep "Compile requests " | awk '{ print $NF }') # "grep" cmd has 2 spaces to avoid matching "Compile requests executed"
CACHE_HITS=$(sccache -s | grep "Cache hits" | awk '{ print $NF }')
HIT_RATE=$(echo "scale=2; $CACHE_HITS/$COMPILE_REQUESTS*100" | bc)
HIT_RATE=$(echo - | awk "{printf \"%.2f\n\", $CACHE_HITS / $COMPILE_REQUESTS * 100}")
MSG="${MSG}<br/>cache hit rate ${HIT_RATE} %"
fi
MSG="${MSG}<br/>parallel setting: $PARALLEL_LEVEL"
Expand Down

0 comments on commit d678ab7

Please sign in to comment.