diff --git a/coreneuron/nrniv/global_vars.cpp b/coreneuron/nrniv/global_vars.cpp index 293585eb4..2fb2cafce 100644 --- a/coreneuron/nrniv/global_vars.cpp +++ b/coreneuron/nrniv/global_vars.cpp @@ -9,6 +9,10 @@ #include "coreneuron/nrniv/nrniv_decl.h" #include "coreneuron/nrnoc/membfunc.h" #include "coreneuron/nrniv/nrn_assert.h" +#include "coreneuron/nrniv/nrn2core_direct.h" + +void* (*nrn2core_get_global_dbl_item_)(void*, const char*& name, int& size, double*& val); +int (*nrn2core_get_global_int_item_)(const char* name); using namespace std; namespace coreneuron { @@ -37,69 +41,99 @@ void set_globals(const char* path, bool cli_global_seed, int cli_global_seed_val (*n2v)["dt"] = PSD(0, &dt); (*n2v)["t"] = PSD(0, &t); - string fname = string(path) + string("/globals.dat"); - FILE* f = fopen(fname.c_str(), "r"); - if (!f) { - printf("ignore: could not open %s\n", fname.c_str()); - delete n2v; - n2v = NULL; - return; - } - - char line[256]; - char name[256]; - double val; - int n; - - fscanf(f, "%s\n", line); - check_bbcore_write_version(line); + if (corenrn_embedded) { // CoreNEURON embedded, get info direct from NEURON - for (;;) { - nrn_assert(fgets(line, 256, f) != NULL); - N2V::iterator it; - if (sscanf(line, "%s %lf", name, &val) == 2) { - if (strcmp(name, "0") == 0) { - break; - } + const char* name; + int size; + double* val = NULL; + for (void* p = NULL; (p = (*nrn2core_get_global_dbl_item_)(p, name, size, val)) != NULL;) { + N2V::iterator it; it = n2v->find(name); if (it != n2v->end()) { - nrn_assert(it->second.first == 0); - *(it->second.second) = val; - } - } else if (sscanf(line, "%[^[][%d]\n", name, &n) == 2) { - if (strcmp(name, "0") == 0) { - break; + if (size == 0) { + nrn_assert(it->second.first == 0); + *(it->second.second) = val[0]; + } else { + nrn_assert(it->second.first == (size_t)size); + double* pval = it->second.second; + for (int i = 0; i < size; ++i) { + pval[i] = val[i]; + } + } } - it = n2v->find(name); - if (it != n2v->end()) { - nrn_assert(it->second.first == (size_t)n); - double* pval = it->second.second; - for (int i = 0; i < n; ++i) { - nrn_assert(fgets(line, 256, f) != NULL); - nrn_assert(sscanf(line, "%lf\n", &val) == 1); - pval[i] = val; + delete[] val; + } + secondorder = (*nrn2core_get_global_int_item_)("secondorder"); + nrnran123_set_globalindex((*nrn2core_get_global_int_item_)("Random123_global_index")); + + } else { // get the info from the globals.dat file + + string fname = string(path) + string("/globals.dat"); + FILE* f = fopen(fname.c_str(), "r"); + if (!f) { + printf("ignore: could not open %s\n", fname.c_str()); + delete n2v; + n2v = NULL; + return; + } + + char line[256]; + char name[256]; + double val; + int n; + + fscanf(f, "%s\n", line); + check_bbcore_write_version(line); + + for (;;) { + nrn_assert(fgets(line, 256, f) != NULL); + N2V::iterator it; + if (sscanf(line, "%s %lf", name, &val) == 2) { + if (strcmp(name, "0") == 0) { + break; + } + it = n2v->find(name); + if (it != n2v->end()) { + nrn_assert(it->second.first == 0); + *(it->second.second) = val; } + } else if (sscanf(line, "%[^[][%d]\n", name, &n) == 2) { + if (strcmp(name, "0") == 0) { + break; + } + it = n2v->find(name); + if (it != n2v->end()) { + nrn_assert(it->second.first == (size_t)n); + double* pval = it->second.second; + for (int i = 0; i < n; ++i) { + nrn_assert(fgets(line, 256, f) != NULL); + nrn_assert(sscanf(line, "%lf\n", &val) == 1); + pval[i] = val; + } + } + } else { + nrn_assert(0); } - } else { - nrn_assert(0); } - } - while (fgets(line, 256, f)) { - if (sscanf(line, "%s %d", name, &n) == 2) { - if (strcmp(name, "secondorder") == 0) { - secondorder = n; - } else if ( strcmp(name, "Random123_globalindex") == 0) { - nrnran123_set_globalindex((uint32_t)n); + while (fgets(line, 256, f)) { + if (sscanf(line, "%s %d", name, &n) == 2) { + if (strcmp(name, "secondorder") == 0) { + secondorder = n; + } else if (strcmp(name, "Random123_globalindex") == 0) { + nrnran123_set_globalindex((uint32_t)n); + } } } - } - fclose(f); - // overwrite global.dat config if seed is specified on Command line - if (cli_global_seed) { - nrnran123_set_globalindex((uint32_t)cli_global_seed_value); + fclose(f); + + // overwrite global.dat config if seed is specified on Command line + if (cli_global_seed) { + nrnran123_set_globalindex((uint32_t)cli_global_seed_value); + } } + #if 0 for (N2V::iterator i = n2v->begin(); i != n2v->end(); ++i) { printf("%s %ld %p\n", i->first.c_str(), i->second.first, i->second.second); @@ -109,4 +143,5 @@ void set_globals(const char* path, bool cli_global_seed, int cli_global_seed_val delete n2v; n2v = NULL; } + } // namespace coreneuron diff --git a/coreneuron/nrniv/main1.cpp b/coreneuron/nrniv/main1.cpp index f6941cf89..82bf46362 100644 --- a/coreneuron/nrniv/main1.cpp +++ b/coreneuron/nrniv/main1.cpp @@ -41,6 +41,7 @@ THE POSSIBILITY OF SUCH DAMAGE. #include "coreneuron/nrnoc/nrnoc_decl.h" #include "coreneuron/nrnmpi/nrnmpi.h" #include "coreneuron/nrniv/nrniv_decl.h" +#include "coreneuron/nrniv/nrnmutdec.h" #include "coreneuron/nrniv/output_spikes.h" #include "coreneuron/nrniv/nrn_checkpoint.h" #include "coreneuron/utils/endianness.h" @@ -54,9 +55,86 @@ THE POSSIBILITY OF SUCH DAMAGE. #include "coreneuron/nrniv/partrans.h" #include "coreneuron/nrniv/multisend.h" #include "coreneuron/utils/file_utils.h" +#include "coreneuron/nrniv/nrn2core_direct.h" #include #include +extern "C" { +const char* corenrn_version() { + return coreneuron::bbcore_write_version; +} + +/** + * If "export OMP_NUM_THREADS=n" is not set then omp by default sets + * the number of threads equal to the number of cores on this node. + * If there are a number of mpi processes on this node as well, things + * can go very slowly as there are so many more threads than cores. + * Assume the NEURON users pc.nthread() is well chosen if + * OMP_NUM_THREADS is not set. + */ +void set_openmp_threads(int nthread) { +#if defined(_OPENMP) + if (!getenv("OMP_NUM_THREADS")) { + omp_set_num_threads(nthread); + } +#endif +} + +/** + * Convert char* containing arguments from neuron to char* argv[] for + * coreneuron command line argument parser. + */ +char* prepare_args(int& argc, char**& argv, int use_mpi, const char* arg) { + // first construct all arguments as string + std::string args(arg); + args.insert(0, " coreneuron "); + if (use_mpi) { + args.append(" -mpi "); + } + + // we can't modify string with strtok, make copy + char* first = strdup(args.c_str()); + const char* sep = " "; + + // first count the no of argument + char* token = strtok(first, sep); + argc = 0; + while (token) { + token = strtok(NULL, sep); + argc++; + } + free(first); + + // now build char*argv + argv = new char*[argc]; + first = strdup(args.c_str()); + token = strtok(first, sep); + for (int i = 0; token; i++) { + argv[i] = token; + token = strtok(NULL, sep); + } + + // return actual data to be freed + return first; +} + +int corenrn_embedded_run(int nthread, int have_gaps, int use_mpi, const char* arg) { + corenrn_embedded = 1; + corenrn_embedded_nthread = nthread; + coreneuron::nrn_have_gaps = have_gaps; + + set_openmp_threads(nthread); + int argc = 0; + char** argv; + char* new_arg = prepare_args(argc, argv, use_mpi, arg); + solve_core(argc, argv); + free(new_arg); + delete[] argv; + + return corenrn_embedded; +} +} + #if 0 #include #define NRN_FEEXCEPT (FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) @@ -120,7 +198,8 @@ void nrn_init_and_load_data(int argc, mk_mech(nrnopt_get_str("--datpath").c_str()); // read the global variable names and set their values from globals.dat - set_globals(nrnopt_get_str("--datpath").c_str(), nrnopt_get_flag("--seed"), nrnopt_get_int("--seed")); + set_globals(nrnopt_get_str("--datpath").c_str(), nrnopt_get_flag("--seed"), + nrnopt_get_int("--seed")); report_mem_usage("After mk_mech"); @@ -285,7 +364,6 @@ extern "C" int solve_core(int argc, char** argv) { reports_needs_finalize = configs.size(); } } - // initializationa and loading functions moved to separate nrn_init_and_load_data(argc, argv, configs.size() > 0); std::string checkpoint_path = nrnopt_get_str("--checkpoint"); @@ -329,7 +407,7 @@ extern "C" int solve_core(int argc, char** argv) { // register all reports into reportinglib double min_report_dt = INT_MAX; - for (int i = 0; i < configs.size(); i++) { + for (size_t i = 0; i < configs.size(); i++) { register_report(dt, tstop, delay, configs[i]); if (configs[i].report_dt < min_report_dt) { min_report_dt = configs[i].report_dt; diff --git a/coreneuron/nrniv/mk_mech.cpp b/coreneuron/nrniv/mk_mech.cpp index bc4499264..7d07d3e96 100644 --- a/coreneuron/nrniv/mk_mech.cpp +++ b/coreneuron/nrniv/mk_mech.cpp @@ -29,6 +29,9 @@ THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include +#include +#include #include "coreneuron/nrnconf.h" #include "coreneuron/nrnoc/multicore.h" #include "coreneuron/nrnoc/membdef.h" @@ -37,6 +40,7 @@ THE POSSIBILITY OF SUCH DAMAGE. #include "coreneuron/nrniv/nrn_assert.h" #include "coreneuron/utils/sdprintf.h" #include "coreneuron/mech/cfile/cabvars.h" +#include "coreneuron/nrniv/nrn2core_direct.h" static char banner[] = "Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015"; @@ -62,30 +66,73 @@ int nrn_need_byteswap; std::map mech2type; +extern "C" { +void (*nrn2core_mkmech_info_)(std::ostream&); +} +static void mk_mech(); +static void mk_mech(std::istream&); + /// Read meta data about the mechanisms and allocate corresponding mechanism management data /// structures void mk_mech(const char* datpath) { + if (corenrn_embedded) { + // we are embedded in NEURON + mk_mech(); + return; + } char fnamebuf[1024]; sd_ptr fname = sdprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", datpath, "bbcore_mech.dat"); - FILE* f; - f = fopen(fname, "r"); + std::ifstream fs(fname); - if (f == NULL) { + if (!fs.good()) { fprintf(stderr, "Error: couldn't find bbcore_mech.dat file in the dataset directory \n"); fprintf( stderr, " Make sure to pass full directory path of dataset using -d DIR or --datpath=DIR \n"); } + nrn_assert(fs.good()); + mk_mech(fs); + fs.close(); + + fname = sdprintf(fnamebuf, sizeof(fnamebuf), "%s/%s", datpath, "byteswap1.dat"); + FILE* f; + f = fopen(fname, "r"); + if (!f) { + fprintf(stderr, "Error: couldn't find byteswap1.dat file in the dataset directory \n"); + } nrn_assert(f); + // file consists of int32_t binary 1 . After reading can decide if + // binary info in files needs to be byteswapped. + int32_t x; + nrn_assert(fread(&x, sizeof(int32_t), 1, f) == 1); + nrn_need_byteswap = 0; + if (x != 1) { + BYTEHEADER; + nrn_need_byteswap = 1; + BYTESWAP(x, int32_t); + nrn_assert(x == 1); + } + fclose(f); +} + +// we are embedded in NEURON, get info as stringstream from nrnbbcore_write.cpp +static void mk_mech() { + nrn_need_byteswap = 0; + std::stringstream ss; + nrn_assert(nrn2core_mkmech_info_); + (*nrn2core_mkmech_info_)(ss); + mk_mech(ss); +} +static void mk_mech(std::istream& s) { char version[256]; - fscanf(f, "%s\n", version); + s >> version; check_bbcore_write_version(version); // printf("reading %s\n", fname); int n = 0; - nrn_assert(fscanf(f, "%d\n", &n) == 1); + nrn_assert(s >> n); /// Allocate space for mechanism related data structures alloc_mech(n); @@ -94,8 +141,7 @@ void mk_mech(const char* datpath) { for (int i = 2; i < n; ++i) { char mname[100]; int type = 0, pnttype = 0, is_art = 0, is_ion = 0, dsize = 0, pdsize = 0; - nrn_assert(fscanf(f, "%s %d %d %d %d %d %d\n", mname, &type, &pnttype, &is_art, &is_ion, - &dsize, &pdsize) == 7); + nrn_assert(s >> mname >> type >> pnttype >> is_art >> is_ion >> dsize >> pdsize); nrn_assert(i == type); #ifdef DEBUG printf("%s %d %d %d %d %d %d\n", mname, type, pnttype, is_art, is_ion, dsize, pdsize); @@ -109,7 +155,7 @@ void mk_mech(const char* datpath) { nrn_is_artificial_[type] = is_art; if (is_ion) { double charge = 0.; - nrn_assert(fscanf(f, "%lf\n", &charge) == 1); + nrn_assert(s >> charge); // strip the _ion char iname[100]; strcpy(iname, mname); @@ -120,20 +166,6 @@ void mk_mech(const char* datpath) { // printf("%s %d %d\n", mname, nrn_get_mechtype(mname), type); } - // an int32_t binary 1 is at this position. After reading can decide if - // binary info in files needs to be byteswapped. - int32_t x; - nrn_assert(fread(&x, sizeof(int32_t), 1, f) == 1); - nrn_need_byteswap = 0; - if (x != 1) { - BYTEHEADER; - nrn_need_byteswap = 1; - BYTESWAP(x, int32_t); - nrn_assert(x == 1); - } - - fclose(f); - if (nrnmpi_myid < 1 && nrn_nobanner_ == 0) { fprintf(stderr, " \n"); fprintf(stderr, " %s\n", banner); diff --git a/coreneuron/nrniv/nrn2core_direct.h b/coreneuron/nrniv/nrn2core_direct.h new file mode 100644 index 000000000..ff31c17ca --- /dev/null +++ b/coreneuron/nrniv/nrn2core_direct.h @@ -0,0 +1,92 @@ +#ifndef nrn2core_direct_h +#define nrn2core_direct_h + +#include + +extern "C" { +// The callbacks into nrn/src/nrniv/nrnbbcore_write.cpp to get +// data directly instead of via files. + +extern int corenrn_embedded; +extern int corenrn_embedded_nthread; + +extern void (*nrn2core_group_ids_)(int*); + +extern void (*nrn2core_mkmech_info_)(std::ostream&); + +extern void* (*nrn2core_get_global_dbl_item_)(void*, const char*& name, int& size, double*& val); +extern int (*nrn2core_get_global_int_item_)(const char* name); + +extern void (*nrn2core_get_partrans_setup_info_)(int tid, + int& ntar, + int& nsrc, + int& type, + int& ix_vpre, + int*& sid_target, + int*& sid_src, + int*& v_indices); + +extern int (*nrn2core_get_dat1_)(int tid, + int& n_presyn, + int& n_netcon, + int*& output_gid, + int*& netcon_srcgid); + +extern int (*nrn2core_get_dat2_1_)(int tid, + int& ngid, + int& n_real_gid, + int& nnode, + int& ndiam, + int& nmech, + int*& tml_index, + int*& ml_nodecount, + int& nidata, + int& nvdata, + int& nweight); + +extern int (*nrn2core_get_dat2_2_)(int tid, + int*& v_parent_index, + double*& a, + double*& b, + double*& area, + double*& v, + double*& diamvec); + +extern int (*nrn2core_get_dat2_mech_)(int tid, + size_t i, + int dsz_inst, + int*& nodeindices, + double*& data, + int*& pdata); + +extern int (*nrn2core_get_dat2_3_)(int tid, + int nweight, + int*& output_vindex, + double*& output_threshold, + int*& netcon_pnttype, + int*& netcon_pntindex, + double*& weights, + double*& delays); + +extern int (*nrn2core_get_dat2_corepointer_)(int tid, int& n); + +extern int (*nrn2core_get_dat2_corepointer_mech_)(int tid, + int type, + int& icnt, + int& dcnt, + int*& iarray, + double*& darray); + +extern int (*nrn2core_get_dat2_vecplay_)(int tid, int& n); + +extern int (*nrn2core_get_dat2_vecplay_inst_)(int tid, + int i, + int& vptype, + int& mtype, + int& ix, + int& sz, + double*& yvec, + double*& tvec); +} + +#endif /* nrn2core_direct_h */ diff --git a/coreneuron/nrniv/nrn_filehandler.cpp b/coreneuron/nrniv/nrn_filehandler.cpp index ff901bce6..30727b927 100644 --- a/coreneuron/nrniv/nrn_filehandler.cpp +++ b/coreneuron/nrniv/nrn_filehandler.cpp @@ -41,7 +41,8 @@ void FileHandler::open(const char* filename, bool reorder, std::ios::openmode mo reorder_bytes = reorder; close(); F.open(filename, mode | std::ios::binary); - if (! F.is_open()) fprintf (stderr, "cannot open file %s\n", filename); + if (!F.is_open()) + fprintf(stderr, "cannot open file %s\n", filename); nrn_assert(F.is_open()); current_mode = mode; char version[256]; diff --git a/coreneuron/nrniv/nrn_setup.cpp b/coreneuron/nrniv/nrn_setup.cpp index f9823a110..52fd27fba 100644 --- a/coreneuron/nrniv/nrn_setup.cpp +++ b/coreneuron/nrniv/nrn_setup.cpp @@ -49,6 +49,85 @@ THE POSSIBILITY OF SUCH DAMAGE. #include "coreneuron/nrniv/cellorder.h" #include "coreneuron/utils/reports/nrnsection_mapping.h" +// callbacks into nrn/src/nrniv/nrnbbcore_write.cpp +#include "coreneuron/nrniv/nrn2core_direct.h" + +int corenrn_embedded; +int corenrn_embedded_nthread; + +void (*nrn2core_group_ids_)(int*); + +void (*nrn2core_get_partrans_setup_info_)(int tid, + int& ntar, + int& nsrc, + int& type, + int& ix_vpre, + int*& sid_target, + int*& sid_src, + int*& v_indices); + +int (*nrn2core_get_dat1_)(int tid, + int& n_presyn, + int& n_netcon, + int*& output_gid, + int*& netcon_srcgid); + +int (*nrn2core_get_dat2_1_)(int tid, + int& ngid, + int& n_real_gid, + int& nnode, + int& ndiam, + int& nmech, + int*& tml_index, + int*& ml_nodecount, + int& nidata, + int& nvdata, + int& nweight); + +int (*nrn2core_get_dat2_2_)(int tid, + int*& v_parent_index, + double*& a, + double*& b, + double*& area, + double*& v, + double*& diamvec); + +int (*nrn2core_get_dat2_mech_)(int tid, + size_t i, + int dsz_inst, + int*& nodeindices, + double*& data, + int*& pdata); + +int (*nrn2core_get_dat2_3_)(int tid, + int nweight, + int*& output_vindex, + double*& output_threshold, + int*& netcon_pnttype, + int*& netcon_pntindex, + double*& weights, + double*& delays); + +int (*nrn2core_get_dat2_corepointer_)(int tid, int& n); + +int (*nrn2core_get_dat2_corepointer_mech_)(int tid, + int type, + int& icnt, + int& dcnt, + int*& iarray, + double*& darray); + +int (*nrn2core_get_dat2_vecplay_)(int tid, int& n); + +int (*nrn2core_get_dat2_vecplay_inst_)(int tid, + int i, + int& vptype, + int& mtype, + int& ix, + int& sz, + double*& yvec, + double*& tvec); + // file format defined in cooperation with nrncore/src/nrniv/nrnbbcore_write.cpp // single integers are ascii one per line. arrays are binary int or double // Note that regardless of the gid contents of a group, since all gids are @@ -206,6 +285,18 @@ static void store_phase_args(int ngroup, /* read files.dat file and distribute cellgroups to all mpi ranks */ void nrn_read_filesdat(int& ngrp, int*& grp, int multiple, int*& imult, const char* filesdat) { patstimtype = nrn_get_mechtype("PatternStim"); + if (corenrn_embedded) { + ngrp = corenrn_embedded_nthread; + nrn_assert(multiple == 1); + grp = new int[ngrp + 1]; + imult = new int[ngrp + 1]; + (*nrn2core_group_ids_)(grp); + for (int i = 0; i <= ngrp; ++i) { + imult[i] = 0; + } + return; + } + FILE* fp = fopen(filesdat, "r"); if (!fp) { @@ -249,6 +340,7 @@ void nrn_read_filesdat(int& ngrp, int*& grp, int multiple, int*& imult, const ch ngrp++; } if ((iNum + 1) % iNumFiles == 0) { + // re-read file for each multiple (skipping the two header lines) rewind(fp); fscanf(fp, "%*s\n"); fscanf(fp, "%*d\n"); @@ -258,14 +350,23 @@ void nrn_read_filesdat(int& ngrp, int*& grp, int multiple, int*& imult, const ch fclose(fp); } +static void read_phase1(int* output_gid, int imult, NrnThread& nt); + +static void* direct_phase1(NrnThread* n) { + NrnThread& nt = *n; + int* output_gid; + int valid = + (*nrn2core_get_dat1_)(nt.id, nt.n_presyn, nt.n_netcon, output_gid, netcon_srcgid[nt.id]); + if (valid) { + read_phase1(output_gid, 0, nt); + } + return NULL; +} + void read_phase1(FileHandler& F, int imult, NrnThread& nt) { assert(!F.fail()); - int zz = imult * maxgid; // offset for each gid nt.n_presyn = F.read_int(); /// Number of PreSyn-s in NrnThread nt nt.n_netcon = F.read_int(); /// Number of NetCon-s in NrnThread nt - nt.presyns = new PreSyn[nt.n_presyn]; - nt.netcons = new NetCon[nt.n_netcon + nrn_setup_extracon]; - nt.presyns_helper = (PreSynHelper*)ecalloc(nt.n_presyn, sizeof(PreSynHelper)); int* output_gid = F.read_array(nt.n_presyn); // the extra netcon_srcgid will be filled in later @@ -273,22 +374,11 @@ void read_phase1(FileHandler& F, int imult, NrnThread& nt) { F.read_array(netcon_srcgid[nt.id], nt.n_netcon); F.close(); -#if 0 - // for checking whether negative gids fit into the gid space - // not used for now since negative gids no longer encode the thread id. - double dmaxint = 1073741824.; //2^30 - for (;;) { - if (dmaxint*2. == double(int(dmaxint*2.))) { - dmaxint *= 2.; - }else{ - if (dmaxint*2. - 1. == double(int(dmaxint*2. - 1.))) { - dmaxint = 2.*dmaxint - 1.; - break; - } - } - } -#endif + read_phase1(output_gid, imult, nt); +} +static void read_phase1(int* output_gid, int imult, NrnThread& nt) { + int zz = imult * maxgid; // offset for each gid // offset the (non-negative) gids according to multiple // make sure everything fits into gid space. for (int i = 0; i < nt.n_presyn; ++i) { @@ -297,6 +387,11 @@ void read_phase1(FileHandler& F, int imult, NrnThread& nt) { output_gid[i] += zz; } } + + nt.presyns = new PreSyn[nt.n_presyn]; + nt.netcons = new NetCon[nt.n_netcon + nrn_setup_extracon]; + nt.presyns_helper = (PreSynHelper*)ecalloc(nt.n_presyn, sizeof(PreSynHelper)); + int* nc_srcgid = netcon_srcgid[nt.id]; for (int i = 0; i < nt.n_netcon; ++i) { if (nc_srcgid[i] >= 0) { @@ -345,6 +440,7 @@ void read_phase1(FileHandler& F, int imult, NrnThread& nt) { nt.presyns[i].output_index_ = -1; } } + delete[] output_gid; if (nrn_setup_extracon > 0) { @@ -638,12 +734,25 @@ void nrn_setup(const char* filesdat, assert(nrn_setup_multiple == 1); nrn_partrans::transfer_thread_data_ = new nrn_partrans::TransferThreadData[nrn_nthread]; nrn_partrans::setup_info_ = new nrn_partrans::SetupInfo[ngroup]; - coreneuron::phase_wrapper(); + if (!corenrn_embedded) { + coreneuron::phase_wrapper(); + } else { + nrn_assert(sizeof(nrn_partrans::sgid_t) == sizeof(int)); + for (int i = 0; i < ngroup; ++i) { + nrn_partrans::SetupInfo& si = nrn_partrans::setup_info_[i]; + (*nrn2core_get_partrans_setup_info_)(i, si.ntar, si.nsrc, si.type, si.ix_vpre, + si.sid_target, si.sid_src, si.v_indices); + } + } nrn_partrans::gap_mpi_setup(ngroup); } - coreneuron::phase_wrapper<( - coreneuron::phase)1>(); /// If not the xlc compiler, it should be coreneuron::phase::one + if (!corenrn_embedded) { + coreneuron::phase_wrapper<(coreneuron::phase)1>(); /// If not the xlc compiler, it should + /// be coreneuron::phase::one + } else { + nrn_multithread_job(direct_phase1); + } // from the gid2out map and the netcon_srcgid array, // fill the gid2in, and from the number of entries, @@ -653,7 +762,7 @@ void nrn_setup(const char* filesdat, // read the rest of the gidgroup's data and complete the setup for each // thread. /* nrn_multithread_job supports serial, pthread, and openmp. */ - coreneuron::phase_wrapper<(coreneuron::phase)2>(); + coreneuron::phase_wrapper<(coreneuron::phase)2>(corenrn_embedded); if (is_mapping_needed) coreneuron::phase_wrapper<(coreneuron::phase)3>(); @@ -800,10 +909,23 @@ void nrn_inverse_i_layout(int i, int& icnt, int cnt, int& isz, int sz, int layou template inline void mech_layout(FileHandler& F, T* data, int cnt, int sz, int layout) { if (layout == 1) { /* AoS */ + if (corenrn_embedded) { + return; + } F.read_array(data, cnt * sz); } else if (layout == 0) { /* SoA */ int align_cnt = nrn_soa_padded_size(cnt, layout); - T* d = F.read_array(cnt * sz); + T* d; + if (corenrn_embedded) { + d = new T[cnt * sz]; + for (int i = 0; i < cnt; ++i) { + for (int j = 0; j < sz; ++j) { + d[i * sz + j] = data[i * sz + j]; + } + } + } else { + d = F.read_array(cnt * sz); + } for (int i = 0; i < cnt; ++i) { for (int j = 0; j < sz; ++j) { data[i + j * align_cnt] = d[i * sz + j]; @@ -976,28 +1098,53 @@ void nrn_cleanup(bool clean_ion_global_map) { netcon_in_presyn_order_.clear(); nrn_threads_free(); + + if (pnttype2presyn) { + free(pnttype2presyn); + } } void read_phase2(FileHandler& F, int imult, NrnThread& nt) { - assert(!F.fail()); + bool direct = corenrn_embedded ? true : false; + if (!direct) { + assert(!F.fail()); // actually should assert that it is open + } nrn_assert(imult >= 0); // avoid imult unused warning #if 1 || CHKPNTDEBUG NrnThreadChkpnt& ntc = nrnthread_chkpnt[nt.id]; ntc.file_id = gidgroups_w[nt.id]; #endif NrnThreadMembList* tml; - int n_outputgid = F.read_int(); + + int n_outputgid, ndiam, nmech, *tml_index, *ml_nodecount; + if (direct) { + int nidata, nvdata; + (*nrn2core_get_dat2_1_)(nt.id, n_outputgid, nt.ncell, nt.end, ndiam, nmech, tml_index, + ml_nodecount, nidata, nvdata, nt.n_weight); + nt._nidata = nidata; + nt._nvdata = nvdata; + } else { + n_outputgid = F.read_int(); + nt.ncell = F.read_int(); + nt.end = F.read_int(); + ndiam = F.read_int(); // 0 if not needed, else nt.end + nmech = F.read_int(); + tml_index = new int[nmech]; + ml_nodecount = new int[nmech]; + for (int i = 0; i < nmech; ++i) { + tml_index[i] = F.read_int(); + ml_nodecount[i] = F.read_int(); + } + nt._nidata = F.read_int(); + nt._nvdata = F.read_int(); + nt.n_weight = F.read_int(); + } + #if CHKPNTDEBUG ntc.n_outputgids = n_outputgid; -#endif - nrn_assert(n_outputgid > 0); // avoid n_outputgid unused warning - nt.ncell = F.read_int(); - nt.end = F.read_int(); - int ndiam = F.read_int(); // 0 if not needed, else nt.end - int nmech = F.read_int(); -#if CHKPNTDEBUG ntc.nmech = nmech; #endif + nrn_assert(n_outputgid > 0); // avoid n_outputgid unused warning /// Checkpoint in coreneuron is defined for both phase 1 and phase 2 since they are written /// together @@ -1035,11 +1182,11 @@ void read_phase2(FileHandler& F, int imult, NrnThread& nt) { tml->ml->_net_send_buffer = NULL; tml->ml->_permute = NULL; tml->next = NULL; - tml->index = F.read_int(); + tml->index = tml_index[i]; if (memb_func[tml->index].alloc == NULL) { hoc_execerror(memb_func[tml->index].sym, "mechanism does not exist"); } - tml->ml->nodecount = F.read_int(); + tml->ml->nodecount = ml_nodecount[i]; if (!memb_func[tml->index].sym) { printf("%s (type %d) is not available\n", nrn_get_mechname(tml->index), tml->index); exit(1); @@ -1067,6 +1214,8 @@ void read_phase2(FileHandler& F, int imult, NrnThread& nt) { } tml_last = tml; } + delete[] tml_index; + delete[] ml_nodecount; if (shadow_rhs_cnt) { nt._shadow_rhs = (double*)ecalloc_align(nrn_soa_padded_size(shadow_rhs_cnt, 0), @@ -1076,10 +1225,6 @@ void read_phase2(FileHandler& F, int imult, NrnThread& nt) { nt.shadow_rhs_cnt = shadow_rhs_cnt; } - nt._nidata = F.read_int(); - nt._nvdata = F.read_int(); - nt.n_weight = F.read_int(); - nt._data = NULL; // allocated below after padding nt.mapping = NULL; // section segment mapping @@ -1145,22 +1290,25 @@ void read_phase2(FileHandler& F, int imult, NrnThread& nt) { // matrix info nt._v_parent_index = (int*)ecalloc_align(nt.end, NRN_SOA_BYTE_ALIGN, sizeof(int)); - F.read_array(nt._v_parent_index, nt.end); + if (direct) { + (*nrn2core_get_dat2_2_)(nt.id, nt._v_parent_index, nt._actual_a, nt._actual_b, + nt._actual_area, nt._actual_v, nt._actual_diam); + } else { + F.read_array(nt._v_parent_index, nt.end); + F.read_array(nt._actual_a, nt.end); + F.read_array(nt._actual_b, nt.end); + F.read_array(nt._actual_area, nt.end); + F.read_array(nt._actual_v, nt.end); + if (ndiam) { + F.read_array(nt._actual_diam, nt.end); + } + } #if CHKPNTDEBUG ntc.parent = new int[nt.end]; memcpy(ntc.parent, nt._v_parent_index, nt.end * sizeof(int)); -#endif - F.read_array(nt._actual_a, nt.end); - F.read_array(nt._actual_b, nt.end); - F.read_array(nt._actual_area, nt.end); -#if CHKPNTDEBUG ntc.area = new double[nt.end]; memcpy(ntc.area, nt._actual_area, nt.end * sizeof(double)); #endif - F.read_array(nt._actual_v, nt.end); - if (ndiam) { - F.read_array(nt._actual_diam, nt.end); - } int synoffset = 0; int* pnt_offset = new int[n_memb_func]; @@ -1168,27 +1316,41 @@ void read_phase2(FileHandler& F, int imult, NrnThread& nt) { // All the mechanism data and pdata. // Also fill in the pnt_offset // Complete spec of Point_process except for the acell presyn_ field. - for (tml = nt.tml; tml; tml = tml->next) { + int itml = 0; + int dsz_inst = 0; + for (tml = nt.tml, itml = 0; tml; tml = tml->next, ++itml) { int type = tml->index; Memb_list* ml = tml->ml; int is_art = nrn_is_artificial_[type]; int n = ml->nodecount; int szp = nrn_prop_param_size_[type]; int szdp = nrn_prop_dparam_size_[type]; + int layout = nrn_mech_data_layout_[type]; - if (!is_art) { + if (!is_art && !direct) { ml->nodeindices = (int*)ecalloc_align(ml->nodecount, NRN_SOA_BYTE_ALIGN, sizeof(int)); - F.read_array(ml->nodeindices, ml->nodecount); } else { ml->nodeindices = NULL; } + if (szdp) { + ml->pdata = (int*)ecalloc_align(nrn_soa_padded_size(n, layout) * szdp, + NRN_SOA_BYTE_ALIGN, sizeof(int)); + } + + if (direct) { + (*nrn2core_get_dat2_mech_)(nt.id, itml, dsz_inst, ml->nodeindices, ml->data, ml->pdata); + } else { + if (!is_art) { + F.read_array(ml->nodeindices, ml->nodecount); + } + } + if (szdp) { + ++dsz_inst; + } - int layout = nrn_mech_data_layout_[type]; mech_layout(F, ml->data, n, szp, layout); if (szdp) { - ml->pdata = (int*)ecalloc_align(nrn_soa_padded_size(n, layout) * szdp, - NRN_SOA_BYTE_ALIGN, sizeof(int)); mech_layout(F, ml->pdata, n, szdp, layout); #if CHKPNTDEBUG // Not substantive. Only for debugging. Memb_list_ckpnt* mlc = ntc.mlmap[type]; @@ -1479,7 +1641,9 @@ for (int i=0; i < nt.end; ++i) { } // from nrn_has_net_event create pnttype2presyn. - pnttype2presyn = (int*)ecalloc(n_memb_func, sizeof(int)); + if (!pnttype2presyn) { + pnttype2presyn = (int*)ecalloc(n_memb_func, sizeof(int)); + } for (int i = 0; i < n_memb_func; ++i) { pnttype2presyn[i] = -1; } @@ -1500,7 +1664,15 @@ for (int i=0; i < nt.end; ++i) { // Here we associate the real cells with voltage pointers and // acell PreSyn with the Point_process. // nt.presyns order same as output_vindex order - int* output_vindex = F.read_array(nt.n_presyn); + int *output_vindex, *pnttype, *pntindex; + double *output_threshold, *delay; + if (direct) { + (*nrn2core_get_dat2_3_)(nt.id, nt.n_weight, output_vindex, output_threshold, pnttype, + pntindex, nt.weights, delay); + } + if (!direct) { + output_vindex = F.read_array(nt.n_presyn); + } #if CHKPNTDEBUG ntc.output_vindex = new int[nt.n_presyn]; memcpy(ntc.output_vindex, output_vindex, nt.n_presyn * sizeof(int)); @@ -1509,7 +1681,9 @@ for (int i=0; i < nt.end; ++i) { // only indices >= 0 (i.e. _actual_v indices) will be changed. node_permute(output_vindex, nt.n_presyn, nt._permute); } - double* output_threshold = F.read_array(nt.ncell); + if (!direct) { + output_threshold = F.read_array(nt.ncell); + } #if CHKPNTDEBUG ntc.output_threshold = new double[nt.ncell]; memcpy(ntc.output_threshold, output_threshold, nt.ncell * sizeof(double)); @@ -1562,8 +1736,12 @@ for (int i=0; i < nt.end; ++i) { // Make NetCon.target_ point to proper Point_process. Only the NetCon // with pnttype[i] > 0 have a target. - int* pnttype = F.read_array(nnetcon); - int* pntindex = F.read_array(nnetcon); + if (!direct) { + pnttype = F.read_array(nnetcon); + } + if (!direct) { + pntindex = F.read_array(nnetcon); + } #if CHKPNTDEBUG ntc.pnttype = new int[nnetcon]; ntc.pntindex = new int[nnetcon]; @@ -1619,8 +1797,10 @@ for (int i=0; i < nt.end; ++i) { // weights in netcons order in groups defined by Point_process target type. nt.n_weight += nrn_setup_extracon * extracon_target_nweight; - nt.weights = new double[nt.n_weight]; - F.read_array(nt.weights, nweight); + if (!direct) { + nt.weights = new double[nt.n_weight]; + F.read_array(nt.weights, nweight); + } int iw = 0; for (int i = 0; i < nnetcon; ++i) { @@ -1636,7 +1816,9 @@ for (int i=0; i < nt.end; ++i) { delete[] pnttype; // delays in netcons order - double* delay = F.read_array(nnetcon); + if (!direct) { + delay = F.read_array(nnetcon); + } #if CHKPNTDEBUG ntc.delay = new double[nnetcon]; memcpy(ntc.delay, delay, nnetcon * sizeof(double)); @@ -1658,18 +1840,38 @@ for (int i=0; i < nt.end; ++i) { } // BBCOREPOINTER information - npnt = F.read_int(); + if (direct) { + (*nrn2core_get_dat2_corepointer_)(nt.id, npnt); + } else { + npnt = F.read_int(); + } #if CHKPNTDEBUG ntc.nbcp = npnt; ntc.bcpicnt = new int[npnt]; ntc.bcpdcnt = new int[npnt]; ntc.bcptype = new int[npnt]; #endif - for (int i = 0; i < npnt; ++i) { + for (NrnThreadMembList* tml = nt.tml; tml; tml = tml->next) { + int type = tml->index; + if (!nrn_bbcore_read_[type]) { + continue; + } int* iArray = NULL; double* dArray = NULL; - int type = F.read_int(); - assert(nrn_bbcore_read_[type]); + int icnt, dcnt; + if (direct) { + (*nrn2core_get_dat2_corepointer_mech_)(nt.id, type, icnt, dcnt, iArray, dArray); + } else { + type = F.read_int(); + icnt = F.read_int(); + dcnt = F.read_int(); + if (icnt) { + iArray = F.read_array(icnt); + } + if (dcnt) { + dArray = F.read_array(dcnt); + } + } if (!nrn_bbcore_write_[type] && nrn_checkpoint_arg_exists) { fprintf( stderr, @@ -1677,19 +1879,11 @@ for (int i=0; i < nt.end; ++i) { memb_func[type].sym); assert(nrn_bbcore_write_[type]); } - int icnt = F.read_int(); - int dcnt = F.read_int(); #if CHKPNTDEBUG ntc.bcptype[i] = type; ntc.bcpicnt[i] = icnt; ntc.bcpdcnt[i] = dcnt; #endif - if (icnt) { - iArray = F.read_array(icnt); - } - if (dcnt) { - dArray = F.read_array(dcnt); - } int ik = 0; int dk = 0; Memb_list* ml = nt._ml_list[type]; @@ -1722,7 +1916,12 @@ for (int i=0; i < nt.end; ++i) { // VecPlayContinuous instances // No attempt at memory efficiency - int n = F.read_int(); + int n; + if (direct) { + (*nrn2core_get_dat2_vecplay_)(nt.id, n); + } else { + n = F.read_int(); + } nt.n_vecplay = n; if (n) { nt._vecplay = new void*[n]; @@ -1735,40 +1934,57 @@ for (int i=0; i < nt.end; ++i) { ntc.mtype = new int[n]; #endif for (int i = 0; i < n; ++i) { - int vtype = F.read_int(); + int vtype, mtype, ix, sz; + double *yvec1, *tvec1; + if (direct) { + (*nrn2core_get_dat2_vecplay_inst_)(nt.id, i, vtype, mtype, ix, sz, yvec1, tvec1); + } else { + vtype = F.read_int(); + mtype = F.read_int(); + ix = F.read_int(); + sz = F.read_int(); + } nrn_assert(vtype == VecPlayContinuousType); #if CHKPNTDEBUG ntc.vtype[i] = vtype; #endif - int mtype = F.read_int(); #if CHKPNTDEBUG ntc.mtype[i] = mtype; #endif Memb_list* ml = nt._ml_list[mtype]; - int ix = F.read_int(); - int sz = F.read_int(); #if CHKPNTDEBUG ntc.vecplay_ix[i] = ix; #endif IvocVect* yvec = vector_new(sz); - F.read_array(vector_vec(yvec), sz); IvocVect* tvec = vector_new(sz); - F.read_array(vector_vec(tvec), sz); + if (direct) { + double* py = vector_vec(yvec); + double* pt = vector_vec(tvec); + for (int j = 0; j < sz; ++j) { + py[j] = yvec1[j]; + pt[j] = tvec1[j]; + } + delete[] yvec1; + delete[] tvec1; + } else { + F.read_array(vector_vec(yvec), sz); + F.read_array(vector_vec(tvec), sz); + } ix = nrn_param_layout(ix, mtype, ml); if (ml->_permute) { ix = nrn_index_permute(ix, mtype, ml); } nt._vecplay[i] = new VecPlayContinuous(ml->data + ix, yvec, tvec, NULL, nt.id); } + if (!direct) { + // store current checkpoint state to continue reading mapping + F.record_checkpoint(); - // store current checkpoint state to continue reading mapping - F.record_checkpoint(); - - // If not at end of file, then this must be a checkpoint and restore tqueue. - if (!F.eof()) { - checkpoint_restore_tqueue(nt, F); + // If not at end of file, then this must be a checkpoint and restore tqueue. + if (!F.eof()) { + checkpoint_restore_tqueue(nt, F); + } } - // NetReceiveBuffering for (int i = 0; i < net_buf_receive_cnt_; ++i) { int type = net_buf_receive_type_[i]; diff --git a/coreneuron/nrniv/nrn_setup.h b/coreneuron/nrniv/nrn_setup.h index 0cd09faf3..4c6929a66 100644 --- a/coreneuron/nrniv/nrn_setup.h +++ b/coreneuron/nrniv/nrn_setup.h @@ -34,6 +34,7 @@ THE POSSIBILITY OF SUCH DAMAGE. #include "coreneuron/nrniv/nrn_filehandler.h" #include "coreneuron/utils/sdprintf.h" namespace coreneuron { +static bool do_not_open; static int ngroup_w; static int* gidgroups_w; static int* imult_w; @@ -112,27 +113,31 @@ inline void read_phase_aux(FileHandler& F, int imult, NrnThread& nt) { /// Reading phase wrapper for each neuron group. template inline void* phase_wrapper_w(NrnThread* nt) { + bool no_open = do_not_open; int i = nt->id; char fnamebuf[1000]; char check_fnamebuf[1000] = ""; if (i < ngroup_w) { - const char* data_dir = path_w; - // directory to read could be different for phase 2 if we are restoring - // all other phases still read from dataset directory because the data - // is constant - if (P == 2) { - data_dir = restore_path_w; + if (!no_open) { + const char* data_dir = path_w; + // directory to read could be different for phase 2 if we are restoring + // all other phases still read from dataset directory because the data + // is constant + if (P == 2) { + data_dir = restore_path_w; + } + + sd_ptr fname = sdprintf(fnamebuf, sizeof(fnamebuf), + std::string("%s/%d_" + getPhaseName

() + ".dat").c_str(), + data_dir, gidgroups_w[i]); + + // if no file failed to open or not opened at all + file_reader_w[i].open(fname, byte_swap_w); } - - sd_ptr fname = sdprintf(fnamebuf, sizeof(fnamebuf), - std::string("%s/%d_" + getPhaseName

() + ".dat").c_str(), - data_dir, gidgroups_w[i]); - - // if no file failed to open or not opened at all - file_reader_w[i].open(fname, byte_swap_w); - read_phase_aux

(file_reader_w[i], imult_w[i], *nt); - file_reader_w[i].close(); + if (!no_open) { + file_reader_w[i].close(); + } if (P == 2) { setup_ThreadData(*nt); } @@ -142,8 +147,14 @@ inline void* phase_wrapper_w(NrnThread* nt) { /// Specific phase reading executed by threads. template -inline static void phase_wrapper() { +inline static void phase_wrapper(int direct = 0) { + if (direct) { + do_not_open = true; + } nrn_multithread_job(phase_wrapper_w

); + if (direct) { + do_not_open = false; + } } } // namespace coreneuron } // namespace coreneuron diff --git a/coreneuron/nrniv/nrnoptarg.cpp b/coreneuron/nrniv/nrnoptarg.cpp index f4fc10a81..9a883b304 100644 --- a/coreneuron/nrniv/nrnoptarg.cpp +++ b/coreneuron/nrniv/nrnoptarg.cpp @@ -70,7 +70,7 @@ static param_int param_int_args[] = { "Model duplication factor. Model size is normal size * (int)."}, {"--extracon -x", 0, 0, 10000000, "Number of extra random connections in each thread to other duplicate models (int)."}, - {"--seed -s", -1,0, 100000000, "Initialization seed for random number generator (int)."}, + {"--seed -s", -1, 0, 100000000, "Initialization seed for random number generator (int)."}, {NULL, 0, 0, 0, NULL}}; static param_dbl param_dbl_args[] = { diff --git a/coreneuron/nrniv/partrans.cpp b/coreneuron/nrniv/partrans.cpp index 6a7dad972..8ef385c47 100644 --- a/coreneuron/nrniv/partrans.cpp +++ b/coreneuron/nrniv/partrans.cpp @@ -150,7 +150,6 @@ void nrnthread_v_transfer(NrnThread* _nt) { } void nrn_partrans::gap_update_indices() { - printf("gap_update_indices\n"); if (insrcdspl_) { // clang-format off #pragma acc enter data create( \ diff --git a/coreneuron/nrnoc/nrnoc_aux.cpp b/coreneuron/nrnoc/nrnoc_aux.cpp index 98174ad1f..f48a00e94 100644 --- a/coreneuron/nrnoc/nrnoc_aux.cpp +++ b/coreneuron/nrnoc/nrnoc_aux.cpp @@ -38,7 +38,7 @@ int v_structure_change; int diam_changed; #define MAXERRCOUNT 5 int hoc_errno_count; -const char* bbcore_write_version = "1.1"; +const char* bbcore_write_version = "1.2"; char* pnt_name(Point_process* pnt) { return memb_func[pnt->_type].sym; diff --git a/coreneuron/scopmath_core/dimplic.cpp b/coreneuron/scopmath_core/dimplic.cpp index 5933c9d5a..24a4594ac 100644 --- a/coreneuron/scopmath_core/dimplic.cpp +++ b/coreneuron/scopmath_core/dimplic.cpp @@ -41,5 +41,4 @@ int nrn_kinetic_steer(int fun, SparseObj* so, double* rhs, _threadargsproto_) { return 0; } - } // namespace coreneuron diff --git a/coreneuron/utils/reports/report_configuration_parser.cpp b/coreneuron/utils/reports/report_configuration_parser.cpp index 42e8de6d0..0e762a154 100644 --- a/coreneuron/utils/reports/report_configuration_parser.cpp +++ b/coreneuron/utils/reports/report_configuration_parser.cpp @@ -69,7 +69,8 @@ std::vector create_report_configurations(const char* conf_f FILE* fp = fopen(conf_file, "r"); if (!fp) { - std::cerr << "Cannot open configuration file: " << conf_file << ", aborting execution" << std::endl; + std::cerr << "Cannot open configuration file: " << conf_file << ", aborting execution" + << std::endl; abort(); } diff --git a/tests/integration/ring/12_1.dat b/tests/integration/ring/12_1.dat index 5162ae94b..b6f506b94 100644 Binary files a/tests/integration/ring/12_1.dat and b/tests/integration/ring/12_1.dat differ diff --git a/tests/integration/ring/12_2.dat b/tests/integration/ring/12_2.dat index 8f556dde2..67cab7a12 100644 Binary files a/tests/integration/ring/12_2.dat and b/tests/integration/ring/12_2.dat differ diff --git a/tests/integration/ring/13_1.dat b/tests/integration/ring/13_1.dat index b06096bd8..2b60c02dc 100644 Binary files a/tests/integration/ring/13_1.dat and b/tests/integration/ring/13_1.dat differ diff --git a/tests/integration/ring/13_2.dat b/tests/integration/ring/13_2.dat index fbd7cb6ab..cea499d1e 100644 Binary files a/tests/integration/ring/13_2.dat and b/tests/integration/ring/13_2.dat differ diff --git a/tests/integration/ring/bbcore_mech.dat b/tests/integration/ring/bbcore_mech.dat index fa1063c11..d01670bfe 100644 Binary files a/tests/integration/ring/bbcore_mech.dat and b/tests/integration/ring/bbcore_mech.dat differ diff --git a/tests/integration/ring/byteswap1.dat b/tests/integration/ring/byteswap1.dat new file mode 100644 index 000000000..f66c9cf4c Binary files /dev/null and b/tests/integration/ring/byteswap1.dat differ diff --git a/tests/integration/ring/dict b/tests/integration/ring/dict index 3dafd00cf..a4f2822cf 100644 --- a/tests/integration/ring/dict +++ b/tests/integration/ring/dict @@ -1 +1 @@ -653654561489 : "Namespace(appendhash=False, branch=[10, 20], compart=[1, 1], coredat='coredat', gap=False, gran=0, multisplit=False, ncell=20, npt=8, nring=1, nt=1, rparm=False, runcn=False, secmapping=True, show=False, tstop=100.0)" +375547438551 : "Namespace(appendhash=False, branch=[10, 20], compart=[1, 1], coredat='coredat', gap=False, gran=0, multisplit=False, ncell=20, npt=8, nring=1, nt=1, rparm=False, runcn=False, secmapping=False, show=False, tstop=100.0)" diff --git a/tests/integration/ring/files.dat b/tests/integration/ring/files.dat index 0b91bf0f4..589733292 100644 --- a/tests/integration/ring/files.dat +++ b/tests/integration/ring/files.dat @@ -1,4 +1,4 @@ -1.1 +1.2 2 12 13 diff --git a/tests/integration/ring/globals.dat b/tests/integration/ring/globals.dat index 7693478b9..4c50e6471 100644 --- a/tests/integration/ring/globals.dat +++ b/tests/integration/ring/globals.dat @@ -1,4 +1,4 @@ -1.1 +1.2 PI 3.141592653589793116 E 2.7182818284590450908 GAMMA 0.57721566490153286555 diff --git a/tests/integration/ring_gap/0_1.dat b/tests/integration/ring_gap/0_1.dat deleted file mode 100644 index b8eb8b961..000000000 Binary files a/tests/integration/ring_gap/0_1.dat and /dev/null differ diff --git a/tests/integration/ring_gap/12_1.dat b/tests/integration/ring_gap/12_1.dat new file mode 100644 index 000000000..874cf2210 Binary files /dev/null and b/tests/integration/ring_gap/12_1.dat differ diff --git a/tests/integration/ring_gap/0_2.dat b/tests/integration/ring_gap/12_2.dat similarity index 99% rename from tests/integration/ring_gap/0_2.dat rename to tests/integration/ring_gap/12_2.dat index dcce6f700..c7002e8b7 100644 Binary files a/tests/integration/ring_gap/0_2.dat and b/tests/integration/ring_gap/12_2.dat differ diff --git a/tests/integration/ring_gap/0_gap.dat b/tests/integration/ring_gap/12_gap.dat similarity index 98% rename from tests/integration/ring_gap/0_gap.dat rename to tests/integration/ring_gap/12_gap.dat index ef2eaaee6..dc612a16b 100644 Binary files a/tests/integration/ring_gap/0_gap.dat and b/tests/integration/ring_gap/12_gap.dat differ diff --git a/tests/integration/ring_gap/13_1.dat b/tests/integration/ring_gap/13_1.dat new file mode 100644 index 000000000..aafa96f6b Binary files /dev/null and b/tests/integration/ring_gap/13_1.dat differ diff --git a/tests/integration/ring_gap/1_2.dat b/tests/integration/ring_gap/13_2.dat similarity index 99% rename from tests/integration/ring_gap/1_2.dat rename to tests/integration/ring_gap/13_2.dat index 8f7bb6464..b234eae65 100644 Binary files a/tests/integration/ring_gap/1_2.dat and b/tests/integration/ring_gap/13_2.dat differ diff --git a/tests/integration/ring_gap/1_gap.dat b/tests/integration/ring_gap/13_gap.dat similarity index 98% rename from tests/integration/ring_gap/1_gap.dat rename to tests/integration/ring_gap/13_gap.dat index 34dedf660..d94f3d7bd 100644 Binary files a/tests/integration/ring_gap/1_gap.dat and b/tests/integration/ring_gap/13_gap.dat differ diff --git a/tests/integration/ring_gap/1_1.dat b/tests/integration/ring_gap/1_1.dat deleted file mode 100644 index 483a52bb7..000000000 Binary files a/tests/integration/ring_gap/1_1.dat and /dev/null differ diff --git a/tests/integration/ring_gap/bbcore_mech.dat b/tests/integration/ring_gap/bbcore_mech.dat index fa1063c11..d01670bfe 100644 Binary files a/tests/integration/ring_gap/bbcore_mech.dat and b/tests/integration/ring_gap/bbcore_mech.dat differ diff --git a/tests/integration/ring_gap/byteswap1.dat b/tests/integration/ring_gap/byteswap1.dat new file mode 100644 index 000000000..f66c9cf4c Binary files /dev/null and b/tests/integration/ring_gap/byteswap1.dat differ diff --git a/tests/integration/ring_gap/dict b/tests/integration/ring_gap/dict index 74b6e9c5d..5e6a9f059 100644 --- a/tests/integration/ring_gap/dict +++ b/tests/integration/ring_gap/dict @@ -1 +1 @@ -484976163194 : "Namespace(appendhash=False, branch=[10, 20], compart=[1, 1], coredat='coredat', gap=True, gran=0, multisplit=False, ncell=20, npt=8, nring=1, nt=1, rparm=False, secmapping=False, show=False, tstop=100.0)" +443619202843 : "Namespace(appendhash=False, branch=[10, 20], compart=[1, 1], coredat='coredat', gap=True, gran=0, multisplit=False, ncell=20, npt=8, nring=1, nt=1, rparm=False, runcn=False, secmapping=False, show=False, tstop=100.0)" diff --git a/tests/integration/ring_gap/files.dat b/tests/integration/ring_gap/files.dat index cedd1ac01..d67757357 100644 --- a/tests/integration/ring_gap/files.dat +++ b/tests/integration/ring_gap/files.dat @@ -1,5 +1,5 @@ -1.1 +1.2 -1 2 -0 -1 +12 +13 diff --git a/tests/integration/ring_gap/globals.dat b/tests/integration/ring_gap/globals.dat index 1ce1edf07..4c50e6471 100644 --- a/tests/integration/ring_gap/globals.dat +++ b/tests/integration/ring_gap/globals.dat @@ -1,4 +1,4 @@ -1.1 +1.2 PI 3.141592653589793116 E 2.7182818284590450908 GAMMA 0.57721566490153286555 @@ -10,7 +10,7 @@ hoc_ac_ 1 float_epsilon 9.999999999999999395e-12 hoc_cross_x_ 0 hoc_cross_y_ 0 -default_dll_loaded_ 1 +default_dll_loaded_ 0 clamp_resist 0.0010000000000000000208 celsius 6.2999999999999998224 t 0