Skip to content

Commit

Permalink
misc: Restrict MPI perf logging to rank 0
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Jun 12, 2023
1 parent 9b9c45e commit e7f0d97
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion devito/operator/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e7f0d97

Please sign in to comment.