FRSS
Introduction
FRSS is a library for printing the resident set size (RSS) of a Fortran application at runtime. It is MPI-aware and displays the memory information for the corresponding MPI rank. It can also be used to determine the maximum used memory per node.
Usage
Print the RSS
Anywhere in you Fortran code, you can trigger the output by calling the subroutine:
call frss_print()
It will print the following information to stdout:
Abbreviation | Description | Source |
---|---|---|
RSS | Current resident set size | /proc/self/status |
HWM | High water mark of the RSS | /proc/self/status |
OOM | Out-of-memory score | /proc/self/oom_score |
dt | Elapsed wall-clock time since last call |
If you want to display this information only for a specific MPI rank, call (e.g. for rank 0):
call frss_print_rank(0)
You can also display the currently used memory of the node your application is running on by calling:
call frss_print_node()
Monitor memory consumption of a node
To determine the high water mark of the used memory per node, you need to start the measurement first providing the desired time sampling. For extracting the memory information every 1000 milliseconds, for example, call:
call frss_monitor_node(1000)
Before your application finishes, print the measured data with:
call frss_print_node()
The output contains the following information:
Label | Description | Source |
---|---|---|
Total | Total usable memory | /proc/meminfo |
Used (now) | Currently used memory | /proc/meminfo |
Used (initial) | Used memory when frss_monitor_node was called |
/proc/meminfo |
Used (max) | Maxmimum of used memory during measurement | /proc/meminfo |
Link with FRSS
In order to use FRSS, you need to link with the library, e.g. by using the following flags: -L/path/to/frss -lfrss
.