42 integer,
parameter,
public :: MAX_INFO_LEN = 256
52 procedure(event_info_get_info),
deferred :: get_info
60 class(event_info_t),
intent(in) :: this
61 character(len=MAX_INFO_LEN) :: result
71 character(len=MAX_INFO_LEN) :: function_name
72 character(len=ALGO_LABEL_LEN) :: op_label
78 procedure :: event_function_call_constructor
86 character(len=MAX_INFO_LEN) :: name
87 character(len=MAX_INFO_LEN) :: detail
88 class(iteration_counter_t),
allocatable :: iteration
89 character(len=MAX_INFO_LEN) :: action
95 procedure :: event_iteration_update_constructor
103 character(len=MAX_INFO_LEN) :: text
109 procedure :: event_marker_constructor
117 integer,
public :: enter_ID
121 procedure :: event_handle_constructor
126 type(mpi_grp_t) :: mpi_grp
134 integer,
intent(in) :: id
146 character(*),
intent(in) :: name
152 event%function_name = name
154 if (
present(op))
then
155 event%op_label = op%label
157 event%op_label =
"NULL"
166 character(len=MAX_INFO_LEN) ::
info
170 info =
"type: function_call | function: " // trim(this%function_name)
171 if (this%op_label /=
"NULL")
then
172 info = trim(
info) //
" | operation: " // trim(this%op_label)
181 character(*),
intent(in) :: name
182 character(*),
intent(in) :: detail
184 character(len=*),
intent(in) :: action
189 event%iteration = iteration
191 event%detail = detail
192 event%action = action
200 character(len=MAX_INFO_LEN) ::
info
204 write(
info,
'("type: clock_update | clock_name: ",a," | clock_detail: ",a," | clock: ",E15.5," | action: ",a)') &
205 trim(this%name), trim(this%detail), this%iteration%value(), trim(this%action)
213 character(*),
intent(in) :: text
226 character(len=MAX_INFO_LEN) ::
info
230 write(
info,
'("type: marker | text: ",a)') trim(this%text)
238 character(*),
intent(in) :: filename
247 if (
debug%propagation_graph .and. mpi_grp%rank == 0)
then
248 iunit =
io_open(filename, namespace, action=
"write", status=
"unknown")
258 if (
debug%propagation_graph .and. mpi_grp%rank == 0)
then
268 class(
namespace_t),
intent(in),
optional :: system_namespace
271 character(len = MAX_NAMESPACE_LEN) :: system_name
275 if (
debug%propagation_graph .and. mpi_grp%rank == 0)
then
277 if (
present(system_namespace))
then
278 system_name =
'.'//trim(system_namespace%get())
279 if (system_name ==
'.') system_name =
''
284 write(iunit,
'("MARKER: ",I10," | system: ",a,"| ",a)' , advance=
'yes') event_id, &
285 trim(system_name), trim(event%get_info())
286 event_id = event_id + 1
295 interaction_iteration, partner_iteration, requested_iteration)
result(handle)
296 class(
namespace_t),
intent(in),
optional :: system_namespace
298 character(*),
optional :: extra
306 character(len = MAX_NAMESPACE_LEN) :: system_name
310 if (
debug%propagation_graph .and. mpi_grp%rank == 0)
then
312 if (
present(system_namespace))
then
313 system_name =
'.'//trim(system_namespace%get())
314 if (system_name ==
'.') system_name =
''
321 write(iunit,
'("IN step: ",I10," | system: ",a,"| ",a)' , advance=
'no') event_id, trim(system_name), trim(event%get_info())
323 if (
present(extra))
then
324 write(iunit,
'(" | ",a)' , advance=
'no') trim(extra)
327 if (
present(system_iteration))
then
328 write(iunit,
'(" | system_clock:", E15.5)' , advance=
'no') system_iteration%value()
331 if (
present(algo_iteration))
then
332 write(iunit,
'(" | algo_clock:", E15.5)' , advance=
'no') algo_iteration%value()
335 if (
present(interaction_iteration))
then
336 write(iunit,
'(" | interaction_clock:", E15.5)' , advance=
'no') interaction_iteration%value()
339 if (
present(partner_iteration))
then
340 write(iunit,
'(" | partner_clock:", E15.5)' , advance=
'no') partner_iteration%value()
343 if (
present(requested_iteration))
then
344 write(iunit,
'(" | requested_clock:", E15.5)' , advance=
'no') requested_iteration%value()
347 write(iunit,
'()' , advance=
'yes')
349 event_id = event_id + 1
357 interaction_iteration, partner_iteration, requested_iteration)
359 character(*),
optional :: extra
360 logical,
optional :: update
367 character(17) :: update_string
371 if (
debug%propagation_graph .and. mpi_grp%rank == 0)
then
373 if (
present(update))
then
375 update_string =
" | updated: true"
377 update_string =
" | updated: false"
383 write(iunit,
'("OUT step: ",I10," | closes: ",I10)', advance=
'no') &
384 event_id, handle%enter_ID
386 if (
present(update))
then
388 write(iunit,
'(" | updated: true")', advance=
'no')
390 write(iunit,
'(" | updated: false")', advance=
'no')
394 if (
present(extra))
then
395 write(iunit,
'(" | ",a)' , advance=
'no') trim(extra)
398 if (
present(system_iteration))
then
399 write(iunit,
'(" | system_clock:", E15.5)' , advance=
'no') system_iteration%value()
402 if (
present(algo_iteration))
then
403 write(iunit,
'(" | prop_clock:", E15.5)' , advance=
'no') algo_iteration%value()
406 if (
present(interaction_iteration))
then
407 write(iunit,
'(" | interaction_clock:", E15.5)' , advance=
'no') interaction_iteration%value()
410 if (
present(partner_iteration))
then
411 write(iunit,
'(" | partner_clock:", E15.5)' , advance=
'no') partner_iteration%value()
414 if (
present(requested_iteration))
then
415 write(iunit,
'(" | requested_clock:", E15.5)' , advance=
'no') requested_iteration%value()
418 write(iunit,
'()' , advance=
'yes')
420 event_id = event_id + 1
This module implements the basic elements defining algorithms.
type(debug_t), save, public debug
subroutine, public io_close(iunit, grp)
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
This module implements the multisystem debug functionality.
type(event_marker_t) function event_marker_constructor(text)
type(event_function_call_t) function event_function_call_constructor(name, op)
character(len=max_info_len) function event_function_call_get_info(this)
subroutine, public multisystem_debug_write_marker(system_namespace, event)
character(len=max_info_len) function event_iteration_update_get_info(this)
type(event_iteration_update_t) function event_iteration_update_constructor(name, detail, iteration, action)
type(event_handle_t) function, public multisystem_debug_write_event_in(system_namespace, event, extra, system_iteration, algo_iteration, interaction_iteration, partner_iteration, requested_iteration)
subroutine, public multisystem_debug_init(filename, namespace, group)
type(event_handle_t) function event_handle_constructor(id)
subroutine, public multisystem_debug_write_event_out(handle, extra, update, system_iteration, algo_iteration, interaction_iteration, partner_iteration, requested_iteration)
character(len=max_info_len) function event_marker_get_info(this)
subroutine, public multisystem_debug_end()
Descriptor of one algorithmic operation.
This class implements the iteration counter used by the multisystem algorithms. As any iteration coun...
This is defined even when running serial.
events marking a function call
handle to keep track of in- out- events
abstract class to specify events in the algorithm execution
events marking an iteration update