This repository includes tests related to CoreNEURON and NEURON intergration.
More information about NEURON and CoreNEURON can be found here:
- This version of the repository is compatible with NEURON versions newer than 8.1 (#10)
More information and details how to do this you can find in the above links. A typical way to install them to run the tests is the following:
git clone https://github.com/neuronsimulator/nrn.git
cd nrn
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=./install -DNRN_ENABLE_CORENEURON=ON
make -j8
make install
For GPU execution set the following CMake variable:
-DCORENRN_ENABLE_GPU=ON
Note: For
GPUexecution make sure that you use a compiler that supportsOpenACCcompilation andCUDAis also available in your system. See more details here.
All the tests can be run with NEURON or CoreNEURON and with multiple configurations depending on the provided options to special or special-core.
The available options are described bellow:
coreneuron: Enables the execution of the test withCoreNEURONusing the on-line modegpu: Enables the execution of the test withCoreNEURONon-line mode onGPU.
Note: for this option you need to make sure that
NEURONis installed with theCMakeoptionCORENRN_ENABLE_GPUenabled.
filemode: RunsCoreNEURONfromNEURONin off-line mode.NEURONautomatically generates theCoreNEURONdataset and runs the simulation withCoreNEURON. To use thiscoreneuronoption must be enabled.dumpmodel: Creates theCoreNEURONdataset. This enablesCoreNEURONto run separately after the initial simulation.
The following commands runs one of the included test with CoreNEURON and with the GPU backend enabled.
nrnivmodl -coreneuron mod
mpirun -n 2 ./x86_64/special -mpi -c sim_time=100 -c coreneuron=1 -c gpu=1 testkin.hoc
The following commands runs one of the included tests with NEURON, generates the CoreNEURON dataset, runs the CoreNEURON simulation and compares the spikes between the two.
nrnivmodl -coreneuron mod
mpirun -n 2 ./x86_64/special -mpi -c sim_time=100 -c dumpmodel=1 -c gpu=1 testkin.hoc
cat outkin.dat | sort -k 1n,1n -k 2n,2n > out_nrn_kin.spk
mpirun -n 2 ./x86_64/special-core --mpi --tstop 100 --datpath coredat
cat out.dat | sort -k 1n,1n -k 2n,2n > out_cn_kin.spk
diff -w -q out_nrn_kin.spk out_cn_kin.spk
To make sure that the NEURON and CoreNEURON used to run the tests are running properly it's also needed to compare their generated spikes with the ones existing in the reference folder for each test.
To run all the tests you can use the run.sh file which runs all the tests included in this repository with NEURON and CoreNEURON using some default parameters and then compares them with the reference spikes.
You can select which tests to run by setting the spike_comparison_tests, direct_tests and gpu_tests.
Note: Make sure that you compiled the included mod files in the
moddirectory before running the script. To do this you need to runnrnivmodl -coreneuron mod.
There are 3 kinds of tests:
spike_comparison_tests: Those tests are used only to compare the generated spikes fromNEURONandCoreNEURONto the reference spikes- bbcore
- conc
- deriv
- gf
- kin
- patstim
- vecplay
- watch
- vecevent
direct_tests: Those test compare internally the voltage and currents betweenNEURONandCoreNEURONand generate a spike output file for comparison with the reference spikes- netstimdirect
gpu_tests: Same asspike_comparison_testsbut if set they compare the spikes generated byNEURONandCoreNEURONusing theGPUbackend with the reference spikes.