# Python runs on only one core

**URL:** https://brian.discourse.group/t/python-runs-on-only-one-core/375
**Category:** Support
**Created:** [29 April 2021 16:14 UTC](https://brian.discourse.group/t/python-runs-on-only-one-core/375 "2021-04-29T16:14:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jeffry](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jeffry](https://brian.discourse.group/u/Jeffry)
#### Post date: [29 April 2021 16:14 UTC](https://brian.discourse.group/t/python-runs-on-only-one-core/375/1 "2021-04-29T16:14:30Z")

</div>

# 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"](https://github.com/henokhope1/stdp-mnist-brian2)). 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.

---

<div class="post-metadata">

### Author: ![mstimberg](https://yyz2.discourse-cdn.com/free1/user_avatar/brian.discourse.group/mstimberg/32/11_2.png) [@mstimberg](https://brian.discourse.group/u/mstimberg)
#### Post date: [29 April 2021 16:31 UTC](https://brian.discourse.group/t/python-runs-on-only-one-core/375/2 "2021-04-29T16:31:34Z")

</div>

Hi. If I am not mistaken, that code is using Brian’s standard runtime mode (see [_Computational methods_ in the docs](https://brian2.readthedocs.io/en/stable/user/computation.html)), 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](https://brian2.readthedocs.io/en/stable/developer/openmp.html). 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](https://brian.discourse.group/t/unsupervised-learning-of-digit-recognition-using-spike-timing-dependent/189) If you want to discuss how to speed things up, this might be a good place.

---

<div class="post-metadata">

### Author: ![Jeffry](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jeffry](https://brian.discourse.group/u/Jeffry)
#### Post date: [29 April 2021 19:10 UTC](https://brian.discourse.group/t/python-runs-on-only-one-core/375/3 "2021-04-29T19:10:42Z")

</div>

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