subroutinelocate_sourcesprivate
subroutine locate_sources(site)
Find the code of each procedure and type in the text of its file. Files are handled in parallel.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| site | type(site_t) | inout | the site |
Calls
Source
Show the code
subroutine locate_sources(site)
type(site_t), intent(inout) :: site !! the site
integer, allocatable :: ids(:), starts(:)
integer :: k, n, runs, r, file
allocate (ids(site%p%list%n), starts(site%p%list%n + 1))
n = 0
runs = 0
file = 0
do k = 1, site%p%list%n
associate (e => site%p%list%box(k)%e)
if (.not. is_procedure(e%kind) .and. e%kind /= E_TYPE) cycle
if (allocated(e%external_url) .or. .not. e%visible) cycle
if (.not. wants_source(site, k)) cycle
n = n + 1
ids(n) = k
if (e%file /= file) then
file = e%file
runs = runs + 1
starts(runs) = n
end if
end associate
end do
starts(runs + 1) = n + 1
!$omp parallel do schedule(dynamic) num_threads(max(1, site%s%parallel)) default(shared) private(r)
do r = 1, runs
call locate_in_file(site, ids(starts(r):starts(r + 1) - 1))
end do
!$omp end parallel do
end subroutine locate_sources