decompose_proc
–
Given the total number of available processors and the number of dimensions,
determine the number of processors along each dimension.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | num_procs |
number of processors |
||
integer, | intent(out) | :: | proc_sizes(2) |
array for the num of procs in each dimension |
subroutine decompose_proc(num_procs, proc_sizes) ! integer, intent(in) :: num_procs !! number of processors integer, intent(out) :: proc_sizes(2) !! array for the num of procs in each dimension !------------------------------------------------------------------------------ proc_sizes(1) = INT(FLOOR(SQRT(num_procs*1.0))) DO IF (MOD(num_procs, proc_sizes(1)) == 0) THEN proc_sizes(2) = INT(num_procs / proc_sizes(1)) EXIT END IF proc_sizes(1) = proc_sizes(1) + 1 END DO end subroutine decompose_proc