Giter Site home page Giter Site logo

bluebrain / coreneuron Goto Github PK

View Code? Open in Web Editor NEW
135.0 25.0 38.0 41.78 MB

Simulator optimized for large scale neural network simulations.

License: BSD 3-Clause "New" or "Revised" License

CMake 8.98% C++ 87.06% C 0.72% Perl 0.10% AMPL 1.96% Shell 0.78% Cuda 0.41%
neuron neural-network neuroscience compartmental simulation-framework supercomputing hpc

coreneuron's Introduction

‼️ NOTE: The CoreNEURON is now integrated within NEURON simulator at the source level and hence all the latest development happens under the main GitHub project neuronsimulator/nrn. To use CoreNEURON, see the latest NEURON documentation under nrn.readthedocs.io.:bangbang:


CoreNEURON CI codecov

CoreNEURON

Citation

If you would like to know more about CoreNEURON or would like to cite it, then use the following paper:

  • Pramod Kumbhar, Michael Hines, Jeremy Fouriaux, Aleksandr Ovcharenko, James King, Fabien Delalondre and Felix Schürmann. CoreNEURON : An Optimized Compute Engine for the NEURON Simulator (doi.org/10.3389/fninf.2019.00063)

License

Funding

CoreNEURON is developed in a joint collaboration between the Blue Brain Project and Yale University. This work is supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH Board of the Swiss Federal Institutes of Technology, NIH grant number R01NS11613 (Yale University), the European Union Seventh Framework Program (FP7/20072013) under grant agreement n◦ 604102 (HBP) and the European Union’s Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreement n◦ 720270 (Human Brain Project SGA1), n◦ 785907 (Human Brain Project SGA2) and n◦ 945539 (Human Brain Project SGA3).

Copyright (c) 2016 - 2022 Blue Brain Project/EPFL

coreneuron's People

Contributors

alex4200 avatar alexsavulescu avatar alkino avatar asvg avatar bdelmarm avatar brunomaga avatar cattabiani avatar delalond avatar ferdonline avatar fouriaux avatar iomaganaris avatar jamesgking avatar jorblancoa avatar kailangen avatar kotsaloscv avatar kupermind avatar nrnhines avatar ohm314 avatar olupton avatar orena1 avatar pramodk avatar pramodskumbhar avatar sergiorg-hpc avatar sharkovsky avatar st4rl3ss avatar tapaswenipathak avatar viniciusdepadua avatar weinaji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coreneuron's Issues

-mpi still needed with --read-config

Even if -mpi flag is included in the configure file used with --read-config, it is still needed to be added in the command executing CoreNeuron.
This is due to the fact that -mpi flag is checked if exists in the arguments of the executable.
If it is not provided, there simulation fails with Segmentation Faults

Is PG_ACC_BUGS still necessary?

CoreNEURON has following macros :

→ grep -r ACC_BUG coreneuron/*
coreneuron/mech/modfile/hh.cpp:#if defined(PG_ACC_BUGS)
coreneuron/nrnoc/eion.cpp:#if defined(PG_ACC_BUGS)
coreneuron/nrnoc/register_mech.cpp:#if defined(PG_ACC_BUGS)
coreneuron/nrnoc/nrnoc_ml.h:#if PG_ACC_BUGS

Todo for this ticket :

  • Check when PG_ACC_BUGS was introduced and what was the purpose
  • If it was due to some old version, check if the issue doesnt appear with current 18.4 PGI compiler
  • If so, remove related code from CoreNEURON as well as MOD2C

Issue while linking on BB5 with PGI compiler

When we build coreneuron on BB5 with spack install coreneuron@develop %pgi ^[email protected], we get :

[100%] Linking CXX executable coreneuron_exec
cd /gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/SC_BENCHMARKS/paper/coreneuron/build/apps && /gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/tools/2018-12-19/linux-rhel7-x86_64/gcc-6.4.0/cmake-3.13.0-ivumccos42/bin/cmake -E cmake_link_script CMakeFiles/coreneuron_exec.dir/link.txt --verbose=1
/opt/hpe/hpc/mpt/mpt-2.16/bin/mpicxx  -acc -Minline=size:200,levels:10 -Minfo=acc -O2 -Minline=size:1000,levels:100,totalsize:40000,maxsize:4000 -ta=tesla:cuda9.0 -I/gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/NMODL_VALIDATION/nmodl/build/install/include -I/gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/SC_BENCHMARKS/paper/soft/install/linux-rhel7-x86_64/pgi-18.4/eigen-3.4-a4dqva/include/eigen3   CMakeFiles/coreneuron_exec.dir/coreneuron.cpp.o  -o coreneuron_exec -Wl,-rpath,/gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/SC_BENCHMARKS/paper/soft/install/linux-rhel7-x86_64/pgi-18.4/caliper-1.9.1-qyo5jj/lib64::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ../coreneuron/libcorenrnmech.a ../coreneuron/libscopmath.a ../coreneuron/libcoreneuron.a ../coreneuron/libcudacoreneuron.a /gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/external-libraries/2018-12-19/linux-rhel7-x86_64/gcc-6.4.0/cuda-9.0.176-magtzew2kj/lib64/libcudadevrt.a /gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/external-libraries/2018-12-19/linux-rhel7-x86_64/gcc-6.4.0/cuda-9.0.176-magtzew2kj/lib64/libcudart_static.a -ldl /usr/lib64/librt.so /gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/SC_BENCHMARKS/paper/soft/install/linux-rhel7-x86_64/pgi-18.4/caliper-1.9.1-qyo5jj/lib64/libcaliper-mpi.so.1.9.1 /gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/SC_BENCHMARKS/paper/soft/install/linux-rhel7-x86_64/pgi-18.4/caliper-1.9.1-qyo5jj/lib64/libcaliper.so.1.9.1 /gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/SC_BENCHMARKS/paper/soft/install/linux-rhel7-x86_64/pgi-18.4/caliper-1.9.1-qyo5jj/lib64/libcaliper-mpi-common.so.1.9.1 /gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/SC_BENCHMARKS/paper/soft/install/linux-rhel7-x86_64/pgi-18.4/caliper-1.9.1-qyo5jj/lib64/libcaliper-reader.so.1.9.1 /gpfs/bbp.cscs.ch/project/proj20/pramod_scratch/SC_BENCHMARKS/paper/soft/install/linux-rhel7-x86_64/pgi-18.4/caliper-1.9.1-qyo5jj/lib64/libcaliper-common.so.1.9.1
/usr/bin/ld: error in ../coreneuron/libcorenrnmech.a(CoreConfig.cpp.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in ../coreneuron/libcorenrnmech.a(ProbAMPANMDA_EMS.cpp.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in ../coreneuron/libcorenrnmech.a(ProbGABAAB_EMS.cpp.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in ../coreneuron/libcoreneuron.a(capac.cpp.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in ../coreneuron/libcoreneuron.a(solve_core.cpp.o)(.eh_frame); no .eh_frame_hdr table will be created.
/usr/bin/ld: error in ../coreneuron/libcoreneuron.a(pattern.cpp.o)(.eh_frame); no .eh_frame_hdr table will be created.
../coreneuron/libcoreneuron.a(main1.cpp.o): In function `mk_mech_init':
/gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/compilers/2018-12-18/linux-rhel7-x86_64/gcc-4.8.5/gcc-6.4.0-i6lyqfscua/include/c++/6.4.0/ext/type_traits.h:153: undefined reference to `coreneuron::nrnopt_get_str[abi:cxx11](char const*)'
../coreneuron/libcoreneuron.a(main1.cpp.o): In function `run_solve_core':
/gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/compilers/2018-12-18/linux-rhel7-x86_64/gcc-4.8.5/gcc-6.4.0-i6lyqfscua/include/c++/6.4.0/ext/type_traits.h:153: undefined reference to `coreneuron::nrnopt_get_str[abi:cxx11](char const*)'
/gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/compilers/2018-12-18/linux-rhel7-x86_64/gcc-4.8.5/gcc-6.4.0-i6lyqfscua/include/c++/6.4.0/ext/type_traits.h:153: undefined reference to `coreneuron::nrnopt_get_str[abi:cxx11](char const*)'
/gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/compilers/2018-12-18/linux-rhel7-x86_64/gcc-4.8.5/gcc-6.4.0-i6lyqfscua/include/c++/6.4.0/ext/type_traits.h:153: undefined reference to `coreneuron::nrnopt_get_str[abi:cxx11](char const*)'
/gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/compilers/2018-12-18/linux-rhel7-x86_64/gcc-4.8.5/gcc-6.4.0-i6lyqfscua/include/c++/6.4.0/ext/type_traits.h:153: undefined reference to `coreneuron::nrnopt_get_str[abi:cxx11](char const*)'
../coreneuron/libcoreneuron.a(main1.cpp.o):/gpfs/bbp.cscs.ch/apps/hpc/jenkins/deploy/compilers/2018-12-18/linux-rhel7-x86_64/gcc-4.8.5/gcc-6.4.0-i6lyqfscua/include/c++/6.4.0/ext/type_traits.h:153: more undefined references to `coreneuron::nrnopt_get_str[abi:cxx11](char const*)' follow
pgacclnk: child process exit status 1: /usr/bin/ld

Use scope-like API for instrumentor

Unless I am not mistaken, most of the end statements are in the same scope than the corresponding begin. So I suggest to use API that would leverages scopes like scoped_lock for instance.

Instead of:

if (nrn_have_gaps) {
    Instrumentor::phase_begin("gap-v-transfer");
    nrnthread_v_transfer(_nt);
    Instrumentor::phase_end("gap-v-transfer");
}

have something like:

if (nrn_have_gaps) {
    Instrumentor::phase p("gap-v-transfer");
    nrnthread_v_transfer(_nt);
}

nrnivmol_core for coreneuron (nrnivmodl equivalent)

All NEURON users are familiar with building special using nrnivmodl.
When we build neuron, nrnivmodl script is generate which takes care of:

  • fining all mod files and translating via nocmodl
  • create shared / static library
  • link with necessary neuron library and create special

Similar workflow should be available with CoreNEURON. We should create nrnivmodl_core as part of CMake installation.

@fouriaux : when you install neuron, check nrnivmodl script under bin. We have to use configure_file functionality of CMake.

Events with negative delivery time

Hi Michael @nrnhines

When running the MiniColumn_0 circuit (PCP recipe and config), I get several events with a negative delivery time (see 1s.txt for details).

Backtracing I see the following:

  • The event is of type VecPlayContinuous
  • this is where the event is added
  void VecPlayContinuous::play_init() 
  { 
     [...] 
     e_->send((*t_)[ubound_index_], net_cvode_instance, nt);
     [...]
  }
  • the vector IvocVect *t constains negative values.
  • the data in *t is populated by nrn_setup.c at:
        F.read_array<double>(vector_vec(yvec), sz);
        IvocVect* tvec = vector_new1(sz);
        F.read_array<double>(vector_vec(tvec), sz);
  • the read_array operation reads the input from the file
  • adding the following check after the read-out triggers an assert error:
        for (int ii=0; i<tvec->size(); i++)
          { assert(tvec->data()[ii]>=0); }
  • this is read from the input file that neuron writes, so I believe the issue is there.

Let me know.
Thanks
Bruno

Issues running the ringtest example

Hi.

I couple of years back, using the script in this page, https://github.com/nrnhines/ringtest , i was able to run some test with CoreNeuron.

The last version of the script works except the CoreNeuron step.

  1. To run ringtest i had to change the executable location from "bin" to "apps".
    ./coreneuron_x86/bin/coreneuron_exec -e 100 -d coreneuron_data

  2. Running the previous command generates this error.
    coreneuron_exec: /coreneuron_new/sources/CoreNeuron/coreneuron/nrniv/nrn_setup.cpp:1747: void coreneuron::read_phase2(coreneuron::FileHandler&, int, coreneuron::NrnThread&): Assertion `ps->gid_ > -1' failed.
    Aborted

nrnivmodl-core should create static libcorenrnmech-0.0.a

While trying to build a special-core for running in GPUs I came across the following error:

Failing in Thread:1
call to cuModuleGetGlobal returned error 500: Not found

It seems that PGI needs all the libraries to be linked statically and the only option of nrnivmodl-core is building the special-core dynamically.
There could be added an option in nrnivmodl_core_makefile to build the special-core either dynamically, statically, or both, so that if the simulation is needed to run on GPUs the executable can be built statically.

Gapjunction in coreNeuron

I want to simulate a network with gapjunctions on CoreNeuron. Every cell connect to two or more cells in this network. The "source_var" function in ParallelContext seems unable to make one cell connect to more than one cell. So I defined a POINTER in my nmodl file of gapjunction, and it can run on Neuron. but it cannot be compiled successfully by CoreNeuron. Could you please tell me what should I do to solve this problem? Thank you.

Add test for NEURON-CoreNEURON directory memory transfer

Here is test that was used during development:

from neuron import h, gui

h('''create soma''')
h.soma.L=5.6419
h.soma.diam=5.6419
h.soma.insert("hh")
ic = h.IClamp(h.soma(.5))
ic.delay = .5
ic.dur = 0.1
ic.amp = 0.3

v = h.Vector()
v.record(h.soma(.5)._ref_v, sec = h.soma)
tv = h.Vector()
tv.record(h._ref_t, sec=h.soma)
h.run()
vstd = v.cl()
tvstd = tv.cl()

#h.CoreNeuronRun[0].run()
pc = h.ParallelContext()
h.cvode.cache_efficient(1)
h.stdinit()
pc.nrncore_run("-e %g"%h.tstop, 0)

print (bool(tv.eq(tvstd)))
print (v.cl().sub(vstd).abs().max() < 1e-10)

Support for SHARED build with PGI OpenACC build

If we build shared library with OpenACC, we are getting:

cuda_init_device(threadid=1, device 0) dindex=1, api_context=0x95d090
pgi_uacc_cuda_static hostptr=0x2aaaabedc990-0x2aaaabedc998 size=8 name=_ZN10coreneuron14_slist1_ExpSynE flags=0x100
Failing in Thread:1
call to cuModuleGetGlobal returned error 500: Not found

Assertion error when setting Dt=0.025 and duration=100

Params:

--spikebuf = 100000      --spkcompress = 0        --prcellgid = -1
--cell-permute = 0       --nwarp = 0              --ms-subintervals = 2
--ms-phases = 2          --multiple = 1           --extracon = 0
--seed = -1              --report-buffer-size = 4 --pattern = /gpfs/bbp.cscs.ch/home/leite/test/blueconfigs/scx-v5-plasticity/output/pattern.dat
--datpath = /gpfs/bbp.cscs.ch/home/leite/test/blueconfigs/scx-v5-plasticity/output/coreneuron_input--checkpoint = not set--restore = not set
--filesdat = files.dat   --outpath = /gpfs/bbp.cscs.ch/home/leite/test/blueconfigs/scx-v5-plasticity/output/--write-config = not set
--read-config = /gpfs/bbp.cscs.ch/home/leite/test/blueconfigs/scx-v5-plasticity/output/sim.conf--report-conf = /gpfs/bbp.cscs.ch/home/leite/test/blueconfigs/scx-v5-plasticity/output/report.conf--tstop = 100.000000
--dt = 0.025             --dt_io = 0.1            --voltage = -65
--celsius = 34           --forwardskip = 0.000000 --mindelay = 0.175
--help = not set         --threading = not set    --gpu = not set
-mpi = set               --show = not set         --multisend = not set
--binqueue = not set     --skip-mpi-finalize = set

Outcome:
After running the sim more than 50%, we get

allreports create time : 0.003903

nrniv: x86_64/core/mod2c/ProbAMPANMDA_EMS.cpp:567: void coreneuron::_net_receive_kernel(double, coreneuron::Point_process *, int, double): Assertion `_p[34*_cntml_padded + _iml] <= _nrb_t' failed.
MPT ERROR: Rank 0(g:0) received signal SIGABRT/SIGIOT(6).
	Process ID: 41407, Host: r1i5n7, Program: /gpfs/bbp.cscs.ch/project/proj12/jenkins/devel_builds_04-2019/install/linux-rhel7-x86_64/intel-18.0.3/neuron-7.6.6-td3af3/x86_64/bin/nrniv
	MPT Version: HPE MPT 2.16  06/02/17 01:08:38

Implement fast_imem_calculation for GPU

The new fast_imem calculation introduced to CoreNeuron should be implemented for GPU as well using OpenACC.
The related functions to the calculations are: nrn_calc_fast_imem, nrn_finitialize, nrn_rhs and nrn_lhs.
Care should be taken also for the code generation for GPU from mod2c and NMODL.
Related PR: #196

Flags for compilation with Intel compiler

Have you got some recommended flags for optimized builds with the Intel compiler?

For example, if using a XEON Broadwell or a KNL, what flags should I pass for CMAKE_{CXX,C}_FLAGS?

In your experience, is the Intel compiler the fastest, or are PGI/Cray equivalent/better?

tarvis build integration

Even though we have jenkin configuration with bbp cluster, it would be useful to add travis CI integration for Ubuntu and OS X platform to start with.

Improving command line parsing

Currently we use http://ezoptionparser.sourceforge.net for command line arguments. This leads to large number of global options :

/path/to/isntall/directory/coreneuron_exec --help
-b, --spikebuf ARG          Spike buffer size. (100000)
-c, --threading             Parallel threads. The default is serial threads.
-d, --datpath ARG           Path containing CoreNeuron data files. (.)
-dt, --dt ARG               Fixed time step. The default value is set by
                            defaults.dat or is 0.025.
-e, --tstop ARG             Stop time (ms). (100)
-f, --filesdat ARG          Name for the distribution file. (files.dat)
-g, --prcellgid ARG         Output prcellstate information for the gid NUMBER.
-gpu, --gpu                 Enable use of GPUs. The default implies cpu only
                            run.
-h, --help                  Print a usage message briefly summarizing these
                            command-line options, then exit.
-k, --forwardskip ARG       Forwardskip to TIME
-l, --celsius ARG           Temperature in degC. The default value is set in
                            defaults.dat or else is 34.0.
-mpi                        Enable MPI. In order to initialize MPI environment
                            this argument must be specified.
-o, --outpath ARG           Path to place output data files. (.)
-p, --pattern ARG           Apply patternstim using the specified spike file.
-R, --cell-permute ARG      Cell permutation, 0 No; 1 optimise node adjacency; 2
                            optimize parent adjacency. (1)
-s, --seed ARG              Initialization seed for random number generator
                            (int).
-v, --voltage ARG           Initial voltage used for nrn_finitialize(1, v_init).
                            If 1000, then nrn_finitialize(0,...). (-65.)
-W, --nwarp ARG             Number of warps to balance. (0)
-x, --extracon ARG          Number of extra random connections in each thread to
                            other duplicate models (int).
--binqueue                  Use bin queue.
--checkpoint ARG            Enable checkpoint and specify directory to store
                            related files.
--mindelay ARG              Maximum integration interval (likely reduced by
                            minimum NetCon delay). (10)
--ms-phases ARG             Number of multisend phases, 1 or 2. (2)
--ms-subintervals ARG       Number of multisend subintervals, 1 or 2. (2)
--multisend                 Use Multisend spike exchange instead of Allgather.
--read-config ARG           Read configuration file filename.
--restore ARG               Restore simulation from provided checkpoint
                            directory.
--show                      Print args.
--skip-mpi-finalize         Do not call mpi finalize.
--spkcompress ARG           Spike compression. Up to ARG are exchanged during
                            MPI_Allgather. (0)
--write-config ARG          Write configuration file filename.

May be this can be improved with : https://github.com/CLIUtils/CLI11 ?

Matching MPI rank count in NEURON and CoreNeuron

The documentation states that if NEURON is used to generate CoreNeuron inputs, both must use the same number of MPI ranks.

Is this still a requirement?

I have noticed that for a ring benchmark I can run a model generated with N ranks on M ranks and get the expected M/N speedup and the same number of spikes (I haven't checked if the same spikes are generated yet.)

Do we have to use the same number of ranks so that the connection tables match up correctly? That would explain why the ring model still "works".

Bug in CoreNEURON GPU implementation

Creating separate issue reported by @pkuzyc in #60 :

I tried to use the current commit of CoreNEURON to simulate this PC model, but there is a segmentation fault when I run it. The same error also happens when I run ringtest with this commit. The error message is :

--- Copying to Device! ---
-----------COPYING 0'th NrnThread TO DEVICE ---------------
GPU MEMORY USAGE (MB) : Used = 66.375000, Free = 11373.500000 MB, Total = 11439.875000zsh: segmentation fault (core dumped)  ./coreneuron_exec -e 100 -d  --gpu
is there anything wrong?

Remove pthread based multi-threading implementation

Coreneuron inherits pthread based multi-threading code which is not used. This can be safely removed as we rely on OpenMP.

Todo :

  • codebase under #if USE_PTHREAD can be safely removed
  • codebase under #if (USE_PTHREAD || defined(_OPENMP)) should be changed to #if defined(_OPENMP)

Streamlining exit on error procedures

create_report_configuration can fail and raise error using abort(), this lead to an error not necessary easy to interpret from a normal user without a debugger.

this abort and potentially other ones must be replaced by proper error management.

Example Neuron -> CoreNeuron workflow

Congratulations with making the public release!

Have you got an example of a workflow for building a model in Neuron and exporting it to run in CoreNeuron?

A simple model would be good, and an example of building a larger network (out of simple cells/mechanisms) that tests CoreNeuron over multiple nodes would be even better!

Compiling for GPU with PGI

I am unable to compile CoreNeuron with GPU support on Piz Daint.
Below is an example workflow, and the error that I get.

I have tried all combinations of cudatoolkit version (8.0, 9.0, 9.1, 9.2).
I have tried different -ta:xx options like tesla:cc35, tesla:cc60, testla:cuda9.0 and so on.

> module load daint-gpu
> module load CMake

# this loads the 18.5.0 compiler by default, which is the most recent version.
> module swap PrgEnv-cray PrgEnv-pgi
> module swap pgi/18.3.0
> module load cudatoolkit/9.1.85_3.18-6.0.7.0_5.1__g2eb7c52
# I also tried cuda 8.0

> export CC=`which cc`; export CXX=`which CC`;
> compiler_flags="-O2 -ta=tesla:cc60"

> cmake .. -DCMAKE_C_FLAGS:STRING="$compiler_flags" -DCMAKE_CXX_FLAGS:STRING="$compiler_flags" -DUNIT_TESTS=off -DFUNCTIONAL_TESTS=off

> make

# ....
[ 10%] Building CXX object coreneuron/CMakeFiles/coreneuron.dir/utils/randoms/nrnran123.cpp.o
# ...
PGCC-S-0155-External and Static variables are not supported in acc routine - _ZN87_INTERNAL_65__users_bcumming_coreneuron_coreneuron_utils_randoms_nrnran123_cpp_d953a36f10coreneuron1kE (/users/bcumming/coreneuron/coreneuron/utils/randoms/nrnran123.cpp: 102)
PGCC/x86 Linux 18.5-0: compilation completed with severe errors
coreneuron/CMakeFiles/coreneuron.dir/build.make:815: recipe for target 'coreneuron/CMakeFiles/coreneuron.dir/utils/randoms/nrnran123.cpp.o' failed
make[2]: *** [coreneuron/CMakeFiles/coreneuron.dir/utils/randoms/nrnran123.cpp.o] Error 2
CMakeFiles/Makefile2:1023: recipe for target 'coreneuron/CMakeFiles/coreneuron.dir/all' failed
make[1]: *** [coreneuron/CMakeFiles/coreneuron.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2

> c++filt _ZN87_INTERNAL_65__users_bcumming_coreneuron_coreneuron_utils_randoms_nrnran123_cpp_d953a36f10coreneuron1kE
_INTERNAL_65__users_bcumming_coreneuron_coreneuron_utils_randoms_nrnran123_cpp_d953a36f::coreneuron::k

I have tried the following versions of the PGI compiler: 17.5.0, 18.3.0 and 18.5.0. The first two fail before this point, because of a different error with system header files.

mismatch in number of compartments between NEURON and CoreNeuron

Creating a dataset consisting of a single cell, I noticed that the number of compartments that I count in NEURON and those reported by CoreNeuron are different.

To replicate this (assumes you have nrnivmodl and coreneuron_exec in your path):

$ git clone [email protected]:sharkovsky/NEURON_VS_CoreNeruon_mismatch.git
$ cd NEURON_VS_CoreNeruon_mismatch
$ nrnivmodl L5_TTPC1_cADpyr232_1/mechanisms/
$ ./x86_64/special -python singlecell.py

The output of this command should be:

Before calling geom_nseg
tot nsec: 239 tot nseg: 239
After calling geom_nseg
tot nsec: 239 tot nseg: 913

As you can see, the number of compartments counted is 913.

Now run coreneuron and get the output

$ coreneuron_exec -d coredat/single_cell -e 1
 Simulation Statistics
 Number of cells: 1
 Number of compartments: 1153
 Number of presyns: 1
 Number of input presyns: 0

Here, the reported number of compartments is 1153.

For reproducibility, I am using 12effbf and neuronsimulator/nrn@e9b2bb1a7b6faf5664d

Thank you

--read-config option message

When using --read-arg with a non-default name for the config file, an information message appears which seems unclear about what information it provides.

>coreneuron_exec --read-config 1.conf
Info: No default arguments file provided: config

Compile error when compiling CoreNeuron with PGI19.4 and CUDA10

Hi all
I'm trying to compile CoreNeuron with PGI19.4 and CUDA10. My gcc version is 5.4.0 and cmake version is 3.14.3. Here are the commands I used to compile:

module load /path/to/pgi/modfile /path/to/pgi_mpi/modfile
export CC=mpicc
export CXX=mpicxx
cmake .. -DCMAKE_C_FLAGS:STRING="-O2 -lrt -ta=tesla:cuda10.0" \
-DCMAKE_CXX_FLAGS:STRING="-O2 -lrt -std=c++11 -ta=tesla:cuda10.0"\
-DCOMPILE_LIBRARY_TYPE=STATIC\
-DCMAKE_INSTALL_PREFIX=/path/toinstall\
-DCUDA_HOST_COMPILER=which gcc
-DCUDA_PROPAGATE_HOST_FLAGS=OFF\
-DENABLE_SELECTIVE_GPU_PROFILING=ON\
-DENABLE_OPENACC=ON
make

It raised following errors (only list two of them here):
"/home/Softwares/pgi19/linux86-64-llvm/19.4/include/edg/mmintrin.h", line 1267:
error: argument of type "__v4hi" is incompatible with parameter of type "__attribute((vector_size(8))) short"
return (__m64)__builtin_ia32_pcmpgtw((__v4hi)__m1, (__v4hi)__m2);

"/home/Softwares/pgi19/linux86-64-llvm/19.4/include/edg/mmintrin.h", line 1289:
error: argument of type "__v2si" is incompatible with parameter of type "__attribute((vector_size(8))) int"
return (__m64)__builtin_ia32_pcmpgtd((__v2si)__m1, (__v2si)__m2);

Error limit reached.
100 errors detected in the compilation of "/path/to/CoreNeuron/nrniv/balance.cpp".

Could you please have a look at it? Thank you.

Report reading configuration

  1. Wrong error message when trying to read a configuration file that does not exist or cannot be opened:
    "Error while reading report configuration "
    This is to be replaced with meaningful message.

add ETA to progressbar

Currently when the simulation runs, the outputs is in the following format:
Completed 0.59, t = 891
It will be beneficial to also add to this output a ETA.

Thanks.

multisend implementation always need mpi

We need ability to build coreneuron without mpi. It seems like multi-send implementation broke this compatibility:

[ 17%] Building C object coreneuron/CMakeFiles/coreneuron.dir/scopmath_core/abort.c.o
cd /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/spack-build/coreneuron && /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/lib/spack/env/gcc/gcc  -DCORENEURON_BUILD -DDISABLE_HOC_EXP -DENABLE_REPORTING -DHAVE_MALLOC_H -DLAYOUT=0 -DNRNMPI=0 -DNRN_MULTISEND=0 -I/gpfs/bbp.cscs.ch/scratch/gss/viz/kumbhar/neuron_music_home/install/linux-rhel6-x86_64/gcc-4.9.0/reportinglib-develop-aiij3d/include -I/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/utils/randoms -I/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/spack-build/coreneuron -I/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron -I/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron  -g -O2 -Wno-unknown-pragmas   -o CMakeFiles/coreneuron.dir/scopmath_core/abort.c.o   -c /gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/scopmath_core/abort.c
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:89:5: error: ‘NRNMPI_Spike’ does not name a type
     NRNMPI_Spike** buffer_;
     ^
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp: In function ‘void nrn_multisend_send(PreSyn*, double, NrnThread*)’:
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:116:17: error: ‘class PreSyn’ has no member named ‘multisend_index_’
     int i = ps->multisend_index_;
                 ^
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:124:9: error: ‘NRNMPI_Spike’ was not declared in this scope
         NRNMPI_Spike spk;
         ^
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:125:9: error: ‘spk’ was not declared in this scope
         spk.gid = ps->output_index_;
         ^
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:133:53: error: ‘nrnmpi_multisend’ was not declared in this scope
             nrnmpi_multisend(&spk, cnt_phase1, ranks);
                                                     ^
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp: In function ‘void multisend_send_phase2(InputPreSyn*, int, double)’:
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:141:17: error: ‘class InputPreSyn’ has no member named ‘multisend_phase2_index_’
     int i = ps->multisend_phase2_index_;
                 ^
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:147:5: error: ‘NRNMPI_Spike’ was not declared in this scope
     NRNMPI_Spike spk;
     ^
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:148:5: error: ‘spk’ was not declared in this scope
     spk.gid = gid;
     ^
/gpfs/bbp.cscs.ch/home/kumbhar/workarena/systems/lugviz/softwares/sources/spack/var/spack/stage/coreneuron-develop-ei3gfd37guvrzwgiw7n3hkj5zaitpx5e/CoreNeuron/coreneuron/nrniv/multisend.cpp:150:45: error: ‘nrnmpi_multisend’ was not declared in this scope
     nrnmpi_multisend(&spk, cnt_phase2, ranks);

CMake gitexternal projects and warnings

Currently I see following :

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Found MOD2C: /Users/kumbhar/workarena/software/sources/spack/var/spack/stage/coreneuron-perfmodels-wpb4nvufal7pc6us7wk4gw6z7ka62vfj/CoreNeuron/external/mod2c
CMake Warning at /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:1198 (message):
  Line 'CMAKE_BUILD_TYPE=CUSTOM' does not match regex.  Ignoring.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2241 (_ep_command_line_to_initial_cache)
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2305 (_ep_extract_configure_command)
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2568 (_ep_add_configure_command)
  CMake/config/DeclareMod2CSubModule.cmake:42 (ExternalProject_Add)
  CMakeLists.txt:92 (include)

CMake Warning at /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:1198 (message):
  Line
  'CMAKE_INSTALL_PREFIX=/tmp/kumbhar/spack-stage/spack-stage-r6C7vO/CoreNeuron/spack-build/external/mod2c'
  does not match regex.  Ignoring.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2241 (_ep_command_line_to_initial_cache)
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2305 (_ep_extract_configure_command)
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2568 (_ep_add_configure_command)
  CMake/config/DeclareMod2CSubModule.cmake:42 (ExternalProject_Add)
  CMakeLists.txt:92 (include)

CMake Warning at /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:1198 (message):
  Line 'CMAKE_C_COMPILER=gcc' does not match regex.  Ignoring.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2241 (_ep_command_line_to_initial_cache)
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2305 (_ep_extract_configure_command)
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2568 (_ep_add_configure_command)
  CMake/config/DeclareMod2CSubModule.cmake:42 (ExternalProject_Add)
  CMakeLists.txt:92 (include)


CMake Warning at /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:1198 (message):
  Line 'CMAKE_CXX_COMPILER=g++' does not match regex.  Ignoring.
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2241 (_ep_command_line_to_initial_cache)
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2305 (_ep_extract_configure_command)
  /usr/local/Cellar/cmake/3.9.4_1/share/cmake/Modules/ExternalProject.cmake:2568 (_ep_add_configure_command)
  CMake/config/DeclareMod2CSubModule.cmake:42 (ExternalProject_Add)
  CMakeLists.txt:92 (include)

-- Found MPI_C: /usr/local/Cellar/open-mpi/2.1.1/lib/libmpi.dylib
-- Found MPI_CXX: /usr/local/Cellar/open-mpi/2.1.1/lib/libmpi.dylib
-- Looking for include file malloc.h
-- Looking for include file malloc.h - not found

@fouriaux : better to cleanup this noisiness for GitExternalProjects.

Some synaptic events are being delivered with a delay of one timestep

Hi Michal @nrnhines

When looking at the deliver_events(tm) that is delivering events within nt->_t and nt->_t+0.5*nt->_dt or tm, I see now that events were added to the queue one timestep too late.

In practice they are delivered half time step ahead.
To reproduce the bug, simply add to NetCvode::deliver_event(double til, NrnThread *nt):

if (tt>=0) //safe guard until https://github.com/BlueBrain/CoreNeuron/issues/9 is fixed
{   assert(tt >= til-0.5*nt->_dt && tt <=til);  }

This assert double checks that events in the queue are only meant to be delivered within the previous half timestep.

On a PCP Layer1 circuit (use same generation method as my previous ticket):

  • Neuron 347 at time 0.65 will be looking to events to be delivered between 0.65 and 0.65+0.5*dt i.e. 0.6625;
  • Yet the queue has an event with time 0.625, i.e one and a half steps behind, instead of the max allowed of half step;
  • That is a ProbGABAAB_EMS (id 139) event that was added to the queue only at the very same time step by net_cvode_instance->check_thresh(nt) at deliver_net_events(NrnThread *nt) in cvodestb.cpp.
  • This is wrong: if I'm not mistaken should have been added in the previous step at nrn_fixed_step_lastpart(nth) so that the nrn_deliver_events at the previous turn could capture it.

Thank you for looking into this.

Segmentation fault with simple stimulus example

Granting that this might be user error, the python script below crashes with a segmentation fault. No output files are generated.

System info and versions:

  • System is GNU/Linux (Artix)
  • nrniv --version reports NEURON -- VERSION 7.6.2-2-gd3ead4a+ unknown (d3ead4a+) 2018-08-24
  • CoreNEURON is at 0.14 tag.
  • Python is 3.7.2
#!/usr/bin/env python

from neuron import h

class soma_cell:
    def __init__(self):
        self.soma = h.Section(name='soma')
        self.soma.diam = 20
        self.soma.L = 20

        self.syn  = h.ExpSyn(self.soma(0.5))

h('load_file("stdrun.hoc")')
h.cvode.cache_efficient(1)
pc = h.ParallelContext()

cell = soma_cell()
stim = h.NetStim()
stim.number = 1
stim.start = 0

g0 = 0.1 # [µS]
nc_stim = h.NetCon(stim, cell.syn, 0, 0, g0, sec=cell.soma)

h.dt = 0.025
pc.set_maxstep(1)
pc.nrnbbcore_write("cnrn")

If hard disk is full no error message is shown when trying to write out.dat file

It seems that if the harddrive got full while the simulation was running, the simulation ends normally even though the out.dat file was not written correctly.
I think it might be good that CoreNeuron will print an error message stating that the out.dat file was not written completely and if possible to also state that it is because there is no available storage.

Thanks.

Different results with and without OpenMP threads

Tests from testcorenrn repository that simulate more than 1 cell produce different outputs from Neuron when run with CoreNeuron with SoA configuration and more than 1 OpenMP thread.
CoreNeuron was built using the following CMake options:

cmake \
   -G 'Unix Makefiles' \
   -DCMAKE_INSTALL_PREFIX=./install \
   -DCMAKE_BUILD_TYPE=Debug \
   -DCMAKE_C_FLAGS:STRING="-O0" \
   -DCMAKE_CXX_FLAGS:STRING="-O0" \
   -DENABLE_SOA=ON \
   -DCORENEURON_OPENMP=ON \
   -DTEST_MPI_EXEC_BIN="mpirun" \
   -DTEST_EXEC_PREFIX="mpirun;-n;2" \
   -DAUTO_TEST_WITH_SLURM=OFF \
   -DAUTO_TEST_WITH_MPIEXEC=OFF \
   .. /

To run a test (for example "watch" which produces different output):

git clone [email protected]:pramodk/testcorenrn.git
cd testcorenrn
nrnivmodl mod
nrnivmodl-core mod
mkdir testwatchdat
mpirun -n 6 ./x86_64/special -mpi -c sim_time=100 testwatch.hoc
cat out.dat | sort -k 1n,1n -k 2n,2n > out_nrn_watch.spk
export OMP_NUM_THREADS=1
mpirun -n 6 ./x86_64/special-core -mpi -d test${NAME}dat -e 100
diff -w -q out.dat out_nrn_watch.spk // Same results
export OMP_NUM_THREADS=2
mpirun -n 3 ./x86_64/special-core -mpi -d test${NAME}dat -e 100
diff -w -q out.dat out_nrn_watch.spk // Different results

Using the GPU with OpenACC build

I am building CoreNeuron on Piz Daint with PGI OpenACC, and I can run a simulation, however it doesn't look like the GPU is being used (the times look like I am using mutli-threading, and nvprof says that nothing is running on the GPU).

Am I missing something?

set up environment

module swap PrgEnv-cray PrgEnv-pgi
module load daint-gpu
module load CMake
module load gcc 
module load cudatoolkit/9.2.148_3.19-6.0.7.1_2.1__g3d9acc8

configure and build

cmake
          -DCMAKE_INSTALL_PREFIX:PATH=/users/bcumming/nsuite/install
          -DUNIT_TESTS=off
          -DFUNCTIONAL_TESTS=off
          -DCOMPILE_LIBRARY_TYPE=STATIC
          -DCUDA_PROPAGATE_HOST_FLAGS=OFF
          -DENABLE_SELECTIVE_GPU_PROFILING=OFF
          -DENABLE_OPENACC=ON
make
make install

run

srun -n 1 -N 1 -c 24 nvprof coreneuron_exec -mpi -gpu -d /users/bcumming/nsuite/input/benchmarks/ring/small/run_128_2_core -e 200 --outpath /users/bcumming/nsuite/output/benchmarks/ring/small
 
 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
 version id unimplemented
 
 Additional mechanisms from files
 halfgap.mod

 num_mpi=1
 num_omp_thread=24

 Memory (MBs) : After mk_mech ang global initialization : Max 7.3203, Min 7.3203, Avg 7.3203 
 num_mpi=1
 num_omp_thread=24

 Memory (MBs) :            After MPI_Init : Max 7.3203, Min 7.3203, Avg 7.3203 
 Memory (MBs) :          Before nrn_setup : Max 7.4492, Min 7.4492, Avg 7.4492 
 WARNING : GPU execution requires --cell-permute type 1 or 2. Setting it to 1.
 Setup Done   : 0.10 seconds 
 Memory (MBs) :          After nrn_setup  : Max 8.0156, Min 8.0156, Avg 8.0156 

--spikebuf = 100000      --spkcompress = 0        --prcellgid = -1
--cell-permute = 0       --nwarp = 0              --ms-subintervals = 2
--ms-phases = 2          --multiple = 1           --extracon = 0
--seed = -1              --report-buffer-size = 4 --pattern = not set
--datpath = /users/bcumming/nsuite/input/benchmarks/ring/small/run_128_2_core--checkpoint = not set--restore = not set
--filesdat = files.dat   --outpath = /users/bcumming/nsuite/output/benchmarks/ring/small--write-config = not set
--read-config = not set  --report-conf = not set  --tstop = 200
--dt = 0.025             --dt_io = 0.1            --voltage = -65
--celsius = 6.3          --forwardskip = 0        --mindelay = 1
--help = not set         --threading = not set    --gpu = set
-mpi = set               --show = not set         --multisend = not set
--binqueue = not set     --skip-mpi-finalize = not set

 Start time (t) = 0

 Memory (MBs) :  After mk_spikevec_buffer : Max 8.0156, Min 8.0156, Avg 8.0156 
 Memory (MBs) :     After nrn_finitialize : Max 8.0156, Min 8.0156, Avg 8.0156 

 psolve |========================================================| t: 200.00 ETA: 0h00m00s

Solver Time : 0.142402


 Simulation Statistics
 Number of cells: 128
 Number of compartments: 6474
 Number of presyns: 141
 Number of input presyns: 0
 Number of synapses: 141
 Number of point processes: 141
 Number of transfer (gap) targets: 0
 Number of spikes: 264
 Number of spikes with non negative gid-s: 264

Compare binary results between NEURON and CoreNEURON

Sample example:

from neuron import h, gui

h('''create soma''')
h.soma.L=5.6419
h.soma.diam=5.6419
h.soma.insert("hh")
ic = h.IClamp(h.soma(.5))
ic.delay = .5
ic.dur = 0.1
ic.amp = 0.3
h.tstop=100

# run neuron and record v,t
v = h.Vector()
v.record(h.soma(.5)._ref_v, sec = h.soma)
tv = h.Vector()
tv.record(h._ref_t, sec=h.soma)
h.run()

# run coreneuron and record v,t
vstd = v.cl()
tvstd = tv.cl()
pc = h.ParallelContext()
h.cvode.cache_efficient(1)
h.stdinit()
pc.nrncore_run("-e %g"%h.tstop, 0)

# compare trajectories
print (bool(tv.eq(tvstd)))
print (v.cl().sub(vstd).abs().max())
print (v.cl().sub(vstd).abs().max() < 1e-15)
h.quit()

And the output is:

→ nrniv -python neuron_direct.py
NEURON -- VERSION + master (f70c151+) 2019-06-27
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2018
See http://neuron.yale.edu/neuron/credits

loading membrane mechanisms from x86_64/.libs/libnrnmech.so
Additional mechanisms from files


 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2015
 version id unimplemented

 Memory (MBs) :             After mk_mech : Max 17.1758, Min 17.1758, Avg 17.1758
 .....
 Memory (MBs) :  After mk_spikevec_buffer : Max 17.2656, Min 17.2656, Avg 17.2656
 Memory (MBs) :     After nrn_finitialize : Max 17.2773, Min 17.2773, Avg 17.2773

 psolve |========================================================| t: 100.00 ETA: 0h00m00s

Solver Time : 0.00208807


 Simulation Statistics
 Number of cells: 1
 Number of compartments: 3
 Number of presyns: 1
 Number of input presyns: 0
 Number of synapses: 0
 Number of point processes: 1


True
0.0
True

If mod file is not used, continue simulation (even if mod file is different between neuron and coreneuron)

Currently even if mod file is not used, we get error like:

{code}
○ → srun -n 32 $CORENEURON_EXEC -mpi -d $BLUECONFIG_OUTPUT_ROOT/data -o $BLUECONFIG_OUTPUT_ROOT/data -e $BLUECONFIG_DURATION -dt $BLUECONFIG_DT -k $BLUECONFIG_FORWARD_SKIP -r 1 -w $BLUECONFIG_DT_REPORT -R 0
num_mpi=32
num_omp_thread=64

Memory (MBs) : After MPI_Init : Max 10.0977, Min 10.0352, Avg 10.0371
Info: No default arguments file provided: config
hh prop sizes differ psize 25 19 dpsize 6 6
hh prop sizes differ psize 25 19 dpsize 6 6
hh prop sizes differ psize 25 19 dpsize 6 6
hh prop sizes differ psize 25 19 dpsize 6 6
{code}

We should just print the warning and continue simulation.

InterleaveInfo breaks rule of 3 (5)

By pure chance, I came across class InterleaveInfo, which seems to do some resource management. Its destructor releases a host of resources via delete[], however, no special care is taken of copy construction or assignment, which could result in memory errors at runtime (specifically, double-deletes, but formally, undefined behaviour.) I suggest either making the class non-copyable, or implementing the correct copy and assignment semantics.


See the rule of three/five/zero.

segmentation fault in bbcore_write when forgetting to setRNG in synapse

Currently, in a probabilistic synapse model, if I forget to call

synapse.setRNG(int,int)

then, on a call to pc.bbcore_write('coredat') I get a Segmentation fault.
This was traced back to the fact that the random stream is set to NULL.

It would be nicer if bbcore_write could check and output a a reminder to the user that they should set the Random123 generator with setRNG or equivalent call.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.