Skip to content

Commit

Permalink
add option in RT comparison script to turn off plots (only report dif…
Browse files Browse the repository at this point in the history
…ferences via command line)
  • Loading branch information
grantfirl committed Oct 15, 2024
1 parent 7f0ff67 commit ff1737f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions test/cmp_rt2bl.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@

#
parser = argparse.ArgumentParser()
parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output', required=True)
parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines', required=True)
parser.add_argument('-drt', '--dir_rt', help='Directory containing SCM RT output', required=True)
parser.add_argument('-dbl', '--dir_bl', help='Directory containing SCM RT baselines', required=True)
parser.add_argument('-np', '--no_plots', help='flag to turn off generation of difference plots', required=False, action='store_true')

#
def parse_args():
args = parser.parse_args()
dir_rt = args.dir_rt
dir_bl = args.dir_bl
return (dir_rt, dir_bl)
no_plots = args.no_plots
return (dir_rt, dir_bl, no_plots)

#
def main():
#
(dir_rt, dir_bl) = parse_args()
(dir_rt, dir_bl, no_plots) = parse_args()

#
error_count = 0
Expand All @@ -38,14 +40,17 @@ def main():
com = "cmp "+file_rt+" "+file_bl+" > logfile.txt"
result = os.system(com)
if (result != 0):
print("Output for "+run["case"]+"_"+run["suite"]+ " DIFFERS from baseline. Difference plots will be created")
message = "Output for "+run["case"]+"_"+run["suite"]+ " DIFFERS from baseline."
if (not no_plots):
message += " Difference plots will be created."
print(message)
error_count = error_count + 1
else:
print("Output for "+run["case"]+"_"+run["suite"]+ " is IDENTICAL to baseline")
# end if

# Create plots between RTs and baselines (only if differences exist)
if (result != 0):
if (result != 0 and not no_plots):
plot_files = plot_results(file_bl, file_rt)

# Setup output directories for plots.
Expand All @@ -71,7 +76,8 @@ def main():
# end for

# Create tarball with plots.
result = os.system('tar -cvf scm_rt_out.tar scm_rt_out/*')
if (not no_plots):
result = os.system('tar -cvf scm_rt_out.tar scm_rt_out/*')

#
if error_count == 0:
Expand Down

0 comments on commit ff1737f

Please sign in to comment.