= 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 call
{{{
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 Memory overview
---------------------------------------------
Allocated memory (MB)
state and U: 0.59617 MB (persistent)
ensemble array: 0.64087 MB (persistent)
analysis step: 6.05578 MB (temporary)
resampling: 2.81129 MB (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
{{{
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.
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`.