From cd39e835509c33f46738ecc65d567bb7338f7eae Mon Sep 17 00:00:00 2001 From: cephi_sui Date: Wed, 11 Dec 2024 16:36:06 -0500 Subject: [PATCH] Updated power script --- pytorch/{power.sh.bak => power.sh} | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) rename pytorch/{power.sh.bak => power.sh} (79%) mode change 100644 => 100755 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!"