diff --git a/CMakeLists.txt b/CMakeLists.txt index ad65682d34d7f270467c0d889a86c90928f73742..b8c83fae14cd2789cc9e71d943865ba15c487899 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,10 +123,10 @@ install(TARGETS arbor-public-deps EXPORT arbor-targets) add_subdirectory(ext) -# Auxilary/helper utiliies in `aux` are common across test executables -# and examples. Creates interface library `arbor-aux`. +# Support utiliies in `sup` are common across test executables +# and examples. Creates interface library `arbor-sup`. -add_subdirectory(aux) +add_subdirectory(sup) # Keep track of packages we need to add to the generated CMake config # file for arbor. diff --git a/aux/CMakeLists.txt b/aux/CMakeLists.txt deleted file mode 100644 index 2a23eb46bfbdc36d13659ad45d97bb435201854e..0000000000000000000000000000000000000000 --- a/aux/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(aux-sources - - glob.cpp - ioutil.cpp - json_meter.cpp - path.cpp - spike_emitter.cpp -) - -add_library(arbor-aux ${aux-sources}) -target_compile_options(arbor-aux PRIVATE ${ARB_CXXOPT_ARCH}) -target_link_libraries(arbor-aux PUBLIC ext-json arbor) -target_include_directories(arbor-aux PUBLIC include) -set_target_properties(arbor-aux PROPERTIES OUTPUT_NAME arboraux) diff --git a/example/bench/CMakeLists.txt b/example/bench/CMakeLists.txt index df585f1149141fbf6c275ea0808e3b46f27fe3e4..5f07e0c7474363eac10f3ba55179da6de34e50d9 100644 --- a/example/bench/CMakeLists.txt +++ b/example/bench/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(bench EXCLUDE_FROM_ALL bench.cpp recipe.cpp parameters.cpp) add_dependencies(examples bench) -target_link_libraries(bench PRIVATE arbor arbor-aux ext-tclap ext-json) +target_link_libraries(bench PRIVATE arbor arbor-sup ext-tclap ext-json) diff --git a/example/bench/bench.cpp b/example/bench/bench.cpp index 988b07b04c506f817609fe24bafd50959b1ca03b..1bae7acf7a7817cc5680791a1d8e5f50396147e0 100644 --- a/example/bench/bench.cpp +++ b/example/bench/bench.cpp @@ -18,10 +18,10 @@ #include <arbor/version.hpp> -#include <aux/ioutil.hpp> -#include <aux/json_meter.hpp> +#include <sup/ioutil.hpp> +#include <sup/json_meter.hpp> #ifdef ARB_MPI_ENABLED -#include <aux/with_mpi.hpp> +#include <sup/with_mpi.hpp> #endif #include "parameters.hpp" @@ -34,7 +34,7 @@ int main(int argc, char** argv) { try { #ifdef ARB_MPI_ENABLED - aux::with_mpi guard(argc, argv, false); + sup::with_mpi guard(argc, argv, false); auto context = arb::make_context(arb::proc_allocation(), MPI_COMM_WORLD); { int rank = 0; @@ -48,7 +48,7 @@ int main(int argc, char** argv) { profile::profiler_initialize(context); #endif - std::cout << aux::mask_stream(is_root); + std::cout << sup::mask_stream(is_root); bench_params params = read_options(argc, argv); @@ -81,7 +81,7 @@ int main(int argc, char** argv) { std::ofstream fid; fid.exceptions(std::ios_base::badbit | std::ios_base::failbit); fid.open("meters.json"); - fid << std::setw(1) << aux::to_json(report) << "\n"; + fid << std::setw(1) << sup::to_json(report) << "\n"; } // output profile and diagnostic feedback diff --git a/example/bench/parameters.cpp b/example/bench/parameters.cpp index b9ac4b2f8ffb0819865b3e2ba7a21b694a9e08cd..d2a42621e63eec757de9e17af5462a723a456b3a 100644 --- a/example/bench/parameters.cpp +++ b/example/bench/parameters.cpp @@ -3,7 +3,7 @@ #include <iostream> #include <string> -#include <aux/json_params.hpp> +#include <sup/json_params.hpp> #include "parameters.hpp" @@ -42,7 +42,7 @@ std::ostream& operator<<(std::ostream& o, const bench_params& p) { } bench_params read_options(int argc, char** argv) { - using aux::param_from_json; + using sup::param_from_json; bench_params params; if (argc<2) { diff --git a/example/brunel/CMakeLists.txt b/example/brunel/CMakeLists.txt index 7614c809b16e61827a6a9f8c8e9fac579f0324d4..d94f5f3e18faed8b231a97233ddbbf793c823ae1 100644 --- a/example/brunel/CMakeLists.txt +++ b/example/brunel/CMakeLists.txt @@ -3,4 +3,4 @@ add_executable(brunel-miniapp EXCLUDE_FROM_ALL io.cpp) add_dependencies(examples brunel-miniapp) -target_link_libraries(brunel-miniapp PRIVATE arbor arbor-aux ext-tclap) +target_link_libraries(brunel-miniapp PRIVATE arbor arbor-sup ext-tclap) diff --git a/example/brunel/brunel_miniapp.cpp b/example/brunel/brunel_miniapp.cpp index 4ac3dcb17327c01e37f745e83ef9746b09aaaed5..3bb100415c8c767319ade96f54c7701636cb5215 100644 --- a/example/brunel/brunel_miniapp.cpp +++ b/example/brunel/brunel_miniapp.cpp @@ -18,13 +18,13 @@ #include <arbor/simulation.hpp> #include <arbor/version.hpp> -#include <aux/ioutil.hpp> -#include <aux/json_meter.hpp> -#include <aux/path.hpp> -#include <aux/spike_emitter.hpp> -#include <aux/strsub.hpp> +#include <sup/ioutil.hpp> +#include <sup/json_meter.hpp> +#include <sup/path.hpp> +#include <sup/spike_emitter.hpp> +#include <sup/strsub.hpp> #ifdef ARB_MPI_ENABLED -#include <aux/with_mpi.hpp> +#include <sup/with_mpi.hpp> #include <mpi.h> #endif @@ -187,7 +187,7 @@ int main(int argc, char** argv) { try { #ifdef ARB_MPI_ENABLED - aux::with_mpi guard(argc, argv, false); + sup::with_mpi guard(argc, argv, false); auto context = arb::make_context(arb::proc_allocation(), MPI_COMM_WORLD); { MPI_Comm_rank(MPI_COMM_WORLD, &rank); @@ -197,7 +197,7 @@ int main(int argc, char** argv) { auto context = arb::make_context(); #endif - std::cout << aux::mask_stream(root); + std::cout << sup::mask_stream(root); banner(context); arb::profile::meter_manager meters; @@ -250,16 +250,16 @@ int main(int argc, char** argv) { if (options.spike_file_output) { using std::ios_base; - aux::path p = options.output_path; - p /= aux::strsub("%_%.%", options.file_name, rank, options.file_extension); + sup::path p = options.output_path; + p /= sup::strsub("%_%.%", options.file_name, rank, options.file_extension); if (options.single_file_per_rank) { - spike_out = aux::open_or_throw(p, ios_base::out, !options.over_write); - sim.set_local_spike_callback(aux::spike_emitter(spike_out)); + spike_out = sup::open_or_throw(p, ios_base::out, !options.over_write); + sim.set_local_spike_callback(sup::spike_emitter(spike_out)); } else if (rank==0) { - spike_out = aux::open_or_throw(p, ios_base::out, !options.over_write); - sim.set_global_spike_callback(aux::spike_emitter(spike_out)); + spike_out = sup::open_or_throw(p, ios_base::out, !options.over_write); + sim.set_global_spike_callback(sup::spike_emitter(spike_out)); } } @@ -280,12 +280,12 @@ int main(int argc, char** argv) { std::ofstream fid; fid.exceptions(std::ios_base::badbit | std::ios_base::failbit); fid.open("meters.json"); - fid << std::setw(1) << aux::to_json(report) << "\n"; + fid << std::setw(1) << sup::to_json(report) << "\n"; } } catch (io::usage_error& e) { // only print usage/startup errors on master - std::cerr << aux::mask_stream(root); + std::cerr << sup::mask_stream(root); std::cerr << e.what() << "\n"; return 1; } diff --git a/example/dryrun/CMakeLists.txt b/example/dryrun/CMakeLists.txt index 45a0745a3a83dd2d3c43522366e09207a3339f4c..99ed83f0c7d8837acc5aee926ed68e93e19d95e4 100644 --- a/example/dryrun/CMakeLists.txt +++ b/example/dryrun/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(dryrun EXCLUDE_FROM_ALL dryrun.cpp) add_dependencies(examples dryrun) -target_link_libraries(dryrun PRIVATE arbor arbor-aux ext-json) +target_link_libraries(dryrun PRIVATE arbor arbor-sup ext-json) diff --git a/example/dryrun/dryrun.cpp b/example/dryrun/dryrun.cpp index 188bb9878464761c192662faedf87204ee92750c..0077a91b3a7b53ba91d14dc6828e4ef7d49c24f4 100644 --- a/example/dryrun/dryrun.cpp +++ b/example/dryrun/dryrun.cpp @@ -22,14 +22,14 @@ #include <arbor/recipe.hpp> #include <arbor/version.hpp> -#include <aux/ioutil.hpp> -#include <aux/json_meter.hpp> +#include <sup/ioutil.hpp> +#include <sup/json_meter.hpp> #include "parameters.hpp" #ifdef ARB_MPI_ENABLED #include <mpi.h> -#include <aux/with_mpi.hpp> +#include <sup/with_mpi.hpp> #endif using arb::cell_gid_type; @@ -189,7 +189,7 @@ struct cell_stats { int main(int argc, char** argv) { try { #ifdef ARB_MPI_ENABLED - aux::with_mpi guard(argc, argv, false); + sup::with_mpi guard(argc, argv, false); #endif bool root = true; auto params = read_options(argc, argv); @@ -216,7 +216,7 @@ int main(int argc, char** argv) { #ifdef ARB_PROFILE_ENABLED arb::profile::profiler_initialize(ctx); #endif - std::cout << aux::mask_stream(root); + std::cout << sup::mask_stream(root); // Print a banner with information about hardware configuration std::cout << "gpu: " << (has_gpu(ctx)? "yes": "no") << "\n"; diff --git a/example/dryrun/parameters.hpp b/example/dryrun/parameters.hpp index ceb15af7df986d7a568ae4ba60a4df573cf198b3..316ac3ce9746f6902ea7e1e33a71eddaa0cac65c 100644 --- a/example/dryrun/parameters.hpp +++ b/example/dryrun/parameters.hpp @@ -7,7 +7,7 @@ #include <arbor/mc_cell.hpp> -#include <aux/json_params.hpp> +#include <sup/json_params.hpp> // Parameters used to generate the random cell morphologies. struct cell_parameters { @@ -37,7 +37,7 @@ struct run_params { }; run_params read_options(int argc, char** argv) { - using aux::param_from_json; + using sup::param_from_json; run_params params; if (argc<2) { diff --git a/example/generators/CMakeLists.txt b/example/generators/CMakeLists.txt index df774858376f4e3a0731b507fa38033ecdc37def..5b917bade025a2b8ae6659858c84b89b12d78780 100644 --- a/example/generators/CMakeLists.txt +++ b/example/generators/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(event-gen EXCLUDE_FROM_ALL event_gen.cpp) add_dependencies(examples event-gen) -target_link_libraries(event-gen PRIVATE arbor arbor-aux ext-json) +target_link_libraries(event-gen PRIVATE arbor arbor-sup ext-json) diff --git a/example/miniapp/CMakeLists.txt b/example/miniapp/CMakeLists.txt index 8d04d959c74cf6caa2ce7162501b9209b3ed803a..d642cabf3df099709b453c2ce335044067b36002 100644 --- a/example/miniapp/CMakeLists.txt +++ b/example/miniapp/CMakeLists.txt @@ -7,4 +7,4 @@ add_executable(miniapp EXCLUDE_FROM_ALL ) add_dependencies(examples miniapp) -target_link_libraries(miniapp PRIVATE arbor arbor-aux ext-tclap ext-json) +target_link_libraries(miniapp PRIVATE arbor arbor-sup ext-tclap ext-json) diff --git a/example/miniapp/io.hpp b/example/miniapp/io.hpp index 8d300931d6134ea6244b60593567e6b6ab025ddb..f19ee309b9e25345b5b904a18881d6d6ac430e58 100644 --- a/example/miniapp/io.hpp +++ b/example/miniapp/io.hpp @@ -9,7 +9,7 @@ #include <arbor/common_types.hpp> #include <arbor/util/optional.hpp> -#include <aux/path.hpp> +#include <sup/path.hpp> // TODO: this shouldn't be in arb namespace namespace arb { diff --git a/example/miniapp/miniapp.cpp b/example/miniapp/miniapp.cpp index 97530ed0cabff51a3d318ba6550581bf589becea..3e34dd1cc6b4e97bd66bad7b561a6c16c919e000 100644 --- a/example/miniapp/miniapp.cpp +++ b/example/miniapp/miniapp.cpp @@ -17,13 +17,13 @@ #include <arbor/version.hpp> -#include <aux/ioutil.hpp> -#include <aux/json_meter.hpp> -#include <aux/path.hpp> -#include <aux/spike_emitter.hpp> -#include <aux/strsub.hpp> +#include <sup/ioutil.hpp> +#include <sup/json_meter.hpp> +#include <sup/path.hpp> +#include <sup/spike_emitter.hpp> +#include <sup/strsub.hpp> #ifdef ARB_MPI_ENABLED -#include <aux/with_mpi.hpp> +#include <sup/with_mpi.hpp> #include <mpi.h> #endif @@ -38,7 +38,7 @@ using util::any_cast; void banner(const context&); std::unique_ptr<recipe> make_recipe(const io::cl_options&, const probe_distribution&); sample_trace make_trace(const probe_info& probe); -std::fstream& open_or_throw(std::fstream& file, const aux::path& p, bool exclusive = false); +std::fstream& open_or_throw(std::fstream& file, const sup::path& p, bool exclusive = false); void report_compartment_stats(const recipe&); int main(int argc, char** argv) { @@ -47,7 +47,7 @@ int main(int argc, char** argv) { try { #ifdef ARB_MPI_ENABLED - aux::with_mpi guard(argc, argv, false); + sup::with_mpi guard(argc, argv, false); auto context = arb::make_context(arb::proc_allocation(), MPI_COMM_WORLD); { MPI_Comm_rank(MPI_COMM_WORLD, &rank); @@ -62,7 +62,7 @@ int main(int argc, char** argv) { profile::meter_manager meters; meters.start(context); - std::cout << aux::mask_stream(root); + std::cout << sup::mask_stream(root); // read parameters io::cl_options options = io::read_options(argc, argv, root); @@ -123,16 +123,16 @@ int main(int argc, char** argv) { if (options.spike_file_output) { using std::ios_base; - aux::path p = options.output_path; - p /= aux::strsub("%_%.%", options.file_name, rank, options.file_extension); + sup::path p = options.output_path; + p /= sup::strsub("%_%.%", options.file_name, rank, options.file_extension); if (options.single_file_per_rank) { - spike_out = aux::open_or_throw(p, ios_base::out, !options.over_write); - sim.set_local_spike_callback(aux::spike_emitter(spike_out)); + spike_out = sup::open_or_throw(p, ios_base::out, !options.over_write); + sim.set_local_spike_callback(sup::spike_emitter(spike_out)); } else if (rank==0) { - spike_out = aux::open_or_throw(p, ios_base::out, !options.over_write); - sim.set_global_spike_callback(aux::spike_emitter(spike_out)); + spike_out = sup::open_or_throw(p, ios_base::out, !options.over_write); + sim.set_global_spike_callback(sup::spike_emitter(spike_out)); } } @@ -160,12 +160,12 @@ int main(int argc, char** argv) { std::ofstream fid; fid.exceptions(std::ios_base::badbit | std::ios_base::failbit); fid.open("meters.json"); - fid << std::setw(1) << aux::to_json(report) << "\n"; + fid << std::setw(1) << sup::to_json(report) << "\n"; } } catch (io::usage_error& e) { // only print usage/startup errors on master - std::cerr << aux::mask_stream(root); + std::cerr << sup::mask_stream(root); std::cerr << e.what() << "\n"; return 1; } diff --git a/example/miniapp/morphology_pool.cpp b/example/miniapp/morphology_pool.cpp index 8515f20e03ad25aa9440c2bd0d9f5a75638869a7..353913b1e5063b5a5b05374edefbdcb49d88c2e9 100644 --- a/example/miniapp/morphology_pool.cpp +++ b/example/miniapp/morphology_pool.cpp @@ -5,8 +5,8 @@ #include <arbor/morphology.hpp> #include <arbor/swcio.hpp> -#include <aux/glob.hpp> -#include <aux/path.hpp> +#include <sup/glob.hpp> +#include <sup/path.hpp> #include "morphology_pool.hpp" @@ -31,7 +31,7 @@ static morphology make_basic_y_morphology() { morphology_pool default_morphology_pool(make_basic_y_morphology()); -void load_swc_morphology(morphology_pool& pool, const aux::path& swc_path) { +void load_swc_morphology(morphology_pool& pool, const sup::path& swc_path) { std::ifstream fi; fi.exceptions(std::ifstream::failbit); @@ -43,7 +43,7 @@ void load_swc_morphology_glob(morphology_pool& pool, const std::string& swc_patt std::ifstream fi; fi.exceptions(std::ifstream::failbit); - auto swc_paths = aux::glob(swc_pattern); + auto swc_paths = sup::glob(swc_pattern); for (const auto& p: swc_paths) { fi.open(p.c_str()); pool.insert(swc_as_morphology(parse_swc_file(fi))); diff --git a/example/miniapp/morphology_pool.hpp b/example/miniapp/morphology_pool.hpp index 31567c0bd99e45706ef1152fa12ca8b478437917..5212982f11de7feeafa325ec194d5a3dcdf8cd75 100644 --- a/example/miniapp/morphology_pool.hpp +++ b/example/miniapp/morphology_pool.hpp @@ -9,7 +9,7 @@ #include <vector> #include <arbor/morphology.hpp> -#include <aux/path.hpp> +#include <sup/path.hpp> namespace arb { @@ -34,7 +34,7 @@ public: extern morphology_pool default_morphology_pool; -void load_swc_morphology(morphology_pool& pool, const aux::path& swc_path); +void load_swc_morphology(morphology_pool& pool, const sup::path& swc_path); void load_swc_morphology_glob(morphology_pool& pool, const std::string& pattern); } // namespace arb diff --git a/example/ring/CMakeLists.txt b/example/ring/CMakeLists.txt index dc8ff649048ac9726a9f1614aec150c15097c68a..48978586327338ac78beecec04c04a2abb0b1cfb 100644 --- a/example/ring/CMakeLists.txt +++ b/example/ring/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(ring EXCLUDE_FROM_ALL ring.cpp) add_dependencies(examples ring) -target_link_libraries(ring PRIVATE arbor arbor-aux ext-tclap ext-json) +target_link_libraries(ring PRIVATE arbor arbor-sup ext-tclap ext-json) diff --git a/example/ring/parameters.hpp b/example/ring/parameters.hpp index 0ca046c4501b1b935a96350502dfd36888ddb0e9..74eb177db794bd5d041e7f9158637d1df3f66ab7 100644 --- a/example/ring/parameters.hpp +++ b/example/ring/parameters.hpp @@ -7,7 +7,7 @@ #include <arbor/mc_cell.hpp> -#include <aux/json_params.hpp> +#include <sup/json_params.hpp> // Parameters used to generate the random cell morphologies. struct cell_parameters { @@ -38,7 +38,7 @@ struct ring_params { }; ring_params read_options(int argc, char** argv) { - using aux::param_from_json; + using sup::param_from_json; ring_params params; if (argc<2) { diff --git a/example/ring/ring.cpp b/example/ring/ring.cpp index ca91d5f1bc4a6cf88441c629dd27cb037f02e760..f92950b970cfc872ae51490e69f82df60cdb03a7 100644 --- a/example/ring/ring.cpp +++ b/example/ring/ring.cpp @@ -21,14 +21,14 @@ #include <arbor/recipe.hpp> #include <arbor/version.hpp> -#include <aux/ioutil.hpp> -#include <aux/json_meter.hpp> +#include <sup/ioutil.hpp> +#include <sup/json_meter.hpp> #include "parameters.hpp" #ifdef ARB_MPI_ENABLED #include <mpi.h> -#include <aux/with_mpi.hpp> +#include <sup/with_mpi.hpp> #endif using arb::cell_gid_type; @@ -160,7 +160,7 @@ int main(int argc, char** argv) { bool root = true; #ifdef ARB_MPI_ENABLED - aux::with_mpi guard(argc, argv, false); + sup::with_mpi guard(argc, argv, false); auto context = arb::make_context(arb::proc_allocation(), MPI_COMM_WORLD); { int rank; @@ -175,7 +175,7 @@ int main(int argc, char** argv) { arb::profile::profiler_initialize(context); #endif - std::cout << aux::mask_stream(root); + std::cout << sup::mask_stream(root); // Print a banner with information about hardware configuration std::cout << "gpu: " << (has_gpu(context)? "yes": "no") << "\n"; diff --git a/lmorpho/CMakeLists.txt b/lmorpho/CMakeLists.txt index 0f338b9ad2e90694de7bbdcb638fec20de9f864b..c198d458fd6135fe56c1e6fd2ed0e9a1e2572aa6 100644 --- a/lmorpho/CMakeLists.txt +++ b/lmorpho/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(lmorpho lmorpho.cpp lsystem.cpp lsys_models.cpp morphio.cpp) -target_link_libraries(lmorpho PRIVATE arbor arbor-aux) +target_link_libraries(lmorpho PRIVATE arbor arbor-sup) # TODO: resolve public headers target_link_libraries(lmorpho PRIVATE arbor-private-headers) diff --git a/lmorpho/lmorpho.cpp b/lmorpho/lmorpho.cpp index 892a732cadb0a45e08dcf1f09c7671a50795dac7..56385a925e9e88cf2daec26646249eb0e2c1a5a8 100644 --- a/lmorpho/lmorpho.cpp +++ b/lmorpho/lmorpho.cpp @@ -7,7 +7,7 @@ #include <arbor/morphology.hpp> #include <arbor/util/optional.hpp> -#include <aux/tinyopt.hpp> +#include <sup/tinyopt.hpp> #include "morphio.hpp" #include "lsystem.hpp" diff --git a/sup/CMakeLists.txt b/sup/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..cdd4ecb0560794a11672e49f039f2bdf170239f5 --- /dev/null +++ b/sup/CMakeLists.txt @@ -0,0 +1,14 @@ +set(sup-sources + + glob.cpp + ioutil.cpp + json_meter.cpp + path.cpp + spike_emitter.cpp +) + +add_library(arbor-sup ${sup-sources}) +target_compile_options(arbor-sup PRIVATE ${ARB_CXXOPT_ARCH}) +target_link_libraries(arbor-sup PUBLIC ext-json arbor) +target_include_directories(arbor-sup PUBLIC include) +set_target_properties(arbor-sup PROPERTIES OUTPUT_NAME arborsup) diff --git a/aux/glob.cpp b/sup/glob.cpp similarity index 90% rename from aux/glob.cpp rename to sup/glob.cpp index 78d96edbac11881b174e04b3052ef864061af4dc..185cfc926b2c9ff204a79d5925373540cf0664a0 100644 --- a/aux/glob.cpp +++ b/sup/glob.cpp @@ -16,10 +16,10 @@ extern "C" { #include <cerrno> -#include <aux/path.hpp> -#include <aux/scope_exit.hpp> +#include <sup/path.hpp> +#include <sup/scope_exit.hpp> -namespace aux { +namespace sup { std::vector<path> glob(const std::string& pattern) { std::vector<path> paths; @@ -43,5 +43,5 @@ std::vector<path> glob(const std::string& pattern) { return paths; } -} // namespace aux +} // namespace sup diff --git a/aux/include/aux/glob.hpp b/sup/include/sup/glob.hpp similarity index 70% rename from aux/include/aux/glob.hpp rename to sup/include/sup/glob.hpp index 406167ce8aeabdc00f9c22eb0815d734c085a58d..aef8d68eb2497bf1038937d84e8c469a493d3cef 100644 --- a/aux/include/aux/glob.hpp +++ b/sup/include/sup/glob.hpp @@ -4,11 +4,11 @@ // TODO: emulate for not-entirely-POSIX platforms. -#include <aux/path.hpp> +#include <sup/path.hpp> -namespace aux { +namespace sup { std::vector<path> glob(const std::string& pattern); -} // namespace aux +} // namespace sup diff --git a/aux/include/aux/ioutil.hpp b/sup/include/sup/ioutil.hpp similarity index 93% rename from aux/include/aux/ioutil.hpp rename to sup/include/sup/ioutil.hpp index 2a9ba4ab7e0bba181518f4f26d1588c4d7db2450..cf516dc0eaed61f33129c70154b67a7a4c87f2db 100644 --- a/aux/include/aux/ioutil.hpp +++ b/sup/include/sup/ioutil.hpp @@ -14,9 +14,9 @@ #include <iostream> #include <fstream> -#include <aux/path.hpp> +#include <sup/path.hpp> -namespace aux { +namespace sup { template <typename charT, typename traitsT = std::char_traits<charT> > class basic_null_streambuf: public std::basic_streambuf<charT, traitsT> { @@ -87,12 +87,12 @@ private: bool mask_; }; -std::fstream open_or_throw(const aux::path& p, std::ios_base::openmode, bool exclusive); +std::fstream open_or_throw(const sup::path& p, std::ios_base::openmode, bool exclusive); -inline std::fstream open_or_throw(const aux::path& p, bool exclusive) { +inline std::fstream open_or_throw(const sup::path& p, bool exclusive) { using std::ios_base; return open_or_throw(p, ios_base::in|ios_base::out, exclusive); } -} // namespace aux +} // namespace sup diff --git a/aux/include/aux/json_meter.hpp b/sup/include/sup/json_meter.hpp similarity index 79% rename from aux/include/aux/json_meter.hpp rename to sup/include/sup/json_meter.hpp index 27489393de72a3b234658968de0de2a4d2e78b5d..76c94ae83436d5b2f750bf309ad226b0d472da9b 100644 --- a/aux/include/aux/json_meter.hpp +++ b/sup/include/sup/json_meter.hpp @@ -1,8 +1,8 @@ #include <arbor/profile/meter_manager.hpp> #include <nlohmann/json.hpp> -namespace aux { +namespace sup { nlohmann::json to_json(const arb::profile::meter_report&); -} +} // namespace sup diff --git a/aux/include/aux/json_params.hpp b/sup/include/sup/json_params.hpp similarity index 96% rename from aux/include/aux/json_params.hpp rename to sup/include/sup/json_params.hpp index f7a848e2c54d8473ea5eec715aa54fd9adc47628..7903b6cd6478a61af7a667b588519925721c6d48 100644 --- a/aux/include/aux/json_params.hpp +++ b/sup/include/sup/json_params.hpp @@ -5,7 +5,7 @@ #include <nlohmann/json.hpp> -namespace aux { +namespace sup { // Search a json object for an entry with a given name. // If found, return the value and remove from json object. @@ -39,4 +39,4 @@ void param_from_json(std::array<T, N>& x, const char* name, nlohmann::json& j) { } } -} // namespace aux +} // namespace sup diff --git a/aux/include/aux/path.hpp b/sup/include/sup/path.hpp similarity index 99% rename from aux/include/aux/path.hpp rename to sup/include/sup/path.hpp index c5429cf5e6ccb6e035a3db6095b672abda6943bb..0502d9a037abf5eb5c8424851b2fc8e7a9828569 100644 --- a/aux/include/aux/path.hpp +++ b/sup/include/sup/path.hpp @@ -24,7 +24,7 @@ #include <utility> #include <vector> -namespace aux { +namespace sup { class posix_path { public: @@ -354,7 +354,7 @@ inline file_status symlink_status(const path& p, std::error_code& ec) { inline file_status status(const path& p) { std::error_code ec; - auto r = ::aux::posix::status(p, ec); + auto r = ::sup::posix::status(p, ec); if (ec) { throw filesystem_error("status()", p, ec); } @@ -409,5 +409,5 @@ inline bool exists(const path& p, std::error_code& ec) { return exists(status(p, ec)); } -} // namespace aux +} // namespace sup diff --git a/aux/include/aux/scope_exit.hpp b/sup/include/sup/scope_exit.hpp similarity index 96% rename from aux/include/aux/scope_exit.hpp rename to sup/include/sup/scope_exit.hpp index 4db228d8b31ea275122260094bbf848eade1ff24..67faecebd47974f47c484dc4a7231c92fa0343ac 100644 --- a/aux/include/aux/scope_exit.hpp +++ b/sup/include/sup/scope_exit.hpp @@ -5,7 +5,7 @@ // Convenience class for RAII control of resources. -namespace aux { +namespace sup { // `scope_exit` guard object will call provided functional object // on destruction. The provided functional object must be nothrow @@ -47,4 +47,4 @@ scope_exit<std::decay_t<F>> on_scope_exit(F&& f) { return scope_exit<std::decay_t<F>>(std::forward<F>(f)); } -} // namespace aux +} // namespace sup diff --git a/aux/include/aux/spike_emitter.hpp b/sup/include/sup/spike_emitter.hpp similarity index 87% rename from aux/include/aux/spike_emitter.hpp rename to sup/include/sup/spike_emitter.hpp index fdbfa16f16297f2896e5ee3b3fa113b5814dd571..0656f00b3117f308c37b57dc56f701df4fb6a318 100644 --- a/aux/include/aux/spike_emitter.hpp +++ b/sup/include/sup/spike_emitter.hpp @@ -4,7 +4,7 @@ #include <arbor/spike.hpp> -namespace aux { +namespace sup { struct spike_emitter { std::reference_wrapper<std::ostream> out; @@ -13,4 +13,4 @@ struct spike_emitter { void operator()(const std::vector<arb::spike>&); }; -} // namespace aux +} // namespace sup diff --git a/aux/include/aux/strsub.hpp b/sup/include/sup/strsub.hpp similarity index 97% rename from aux/include/aux/strsub.hpp rename to sup/include/sup/strsub.hpp index b2dca8497b7ec894aeb8ef0587f1cde40066458e..35daea5469a0caf932b37a1a6d4d848e64781219 100644 --- a/aux/include/aux/strsub.hpp +++ b/sup/include/sup/strsub.hpp @@ -17,7 +17,7 @@ #include <string> #include <utility> -namespace aux { +namespace sup { // Stream-writing strsub(...): @@ -63,4 +63,4 @@ std::string strsub(const char* templ, Args&&... args) { return strsub('%', templ, std::forward<Args>(args)...); } -} // namespace aux +} // namespace sup diff --git a/aux/include/aux/tinyopt.hpp b/sup/include/sup/tinyopt.hpp similarity index 100% rename from aux/include/aux/tinyopt.hpp rename to sup/include/sup/tinyopt.hpp diff --git a/aux/include/aux/with_mpi.hpp b/sup/include/sup/with_mpi.hpp similarity index 96% rename from aux/include/aux/with_mpi.hpp rename to sup/include/sup/with_mpi.hpp index 6a0e21e564008f08802e928f23a9851993ad1971..8b7366f0250082e377ed3682103f18964192a594 100644 --- a/aux/include/aux/with_mpi.hpp +++ b/sup/include/sup/with_mpi.hpp @@ -4,7 +4,7 @@ #include <arbor/communication/mpi_error.hpp> -namespace aux { +namespace sup { struct with_mpi { with_mpi(int& argc, char**& argv, bool fatal_errors = true) { @@ -36,4 +36,4 @@ private: } }; -} +} // namespace sup diff --git a/aux/ioutil.cpp b/sup/ioutil.cpp similarity index 78% rename from aux/ioutil.cpp rename to sup/ioutil.cpp index d6e723d6455b2d7ca0737854678be7aedf1380be..4725cc1a98be251d978266b783e7f91ee2545775 100644 --- a/aux/ioutil.cpp +++ b/sup/ioutil.cpp @@ -1,11 +1,11 @@ #include <fstream> #include <utility> -#include <aux/ioutil.hpp> -#include <aux/path.hpp> -#include <aux/strsub.hpp> +#include <sup/ioutil.hpp> +#include <sup/path.hpp> +#include <sup/strsub.hpp> -namespace aux { +namespace sup { std::fstream open_or_throw(const path& p, std::ios_base::openmode mode, bool exclusive) { if (exclusive && exists(p)) { @@ -21,5 +21,5 @@ std::fstream open_or_throw(const path& p, std::ios_base::openmode mode, bool exc return file; } -} // namespace aux +} // namespace sup diff --git a/aux/json_meter.cpp b/sup/json_meter.cpp similarity index 95% rename from aux/json_meter.cpp rename to sup/json_meter.cpp index ec9e8d965a684d0f66ecc74d74a94f3d1b9a198c..c587d4dfe32b5eebb5a6d1d3522e03fe97be3948 100644 --- a/aux/json_meter.cpp +++ b/sup/json_meter.cpp @@ -1,7 +1,7 @@ #include <arbor/profile/meter_manager.hpp> #include <nlohmann/json.hpp> -namespace aux { +namespace sup { static nlohmann::json to_json(const arb::profile::measurement& mnt) { nlohmann::json measurements; @@ -30,4 +30,4 @@ nlohmann::json to_json(const arb::profile::meter_report& report) { }; } -} +} // namespace sup diff --git a/aux/path.cpp b/sup/path.cpp similarity index 96% rename from aux/path.cpp rename to sup/path.cpp index 64321b23bfadb8cb7d5266e05a553cf858788035..441e5768795edf117125ef5202af259142d32f5e 100644 --- a/aux/path.cpp +++ b/sup/path.cpp @@ -5,9 +5,9 @@ extern "C" { #include <cerrno> -#include <aux/path.hpp> +#include <sup/path.hpp> -namespace aux { +namespace sup { namespace posix { namespace impl { @@ -64,5 +64,5 @@ file_status symlink_status(const path& p, std::error_code& ec) { } } // namespace posix -} // namespace arb +} // namespace sup diff --git a/aux/spike_emitter.cpp b/sup/spike_emitter.cpp similarity index 87% rename from aux/spike_emitter.cpp rename to sup/spike_emitter.cpp index db33121dcecd28b5e33523a0b19c079f03e55629..ec451be1a8daa2c939671e010bef15e4e515769c 100644 --- a/aux/spike_emitter.cpp +++ b/sup/spike_emitter.cpp @@ -2,9 +2,9 @@ #include <iostream> #include <arbor/spike.hpp> -#include <aux/spike_emitter.hpp> +#include <sup/spike_emitter.hpp> -namespace aux { +namespace sup { spike_emitter::spike_emitter(std::ostream& out): out(out) {} @@ -20,4 +20,4 @@ void spike_emitter::operator()(const std::vector<arb::spike>& spikes) { } }; -} // namespace aux +} // namespace sup diff --git a/test/unit-distributed/CMakeLists.txt b/test/unit-distributed/CMakeLists.txt index a7c60af2809a86bef31e7a7b62252f8e2dc2557d..6b84f561ef4b990c104c561d88bce19dbf3ed0a2 100644 --- a/test/unit-distributed/CMakeLists.txt +++ b/test/unit-distributed/CMakeLists.txt @@ -13,7 +13,7 @@ add_dependencies(tests unit-local) target_compile_options(unit-local PRIVATE ${ARB_CXXOPT_ARCH}) target_compile_definitions(unit-local PRIVATE TEST_LOCAL) -target_link_libraries(unit-local PRIVATE gtest arbor arbor-aux arbor-private-headers) +target_link_libraries(unit-local PRIVATE gtest arbor arbor-sup arbor-private-headers) if(ARB_WITH_MPI) add_executable(unit-mpi EXCLUDE_FROM_ALL ${unit-distributed_sources}) @@ -21,6 +21,6 @@ if(ARB_WITH_MPI) target_compile_options(unit-mpi PRIVATE ${ARB_CXXOPT_ARCH}) target_compile_definitions(unit-mpi PRIVATE TEST_MPI) - target_link_libraries(unit-mpi PRIVATE gtest arbor arbor-aux arbor-private-headers) + target_link_libraries(unit-mpi PRIVATE gtest arbor arbor-sup arbor-private-headers) endif() diff --git a/test/unit-distributed/test.cpp b/test/unit-distributed/test.cpp index 4f116af81ee07a65b725447f79843f52ce82e03d..6dbbd01840dbf95ef6de021f05b0aa9f0d75f708 100644 --- a/test/unit-distributed/test.cpp +++ b/test/unit-distributed/test.cpp @@ -7,10 +7,10 @@ #include <arbor/context.hpp> -#include <aux/ioutil.hpp> -#include <aux/tinyopt.hpp> +#include <sup/ioutil.hpp> +#include <sup/tinyopt.hpp> #ifdef TEST_MPI -#include <aux/with_mpi.hpp> +#include <sup/with_mpi.hpp> #endif #include "distributed_context.hpp" @@ -35,7 +35,7 @@ int main(int argc, char **argv) { alloc.gpu_id = -1; #ifdef TEST_MPI - aux::with_mpi guard(argc, argv, false); + sup::with_mpi guard(argc, argv, false); g_context = arb::make_context(alloc, MPI_COMM_WORLD); #elif defined(TEST_LOCAL) g_context = arb::make_context(alloc); diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 103095c22ef04813373c9bde16cda95418b254cb..c78bf48c894c1d3341a13f835e6602ca03222588 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -145,4 +145,4 @@ add_dependencies(tests unit) target_compile_options(unit PRIVATE ${ARB_CXXOPT_ARCH}) target_compile_definitions(unit PRIVATE "-DDATADIR=\"${CMAKE_CURRENT_SOURCE_DIR}/swc\"") target_include_directories(unit PRIVATE "${CMAKE_CURRENT_BINARY_DIR}") -target_link_libraries(unit PRIVATE gtest arbor arbor-private-headers arbor-aux) +target_link_libraries(unit PRIVATE gtest arbor arbor-private-headers arbor-sup) diff --git a/test/unit/test_mask_stream.cpp b/test/unit/test_mask_stream.cpp index bdc7cd8d46f5d3e179589ee580f55bf198410a49..bd5444996912dbf1a748ab507ccc2ec77cf36de5 100644 --- a/test/unit/test_mask_stream.cpp +++ b/test/unit/test_mask_stream.cpp @@ -2,9 +2,9 @@ #include "../gtest.h" -#include <aux/ioutil.hpp> +#include <sup/ioutil.hpp> -using aux::mask_stream; +using sup::mask_stream; TEST(mask_stream,nomask) { // expect mask_stream(true) on a new stream not to change rdbuf. diff --git a/test/unit/test_path.cpp b/test/unit/test_path.cpp index d359dc2e5b9c4be6c1363348a88045419d62df24..c52c4bbc486ee7221f70632317ebd4b9816bbe5a 100644 --- a/test/unit/test_path.cpp +++ b/test/unit/test_path.cpp @@ -5,9 +5,9 @@ #include <string> #include <vector> -#include <aux/path.hpp> +#include <sup/path.hpp> -using namespace aux; +using namespace sup; TEST(path, posix_ctor) { // test constructor ans assignment overloads with sample character sequences. diff --git a/test/unit/test_spike_emitter.cpp b/test/unit/test_spike_emitter.cpp index 60af2a92cbeb3a1a75085999348453147c8f24ee..a66812773861296398c2b3f75c35e4d421eb3fe3 100644 --- a/test/unit/test_spike_emitter.cpp +++ b/test/unit/test_spike_emitter.cpp @@ -5,11 +5,11 @@ #include <vector> #include <arbor/spike.hpp> -#include <aux/spike_emitter.hpp> +#include <sup/spike_emitter.hpp> TEST(spike_emitter, formatting) { std::stringstream out; - auto callback = aux::spike_emitter(out); + auto callback = sup::spike_emitter(out); std::vector<arb::spike> spikes = { { { 0, 0 }, 0.0 }, diff --git a/test/validation/CMakeLists.txt b/test/validation/CMakeLists.txt index 9e975a67bb82c2a06f880516aa36ebc900efd17f..7d885e07b8964a9f74810f6e5db398f4d871ad62 100644 --- a/test/validation/CMakeLists.txt +++ b/test/validation/CMakeLists.txt @@ -18,7 +18,7 @@ add_dependencies(tests validate) target_compile_options(validate PRIVATE ${ARB_CXXOPT_ARCH}) target_compile_definitions(validate PRIVATE "ARB_DATADIR=\"${ARB_VALIDATION_DATA_DIR}\"") -target_link_libraries(validate PRIVATE gtest arbor arbor-aux ext-json) +target_link_libraries(validate PRIVATE gtest arbor arbor-sup ext-json) if(ARB_BUILD_VALIDATION_DATA) add_dependencies(validate validation_data) diff --git a/test/validation/convergence_test.hpp b/test/validation/convergence_test.hpp index 25742cdb762f58d2e18524428dd27d52c027e060..e0ee8496241f48343db001a90d41c92275d3fef1 100644 --- a/test/validation/convergence_test.hpp +++ b/test/validation/convergence_test.hpp @@ -9,7 +9,7 @@ #include <arbor/simple_sampler.hpp> #include <arbor/simulation.hpp> #include <arbor/schedule.hpp> -#include <aux/path.hpp> +#include <sup/path.hpp> #include "../gtest.h" @@ -61,7 +61,7 @@ public: // Allow free access to JSON meta data attached to saved traces. nlohmann::json& metadata() { return meta_; } - void load_reference_data(const aux::path& ref_path) { + void load_reference_data(const sup::path& ref_path) { run_validation_ = false; try { ref_data_ = g_trace_io.load_traces(ref_path); diff --git a/test/validation/validate.cpp b/test/validation/validate.cpp index cac0ac3d1938199f1884422de45bedf33877704a..082937079028043123ac89a32707531c028a4415 100644 --- a/test/validation/validate.cpp +++ b/test/validation/validate.cpp @@ -4,7 +4,7 @@ #include <string> #include <exception> -#include <aux/tinyopt.hpp> +#include <sup/tinyopt.hpp> #include "../gtest.h" diff --git a/test/validation/validate_ball_and_stick.cpp b/test/validation/validate_ball_and_stick.cpp index 2a047354bf3efa80577a11c40e52955f4a087c8d..22f12314af8ae0ca1167494e841a290498b87019 100644 --- a/test/validation/validate_ball_and_stick.cpp +++ b/test/validation/validate_ball_and_stick.cpp @@ -11,7 +11,7 @@ #include <arbor/recipe.hpp> #include <arbor/simple_sampler.hpp> #include <arbor/simulation.hpp> -#include <aux/path.hpp> +#include <sup/path.hpp> #include "../common_cells.hpp" #include "../simple_recipes.hpp" @@ -33,7 +33,7 @@ struct probe_point { template <typename ProbePointSeq> void run_ncomp_convergence_test( const char* model_name, - const aux::path& ref_data_path, + const sup::path& ref_data_path, context& context, const mc_cell& c, ProbePointSeq& probe_points, diff --git a/test/validation/validate_synapses.cpp b/test/validation/validate_synapses.cpp index 92b43b9784740dd004bfd8916ca67568aa1a47bb..a72d285a65b543dfa7096e241a53d28600b62ea2 100644 --- a/test/validation/validate_synapses.cpp +++ b/test/validation/validate_synapses.cpp @@ -7,7 +7,7 @@ #include <arbor/recipe.hpp> #include <arbor/simple_sampler.hpp> #include <arbor/simulation.hpp> -#include <aux/path.hpp> +#include <sup/path.hpp> #include "../gtest.h" @@ -24,7 +24,7 @@ using namespace arb; void run_synapse_test( const char* syn_type, - const aux::path& ref_data_path, + const sup::path& ref_data_path, const context& context, float t_end=70.f, float dt=0.001) diff --git a/test/validation/validation_data.cpp b/test/validation/validation_data.cpp index cf5963c45e628e04817534970368be23ab7d381b..3ddbaaa7aadc002389203361de2db902648a8088 100644 --- a/test/validation/validation_data.cpp +++ b/test/validation/validation_data.cpp @@ -7,7 +7,7 @@ #include <nlohmann/json.hpp> #include <arbor/simple_sampler.hpp> -#include <aux/path.hpp> +#include <sup/path.hpp> #include "trace_analysis.hpp" #include "validation_data.hpp" @@ -20,7 +20,7 @@ trace_io g_trace_io; #define ARB_DATADIR "" #endif -aux::path trace_io::find_datadir() { +sup::path trace_io::find_datadir() { // If environment variable is set, use that in preference. if (const char* env_path = std::getenv("ARB_DATADIR")) { @@ -39,7 +39,7 @@ aux::path trace_io::find_datadir() { std::error_code ec; for (auto p: paths) { - if (aux::is_directory(p, ec)) { + if (sup::is_directory(p, ec)) { return p; } } @@ -97,8 +97,8 @@ static void parse_trace_json(const nlohmann::json& j, std::map<std::string, trac } } -std::map<std::string, trace_data<double>> trace_io::load_traces(const aux::path& name) { - aux::path file = datadir_/name; +std::map<std::string, trace_data<double>> trace_io::load_traces(const sup::path& name) { + sup::path file = datadir_/name; std::ifstream fid(file); if (!fid) { throw std::runtime_error("unable to load validation data: "+file.native()); diff --git a/test/validation/validation_data.hpp b/test/validation/validation_data.hpp index 620f79eb2657c85d5c3fde9140faabb32057d6a3..bf827bf1198dd2a8272759ad53d4baa871834a5a 100644 --- a/test/validation/validation_data.hpp +++ b/test/validation/validation_data.hpp @@ -8,7 +8,7 @@ #include <nlohmann/json.hpp> #include <arbor/simple_sampler.hpp> -#include <aux/path.hpp> +#include <sup/path.hpp> namespace arb { @@ -46,7 +46,7 @@ public: void save_trace(const std::string& label, const trace_data<double>& data, const nlohmann::json& meta); void save_trace(const std::string& abscissa, const std::string& label, const trace_data<double>& data, const nlohmann::json& meta); - std::map<std::string, trace_data<double>> load_traces(const aux::path& name); + std::map<std::string, trace_data<double>> load_traces(const sup::path& name); // common flags, options set by driver @@ -62,9 +62,9 @@ public: void set_sample_dt(float dt) { sample_dt_ = dt; } float sample_dt() const { return sample_dt_; } - void set_datadir(const aux::path& dir) { datadir_ = dir; } + void set_datadir(const sup::path& dir) { datadir_ = dir; } - void set_output(const aux::path& file) { + void set_output(const sup::path& file) { out_.open(file); if (!out_) { throw std::runtime_error("unable to open file for writing"); @@ -80,7 +80,7 @@ public: } private: - aux::path datadir_; + sup::path datadir_; std::ofstream out_; nlohmann::json jtraces_ = nlohmann::json::array(); bool verbose_flag_ = false; @@ -93,7 +93,7 @@ private: // starting with ARB_DATADIR preprocessor define if defined and // if the directory exists, or else try './validation/data' // and '../validation/data'. - static aux::path find_datadir(); + static sup::path find_datadir(); }; extern trace_io g_trace_io;