Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
CoreNEURON GPU Installation and ringtest example
# stop if error
set -e
# load required modiles on your cluster
module purge
module load mvapich2/2.0.1-nocuda cmake
export BASE_DIR=`pwd`/coreneuron_tutorial
export INSTALL_DIR=$BASE_DIR/install
export SOURCE_DIR=$BASE_DIR/sources
# create directories
# clone repositories
git clone
git clone
git clone
# install neuron
cd $SOURCE_DIR/nrn
sed -i -e 's/GLOBAL minf/RANGE minf/g' src/nrnoc/hh.mod
sed -i -e 's/TABLE minf/:TABLE minf/g' src/nrnoc/hh.mod
./configure --prefix=$INSTALL_DIR --without-iv --with-paranrn --with-nrnpython=`which python`
make install
# install mod2c
cd $SOURCE_DIR/mod2c
mkdir -p build && cd build
make && make install
# set path
export PATH=$INSTALL_DIR/x86_64/bin:$INSTALL_DIR/bin:$PATH
export MODLUNIT=$INSTALL_DIR/share/nrnunits.lib
# clone ring test
git clone
cd ringtest && git checkout tutorial
# build special executable with neuron
cd $SOURCE_DIR/ringtest
nrnivmodl mod
# build coreneuron executable
module purge
module load pgi/pgi64/16.5 pgi/mpich/16.5
module load cuda/7.0
export CC=mpicc
export CXX=mpicxx
cd $SOURCE_DIR/ringtest
mkdir -p coreneuron_x86 && cd coreneuron_x86
make VERBOSE=1
# run simulation using neuron
cd $SOURCE_DIR/ringtest
./x86_64/special -python -tstop 100 -coredat coreneuron_data
# run simulation using coreneuron
cd $SOURCE_DIR/ringtest
./coreneuron_x86/bin/coreneuron_exec -e 100 -d coreneuron_data --gpu --cell_permute=1
# sort compare spike output between neuron and coreneuron
sortspike coreneuron_data/spk1.std out.neuron.spk
sortspike out0.dat out.coreneuron.spk
diff -w out.neuron.spk out.coreneuron.spk
# check which version of CUDA being used by PGI compiler
$ pgcc -show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment