From e7f0d97cb31fee0eddb1996f7db1fe0362cab4a1 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 73cf07f8e46..563c0f37554 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, @@ -869,6 +869,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