brian-team/brian2 — pull request #315 by yger (2014-08-18 09:41:09+00:00)
Title: Openmp

The OpenMP branch is now up and running, and in the default case, it does not depend on openmp or insert any #pragma in the code. The number of threads used in the simulation has to be set via brian_prefs.codegen.cpp_standalone.openmp_threads. By default this number is 0, but if positive, then OpenMP is used in the templates and the appropriate number of threads is recruited. Note that on benchmarks, results are very encouraging, and speedup are pretty robust for codes that are located in dev/benchmark/openmp. All the cpp standalone templates are now OpenMP compatible. Basically, all the object creation is done without the parallelism, so no changes were made, but then all objects inserted within the run() loop need to be openmp-compatible. Major changes, done with Marcel, are also that now network.cpp and synapses.h (renamed in synapses_classes.cpp) are now templates and not in brianlib anymore. This was needed to have a fully template-based solution.