This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Event callback slightly different per report #875
Open
jorblancoa
wants to merge
4
commits into
master
Choose a base branch
from
jblanco/deterministic_reporting
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
554d08e
Event callback slightly different per report
jorblancoa 02654d2
Dont change Binary reports behavior
jorblancoa 4e29f14
Add report time shift only in the first iteration so it doesnt accumu…
jorblancoa d905729
t shift should be a double
jorblancoa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,12 +24,14 @@ ReportEvent::ReportEvent(double dt, | |
double tstart, | ||
const VarsToReport& filtered_gids, | ||
const char* name, | ||
double report_dt) | ||
double report_dt, | ||
int report_index) | ||
: 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 commentThe reason will be displayed to describe this comment to others. Learn more. just to avoid hardcoded factor - what if we replace |
||
nrn_assert(filtered_gids.size()); | ||
step = tstart / dt; | ||
reporting_period = static_cast<int>(report_dt / dt); | ||
|
@@ -74,7 +76,7 @@ void ReportEvent::summation_alu(NrnThread* nt) { | |
|
||
/** on deliver, call ReportingLib and setup next event */ | ||
void ReportEvent::deliver(double t, NetCvode* nc, NrnThread* nt) { | ||
/* reportinglib is not thread safe */ | ||
/* reportinglib is not thread safe */ | ||
#pragma omp critical | ||
{ | ||
summation_alu(nt); | ||
|
@@ -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 commentThe 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 |
||
step++; | ||
// Apply shift only in the first iteration so it doesn't accumulate | ||
report_t_shift_ = 0; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 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.