Skip to content

Commit e041b0c

Browse files
committed
mpi: Check for COMM_NULL when logging
1 parent d38cd39 commit e041b0c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

devito/logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ def set_log_level(level, comm=None):
9393
from devito import configuration
9494

9595
if comm is not None and configuration['mpi']:
96-
if comm.rank != 0:
96+
from devito.mpi.distributed import MPI
97+
if comm is not MPI.COMM_NULL and comm.rank != 0:
9798
logger.removeHandler(stream_handler)
9899
logger.addHandler(logging.NullHandler())
99100
else:

0 commit comments

Comments
 (0)