-
Notifications
You must be signed in to change notification settings - Fork 39
Event callback slightly different per report #875
base: master
Are you sure you want to change the base?
Conversation
…late in each event
still issues when launching with libsonata-report master |
@@ -88,8 +90,11 @@ void ReportEvent::deliver(double t, NetCvode* nc, NrnThread* nt) { | |||
gids_to_report.data(), | |||
report_path.data()); | |||
#endif | |||
send(t + dt, nc, nt); | |||
// Deterministic event time per report to avoid deadlocks | |||
send(t + dt + report_t_shift_, nc, nt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's the only way to do it without changing the API of reportinglib? it's a bit ugly that we need to add this artificial 1e-6*report_idx
to fix the order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments otherwise LGTM
@@ -155,6 +155,7 @@ std::vector<ReportConfiguration> create_report_configurations(const std::string& | |||
// extra new line: skip | |||
report_conf.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); | |||
} | |||
report.report_index = report.format == "SONATA" ? i : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
report.report_index = report.format == "SONATA" ? i : 0; | |
report.report_index = i; |
I think we don't need to have this specialised for sonata only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing differences in the binary reports in the CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ok!
How many such reports are different? the new logic of "determinist ordering" of report recording seems cleaner right? In that case, I wonder if we should just change the report files.
: dt(dt) | ||
, tstart(tstart) | ||
, report_path(name) | ||
, report_dt(report_dt) | ||
, vars_to_report(filtered_gids) { | ||
, vars_to_report(filtered_gids) | ||
, report_t_shift_(1e-6 * report_index) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to avoid hardcoded factor - what if we replace 1e-6
with dt/1e-3
? i.e. whatever will be the value of dt in the future, we can always have this factor 1e3 times lower.
Description
Enforce deterministic report events