MPILogFilter#

class caput.pipeline.tasklib.base.MPILogFilter(add_mpi_info: bool = True, level_rank0: int = logging.INFO, level_all: int = logging.WARN)[source]#

Bases: logging.Filter

Filter log entries by MPI rank.

Also this will optionally add MPI rank information, and add an elapsed time entry.

Parameters:
add_mpi_infobool, optional

Add MPI rank/size info to log records that don’t already have it.

level_rank0int, optional

Log level for messages from rank=0. Default is logging.INFO.

level_allint, optional

Log level for messages from all other ranks. Default is logging.WARN.

Methods#

filter(record)

Add MPI info if desired.