From 89462916a503a75fb864d0d008d6787132bf66e5 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Thu, 16 Mar 2023 13:32:04 -0500 Subject: [PATCH] wave-mpi: add --log argument (#852) also brings wave.py arguments in line with the other examples. --- examples/wave-mpi.py | 9 +++++---- examples/wave.py | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/wave-mpi.py b/examples/wave-mpi.py index 00198b8d7..b9f25f4d9 100644 --- a/examples/wave-mpi.py +++ b/examples/wave-mpi.py @@ -252,12 +252,13 @@ def rhs(t, w): if __name__ == "__main__": logging.basicConfig(format="%(message)s", level=logging.INFO) - # Turn off profiling to not overwhelm CI - use_profiling = False - use_logging = True import argparse parser = argparse.ArgumentParser(description="Wave (MPI version)") + parser.add_argument("--profiling", action="store_true", + help="turn on detailed performance profiling") + parser.add_argument("--log", action="store_true", + help="enable logging") parser.add_argument("--lazy", action="store_true", help="switch to a lazy computation mode") args = parser.parse_args() @@ -266,6 +267,6 @@ def rhs(t, w): from grudge.array_context import get_reasonable_array_context_class actx_class = get_reasonable_array_context_class(lazy=lazy, distributed=True) - main(actx_class, use_profiling=use_profiling, use_logmgr=use_logging, lazy=lazy) + main(actx_class, use_profiling=args.profiling, use_logmgr=args.log, lazy=lazy) # vim: foldmethod=marker diff --git a/examples/wave.py b/examples/wave.py index 8b3d53538..e1105bdf9 100644 --- a/examples/wave.py +++ b/examples/wave.py @@ -179,9 +179,9 @@ def rhs(t, w): if __name__ == "__main__": import argparse parser = argparse.ArgumentParser(description="Wave (non-MPI version)") - parser.add_argument("--profile", action="store_true", + parser.add_argument("--profiling", action="store_true", help="enable kernel profiling") - parser.add_argument("--logging", action="store_true", + parser.add_argument("--log", action="store_true", help="enable logging") parser.add_argument("--lazy", action="store_true", help="enable lazy evaluation") @@ -191,7 +191,7 @@ def rhs(t, w): actx_class = get_reasonable_array_context_class(lazy=args.lazy, distributed=False) - main(actx_class, use_profiling=args.profile, - use_logmgr=args.logging, lazy=args.lazy) + main(actx_class, use_profiling=args.profiling, + use_logmgr=args.log, lazy=args.lazy) # vim: foldmethod=marker