KronLinInv  0.3
Kronecker-product-based linear inversion

◆ spreadwork()

subroutine parautil::spreadwork ( integer, intent(in)  nit,
integer, intent(in)  nunits,
integer, dimension(:), intent(out), allocatable  scheduling,
integer, dimension(:,:), intent(out), allocatable  looping,
integer, intent(in)  startpoint 
)

Definition at line 163 of file ompi_kronlininv.f08.

163  integer,intent(in) :: nit,nunits,startpoint
164  integer,allocatable,intent(out) :: scheduling(:),looping(:,:)
165  integer :: i,nitcpu,resto
166  if (nit<=nunits) then
167  write(*,*) myrank,": spredwork(): nit<=nunits"
168  write(*,*) nit,nunits
169  stop
170  end if
171  if (allocated(scheduling) ) deallocate(scheduling)
172  if (allocated(looping)) deallocate(looping)
173  allocate(scheduling(nunits),looping(nunits,2))
174 
175  !! compute distribution of workload for Nb
176  nitcpu = nit/nunits
177  scheduling(:) = nitcpu
178  resto = mod(nit,nunits)
179 
180  !! spread the remaining workload
181  scheduling(1:resto) = scheduling(1:resto) + 1
182  looping(1,:) = [startpoint,startpoint+scheduling(1)-1]
183  do i=2,nunits
184  looping(i,1) = sum(scheduling(1:i-1)) + startpoint
185  looping(i,2) = sum(scheduling(1:i)) + startpoint - 1
186  end do
187 
188  !!print*,myrank,": loop 1",looping(:,1),&
189  !! "| loop 2",looping(:,2)," | sched ",scheduling
190 
integer, public, protected myrank
Here is the caller graph for this function: