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

Rename callbacks

parent 99942ab5
No related branches found
No related tags found
No related merge requests found
#!/etc/bash #!/usr/bin/env bash
#flags="-t cpu -O" #flags="-t cpu -O"
flags="-t cpu" flags="-t cpu"
......
python ./soma.py #!/usr/bin/env bash
python ./ball_and_stick.py
python ./ball_and_3stick.py python2 ./soma.py
python ./simple_synapse.py --synapse exp2 python2 ./ball_and_stick.py
python ./simple_synapse.py --synapse exp python2 ./ball_and_3stick.py
python2 ./simple_synapse.py --synapse exp2
python2 ./simple_synapse.py --synapse exp
...@@ -92,16 +92,16 @@ public: ...@@ -92,16 +92,16 @@ public:
/// events in each queue are all events that must be delivered to targets in that cell /// 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. /// group as a result of the global spike exchange.
std::vector<event_queue> exchange(const std::vector<spike_type>& local_spikes, std::vector<event_queue> exchange(const std::vector<spike_type>& local_spikes,
std::function<void (const std::vector<spike_type>&)> do_export_local, std::function<void (const std::vector<spike_type>&)> local_export_callback,
std::function<void(const std::vector<spike_type>&)> do_export_global) std::function<void(const std::vector<spike_type>&)> global_export_callback)
{ {
do_export_local(local_spikes); local_export_callback(local_spikes);
// global all-to-all to gather a local copy of the global spike list on each node. // 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 ); auto global_spikes = communication_policy_.gather_spikes( local_spikes );
num_spikes_ += global_spikes.size(); num_spikes_ += global_spikes.size();
do_export_global(global_spikes); global_export_callback(global_spikes);
// check each global spike in turn to see it generates local events. // check each global spike in turn to see it generates local events.
// if so, make the events and insert them into the appropriate event list. // if so, make the events and insert them into the appropriate event list.
......
...@@ -83,7 +83,7 @@ public: ...@@ -83,7 +83,7 @@ public:
// Perform a export of local spikes, typically used for exporting to multi- // Perform a export of local spikes, typically used for exporting to multi-
// ple files from each rank individually. // ple files from each rank individually.
// spikes are buffer before export // spikes are buffer before export
void do_export_local(const std::vector<spike_type>& spikes) void local_export_callback(const std::vector<spike_type>& spikes)
{ {
// TODO: No export needed, so exit // TODO: No export needed, so exit
if (!spike_file_output_) { if (!spike_file_output_) {
...@@ -104,7 +104,7 @@ public: ...@@ -104,7 +104,7 @@ public:
// Perform a export of global spikes, typically used for exporting spikes // Perform a export of global spikes, typically used for exporting spikes
// from a single rank in a simulation // from a single rank in a simulation
// spikes are buffer before export // spikes are buffer before export
void do_export_global(const std::vector<spike_type>& spikes) void global_export_callback(const std::vector<spike_type>& spikes)
{ {
if (!spike_file_output_) { if (!spike_file_output_) {
return; return;
......
...@@ -169,8 +169,8 @@ public: ...@@ -169,8 +169,8 @@ public:
auto local_spikes = previous_spikes().gather(); auto local_spikes = previous_spikes().gather();
future_events() = communicator_.exchange(local_spikes, future_events() = communicator_.exchange(local_spikes,
// send the exporter function as pointers to export // send the exporter function as pointers to export
[&](const std::vector<spike_type>& spikes) { exporter_->do_export_local(spikes); }, [&](const std::vector<spike_type>& spikes) { exporter_->local_export_callback(spikes); },
[&] (const std::vector<spike_type>& spikes){ exporter_->do_export_global(spikes); }); [&] (const std::vector<spike_type>& spikes){ exporter_->global_export_callback(spikes); });
PL(2); PL(2);
}; };
......
...@@ -106,7 +106,7 @@ int main(int argc, char** argv) ...@@ -106,7 +106,7 @@ int main(int argc, char** argv)
for (int idx = 0; idx < nr_repeats; ++idx) { for (int idx = 0; idx < nr_repeats; ++idx) {
int time_start = clock(); int time_start = clock();
manager.do_export_local(spikes); manager.local_export_callback(spikes);
int time_stop = clock(); int time_stop = clock();
int run_time = (time_stop - time_start); int run_time = (time_stop - time_start);
......
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