Skip to content
Snippets Groups Projects
Select Git revision
  • b53112e5e70fdecbc1ceb391388048dee22704ef
  • 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

disk_io.cpp

Blame
  • disk_io.cpp 5.14 KiB
    #include <cstdlib>
    #include <ctime>
    #include <fstream>
    #include <iostream>
    #include <numeric>
    #include <stdio.h>
    #include <cstring>
    
    #include <cell.hpp>
    #include <cell_group.hpp>
    #include <common_types.hpp>
    #include <fvm_cell.hpp>
    
    #include <communication/communicator.hpp>
    #include <communication/global_policy.hpp>
    #include <communication/export_manager.hpp>
    
    using namespace nest::mc;
    
    using global_policy = communication::global_policy;
    using lowered_cell = nest::mc::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,
        global_policy>::spike_type;
    
    int main(int argc, char** argv)
    {
        //Setup the possible mpi environment
        nest::mc::communication::global_policy_guard global_guard(argc, argv);
    
        // very simple command line parsing
        if (argc < 3) {
            std::cout << "disk_io <int nrspikes> <int nr_repeats> <file_per_rank (true|false)> [simple_output (false|true)]"
                << "   Simple performance test runner for the exporter manager"
                << "   It exports nrspikes nr_repeats using the export_manager and will produce"
                << "   the total, mean and std of the time needed to perform the output to disk"
                << "   <file_per_rank> true will produce a single file per mpi rank"
                << "   <simple_output> true will produce a simplyfied comma seperated output for automatic parsing"
                << "    The application can be started with mpi support and will produce output on a single rank";
    
            std::cout << "    if nrspikes is not a multiple of the nr of mpi rank, floor is take" << std::endl;
            exit(1);
        }
        int nr_spikes = atoi(argv[1]);
    
        if (nr_spikes == 0) {
            std::cout << "disk_io <nrspikes>" << std::endl;
            std::cout << "  nrspikes should be a valid integer higher then zero" << std::endl;
            exit(1);
        }
        int nr_repeats = atoi(argv[2]);
    
        if (nr_repeats == 0) {
            std::cout << "disk_io <nrspikes>" << std::endl;
            std::cout << "  nr_repeats should be a valid integer higher then zero" << std::endl;
            exit(1);
        }
    
        bool file_per_rank = false;
        std::string single(argv[3]);
        if (single == std::string("true")) {
            file_per_rank = true;
        }
    
        bool simple_stats = false;
        if (argc == 5) {
            std::string simple(argv[4]);
            if (simple == std::string("true"))
            {