This subroutine is used to return the idle processes from the xxf and yxf layouts. Idle processes sometimes occur, dependent on the process count used, because the data domain does not evenly divide by the total number of processes available. These can cause high communications overheads for the non-linear calculations for large numbers of processes so it is useful to print this data out in ingen to let users know which process counts this can happen at for a given input file We currently use an arbitrary cutoff of 10% difference in idle processes to suggest that the unbalanced decomposition functionality should be used to mitigate the impact of this difference.
AJ June 2012
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | npe | |||
real, | intent(out) | :: | idle_percentage | |||
logical, | intent(out) | :: | use_unbalanced |
subroutine get_idle_processes(npe, idle_percentage, use_unbalanced)
use gs2_layouts, only : calculate_idle_processes
implicit none
integer, intent(in) :: npe
real, intent(out) :: idle_percentage
logical, intent(out) :: use_unbalanced
call calculate_idle_processes(npe, idle_percentage)
! This 0.1 represents the arbitrary 10% difference threshold discussed above.
if(idle_percentage .gt. 0.1) then
use_unbalanced = .true.
else
use_unbalanced = .false.
end if
idle_percentage = idle_percentage * 100
end subroutine get_idle_processes