Python runs on only one core

Description of problem

I am very new to Brian. I am running the python code for classifying MNIST database using Unsupervised Learning (GitHub - henokhope1/stdp-mnist-brian2: Brian 2 version of Paper "Unsupervised Learning of digit recognition using STDP"). The htop command revealed that the code is running on only 1 core out of the 32 cores on my server. I found that there are 5 threads in the program. Please let me know how to make this code run on more than one core.

Hi. If I am not mistaken, that code is using Brian’s standard runtime mode (see Computational methods in the docs), which only supports single-core computation. Simulations using standalone mode (see the previous link) have some restrictions but can make use of multithreading with OpenMP. Another option to speed up things with runtime mode is to run independent simulations in parallel with something like joblib or Python’s builtin multiprocessing support. In sum, there’s no simple switch to make code like the one you are referring to run on multiple threads with Brian.

Finally, note that other users are also interested in simulations of the STDP-MNIST paper, see e.g. this thread: Unsupervised learning of digit recognition using spike-timing-dependent If you want to discuss how to speed things up, this might be a good place.

2 Likes

Thanks a lot for your help. I will read more about these topics.