Changes between Version 2 and Version 3 of OnlineAdaptParallelization_PDAF3


Ignore:
Timestamp:
Sep 1, 2025, 10:50:36 AM (21 hours ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OnlineAdaptParallelization_PDAF3

    v2 v3  
    2323In the tutorial code and the templates in `templates/online`, the parallelization is initialized in the routine `init_parallel_pdaf` (file `init_parallel_pdaf.F90`). The required variables are defined in `mod_parallel.F90`. These files can be used as templates.
    2424
     25In implementations done with PDAF V3.0 and later, `init_parallel_pdaf` provides the parallelization variables to PDAF by a call to `PDAF3_set_parallel`. Implementations done before do usually not include this call, but provide the variables to PDAF in the initialization call to `PDAF_init`.
     26
    2527Like many numerical models, PDAF uses the MPI standard for the parallelization. For the case of a parallelized model, we assume in the description below that the model is parallelized using MPI. If the model is parallelized using OpenMP, one can follow the explanations for a non-parallel model below.
    2628
     
    43451. Insert the call `init_parallel_pdaf` directly after `MPI_init`.
    44461. Check whether the model uses `MPI_COMM_WORLD`.
    45  * If yes, then replace `MPI_COMM_WORLD` in all places except `MPI_abort` and `MPI_finalize` by a user-defined communicator (we call it `COMM_mymodel` here), which can be initialized as `COMM_mymodel=MPI_COMM_WORLD`.
    46  * If no, then take note of the name of the communicator variable (we assume it's `COMM_mymodel`). The next steps are valid if the model uses `COMM_mymodel` in a way that all processes of the program are included (thus analogous to `MPI_COMM_WORLD`). If the model is using less processes, this is a [#SpecialCase special case, which we discuss further below].
     47 * If yes, then replace `MPI_COMM_WORLD` in all places, except `MPI_abort` and `MPI_finalize` by a user-defined communicator (we call it `COMM_mymodel` here), which can be initialized as `COMM_mymodel=MPI_COMM_WORLD`.
     48 * If no, then take note of the name of the communicator variable (we assume here it's `COMM_mymodel`). The next steps are valid if the model uses `COMM_mymodel` in a way that all processes of the program are included (thus analogous to `MPI_COMM_WORLD`). If the model is using less processes, this is a [#SpecialCase special case, which we discuss further below].
    47491. Adapt `init_parallel_pdaf` so that at the end of this routine you set `COMM_mymodel=COMM_model`. Potentially, also set the rank and size variables of the model, respectively, by `mype_model` and `npes_model`.
    48501. The number of model tasks in variable `n_modeltasks` is required by `init_parallel_pdaf` to perform commucator splitting. In the tutorial code we added a command-line parsing to set the variable (it is parsing for `dim_ens`). One could also read the value from a configuration file.