This subroutine wraps up the output functionality for the code that creates the list of suggested process counts for the linear computation and checks whether those process counts work well for the non-linear calculations as well.
The optional parameter onlyxoryfac (which is a logical) is used to highlight process counts that have been generated using code which looks for the factors of kx*ky rather than kx and ky separately. This is only currently used for layouts that start with x and y (for instance xyles or yxles).
AJ June 2012
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | npe | |||
character(len=*), | intent(in) | :: | distchar | |||
integer, | intent(in) | :: | report_unit | |||
logical, | intent(in), | optional | :: | onlyxoryfac |
subroutine report_idle_procs(npe, distchar, report_unit, onlyxoryfac)
use optionals, only: get_option_with_default
implicit none
integer, intent(in) :: npe, report_unit
character(*), intent(in) :: distchar
logical, optional, intent(in) :: onlyxoryfac
logical :: onlyxoryfac_local
integer :: percentage_xxf_unbalanced_amount, percentage_yxf_unbalanced_amount
logical :: use_unbalanced_xxf, use_unbalanced_yxf, use_unbalanced
real :: idle_percentage
type(proc_layout_type) :: procl
character(len = 3) :: xandy_mark
call get_idle_processes(npe, idle_percentage, use_unbalanced)
procl%nproc = npe
procl%percent_xxf_2_yxf = idle_percentage
onlyxoryfac_local = get_option_with_default(onlyxoryfac, .true.)
xandy_mark = ' '
if (.not. onlyxoryfac_local) xandy_mark = '(*)'
if(use_unbalanced) then
call get_unbalanced_suggestions(npe, percentage_xxf_unbalanced_amount, percentage_yxf_unbalanced_amount, use_unbalanced_xxf, use_unbalanced_yxf)
write (report_unit, fmt="('| ',i8,' ',a3,' | ',a3,' | ',i3,' | ',L1,' | ',i3,' | ',L1,' | ',i3,' |')") &
npe, xandy_mark, distchar, INT(idle_percentage), use_unbalanced_xxf, percentage_xxf_unbalanced_amount, use_unbalanced_yxf, percentage_yxf_unbalanced_amount
procl%should_use_unbalanced_xxf = use_unbalanced_xxf
procl%percentage_xxf_unbalanced_amount = percentage_xxf_unbalanced_amount
procl%should_use_unbalanced_yxf = use_unbalanced_yxf
procl%percentage_yxf_unbalanced_amount = percentage_yxf_unbalanced_amount
else
write (report_unit, fmt="('| ',i8,' ',a3,' | ',a3,' | ',i3,' | | | | |')") &
npe, xandy_mark, distchar, INT(idle_percentage)
procl%should_use_unbalanced_xxf = .false.
procl%percentage_xxf_unbalanced_amount = 0.0
procl%should_use_unbalanced_yxf = .false.
procl%percentage_yxf_unbalanced_amount = 0.0
end if
sweet_spots = [sweet_spots, procl]
end subroutine report_idle_procs