From 589c9c9f859c5c34bee6e3a246eb7dff928cfcf5 Mon Sep 17 00:00:00 2001 From: George Bisbas Date: Thu, 18 May 2023 16:21:53 +0100 Subject: [PATCH] misc: Restrict MPI perf logging to rank 0 --- devito/operator/operator.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/devito/operator/operator.py b/devito/operator/operator.py index d1bee9fa665..0716adc6708 100644 --- a/devito/operator/operator.py +++ b/devito/operator/operator.py @@ -8,7 +8,7 @@ from devito.arch import compiler_registry, platform_registry from devito.data import default_allocator from devito.exceptions import InvalidOperator -from devito.logger import debug, info, perf, warning, is_log_enabled_for +from devito.logger import debug, info, perf, warning, is_log_enabled_for, set_log_level from devito.ir.equations import LoweredEq, lower_exprs from devito.ir.clusters import ClusterGroup, clusterize from devito.ir.iet import (Callable, CInterface, EntryFunction, FindSymbols, MetaCall, @@ -877,6 +877,11 @@ def _emit_timings(timings, indent=''): def _emit_apply_profiling(self, args): """Produce a performance summary of the profiled sections.""" + + # In case 'MPI0' is selected for logging, restrict result printing to one rank + if configuration['mpi']: + set_log_level(configuration['log-level'], comm=args.comm) + # Rounder to 2 decimal places fround = lambda i: ceil(i * 100) / 100