Supplying SLI scripts with parameters

Using the --userargs=arg1:... command line switch, it is possible to supply a SLI script with parameters from the outside of NEST. A common use case for this are parameter sweeps, where the parameters are defined in a bash script and multiple instances of NEST are used to test one parameter each. A bash script for this could look like this:

for lambda in `seq 1 20`; do
for gamma in `seq 1 5`; do
nest --userargs=lambda=$lambda:$gamma=$gamma simulation.sli
done
done

The corresponding SLI script simulation.sli could use the supplied parameters like this:

The first line first gets the array of user supplied arguments (userargs) from the statusdict and breaks each element at the "="-symbol. It then converts the first element (lambda, gamma) to a literal and the second argument (the number) to an integer. Using mark and >>, the content of the userargs array is added to a dictionary, which is stored under the name args. The second line just prints the content of the la variable.