A. Developer Installation Guide - Hjorthmedh/Snudda GitHub Wiki

When working with snudda we want to have an identical experience as our users, to encounter as many of the bugs they might encounter. But if we were to install the package ourselves, we'd have to inspect every code change and reinstall it.

To solve this you can use pip to install a git repository as an "editable" package. From the root of the git repo:

pip install -e .[dev]

This will install our package with all of the extra dependencies that a package developer might need such as the tools to generate our documentation or to test or format the code.

You can now be a proud user of snudda:

cd $HOME
mkdir my-snudda-project
cd my-snudda-project

simName=tinySim
snudda init $simName --size 1760000
snudda init $simName --size 10 --overwrite 
snudda place $simName
snudda detect $simName --volumeID Striatum
snudda prune $simName
cp -a data/input_config/input-tinytest-v8.json $simName/input.json
snudda input $simName --input $simName/input.json --time 1.0
nrnivmodl data/cellspecs-var/mechanisms
snudda simulate $simName --time 0.1

If you want to run the touch detection or pruning in parallel, then you need to do the following before running snudda. The sleep command is just to make sure the ipcluster has time to setup the environment before snudda starts. If you have a big machine you might need to increase this delay.

export IPYTHONDIR="`pwd`/.ipython"
export IPYTHON_PROFILE=Snudda_LOCAL

ipcluster start -n 12 --profile=$IPYTHON_PROFILE --ip=127.0.0.1&
sleep 20

You also need to add the parameter --parallel to snudda when running place, detect, prune and input.

snudda init $simName --size 10000

snudda place $simName --parallel
snudda detect $simName --volumeID Striatum --parallel
snudda prune $simName --parallel

snudda input $simName --input $simName/input.json --time 1.0 --parallel

To run the simulation in parallel call snudda simulate through mpiexec

mpiexec -n 12 -map-by socket:OVERSUBSCRIBE snudda simulate $simName --time 1.0

If you want to setup Snudda to run on a super computer, there is an example for how to run it on Tegner at KTH. You will need to adapt it to your own favourite cluster.

Tegner_setup_installation.sh
sbatch Tegner_runSnudda.job