From abe9ee44af83485fa6b9cd7810488fbeac59480b Mon Sep 17 00:00:00 2001
From: "w.klijn" <nonoice@gmail.com>
Date: Fri, 12 Aug 2016 13:20:09 +0200
Subject: [PATCH] Rename callbacks

---
 mechanisms/generate.sh               |  2 +-
 nrn/generate_validation.sh           | 12 +++++++-----
 src/communication/communicator.hpp   |  8 ++++----
 src/communication/export_manager.hpp |  4 ++--
 src/model.hpp                        |  4 ++--
 tests/performance/io/disk_io.cpp     |  2 +-
 6 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/mechanisms/generate.sh b/mechanisms/generate.sh
index 8771b55c..89dfd5e2 100755
--- a/mechanisms/generate.sh
+++ b/mechanisms/generate.sh
@@ -1,4 +1,4 @@
-#!/etc/bash
+#!/usr/bin/env bash
 
 #flags="-t cpu -O"
 flags="-t cpu"
diff --git a/nrn/generate_validation.sh b/nrn/generate_validation.sh
index 5f6cbf95..15149cdd 100755
--- a/nrn/generate_validation.sh
+++ b/nrn/generate_validation.sh
@@ -1,5 +1,7 @@
-python ./soma.py
-python ./ball_and_stick.py
-python ./ball_and_3stick.py
-python ./simple_synapse.py --synapse exp2
-python ./simple_synapse.py --synapse exp
+#!/usr/bin/env bash
+
+python2 ./soma.py
+python2 ./ball_and_stick.py
+python2 ./ball_and_3stick.py
+python2 ./simple_synapse.py --synapse exp2
+python2 ./simple_synapse.py --synapse exp
diff --git a/src/communication/communicator.hpp b/src/communication/communicator.hpp
index 04baca09..d5a82b3d 100644
--- a/src/communication/communicator.hpp
+++ b/src/communication/communicator.hpp
@@ -92,16 +92,16 @@ 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>&)> do_export_local,
-        std::function<void(const std::vector<spike_type>&)> do_export_global)
+        std::function<void (const std::vector<spike_type>&)> local_export_callback,
+        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.
         auto global_spikes = communication_policy_.gather_spikes( local_spikes );
         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.
         // if so, make the events and insert them into the appropriate event list.
diff --git a/src/communication/export_manager.hpp b/src/communication/export_manager.hpp
index 90d4bace..99354ab6 100644
--- a/src/communication/export_manager.hpp
+++ b/src/communication/export_manager.hpp
@@ -83,7 +83,7 @@ public:
     // Perform a export of local spikes, typically used for exporting to multi-
     // ple files from each rank individually.
     // 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
         if (!spike_file_output_) {
@@ -104,7 +104,7 @@ public:
     // Perform a export of global spikes, typically used for exporting spikes
     // from a single rank in a simulation
     // 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_) {
             return;
diff --git a/src/model.hpp b/src/model.hpp
index 9ad1387f..35f332d1 100644
--- a/src/model.hpp
+++ b/src/model.hpp
@@ -169,8 +169,8 @@ public:
                 auto local_spikes = previous_spikes().gather();
                 future_events() = communicator_.exchange(local_spikes,
                     // 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_->do_export_global(spikes); });
+                    [&](const std::vector<spike_type>& spikes) { exporter_->local_export_callback(spikes); },
+                    [&] (const std::vector<spike_type>& spikes){ exporter_->global_export_callback(spikes); });
                 PL(2);
             };
 
diff --git a/tests/performance/io/disk_io.cpp b/tests/performance/io/disk_io.cpp
index f023374f..791cf07d 100644
--- a/tests/performance/io/disk_io.cpp
+++ b/tests/performance/io/disk_io.cpp
@@ -106,7 +106,7 @@ int main(int argc, char** argv)
     for (int idx = 0; idx < nr_repeats; ++idx) {
         int time_start = clock();
 
-        manager.do_export_local(spikes);
+        manager.local_export_callback(spikes);
 
         int time_stop = clock();
         int run_time = (time_stop - time_start);
-- 
GitLab