Skip to content

Commit

Permalink
Fixed event recording for general tracers (fixes #44)
Browse files Browse the repository at this point in the history
  • Loading branch information
chschulte committed Mar 20, 2019
1 parent e733699 commit b1e0383
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
9 changes: 9 additions & 0 deletions changelog.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ Date: 2019-??-??
[DESCRIPTION]
Let's see.

[ENTRY]
Module: kernel
What: change
Rank: major
Thanks: Conrad Drescher
[DESCRIPTION]
The logic for recording events for general tracers was seriously
broken as events after a call to status() have been ignored.

[ENTRY]
Module: float
What: bug
Expand Down
13 changes: 9 additions & 4 deletions gecode/kernel/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,7 @@ namespace Gecode {
d_stable: ;
} else {
// Support disabled propagators and tracing
// Find a non-disabled tracer recorder (possibly null)
TraceRecorder* tr = findtracerecorder();
ViewTraceInfo vti; vti.other();

#define GECODE_STATUS_TRACE(q,s) \
if ((tr != NULL) && (tr->events() & TE_PROPAGATE) && \
(tr->filter()(p->group()))) { \
Expand All @@ -395,12 +393,16 @@ namespace Gecode {
tr->tracer()._propagate(*this,pti); \
}

// Find a non-disabled tracer recorder (possibly null)
TraceRecorder* tr = findtracerecorder();
// Remember post information
ViewTraceInfo vti(pc.p.vti);
goto t_unstable;

t_execute:
stat.propagate++;
if (p->disabled())
goto t_put_into_idle;
vti = pc.p.vti;
pc.p.vti.propagator(*p);
// Keep old modification event delta
med_o = p->u.med;
Expand Down Expand Up @@ -463,8 +465,11 @@ namespace Gecode {
GECODE_NEVER;
}
t_stable:
// Restore post information
pc.p.vti = vti;

#undef GECODE_STATUS_TRACE

}
}

Expand Down

0 comments on commit b1e0383

Please sign in to comment.