Add flag vor debug logging

This commit is contained in:
Jose Gracia 2024-01-26 13:46:12 +01:00
parent 2944f3cae9
commit 41dab7a647

View file

@ -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()