Skip to content
Snippets Groups Projects
Select Git revision
  • 8201428316a60fb7666d8fb6b17e76033b5d5310
  • master default protected
  • tut_ring_allen
  • docs_furo
  • docs_reorder_cable_cell
  • docs_graphviz
  • docs_rtd_dev
  • ebrains_mirror
  • doc_recat
  • docs_spike_source
  • docs_sim_sample_clar
  • docs_pip_warn
  • github_template_updates
  • docs_fix_link
  • cv_default_and_doc_clarification
  • docs_add_numpy_req
  • readme_zenodo_05
  • install_python_fix
  • install_require_numpy
  • typofix_propetries
  • docs_recipe_lookup
  • v0.10.0
  • v0.10.1
  • v0.10.0-rc5
  • v0.10.0-rc4
  • v0.10.0-rc3
  • v0.10.0-rc2
  • v0.10.0-rc
  • v0.9.0
  • v0.9.0-rc
  • v0.8.1
  • v0.8
  • v0.8-rc
  • v0.7
  • v0.6
  • v0.5.2
  • v0.5.1
  • v0.5
  • v0.4
  • v0.3
  • v0.2.2
41 results

io.cpp

Blame
  • io.hpp 1.77 KiB
    #pragma once
    
    #include <stdexcept>
    #include <string>
    #include <utility>
    #include <vector>
    #include <common_types.hpp>
    #include <util/optional.hpp>
    #include <util/path.hpp>
    
    namespace arb {
    namespace io {
        // Holds the options for a simulation run.
        // Default constructor gives default options.
        struct cl_options {
            // Cell parameters:
            uint32_t nexc = 400;
            uint32_t ninh = 100;
            uint32_t next = 40;
            double syn_per_cell_prop = 0.05;
            float weight = 1.2;
            float delay = 0.1;
            float rel_inh_strength = 1;
            double poiss_lambda = 1;
    
            // Simulation running parameters:
            double tfinal = 100.;
            double dt = 1;
            uint32_t group_size = 10;
            uint32_t seed = 42;
    
            // Parameters for spike output.
            bool spike_file_output = false;
            bool single_file_per_rank = false;
            bool over_write = true;
            std::string output_path = "./";
            std::string file_name = "spikes";
            std::string file_extension = "gdf";
    
            // Turn on/off profiling output for all ranks.
            bool profile_only_zero = false;
    
            // Be more verbose with informational messages.
            bool verbose = false;
        };
    
        class usage_error: public std::runtime_error {
        public:
            template <typename S>
            usage_error(S&& whatmsg): std::runtime_error(std::forward<S>(whatmsg)) {}
        };
    
        class model_description_error: public std::runtime_error {
        public:
            template <typename S>
            model_description_error(S&& whatmsg): std::runtime_error(std::forward<S>(whatmsg)) {}
        };
    
        std::ostream& operator<<(std::ostream& o, const cl_options& opt);
    
        cl_options read_options(int argc, char** argv, bool allow_write = true);
    } // namespace io
    } // namespace arbor