From d6218b18d9ada2c0b3928a9992b81ebc0eba0f2f Mon Sep 17 00:00:00 2001
From: "w.klijn" <nonoice@gmail.com>
Date: Tue, 16 Aug 2016 16:53:59 +0200
Subject: [PATCH] Fix namespace exporter fix importing of file export
 parameters from json

---
 miniapp/io.cpp                   | 23 ++++++++++++-----------
 miniapp/miniapp.cpp              |  2 +-
 tests/performance/io/disk_io.cpp |  4 ++--
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/miniapp/io.cpp b/miniapp/io.cpp
index d7f328e7..fbc70ef8 100644
--- a/miniapp/io.cpp
+++ b/miniapp/io.cpp
@@ -127,7 +127,7 @@ cl_options read_options(int argc, char** argv) {
         util::nothing,  // trace_max_gid
 
         // spike_output_parameters:
-        false,      // no spike output
+        false,      // spike output
         false,      // single_file_per_simulation
         true,       // Overwrite outputfile if exists
         "./",       // output path
@@ -208,6 +208,17 @@ cl_options read_options(int argc, char** argv) {
                     update_option(options.probe_soma_only, fopts, "probe_soma_only");
                     update_option(options.trace_prefix, fopts, "trace_prefix");
                     update_option(options.trace_max_gid, fopts, "trace_max_gid");
+
+                    // Parameters for spike output
+                    update_option(options.spike_file_output, fopts, "spike_file_output");
+                    if (options.spike_file_output) {
+                        update_option(options.single_file_per_rank, fopts, "single_file_per_rank");
+                        update_option(options.over_write, fopts, "over_write");
+                        update_option(options.output_path, fopts, "output_path");
+                        update_option(options.file_name, fopts, "file_name");
+                        update_option(options.file_extention, fopts, "file_extention");
+                    }
+
                 }
                 catch (std::exception& e) {
                     throw model_description_error(
@@ -260,18 +271,8 @@ cl_options read_options(int argc, char** argv) {
                 else {
                     fopts["trace_max_gid"] = nullptr;
                 }
-
                 fid << std::setw(3) << fopts << "\n";
 
-                // Parameters for spike output
-                options.spike_file_output = fopts["spike_file_output"];
-                if (options.spike_file_output) {
-                    options.single_file_per_rank = fopts["single_file_per_rank"];
-                    options.over_write = fopts["over_write"];
-                    options.output_path = fopts["output_path"].get<std::string>();;
-                    options.file_name = fopts["file_name"].get<std::string>();;
-                    options.file_extention = fopts["file_extention"].get<std::string>();;
-                }
             }
             catch (std::exception& e) {
                 throw model_description_error(
diff --git a/miniapp/miniapp.cpp b/miniapp/miniapp.cpp
index f77d96be..d38d3999 100644
--- a/miniapp/miniapp.cpp
+++ b/miniapp/miniapp.cpp
@@ -33,7 +33,7 @@ using lowered_cell = fvm::fvm_cell<double, cell_local_size_type>;
 using model_type = model<lowered_cell>;
 using time_type = model_type::time_type;
 using sample_trace_type = sample_trace<time_type, model_type::value_type>;
-using file_export_type = communication::exporter_spike_file<time_type, global_policy>;
+using file_export_type = io::exporter_spike_file<time_type, global_policy>;
 void banner();
 std::unique_ptr<recipe> make_recipe(const io::cl_options&, const probe_distribution&);
 std::unique_ptr<sample_trace_type> make_trace(cell_member_type probe_id, probe_spec probe);
diff --git a/tests/performance/io/disk_io.cpp b/tests/performance/io/disk_io.cpp
index 8cec6485..5182b0a8 100644
--- a/tests/performance/io/disk_io.cpp
+++ b/tests/performance/io/disk_io.cpp
@@ -22,7 +22,7 @@ using global_policy = communication::global_policy;
 using lowered_cell = fvm::fvm_cell<double, cell_local_size_type>;
 using cell_group_type = cell_group<lowered_cell>;
 using time_type = typename cell_group_type::time_type;
-using spike_type = communication::exporter_spike_file<time_type,
+using spike_type = io::exporter_spike_file<time_type,
     global_policy>::spike_type;
 using timer = util::timer_type;
 
@@ -68,7 +68,7 @@ int main(int argc, char** argv)
     }
 
     // Create the sut
-   communication::exporter_spike_file<time_type, global_policy> exporter(
+   io::exporter_spike_file<time_type, global_policy> exporter(
          "spikes", "./", "gdf", true);
 
     // We need the nr of ranks to calculate the nr of spikes to produce per
-- 
GitLab