Biowulf at the NIH
RSS Feed
Neuron on Biowulf

NEURON is a simulation environment for modeling individual neurons and networks of neurons. It provides tools for conveniently building, managing, and using models in a way that is numerically sound and computationally efficient. It is particularly well-suited to problems that are closely linked to experimental data, especially those that involve cells with complex anatomical and biophysical properties.

Neuron was developed at Yale University. Neuron website

Neuron can be run via the GUI, which is best done on Helix. The purpose of running Neuron on Biowulf is to run batch jobs using command-line scripts, which can be multithreaded or parallel.

The neuron environment variables are most easily set up with the modules commands as in the example below.

[user@biowulf]$ module avail neuron

---------------- /usr/local/Modules/3.2.9/modulefiles ----------------------
neuron/7.1          neuron/7.1-mpi      neuron/7.2(default) neuron/7.2-mpi

[user@biowulf]$ module load neuron         (to load the default latest version)

[user@biowulf]$ module list
Currently Loaded Modulefiles:
  1) neuron/7.2

[user@biowulf]$ module unload neuron/7.2

[user@biowulf]$ module load neuron/7.2-mpi   (load the MPI version)

[user@biowulf]$ module list
Currently Loaded Modulefiles:
  1) neuron/7.2-mpi

Sample hoc files are available in /usr/local/apps/neuron/nrn-7.2/share -- you can copy these to your own directory.

Running a Neuron batch job

Create a batch script along the following lines:

#/bin/bash
#PBS -m be

module load neuron
nrniv myfile.hoc - < build_cell()
> set_buildpars(5,20,0.2,150,200)
>  build_cell()
> here
where myfile.hoc is the file containing the hoc source code.

Submit this job with:

biowulf% qsub -l nodes=1 mybatchscript
This will submit the job to a default node with 2 cores. If you want to make use of Neuron's multi-threading capabilities, you will probably want to submit to a node with more cores. Use 'freen' to see what's available, and submit with something like this:
biowulf% qsub -l nodes=1:c16 mybatchscript
to submit to a node with 16 cores (c16).

Running a parallel Neuron job

Neuron can multithread and use all the cores available on a node. An MPI version has also been built so that your Neuron simulations run on multiple nodes. Read Translating Network Models to parallel hardware to figure out how to change your code to run in parallel.

To run the MPI version, you need to load the appropriate module.

module load neuron/7.2-mpi

The example below uses the hoc file /usr/local/apps/neuron/7.2-mpi/share/test0.hoc. You can copy this to your own space:

cp /usr/local/apps/neuron/7.2-mpi/share/test0.hoc  /home/$USER
Create a batch file along the following lines
#!/bin/bash
#PBS -j oe
# this file is called neuron.bat

# run this file with qsub -v np=# -l nodes=# 

module load neuron/7.2-mpi

mpirun -machinefile $PBS_NODEFILE -np $np `which nrniv` -mpi test0.hoc 

Submit this job with a command like:

biowulf% qsub -v np=16 -l nodes=4:c4 ./neuron.bat

to run on 16 cores (4 x 4-core nodes).

Documentation

Neuron docs on the Yale site.
Neuron User Guide at Duke.
Neuron courses.
Multithreading simulation Q&A