| 51 | |
| 52 | === Simplified parallelization with PDAF 3 interface === |
| 53 | |
| 54 | The PDAF3 interface provides the routines `PDAF3_set_parallel` and `PDAF3_init` to separate the initialization of parallelization variables from the actual initialization of PDAF. |
| 55 | |
| 56 | The routine `PDAF3_set_parallel` provides the parallelization variables to PDAF. It is called at the end of the routine `init_parallel_pdaf`, where the parallelization variables are set in the user code. The routine `PDAF3_init` replaces the previous routine `PDAF_init` and has a shorted interface not including parallelization variables. This approach simplifies the code. |
| 57 | |
| 58 | The tutorial examples, e.g. the files `init_parallel_pdaf.F90` and `init_pdaf.F90` in `tutorial/offline_2D_serial/`, show the implementation. Documentation is provided at [wiki:PDAF3_set_parallel] and [wiki:PDAF3_init]. |
| 59 | |
| 60 | === Possbility to implement without MPI in the user code === |
| 61 | |
| 62 | This aspect is particularly relevant for the offline-coupled mode: If the program is only intended to be used with OpenMP parallelization, but not using a decomposition with MPI, one can omit the call to `init_parallel_pdaf` if `PDAF3_init` is used for the PDAF initialization and if `PDAF_deallocatez is called at the end of the program (usually in `finalize_pdaf`). In this approach, the user code includes no indication of parallelization, which simplifies the code. The program still has to be compiled with an MPI library, but all parallelization aspects are handled by PDAF. |