32 SUBROUTINE init (self, task_list)
43 SUBROUTINE execute (self, task_list, test)
48 class(
link_t),
pointer:: link, nbor
49 logical:: ready, mytask
51 integer,
save:: itimer=0
53 self%task_list => task_list
62 do while (task_list%na>0 .and. wallclock()-start < io%job_seconds)
63 call trace%begin (
'dispatcher1_t%execute', itimer=itimer)
64 if (self%verbose>2)
write (io_unit%dispatcher,*) wallclock(),
'check_mpi' 65 call task_list%check_mpi()
66 call self%process%update (task_list)
71 link => task_list%head
72 do while (
associated(link))
74 if (link%task%state>2)
then 75 if (self%verbose>3)
write (io_unit%dispatcher,*) wallclock(), link%task%id,
'busy' 76 else if (link%task%is_set (bits%internal) .or. link%task%is_set (bits%boundary))
then 79 do while (
associated(nbor))
81 print *,
'dispatcher1: task, nbor, is_ahead =', link%task%id, nbor%task%id, nbor%task%is_ahead_of (link%task)
82 ready = ready .and. nbor%task%is_ahead_of (link%task)
84 if (self%verbose>2)
write (io_unit%dispatcher,*) wallclock(), link%task%id,
'failed', nbor%task%id, nbor%task%time, link%task%time
90 print *,
'dispatcher1: task, ready =', link%task%id, ready
95 mpi_mesg%n_ready = mpi_mesg%n_ready+1
96 if (link%task%state<2)
then 100 task_list%nq = task_list%nq+1
106 if (self%verbose>2)
write (io_unit%dispatcher,*) wallclock(), link%task%id,
'my task' 107 call task_list%check_mpi()
108 if (self%verbose>2)
write (io_unit%dispatcher,*) wallclock(), link%task%id,
'check task_list' 109 if (self%verbose>1)
write (io_unit%log,*) wallclock(), link%task%id,
'update start' 110 if (io%verbose > 1) &
111 print *, omp%thread,
'dispatche1: updating task', link%task%id
112 call task_list%update (link, test)
114 task_list%nq = task_list%nq-1
117 if (self%verbose>1)
write (io_unit%log,*) wallclock(), link%task%id,
'update end' 122 else if (omp%nthreads>2)
then 123 if (self%n_spawn <= omp%nthreads+1)
then 124 if (self%verbose>1)
write (io_unit%dispatcher,*) wallclock(), link%task%id,
'spawning' 125 if (self%verbose>2)
write (io_unit%log,*) wallclock(), link%task%id,
'spawn begin' 129 self%n_spawn = self%n_spawn + 1
130 if (io%verbose > 2) &
131 print *, omp%thread,
'dispatche1: spawning task', link%task%id
133 call self%task_list%check_mpi ()
134 if (self%verbose>2)
write (io_unit%log,*) wallclock(), link%task%id,
'check task_list' 135 if (self%verbose>1)
write (io_unit%log,*) wallclock(), link%task%id,
'update start', self%n_spawn
136 if (io%verbose > 1) &
137 print *, omp%thread,
'dispatche1: updating task', link%task%id
138 call task_list%update (link, test)
142 self%n_spawn = self%n_spawn - 1
143 if (self%verbose>1)
write (io_unit%log,*) wallclock(), link%task%id,
'update end', self%n_spawn
146 task_list%nq = task_list%nq-1
147 if (self%verbose>2)
write (io_unit%log,*) wallclock(), link%task%id,
'spawn end', self%n_spawn
149 if (self%verbose>2)
write (io_unit%log,*) wallclock(), link%task%id,
'taskyield' 156 if (self%verbose>2)
write (io_unit%dispatcher,*) wallclock(), link%task%id,
'updating' 157 if (self%verbose>2)
write (io_unit%log,*) wallclock(), link%task%id,
'update start' 158 call task_list%update (link, test)
160 task_list%nq = task_list%nq-1
161 if (self%verbose>2)
write (io_unit%log,*) wallclock(), link%task%id,
'update end' 167 if (self%verbose>0)
call flush(io_unit%dispatcher)
169 call trace%end (itimer)
174 call mpi_mesg%diagnostics(1)
175 call toc (
'wall time', timer%n_update, time=start)
176 END SUBROUTINE execute
178 END MODULE dispatcher1_mod
Each thread uses a private timer data type, with arrays for start time and total time for each regist...
Support tic/toc timing, as in MATLAB, and accurate wallclock() function. The timing is generally much...
Data type for computing global average, while using only nearest node nbor communication.
Data type to keep and maintain information on MPI processes.
Task list data type, with methods for startup and updates. Message handling is inherited from the tas...
This index file has slot indices for all solver, all initially equal to zero It is the responsibility...
Module with list handling for generic class task_t objects.