44 logical,
public :: info
45 logical,
public :: trace
46 logical,
public :: trace_term
47 logical,
public :: trace_file
48 logical :: extra_checks
49 logical,
public :: interaction_graph
50 logical,
public :: interaction_graph_full
51 logical,
public :: propagation_graph
55 type(debug_t),
save :: debug
58 integer,
parameter :: unit_offset = 1000
63 type(debug_t),
intent(out) :: this
64 type(namespace_t),
intent(in) :: namespace
66 character(len=256) :: node_hook
67 logical :: file_exists, mpi_debug_hook
103 call parse_variable(namespace,
'Debug', option__debug__no, this%bits)
127 if (mpi_debug_hook)
then
130 write(stdout,
'(a,i6,a,i6.6,20x,a)')
'* I ',sec,
'.',usec,
' | MPI debug hook'
132 write(stdout,
'(a,i3,a)')
'node:',
mpi_world%rank,
' In debug hook'
134 file_exists = .false.
136 do while (.not. file_exists)
137 inquire(file=
'node_hook.'//node_hook, exist=file_exists)
139 write(stdout,
'(a,i3,a)')
'node:',
mpi_world%rank, &
140 ' - still sleeping. To release me touch: node_hook.'//trim(node_hook)
143 write(stdout,
'(a,i3,a)')
'node:',
mpi_world%rank,
' Leaving debug hook'
145 call loct_rm(
'node_hook.'//trim(node_hook))
149 write(stdout,
'(a,i6,a,i6.6,20x,a)')
'* O ', sec,
'.', usec,
' | MPI debug hook'
158 type(
debug_t),
intent(inout) :: this
162 this%trace_term = .
true.
163 this%trace_file = .
true.
164 this%interaction_graph = .
true.
165 this%interaction_graph_full = .
true.
166 this%propagation_graph = .
true.
173 type(
debug_t),
intent(inout) :: this
184 character(len=6) :: filenum
187 write(filenum,
'(i6.6)') iunit - unit_offset
189 call loct_rm(
'debug/debug_trace.node.'//filenum)
196 integer,
intent(out) :: iunit
198 character(len=6) :: filenum
201 write(filenum,
'(i6.6)') iunit - unit_offset
203 open(iunit, file =
'debug/debug_trace.node.'//filenum, &
204 action=
'write', status=
'unknown', position=
'append')
211 type(
debug_t),
intent(inout) :: this
213 this%info = (
bitand(this%bits, option__debug__info) /= 0)
214 this%trace_term = (
bitand(this%bits, option__debug__trace_term) /= 0)
215 this%trace_file = (
bitand(this%bits, option__debug__trace_file) /= 0)
216 this%trace = (
bitand(this%bits, option__debug__trace) /= 0) .or. this%trace_term .or. this%trace_file
217 this%extra_checks = (
bitand(this%bits, option__debug__extra_checks) /= 0) .or. this%trace_term .or. this%trace_file
218 this%interaction_graph = (
bitand(this%bits, option__debug__interaction_graph) /= 0)
219 this%interaction_graph_full = (
bitand(this%bits, option__debug__interaction_graph_full) /= 0)
220 this%propagation_graph = (
bitand(this%bits, option__debug__propagation_graph) /= 0)
227 integer,
intent(inout) :: sec
228 integer,
intent(inout) :: usec
239 subroutine time_diff(sec1, usec1, sec2, usec2)
240 integer,
intent(in) :: sec1
241 integer,
intent(in) :: usec1
242 integer,
intent(inout) :: sec2
243 integer,
intent(inout) :: usec2
248 if (usec2 - usec1 < 0)
then
249 usec2 = 1000000 + usec2
250 if (sec2 >= sec1)
then
256 if (sec2 >= sec1)
then
259 usec2 = usec2 - usec1
subroutine, public debug_enable(this)
type(debug_t), save, public debug
subroutine, public debug_open_trace(iunit)
subroutine, public epoch_time_diff(sec, usec)
subroutine from_bits(this)
subroutine, public debug_init(this, namespace)
subroutine, public debug_disable(this)
subroutine time_diff(sec1, usec1, sec2, usec2)
Computes t2 <- t2-t1. sec1,2 and usec1,2 are seconds,microseconds of t1,2.
subroutine, public debug_delete_trace()
integer, public s_epoch_sec
global epoch time (time at startup)
integer, public s_epoch_usec
subroutine, public mpi_debug_init(rank, info)
type(mpi_grp_t), public mpi_world
type(namespace_t), public global_namespace