From 41dab7a6478162cd66bb03437581c6abca0df03f Mon Sep 17 00:00:00 2001 From: Jose Gracia Date: Fri, 26 Jan 2024 13:46:12 +0100 Subject: [PATCH] Add flag vor debug logging --- performance/mpiP/share/mpip2POP.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/performance/mpiP/share/mpip2POP.py b/performance/mpiP/share/mpip2POP.py index d36d63c..ba7c0bf 100755 --- a/performance/mpiP/share/mpip2POP.py +++ b/performance/mpiP/share/mpip2POP.py @@ -13,6 +13,9 @@ def parse_arguments(): parser.add_argument('-s', '--scaling', choices=['strong','weak'], default='weak', help='Strong or weak scaling experiment') + parser.add_argument('-d', '--debug', + action='store_true', + help='Print debug messages for developers') parser.add_argument('mpip_report', nargs='+', type=argparse.FileType('r')) return parser.parse_args() @@ -225,6 +228,10 @@ def print_scaling(scaling, stream=sys.stdout): def main(): args = parse_arguments() + if args.debug: + logging.getLogger().setLevel(logging.DEBUG) + + metrics = list() # compute parallel efficiencies for each input @@ -242,5 +249,9 @@ def main(): pretty_print(metrics) print_scaling(args.scaling) + if __name__ == "__main__": + # set default logging level + logging.getLogger().setLevel(logging.WARNING) + main() \ No newline at end of file