SpineML / SpineML_2_BRAHMS

Code generation scripts to run a SpineML neural model using BRAHMS on standard CPUs
http://spineml.github.io/simulators/BRAHMS/
4 stars 3 forks source link

Debugging SpineML_2_BRAHMS code

If the SpineML_2_BRAHMS-generated code crashes, you, or a friendly developer will need to find out why.

You can debug SpineML_ 2_BRAHMS by giving the -D option to convert_script_s2b, which will then compile components with debugging symbols (the -g option for g++), generate a suitable gdbcmd file, and then run the simulation with brahms-gdb which will mean you'll be able to backtrace into the code that SpineML_2_BRAHMS generates. Note that even if the simulation completes without a crash, you'll still end up in the gdb command line environment; if you've nothing further to do, type 'quit' or use Ctrl-D to exit.

You can use the -D option in conjunction with the -r option to ensure all the components are re-built with debugging symbols incorporated. It's best to do this the first time you run with -D to debug.


Old instructions follow (this was previously a manual process):

How to modify SpineML_2_BRAHMS to debug a simulation using gdb:

Find brahms-gdb in the brahms source code.

Install brahms-gdb in your path

Create a gdbcmd file in your home dir containing something like:

dir ~/src/saccsim/src dir ~/src/brahms dir ~/src/SpineML_2_BRAHMS/Namespace/dev/SpineML/temp/WU/ConnectionListStaticoweight/brahms/0 run

Add as make of the Namespace/dev/SpineML paths as you need to debug your code.

Modify SpineML_2_BRAHMS/xsl/SpineML_2_BRAHMS_write_script.xsl

Change the BRAHMS_CMD fields to call brahms-gdb instead of plain brahms.

There's a similar scheme for brahms-vg - for valgrind.