diff --git a/pytorch/power.sh.bak b/pytorch/power.sh old mode 100644 new mode 100755 similarity index 79% rename from pytorch/power.sh.bak rename to pytorch/power.sh index 072c431..ac0e179 --- a/pytorch/power.sh.bak +++ b/pytorch/power.sh @@ -10,20 +10,18 @@ if [[ $arch = aarch64 ]]; then ((iter++)) sleep 1s } - if [[ -z "$baseline_time_s" ]]; then - baseline_time_s=-1 - fi + baseline_time_s=-1 while [[ "$iter" -ne "$baseline_time_s" ]]; do aarch64_power done elif [[ $arch = x86_64 ]]; then - if [[ -z "$baseline_time_s" ]]; then + if [[ "$baseline_time_s" -eq -1 ]]; then #turbostat -s PkgWatt -i 1 2>/dev/null | awk -F: '/PkgWatt/ {getline; print $0}' #turbostat -s PkgWatt -i 1 | awk '/PkgWatt/ {getline; print $0}' - turbostat -s PkgWatt -i 1 | sed -n "/PkgWatt/{n;p}" + turbostat -s PkgWatt ${@:2} | sed -n "/PkgWatt/{n;n;p}" else #turbostat -s PkgWatt -n "$baseline_time_s" -i 1 2>/dev/null | awk -F: '/PkgWatt/ {getline; print $0}' - turbostat -s PkgWatt -n "$baseline_time_s" -i 1 | sed -n "/PkgWatt/{n;p}" + turbostat -s PkgWatt -n "$baseline_time_s" -i 1 | sed -n "/PkgWatt/{n;n;p}" fi else echo "Unrecognized arch!"