# Question about running depletion in parallel

**URL:** <https://openmc.discourse.group/t/question-about-running-depletion-in-parallel/2029>\
**Category:** User Support\
**Created:** [May 9, 2022, 2:03pm UTC](https://openmc.discourse.group/t/question-about-running-depletion-in-parallel/2029 "2022-05-09T14:03:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zhiying](https://avatars.discourse-cdn.com/v4/letter/z/97f17d/32.png) [@Zhiying](https://openmc.discourse.group/u/Zhiying)\
**Post date:** [May 9, 2022, 2:03pm UTC](https://openmc.discourse.group/t/question-about-running-depletion-in-parallel/2029/1 "2022-05-09T14:03:24Z")

</div>

Hi all,  
I am running a simulation of depletion. In the depletion calculation of OpenMC, 4 threads are used by default, but this does not meet my calculation needs. So I would like to ask if there is a way to specify in the Python scripts the number of threads used by the computation? Any suggesstions would be appreciated.

Regards,  
Zhiying

---

<div class="post-metadata">

**Author:** ![lz152](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/lz152/32/1547_2.png) [@lz152](https://openmc.discourse.group/u/lz152)\
**Post date:** [May 10, 2022, 12:47am UTC](https://openmc.discourse.group/t/question-about-running-depletion-in-parallel/2029/2 "2022-05-10T00:47:54Z")

</div>

Hi，  
Maybe it is what you need:  
[https://docs.openmc.org/en/stable/usersguide/scripts.html](https://docs.openmc.org/en/stable/usersguide/scripts.html)  
Hope it help!

* * *

Zhuangli

---

<div class="post-metadata">

**Author:** ![Zhiying](https://avatars.discourse-cdn.com/v4/letter/z/97f17d/32.png) [@Zhiying](https://openmc.discourse.group/u/Zhiying)\
**Post date:** [May 10, 2022, 1:26am UTC](https://openmc.discourse.group/t/question-about-running-depletion-in-parallel/2029/3 "2022-05-10T01:26:34Z")

</div>

Thank you for your reply. In my calculation, the burnup simulation is controlled via python scripts. Therefore, I cannot control the parallel execution of the program through the command line. By the way, openmc on my computer was installed using conda. So I can’t use mpi4py to achieve multi-threaded or multi-core parallel computing. Thanks again for your advice, maybe I need to reinstall openmc from the source.

---

<div class="post-metadata">

**Author:** ![lz152](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/lz152/32/1547_2.png) [@lz152](https://openmc.discourse.group/u/lz152)\
**Post date:** [May 10, 2022, 1:36am UTC](https://openmc.discourse.group/t/question-about-running-depletion-in-parallel/2029/4 "2022-05-10T01:36:43Z")

</div>

I use C++ to control my openmc run, so my command line is like:

```auto
system(openmc -s <number of threads>)

```

Guys should have a wonderful answer for your question.  
With regards.

* * *

Zhuangli

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [May 10, 2022, 11:43am UTC](https://openmc.discourse.group/t/question-about-running-depletion-in-parallel/2029/5 "2022-05-10T11:43:06Z")

</div>

Right now there is no way to specify the number of OpenMP threads directly using the `Operator` or `Integrator` classes. However, you can set the `OMP_NUM_THREADS` environment variable, which will be used by OpenMC.

---

<div class="post-metadata">

**Author:** ![Zhiying](https://avatars.discourse-cdn.com/v4/letter/z/97f17d/32.png) [@Zhiying](https://openmc.discourse.group/u/Zhiying)\
**Post date:** [May 10, 2022, 11:59pm UTC](https://openmc.discourse.group/t/question-about-running-depletion-in-parallel/2029/6 "2022-05-10T23:59:16Z")

</div>

Thank you so much for your suggestion.
