Changes between Version 37 and Version 38 of AdaptParallelization


Ignore:
Timestamp:
May 20, 2025, 5:07:46 PM (12 days ago)
Author:
lnerger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdaptParallelization

    v37 v38  
    7474== Adaptions for a serial model ==
    7575
    76 If the numerical model is not parallelized (i.e. serial), we need to add the parallelization for the ensemble. We follow here the approach used in the tutorial code `tutorial/online_2D_serialmodel`. The files `mod_parallel_pdaf.F90`, `init_parallel_pdaf.F90`, `finalize_pdaf.F90` (and `parser_mpi.F90`) can be directly used. Note, the `init_parallel_pdaf` uses command-line parsing (from `parser_mpi.F90`) to read the number of model tasks (`n_modeltasks`) from the command line (specifying `-ens N_MODELTASKS`, where N_MODELTASKS should be the ensmeble size). One can replace this, e.g., by reading from a configuration file.
     76=== The adaptions in short ===
     77
     78If you are experienced with MPI, the steps are the following using the files `mod_parallel_pdaf.F90`, `init_parallel_pdaf.F90`, `finalize_pdaf.F90` and `parser_mpi.F90` from `tutorial/online_2D_serialmodel`.
     791. Insert `CALL init_parallel_pdaf(0, 1)` at the beginning of the main program. This routine will also call `MPI_Init`.
     801. Insert `CALL finalize_pdaf()` at the end of the main program. This routine will also finalize MPI.
     811. The number of model tasks in variable `n_modeltasks` is determined in `init_parallel_pdaf` by command line parsing (it is parsing for `dim_ens`, thus setting `-dim_ens N_MODELTASKS`, where N_MODELTASKS should be the ensemble size). One could also read the value from a configuration file.
     82
     83
     84=== Details on adapting a serial model ===
     85
     86If the numerical model is not parallelized (i.e. serial), we need to add the parallelization for the ensemble. We follow here the approach used in the tutorial code `tutorial/online_2D_serialmodel`. The files `mod_parallel_pdaf.F90`, `init_parallel_pdaf.F90`, `finalize_pdaf.F90` (and `parser_mpi.F90`) can be directly used. Note, the `init_parallel_pdaf` uses command-line parsing (from `parser_mpi.F90`) to read the number of model tasks (`n_modeltasks`) from the command line (specifying `-dim_ens N_MODELTASKS`, where N_MODELTASKS should be the ensemble size). One can replace this, e.g., by reading from a configuration file.
    7787
    7888In the tutorial code, the parallelization is simply initialized by adding the line