= Offline Mode: Adding memory and timing information =
{{{
#!html
}}}
[[PageOutline(2-3,Contents of this page)]]
== Overview ==
PDAF provides functions to display the memory required by the array allocated inside PDAF. In addition, information about the execution duration of different parts of PDAF can be displayed. These information can be obtained by calling the routine `PDAF_print_info`.
The calls described here are implemented in `finalize_pdaf.F90` in the template and tutorial codes. One can directly use these routines without changes.
== Displaying memory information ==
Information about the memory required by PDAF through allocated arrays is provided by the line
{{{
IF (mype_world==0) CALL PDAF_print_info(10)
}}}
The function displays the following information
* Memory required for the ensemble array, state vector, and matrix '''Uinv'''
* Memory required by the analysis step
* Memory required to perform the ensemble transformation
The output will look like this:
{{{
PDAF PDAF Memory overview
PDAF ---------------------------------------------
PDAF Allocated memory (MiB)
PDAF state and A: 2.000 MiB (persistent)
PDAF ensemble array: 16.000 MiB (persistent)
PDAF analysis step: 0.757 MiB (temporary)
PDAF PDAF-OMI: 0.521 MiB (temporary)
}}}
This memory information shows only the memory required by a single filter processes. In the example codes, this is the process with `mype_world=0`. One can also display the overall allocated memory by adding
{{{
CALL PDAF_print_info(11)
}}}
to the routine `finalize_pdaf`.
== Displaying timing information ==
Timing information is displayed by the call
{{{
IF (mype_world==0) CALL PDAF_print_info(3)
}}}
to the code. This will provide an output like
{{{
PDAF PDAF Timing information - call-back routines
PDAF ----------------------------------------------------
PDAF Initialize PDAF: 2.761 s
PDAF init_ens_pdaf: 2.760 s
PDAF LESTKF analysis: 62.393 s
PDAF PDAF-internal operations: 32.830 s
PDAF OMI-internal routines: 12.946 s
PDAF init_n_domains_pdaf: 0.000 s
PDAF init_dim_l_pdaf: 0.031 s
PDAF Time in OMI observation module routines
PDAF init_dim_obs_pdafomi: 0.410 s
PDAF obs_op_pdafomi: 0.006 s
PDAF init_dim_obs_l_pdafomi: 15.759 s
PDAF prepoststep_pdaf: 4.473 s
}}}
This timing display is particularly aimed at distinguishing the time spent in call-back routines from the time spent in PDAF-internal routines or PDAF-OMI internal routines. This timing information indicate those call-back routines that need particularly much time.
The timing information is for a single process. In the example codes, this is the process with `mype_world=0`. Without checking for `mype_world` one can let each process display its timing information.
Less detailed information cab be obtained using a value of 1, and more detailed information can be obtained using a value of 4 in the call to `PDAF_print_info`.