deepmd.loggers
==============

.. py:module:: deepmd.loggers

.. autoapi-nested-parse::

   
   Module taking care of logging duties.
















   ..
       !! processed by numpydoc !!


Submodules
----------

.. toctree::
   :maxdepth: 1

   /autoapi/deepmd/loggers/loggers/index
   /autoapi/deepmd/loggers/training/index


Functions
---------

.. autoapisummary::

   deepmd.loggers.set_log_handles


Package Contents
----------------

.. py:function:: set_log_handles(level: int, log_path: Optional[pathlib.Path] = None, mpi_log: Optional[str] = None) -> None

   
   Set desired level for package loggers and add file handlers.


   :Parameters:

       **level** : :class:`python:int`
           logging level

       **log_path** : :obj:`Optional <typing.Optional>`\[:class:`python:str`]
           path to log file, if None logs will be send only to console. If the parent
           directory does not exist it will be automatically created, by default None

       **mpi_log** : :obj:`Optional <typing.Optional>`\[:class:`python:str`], :obj:`optional`
           mpi log type. Has three options. `master` will output logs to file and console
           only from rank==0. `collect` will write messages from all ranks to one file
           opened under rank==0 and to console. `workers` will open one log file for each
           worker designated by its rank, console behaviour is the same as for `collect`.
           If this argument is specified, package 'mpi4py' must be already installed.
           by default None







   :Raises:

       :obj:`RuntimeError`
           If the argument `mpi_log` is specified, package `mpi4py` is not installed.




   .. rubric:: Notes

   Logging levels:

   +---------+--------------+----------------+----------------+----------------+
   |         | our notation | python logging | tensorflow cpp | OpenMP         |
   +=========+==============+================+================+================+
   | debug   | 10           | 10             | 0              | 1/on/true/yes  |
   +---------+--------------+----------------+----------------+----------------+
   | info    | 20           | 20             | 1              | 0/off/false/no |
   +---------+--------------+----------------+----------------+----------------+
   | warning | 30           | 30             | 2              | 0/off/false/no |
   +---------+--------------+----------------+----------------+----------------+
   | error   | 40           | 40             | 3              | 0/off/false/no |
   +---------+--------------+----------------+----------------+----------------+

   .. rubric:: References

   https://groups.google.com/g/mpi4py/c/SaNzc8bdj6U
   https://stackoverflow.com/questions/35869137/avoid-tensorflow-print-on-standard-error
   https://stackoverflow.com/questions/56085015/suppress-openmp-debug-messages-when-running-tensorflow-on-cpu

   .. only:: latex

      


   ..
       !! processed by numpydoc !!

