Initialise decomposition from config, with optional auto-factoring
If cfg%px and cfg%py are both 1 but nprocs > 1, automatically computes an optimal process grid. Updates cfg%px and cfg%py with the chosen values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(decomp_t), | intent(out) | :: | d |
Decomposition descriptor to populate |
||
| type(config_t), | intent(inout) | :: | cfg |
Configuration (px, py may be updated) |
||
| integer, | intent(in) | :: | nprocs |
Total number of MPI ranks |
||
| integer, | intent(in) | :: | rank |
This MPI rank (0-based) |
subroutine decomp_init_from_config(d, cfg, nprocs, rank) !! Initialise decomposition from config, with optional auto-factoring !! !! If cfg%px and cfg%py are both 1 but nprocs > 1, automatically !! computes an optimal process grid. Updates cfg%px and cfg%py !! with the chosen values. type(decomp_t), intent(out) :: d !! Decomposition descriptor to populate type(config_t), intent(inout) :: cfg !! Configuration (px, py may be updated) integer, intent(in) :: nprocs !! Total number of MPI ranks integer, intent(in) :: rank !! This MPI rank (0-based) ! Auto-compute process grid if user didn't specify one if (nprocs > 1 .and. cfg%px == 1 .and. cfg%py == 1) then call decomp_auto_factor(nprocs, cfg%nx, cfg%ny, cfg%px, cfg%py) end if call decomp_init(d, cfg%nx, cfg%ny, cfg%px, cfg%py, rank) end subroutine decomp_init_from_config