This subroutine is used to return the unbalanced suggestions for a given process count (npe). The calculation is performed using the calculate_unbalanced_x and calculate_unbalanced_y subroutines from gs2_layouts. These return the unbalanced decomposition size (difference between the suggested small and large block size for the decomposition) and from this a logical is set to recommend whether the unbalanced decomposition should be used or not.
AJ June 2012
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | npe | |||
integer, | intent(out) | :: | percentage_xxf_unbalanced_amount | |||
integer, | intent(out) | :: | percentage_yxf_unbalanced_amount | |||
logical, | intent(out) | :: | use_unbalanced_xxf | |||
logical, | intent(out) | :: | use_unbalanced_yxf |
subroutine get_unbalanced_suggestions(npe, percentage_xxf_unbalanced_amount, percentage_yxf_unbalanced_amount, &
use_unbalanced_xxf, use_unbalanced_yxf)
use gs2_layouts, only : calculate_unbalanced_x, calculate_unbalanced_y
implicit none
integer, intent(in) :: npe
integer, intent(out) :: percentage_xxf_unbalanced_amount, percentage_yxf_unbalanced_amount
logical, intent(out) :: use_unbalanced_xxf, use_unbalanced_yxf
real :: xxf_unbalanced_amount, yxf_unbalanced_amount
call calculate_unbalanced_x(npe, 0, xxf_unbalanced_amount)
if(xxf_unbalanced_amount .gt. 0) then
use_unbalanced_xxf = .true.
percentage_xxf_unbalanced_amount = int(xxf_unbalanced_amount * 100.0)
else
use_unbalanced_xxf = .false.
percentage_xxf_unbalanced_amount = 0
end if
call calculate_unbalanced_y(npe, 0, yxf_unbalanced_amount)
if(yxf_unbalanced_amount .gt. 0) then
use_unbalanced_yxf = .true.
percentage_yxf_unbalanced_amount = int(yxf_unbalanced_amount * 100.0)
else
use_unbalanced_yxf = .false.
percentage_yxf_unbalanced_amount = 0
end if
end subroutine get_unbalanced_suggestions