Skip to content
Snippets Groups Projects
Commit 76bd2469 authored by Benjamin Cumming's avatar Benjamin Cumming
Browse files

fix invalid memory access

parent 1f13849d
No related branches found
No related tags found
No related merge requests found
......@@ -84,21 +84,15 @@ int main(int argc, char** argv) {
m.attach_sampler(probe.id, make_trace_sampler(traces.back().get(), sample_dt));
}
m.print_spikes();
// dummy run of the model for one step to ensure that profiling is consistent
m.run(options.dt, options.dt);
// reset the model
m.reset();
std::cout << "\n";
m.print_spikes();
// which requires resetting the sources
// rest the source spikes
for (auto source : local_sources) {
m.add_artificial_spike({source, 0});
}
std::cout << "\n";
m.print_spikes();
// run model
m.run(options.tfinal, options.dt);
......
......@@ -83,8 +83,12 @@ public:
communicator_.reset();
current_events().clear();
future_events().clear();
for(auto& q : current_events()) {
q.clear();
}
for(auto& q : future_events()) {
q.clear();
}
current_spikes().clear();
previous_spikes().clear();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment