mpi_array.logging.get_root_logger

mpi_array.logging.get_root_logger(name, comm=None, root_rank=0)[source]

Returns a logging.Logger object with time-stamp, comm.Get_name() and comm.Get_rank() in the message. Logging output limited to the MPI rank specified by root_rank.

Parameters:
  • name (str) – Name of logger (note that the name of logger actually created will be name + ".rank." + ("%04d" % comm.Get_rank())).
  • comm (mpi4py.MPI.Comm) – MPI communicator. Used for determining the rank of this process. If None uses mpi4py.MPI.COMM_WORLD.
  • root_rank (int) – Logging output is limited to this rank, the returned logging.Logger objects on other ranks have a logging.NullHandler.
Return type:

logging.Logger

Returns:

Logger object.