FMS
2024.03
Flexible Modeling System
|
Module to expose the memory printing API. More...
Functions/Subroutines | |
subroutine, public | memutils_init (print_flag) |
Initialize the memutils module. More... | |
subroutine, public | print_memuse_stats (text, unit, always) |
Print memory usage stats to stdout, or a particular file. More... | |
Variables | |
logical, private | print_memory_usage =.FALSE. |
Default behavior of print_memuse_stats() | |
Module to expose the memory printing API.
Module to expose the memory printing API
Model components at times desire to print the memory statics to stderr, or another file (e.g. the log file). This can be useful in debugging. This module exposes the print_memuse_stat and memutils_init calls for use in external user code.
subroutine, public memutils_mod::memutils_init | ( | logical, optional | print_flag | ) |
Initialize the memutils module.
memutils_init initializes the print_memory_usage and memutils_initialized module variables when called. This configures if print_memuse_stats() should print the memory statistics when called. memutils_init, at present, can be called multiple times, and potentially change the behavior of print_memuse_stats().
print_flag | Indicate if memory statistics should be printed by default |
Definition at line 54 of file memutils.F90.
subroutine, public memutils_mod::print_memuse_stats | ( | character(len=*), intent(in) | text, |
integer, intent(in), optional | unit, | ||
logical, intent(in), optional | always | ||
) |
Print memory usage stats to stdout, or a particular file.
API to allow external user code to print memory statistics to stderr, or an optional file (Fortran file unit). The module variable print_memory_usage
will control the default behavior (set when memutils_init is called). The default behavior can be modified passing in the optional always
(logical) parameter. If always.eqv..TRUE.
, print_memuse_stats() will print the memory statistics.
[in] | text | Text to be printed before the memory statistics |
[in] | unit | Fortran file unit to where memory statistics should be recorded |
[in] | always | If .TRUE. , force memory statistics to be printed |
Definition at line 70 of file memutils.F90.