Skip to content

Commit

Permalink
Test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars T Hansen committed Nov 26, 2024
1 parent aae7228 commit 25b2993
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions code/tests/relative/sonalyze/profile-print.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ source test-settings
# We want this to pick something with more than one process, so do our best. It might find nothing.
job=$($OLD_SONALYZE jobs -data-dir "$DATA_PATH" -config-file "$CONFIG" -f 2d -t 1d -min-runtime 1h -u - -fmt awk,job,cmd | grep , | head -n 1 | awk '{ print $1 }')

# No 'default' alias in the old code, so expand it
# No 'default' alias in the old code, so expand it. Here I add nproc because I don't want to
# test the nproc-insertion logic, as it is different in the new code.
echo "Format old: fixed,default"
$OLD_SONALYZE profile -data-dir "$DATA_PATH" -f 20d -config-file "$CONFIG" -job $job -t 1d -fmt fixed,time,cpu,mem,gpu,gpumem,cmd > old-output.txt
$NEW_SONALYZE profile -data-dir "$DATA_PATH" -f 20d -config-file "$CONFIG" -job $job -t 1d -fmt fixed,default > new-output.txt
$OLD_SONALYZE profile -data-dir "$DATA_PATH" -f 20d -config-file "$CONFIG" -job $job -t 1d -fmt fixed,time,cpu,mem,gpu,gpumem,cmd,nproc > old-output.txt
$NEW_SONALYZE profile -data-dir "$DATA_PATH" -f 20d -config-file "$CONFIG" -job $job -t 1d -fmt fixed,default,nproc > new-output.txt
diff -b old-output.txt new-output.txt
rm -f old-output.txt new-output.txt

# v0 and v1 default (new names) should print the same. It's broken that this is 'mem' and not 'res' but we're not going to rock that boat.
# Again add nproc to avoid testing the nproc-insertion logic.
echo "Format old vs v1default: fixed,default"
$OLD_SONALYZE profile -data-dir "$DATA_PATH" -f 20d -config-file "$CONFIG" -job $job -t 1d -fmt fixed,noheader,time,cpu,mem,gpu,gpumem,cmd > old-output.txt
$NEW_SONALYZE profile -data-dir "$DATA_PATH" -f 20d -config-file "$CONFIG" -job $job -t 1d -fmt fixed,noheader,v1default > new-output.txt
$OLD_SONALYZE profile -data-dir "$DATA_PATH" -f 20d -config-file "$CONFIG" -job $job -t 1d -fmt fixed,noheader,time,cpu,mem,gpu,gpumem,cmd,nproc > old-output.txt
$NEW_SONALYZE profile -data-dir "$DATA_PATH" -f 20d -config-file "$CONFIG" -job $job -t 1d -fmt fixed,noheader,v1default,nproc > new-output.txt
diff -b old-output.txt new-output.txt
rm -f old-output.txt new-output.txt

Expand Down

0 comments on commit 25b2993

Please sign in to comment.