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
72 character(len=MAX_INFO_LEN) :: function_name
73 character(len=ALGO_LABEL_LEN) :: op_label
79 procedure :: event_function_call_constructor
88 character(len=MAX_INFO_LEN) :: name
89 character(len=MAX_INFO_LEN) :: detail
90 class(iteration_counter_t),
allocatable :: iteration
91 character(len=MAX_INFO_LEN) :: action
97 procedure :: event_iteration_update_constructor
106 character(len=MAX_INFO_LEN) :: text
112 procedure :: event_marker_constructor
121 integer,
public :: enter_ID
138 integer,
intent(in) :: id
150 character(*),
intent(in) :: name
156 event%function_name = name
158 if (
present(op))
then
159 event%op_label = op%label
161 event%op_label =
"NULL"
170 character(len=MAX_INFO_LEN) ::
info
174 info =
"type: function_call | function: " // trim(this%function_name)
175 if (this%op_label /=
"NULL")
then
176 info = trim(
info) //
" | operation: " // trim(this%op_label)
185 character(*),
intent(in) :: name
186 character(*),
intent(in) :: detail
188 character(len=*),
intent(in) :: action
193 event%iteration = iteration
195 event%detail = detail
196 event%action = action
204 character(len=MAX_INFO_LEN) ::
info
208 write(
info,
'("type: clock_update | clock_name: ",a," | clock_detail: ",a," | clock: ",E15.5," | action: ",a)') &
209 trim(this%name), trim(this%detail), this%iteration%value(), trim(this%action)
217 character(*),
intent(in) :: text
230 character(len=MAX_INFO_LEN) ::
info
234 write(
info,
'("type: marker | text: ",a)') trim(this%text)
242 character(*),
intent(in) :: filename
251 if (
debug%propagation_graph .and.
mpi_grp%is_root())
then
252 iunit =
io_open(filename, namespace, action=
"write", status=
"unknown")
262 if (
debug%propagation_graph .and.
mpi_grp%is_root())
then
272 class(
namespace_t),
intent(in),
optional :: system_namespace
275 character(len = MAX_NAMESPACE_LEN) :: system_name
279 if (
debug%propagation_graph .and.
mpi_grp%is_root())
then
281 if (
present(system_namespace))
then
282 system_name =
'.'//trim(system_namespace%get())
283 if (system_name ==
'.') system_name =
''
288 write(
iunit,
'("MARKER: ",I10," | system: ",a,"| ",a)' , advance=
'yes')
event_id, &
289 trim(system_name), trim(event%get_info())
299 interaction_iteration, partner_iteration, requested_iteration)
result(handle)
302 character(*),
optional :: extra
310 character(len = MAX_NAMESPACE_LEN) :: system_name
314 if (
debug%propagation_graph .and.
mpi_grp%is_root())
then
316 if (
present(system_namespace))
then
317 system_name =
'.'//trim(system_namespace%get())
318 if (system_name ==
'.') system_name =
''
325 write(
iunit,
'("IN step: ",I10," | system: ",a,"| ",a)' , advance=
'no')
event_id, trim(system_name), trim(event%get_info())
327 if (
present(extra))
then
328 write(
iunit,
'(" | ",a)' , advance=
'no') trim(extra)
331 if (
present(system_iteration))
then
332 write(
iunit,
'(" | system_clock:", E15.5)' , advance=
'no') system_iteration%value()
335 if (
present(algo_iteration))
then
336 write(
iunit,
'(" | algo_clock:", E15.5)' , advance=
'no') algo_iteration%value()
339 if (
present(interaction_iteration))
then
340 write(
iunit,
'(" | interaction_clock:", E15.5)' , advance=
'no') interaction_iteration%value()
343 if (
present(partner_iteration))
then
344 write(
iunit,
'(" | partner_clock:", E15.5)' , advance=
'no') partner_iteration%value()
347 if (
present(requested_iteration))
then
348 write(
iunit,
'(" | requested_clock:", E15.5)' , advance=
'no') requested_iteration%value()
351 write(
iunit,
'()' , advance=
'yes')
361 interaction_iteration, partner_iteration, requested_iteration)
363 character(*),
optional :: extra
364 logical,
optional :: update
371 character(17) :: update_string
375 if (
debug%propagation_graph .and.
mpi_grp%is_root())
then
377 if (
present(update))
then
379 update_string =
" | updated: true"
381 update_string =
" | updated: false"
387 write(
iunit,
'("OUT step: ",I10," | closes: ",I10)', advance=
'no') &
390 if (
present(update))
then
392 write(
iunit,
'(" | updated: true")', advance=
'no')
394 write(
iunit,
'(" | updated: false")', advance=
'no')
398 if (
present(extra))
then
399 write(
iunit,
'(" | ",a)' , advance=
'no') trim(extra)
402 if (
present(system_iteration))
then
403 write(
iunit,
'(" | system_clock:", E15.5)' , advance=
'no') system_iteration%value()
406 if (
present(algo_iteration))
then
407 write(
iunit,
'(" | prop_clock:", E15.5)' , advance=
'no') algo_iteration%value()
410 if (
present(interaction_iteration))
then
411 write(
iunit,
'(" | interaction_clock:", E15.5)' , advance=
'no') interaction_iteration%value()
414 if (
present(partner_iteration))
then
415 write(
iunit,
'(" | partner_clock:", E15.5)' , advance=
'no') partner_iteration%value()
418 if (
present(requested_iteration))
then
419 write(
iunit,
'(" | requested_clock:", E15.5)' , advance=
'no') requested_iteration%value()
422 write(
iunit,
'()' , advance=
'yes')
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()
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
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