Changes between Initial Version and Version 1 of OfflineAddingMemoryandTimingInformation_PDAF3


Ignore:
Timestamp:
May 25, 2025, 6:12:04 PM (5 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OfflineAddingMemoryandTimingInformation_PDAF3

    v1 v1  
     1= Offline Mode: Memory and timing information =
     2
     3{{{
     4#!html
     5<div class="wiki-toc">
     6<h4>Offline Mode: Implementation Guide</h4>
     7<ol><li><a href="OfflineImplementationGuide_PDAF3">Main page</a></li>
     8<li><a href="OfflineAdaptParallelization_PDAF3">Initializing  the parallelization</a></li>
     9<li><a href="OfflineInitPdaf_PDAF3">Initializing PDAF</a></li>
     10<li><a href="ImplementationofAnalysisStep_PDAF3">Implementing the analysis step</a></li>
     11<li>Memory and timing information</li>
     12</ol>
     13</div>
     14}}}
     15
     16[[PageOutline(2-3,Contents of this page)]]
     17
     18== Overview ==
     19
     20PDAF 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`.
     21
     22The calls described here are implemented in `finalize_pdaf.F90` in the template and tutorial codes. One can directly use these routines without changes.
     23
     24== Displaying memory information ==
     25
     26Information about the memory required by PDAF through allocated arrays is provided by the line
     27{{{
     28  IF (mype_world==0) CALL PDAF_print_info(10)
     29}}}
     30The function displays the following information
     31 * Memory required for the ensemble array, state vector, and matrix '''Ainv'''
     32 * Memory required by the analysis step
     33 * Memory required to perform the ensemble transformation
     34
     35The output will look like this:
     36{{{
     37PDAF                       PDAF Memory overview
     38PDAF          ---------------------------------------------
     39PDAF                     Allocated memory  (MiB)
     40PDAF              state and A:      2.000 MiB (persistent)
     41PDAF           ensemble array:     16.000 MiB (persistent)
     42PDAF            analysis step:      0.757 MiB (temporary)
     43PDAF                 PDAF-OMI:      0.521 MiB (temporary)
     44
     45}}}
     46
     47This 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
     48{{{
     49  CALL PDAF_print_info(11)
     50}}}
     51to the routine `finalize_pdaf`.
     52
     53== Displaying timing information ==
     54
     55Timing information is displayed by the call
     56{{{
     57  IF (mype_world==0) CALL PDAF_print_info(3)
     58}}}
     59to the code. This will provide an output like
     60{{{
     61PDAF            PDAF Timing information - call-back routines
     62PDAF        ----------------------------------------------------
     63PDAF          Initialize PDAF:                     2.761 s
     64PDAF            init_ens_pdaf:                       2.760 s
     65PDAF          LESTKF analysis:                    62.393 s
     66PDAF            PDAF-internal operations:           32.830 s
     67PDAF            OMI-internal routines:              12.946 s
     68PDAF            init_n_domains_pdaf:                 0.000 s
     69PDAF            init_dim_l_pdaf:                     0.031 s
     70PDAF            Time in OMI observation module routines
     71PDAF              init_dim_obs_pdafomi:              0.410 s
     72PDAF              obs_op_pdafomi:                    0.006 s
     73PDAF              init_dim_obs_l_pdafomi:           15.759 s
     74PDAF          prepoststep_pdaf:                    4.473 s
     75}}}
     76This 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.
     77
     78The 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.
     79
     80Less detailed information can 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`.