Changes between Version 13 and Version 14 of AddingMemoryandTimingInformation


Ignore:
Timestamp:
May 22, 2025, 9:26:27 PM (10 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AddingMemoryandTimingInformation

    v13 v14  
    2424PDAF 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`.
    2525
     26The calls described here are implemented in `finalize_pdaf.F90` in the template and tutorial codes. One can directly use these routines without changes.
     27
    2628== Displaying memory information ==
    2729
    2830Information about the memory required by PDAF through allocated arrays can be obtained by inserting into the program the line
    2931{{{
    30   CALL PDAF_print_info(2)
     32  IF (mype_world==0) CALL PDAF_print_info(10)
    3133}}}
    3234The function displays the following information
    33  * Memory required for the ensemble array, state vector, and matrix '''Uinv'''
     35 * Memory required for the ensemble array, state vector, and matrix '''Ainv'''
    3436 * Memory required by the analysis step
    3537 * Memory required to perform the ensemble transformation
     
    4547}}}
    4648
    47 Currently 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`.
     49This 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
     50{{{
     51  CALL PDAF_print_info(11)
     52}}}
     53to the routine `finalize_pdaf`.
    4854
    4955== Displaying timing information ==
     
    6571More detailed output is obtained with
    6672{{{
    67   CALL PDAF_print_info(3)
     73  IF (mype_world==0) CALL PDAF_print_info(3)
    6874}}}
    6975which will display timing information of each of the call-back routines. E.g. for the LESTKF this might look like:
    7076{{{
    71   PDAF            PDAF Timing information - call-back routines
    72   PDAF        ----------------------------------------------------
    73   PDAF          Initialize PDAF:                     2.007 s
    74   PDAF            init_ens_pdaf:                       2.004 s
    75   PDAF          Ensemble forecast:                 571.850 s
    76   PDAF            MPI communication in PDAF:           0.004 s
    77   PDAF            distribute_state_pdaf:               0.140 s
    78   PDAF            collect_state_pdaf:                  0.001 s
    79   PDAF          LESTKF analysis:                    12.654 s
    80   PDAF            PDAF-internal operations:           10.360 s
    81   PDAF            init_n_domains_pdaf:                 0.000 s
    82   PDAF            init_dim_obs_f_pdaf:                 1.091 s
    83   PDAF            obs_op_f_pdaf:                       0.022 s
    84   PDAF            init_dim_l_pdaf:                     0.001 s
    85   PDAF            init_dim_obs_l_pdaf:                 1.136 s
    86   PDAF            g2l_state_pdaf:                      0.003 s
    87   PDAF            g2l_obs_pdaf:                        0.007 s
    88   PDAF            init_obs_l_pdaf:                     0.004 s
    89   PDAF            prodRinvA_l_pdaf:                    0.023 s
    90   PDAF            l2g_state_pdaf:                      0.002 s
    91   PDAF          prepoststep_pdaf:                   91.396 s
     77PDAF            PDAF Timing information - call-back routines
     78PDAF        ----------------------------------------------------
     79PDAF          Initialize PDAF:                     1.552 s
     80PDAF            init_ens_pdaf:                       1.526 s
     81PDAF          Ensemble forecast:               23847.693 s
     82PDAF            MPI communication in PDAF:         666.890 s
     83PDAF            distribute_state_pdaf:               2.153 s
     84PDAF            collect_state_pdaf:                  0.427 s
     85PDAF          LESTKF analysis:                   191.429 s
     86PDAF            PDAF-internal operations:          157.618 s
     87PDAF            OMI-internal routines:               1.524 s
     88PDAF            init_n_domains_pdaf:                 0.000 s
     89PDAF            init_dim_l_pdaf:                     0.127 s
     90PDAF            g2l_state_pdaf:                      5.190 s
     91PDAF            l2g_state_pdaf:                      3.087 s
     92PDAF            Time in OMI observation module routines
     93PDAF              init_dim_obs_pdafomi:              8.880 s
     94PDAF              obs_op_pdafomi:                    3.913 s
     95PDAF              init_dim_obs_l_pdafomi:           10.750 s
     96PDAF          prepoststep_pdaf:                 9422.757 s
    9297}}}
    93 This 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.
    94 The 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.
     98This example is from one of our real data assimilation applications where we performed 13 analysis steps in this run. Most of the time is spent in for ensemble forecast. The second most time is spent in `prepoststep_pdaf`, which is mainly due to the writing of large output files using a parallel writing using the binary netCDF file format.
     99The analysis steps  (line `LESTKF analysis`) took only 191.429s. Most of this time was spent for computations inside PDAF (line `PDAF-interal operations`, 157.618s), while also `init_dim_obs_l_pdafomi` (the search for observations within the localization cut-off radius, 10.75s) and `init_dim_obs_f_pdafomi` (the initialization of observation information, 8.88s) took some time.
    95100
    96101If significant time is spend in one or several of the call-back routines, this gives an indication which routines might have potential for optimization.
    97102
    98 More 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.
     103More 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. If one performs the call without `IF (mype_world==0) ` each process would write its timing information.
    99104