Loading ci/complexity_measurements/check_for_changes.py 0 → 100644 +45 −0 Original line number Original line Diff line number Diff line import argparse import csv import sys import numpy as np THRESH = 0.01 COLS = [ [3, 5, 7, 9], # wmops_all [3,5,7,8,10,12,13,15,17], # ram_all [3,5,7,9,11,13,15,17,19], # rom_all ] def main(args): linewise_logfiles = [args.wmops_logfile, args.ram_logfile, args.rom_logfile] changes_found_linewise = any([check_linewise_logfile(f, c) for f, c in zip(linewise_logfiles, COLS)]) if changes_found_linewise: print("Global max of WMOPS, RAM or ROM changed") return int(changes_found_linewise) def check_linewise_logfile(filepath, cols): with open(filepath) as f: contents = [line for line in csv.reader(f, delimiter=" ")] curr = contents[-1] prev = contents[-2] change_ratios = [abs(float(curr[i]) / float(prev[i]) - 1) > THRESH for i in cols] changes_found = any(change_ratios) return changes_found if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("wmops_logfile") parser.add_argument("ram_logfile") parser.add_argument("rom_logfile") args = parser.parse_args() sys.exit(main(args)) ci/complexity_measurements/getWmops.sh +6 −1 Original line number Original line Diff line number Diff line Loading @@ -86,4 +86,9 @@ ${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameF # generate java script from database # generate java script from database tcsh ${scriptDir}/genWebpageData_Rom.csh ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/graphs_rom_flc.js Graphs_ROM tcsh ${scriptDir}/genWebpageData_Rom.csh ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/graphs_rom_flc.js Graphs_ROM python3 ${scriptDir}/check_for_changes.py ${destDir}/wmops/log_wmops_all.txt ${destDir}/wmops/log_ram_all.txt ${destDir}/wmops/log_rom_all.txt if [ "$?" != "0" ]; then ret_val=1 fi exit $ret_val exit $ret_val Loading
ci/complexity_measurements/check_for_changes.py 0 → 100644 +45 −0 Original line number Original line Diff line number Diff line import argparse import csv import sys import numpy as np THRESH = 0.01 COLS = [ [3, 5, 7, 9], # wmops_all [3,5,7,8,10,12,13,15,17], # ram_all [3,5,7,9,11,13,15,17,19], # rom_all ] def main(args): linewise_logfiles = [args.wmops_logfile, args.ram_logfile, args.rom_logfile] changes_found_linewise = any([check_linewise_logfile(f, c) for f, c in zip(linewise_logfiles, COLS)]) if changes_found_linewise: print("Global max of WMOPS, RAM or ROM changed") return int(changes_found_linewise) def check_linewise_logfile(filepath, cols): with open(filepath) as f: contents = [line for line in csv.reader(f, delimiter=" ")] curr = contents[-1] prev = contents[-2] change_ratios = [abs(float(curr[i]) / float(prev[i]) - 1) > THRESH for i in cols] changes_found = any(change_ratios) return changes_found if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("wmops_logfile") parser.add_argument("ram_logfile") parser.add_argument("rom_logfile") args = parser.parse_args() sys.exit(main(args))
ci/complexity_measurements/getWmops.sh +6 −1 Original line number Original line Diff line number Diff line Loading @@ -86,4 +86,9 @@ ${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameF # generate java script from database # generate java script from database tcsh ${scriptDir}/genWebpageData_Rom.csh ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/graphs_rom_flc.js Graphs_ROM tcsh ${scriptDir}/genWebpageData_Rom.csh ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/graphs_rom_flc.js Graphs_ROM python3 ${scriptDir}/check_for_changes.py ${destDir}/wmops/log_wmops_all.txt ${destDir}/wmops/log_ram_all.txt ${destDir}/wmops/log_rom_all.txt if [ "$?" != "0" ]; then ret_val=1 fi exit $ret_val exit $ret_val