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 | |||
logical, | intent(in), | optional | :: | onlyxoryfac |
subroutine report_idle_procs(npe, distchar, onlyxoryfac)
implicit none
integer, intent(in) :: npe
character(*), intent(in) :: distchar
logical, optional, intent(in) :: onlyxoryfac
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
type(proc_layout_type), dimension(:), allocatable :: sweet_spots_temp
call get_idle_processes(npe, idle_percentage, use_unbalanced)
procl%nproc = npe
procl%split_char = distchar
procl%percent_xxf_2_yxf = idle_percentage
if(use_unbalanced) then
call get_unbalanced_suggestions(npe, percentage_xxf_unbalanced_amount, percentage_yxf_unbalanced_amount, use_unbalanced_xxf, use_unbalanced_yxf)
if(present(onlyxoryfac)) then
if(onlyxoryfac) then
write (report_unit, fmt="('| ',i8,' | ',a3,' | ',i3,' | ',L1,' | ',i3,' | ',L1,' | ',i3,' |')") &
npe, distchar, INT(idle_percentage), use_unbalanced_xxf, percentage_xxf_unbalanced_amount, use_unbalanced_yxf, percentage_yxf_unbalanced_amount
else
write (report_unit, fmt="('| ',i8,'(*)| ',a3,' | ',i3,' | ',L1,' | ',i3,' | ',L1,' | ',i3,' |')") &
npe, distchar, INT(idle_percentage), use_unbalanced_xxf, percentage_xxf_unbalanced_amount, use_unbalanced_yxf, percentage_yxf_unbalanced_amount
end if
else
write (report_unit, fmt="('| ',i8,' | ',a3,' | ',i3,' | ',L1,' | ',i3,' | ',L1,' | ',i3,' |')") &
npe, distchar, INT(idle_percentage), use_unbalanced_xxf, percentage_xxf_unbalanced_amount, use_unbalanced_yxf, percentage_yxf_unbalanced_amount
end if
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
if(present(onlyxoryfac)) then
if(onlyxoryfac) then
write (report_unit, fmt="('| ',i8,' | ',a3,' | ',i3,' | | | | |')") &
npe, distchar, INT(idle_percentage)
else
write (report_unit, fmt="('| ',i8,'(*)| ',a3,' | ',i3,' | | | | |')") &
npe, distchar, INT(idle_percentage)
end if
else
write (report_unit, fmt="('| ',i8,' | ',a3,' | ',i3,' | | | | |')") &
npe, distchar, INT(idle_percentage)
end if
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
n_sweet_spots = n_sweet_spots + 1
sweet_spots(n_sweet_spots) = procl
allocate(sweet_spots_temp(n_sweet_spots))
sweet_spots_temp = sweet_spots
deallocate(sweet_spots)
allocate(sweet_spots(n_sweet_spots+1))
sweet_spots(1:n_sweet_spots) = sweet_spots_temp(:)
end subroutine report_idle_procs