Changes between Initial Version and Version 1 of AddingMemoryandTimingInformation_PDAF23


Ignore:
Timestamp:
May 20, 2025, 10:06:10 AM (11 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AddingMemoryandTimingInformation_PDAF23

    v1 v1  
     1= Adding memory and timing information (PDAF2) =
     2
     3{{{
     4#!html
     5<div class="wiki-toc">
     6<h4>Implementation Guide for PDAF2</h4>
     7<ol><li><a href="ImplementationGuide_PDAF23">Main page</a></li>
     8<li><a href="AdaptParallelization_PDAF23">Adaptation of the parallelization</a></li>
     9<li><a href="InitPdaf_PDAF23">Initialization of PDAF</a></li>
     10<li><a href="ModifyModelforEnsembleIntegration_PDAF23">Modifications for ensemble integration</a></li>
     11<li><a href="ImplementationofAnalysisStep_PDAF23">Implementation of the analysis step</a></li>
     12<li>Memory and timing information</li>
     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
     22== Displaying memory information ==
     23
     24Information about the memory required by PDAF through allocated arrays can be obtained by inserting into the program the line
     25{{{
     26  CALL PDAF_print_info(2)
     27}}}
     28The function displays the following information
     29 * Memory required for the ensemble array, state vector, and matrix '''Uinv'''
     30 * Memory required by the analysis step
     31 * Memory required to perform the ensemble transformation
     32
     33The output will look like this:
     34{{{
     35  PDAF                       PDAF Memory overview
     36  PDAF          ---------------------------------------------
     37  PDAF                     Allocated memory  (MiB)
     38  PDAF              state and A:      0.598 MiB (persistent)
     39  PDAF           ensemble array:      0.641 MiB (persistent)
     40  PDAF            analysis step:     16.425 MiB (temporary)
     41}}}
     42
     43Currently only the memory required by the first process of the filter processes is displayed. Thus the total required memory should be the displayed memory multiplied by the number of processes in `COMM_filter`.
     44
     45== Displaying timing information ==
     46
     47Timing information can be displayed by adding
     48{{{
     49  CALL PDAF_print_info(1)
     50}}}
     51to the code. This will provide an output like
     52{{{
     53  PDAF                     PDAF Timing information
     54  PDAF          ---------------------------------------------
     55  PDAF                  Initialize PDAF:      0.078 s
     56  PDAF                Ensemble forecast:      0.003 s
     57  PDAF                  LESTKF analysis:     25.183 s
     58  PDAF                      Prepoststep:      0.017 s
     59}}}
     60
     61More detailed output is obtained with
     62{{{
     63  CALL PDAF_print_info(3)
     64}}}
     65which will display timing information of each of the call-back routines. E.g. for the LESTKF this might look like:
     66{{{
     67  PDAF            PDAF Timing information - call-back routines
     68  PDAF        ----------------------------------------------------
     69  PDAF          Initialize PDAF:                     2.007 s
     70  PDAF            init_ens_pdaf:                       2.004 s
     71  PDAF          Ensemble forecast:                 571.850 s
     72  PDAF            MPI communication in PDAF:           0.004 s
     73  PDAF            distribute_state_pdaf:               0.140 s
     74  PDAF            collect_state_pdaf:                  0.001 s
     75  PDAF          LESTKF analysis:                    12.654 s
     76  PDAF            PDAF-internal operations:           10.360 s
     77  PDAF            init_n_domains_pdaf:                 0.000 s
     78  PDAF            init_dim_obs_f_pdaf:                 1.091 s
     79  PDAF            obs_op_f_pdaf:                       0.022 s
     80  PDAF            init_dim_l_pdaf:                     0.001 s
     81  PDAF            init_dim_obs_l_pdaf:                 1.136 s
     82  PDAF            g2l_state_pdaf:                      0.003 s
     83  PDAF            g2l_obs_pdaf:                        0.007 s
     84  PDAF            init_obs_l_pdaf:                     0.004 s
     85  PDAF            prodRinvA_l_pdaf:                    0.023 s
     86  PDAF            l2g_state_pdaf:                      0.002 s
     87  PDAF          prepoststep_pdaf:                   91.396 s
     88}}}
     89This example is from one of our real data assimilation application. Most of the time is spent in for ensmeble forecast. The second most time is spent in `prepoststep_pdaf`, which is mainly due to the writing of large output files.
     90The analysis step  (line `LESTKF analysis`) took only 12.65s. Most of this time was spent for computations inside PDAF (line `PDAF-interal operations`, 10.36s), while also `init_dim_obs_f_pdaf` (the initialization of observation information) and `init_dim_obs_l_pdaf` (the search for observations within the localization cut-off radius) took some time.
     91
     92If significant time is spend in one or several of the call-back routines, this gives an indication which routines might have potential for optimization.
     93
     94More detailed information in time spend in different parts of the filter algorithm itself can be obtained using a value of 4 or 5 in the call to `PDAF_print_info`. Only the time from the first process of the filter processes is displayed. However, the time for each process should be similar.
     95