Skip to content
Snippets Groups Projects
Commit 61ee3f99 authored by w.klijn's avatar w.klijn
Browse files

Move local spike exchange to model

parent abe9ee44
No related branches found
No related tags found
No related merge requests found
......@@ -92,11 +92,8 @@ public:
/// events in each queue are all events that must be delivered to targets in that cell
/// group as a result of the global spike exchange.
std::vector<event_queue> exchange(const std::vector<spike_type>& local_spikes,
std::function<void (const std::vector<spike_type>&)> local_export_callback,
std::function<void(const std::vector<spike_type>&)> global_export_callback)
{
local_export_callback(local_spikes);
// global all-to-all to gather a local copy of the global spike list on each node.
auto global_spikes = communication_policy_.gather_spikes( local_spikes );
num_spikes_ += global_spikes.size();
......
......@@ -167,9 +167,9 @@ public:
auto exchange = [&] () {
PE("stepping", "exchange");
auto local_spikes = previous_spikes().gather();
exporter_->local_export_callback(local_spikes);
future_events() = communicator_.exchange(local_spikes,
// send the exporter function as pointers to export
[&](const std::vector<spike_type>& spikes) { exporter_->local_export_callback(spikes); },
[&] (const std::vector<spike_type>& spikes){ exporter_->global_export_callback(spikes); });
PL(2);
};
......
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