GSoC Project Idea 10.3: Improving Brian's parallelization capabilities (OpenMP)

Brian can parallelize simulations over multiple processor cores by making use of the OpenMP framework. However, in its current state Brian does not yet make full use of the parallelization potential. In addition, there are some corner cases where activating parallelization can lead to incorrect results (this is why OpenMP support is still marked as "experimental").

The aim of this project is to finalize the OpenMP support, by:

  • deciding whether parallelization can be safely used based on information about the respective code fragment (which variables are read/written in what way)
  • identifying and implementing additional opportunities for parallelization
  • extensive testing
  • Optional ("stretch goal"): transferring the OpenMP support to other code generation targets (Cython, C++ via weave)

Skills: C++ and Python programming, experience with OpenMP or other parallelization techniques helpful
Mentors: Marcel Stimberg, Dan Goodman

1 Like

Hi, my name is Saurabh Kumar. I am a senior undergrad student at IIIT Bhubaneswar in India and currently doing research at OIST, Japan. I have been amazed by the simplicity and the convenience of using standard mathematical notations in Brian to simulate the spiking neural networks. I have been playing around with OpenMP for a while and I want to improve Brian by making use of parallelization. I have not used any other parallel computing techniques yet, but I am eager to learn them as well. It would be really helpful if @mstimberg can guide me with the next steps, and I can be more acquainted with the project.

Hi, thanks for your interest in this project! As a first step, I think it would be useful to have a closer look at what Brian 2 does behind the scenes, especially with regard to parallelization (there is already OpenMP support, but there’s still a lot to do to improve it). If you run e.g. one of the examples and switch on the C++ standalone mode, Brian will generate the code for the simulation in a folder named output. The main code in that folder is in the subfolder code_objects, with one C++ file for each of the components of the Network. If you switch on OpenMP multithreading, you will see that the generated code now contains OpenMP pragmas. Try to have a look at this and see what the current extent of the OpenMP support is.

1 Like

To go even further, you could have a look at the developer documentation where we document how to support OpenMP in the “templates” that are base of the code generation process.

1 Like

Sure, thanks a lot, I will take a look and get back to you over gitter.