Skip to content
Snippets Groups Projects
Commit 9101c9a6 authored by William E Warriner's avatar William E Warriner
Browse files

modify default time and provide feedback

parent ca3976f7
Branches main
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
#set -euo
pidstat_recording_duration=${1:-0}
pidstat_recording_duration=${1:-5}
if [ $pidstat_recording_duration -eq 0 ]; then
pidstat_recording_count=""
......@@ -30,6 +30,8 @@ ps_header=$(ps -eo "pid,user,cp,drs,cmd" | head -n 1)
pidstat_header=$(pidstat -w | awk 'NR==3 {print $4, $5, $6}')
scontrol_header=$(scontrol listpids | head -n 1)
echo -e "Observing for $pidstat_recording_duration seconds..."
# Sort the outputs by PID, excluding headers
ps_sorted=$(ps -eo "pid,user,cp,drs,cmd" | tail -n +2 | sort -k$PS_PID_COL,$PS_PID_COL)
pidstat_sorted=$( \
......@@ -96,6 +98,8 @@ squeue_header=$(echo "$squeue_header" | sed 's/JOBID/JOB_ARRAY_ID/2' | sed 's/MI
output_header=$(echo "$squeue_header ctx-sw/s nvctx-sw/s total/s threads" | sed 's/ \+/ /g')
output_body=$(join -1 1 -2 1 <(echo "$squeue_body") <(echo "$agg") | sort -k1,1 | sed 's/ \+/ /g')
tput cuu 1
printf "%10s %16s %16s %12s %12s %5s %15s %15s %15s %8s\n" $output_header
for element in "${output_body[@]}"; do
printf "%10s %16s %16s %12s %12s %5s %15.2f %15.2f %15.2f %8s\n" $element
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment