Changes between Version 40 and Version 41 of AdaptParallelization


Ignore:
Timestamp:
May 21, 2025, 10:01:45 AM (13 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdaptParallelization

    v40 v41  
    4141If you are experienced with MPI, the steps are the following:
    42421. Find the call to `MPI_init`
    43 2. Check whether the model uses `MPI_COMM_WORLD`.
    44  * If yes, then replace `MPI_COMM_WORLD` in all places except MPI_abort and MPI_finalize by a user-defined communicator, e.g `COMM_mymodel`, which can be initialized as `COMM_mymodel=MPI_COMM_WORLD`.
    45  * 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, but setting it to MPI_COMM_WORLD. If the model is using less processes, this is a [#SpecialCase special case, which we discuss further below].
    46 3. Insert the call `init_parallel_pdaf` directly after `MPI_init`.
    47 4. 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`.
    48 5. 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.
     431. Insert the call `init_parallel_pdaf` directly after `MPI_init`.
     441. 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].
     471. 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`.
     481. 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.
    4949
    5050