Skip to content

Commit

Permalink
wave-mpi: add --log argument (#852)
Browse files Browse the repository at this point in the history
also brings wave.py arguments in line with the other examples.
  • Loading branch information
matthiasdiener authored Mar 16, 2023
1 parent 35078c8 commit 8946291
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions examples/wave-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
8 changes: 4 additions & 4 deletions examples/wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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

0 comments on commit 8946291

Please sign in to comment.