# How to utilize multi-core/thread to speed up the simulation?

**URL:** <https://fluka-forum.web.cern.ch/t/how-to-utilize-multi-core-thread-to-speed-up-the-simulation/604>\
**Category:** Flair\
**Created:** [19 June 2020 15:38 UTC](https://fluka-forum.web.cern.ch/t/how-to-utilize-multi-core-thread-to-speed-up-the-simulation/604 "2020-06-19T15:38:30Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cesc](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/c/5f8ce5/32.png) [@cesc](https://fluka-forum.web.cern.ch/u/cesc)\
**Post date:** [19 June 2020 16:36 UTC](https://fluka-forum.web.cern.ch/t/how-to-utilize-multi-core-thread-to-speed-up-the-simulation/604/2 "2020-06-19T16:36:26Z")

</div>

Dear Martin,

Once you’ve set up your input file, go to the Run tab and click “add” to add a new run:

 ![1](https://fluka-forum.web.cern.ch/uploads/default/original/1X/c14d1aa395ed69cb180a3ee619f958244e0f3d03.png)

Give it the name e.g. “myrun”. Select the number of cycles (e.g. 5) and primaries (e.g. 1000):

 ![2](https://fluka-forum.web.cern.ch/uploads/default/original/1X/490727f6d270cd9499a2b35702ef5b03ba5640e5.png)

Then click on the grey rectangle in column “Spawn”:

 ![4](https://fluka-forum.web.cern.ch/uploads/default/original/1X/4d3d136a14b43320e50a36628577a8c082556c24.png)

…and proceed to enter the number of CPUs at your disposal, for the sake of argument 8. If you then click on the “+” symbol next to “myrun” you’ll see a list unfold with the 8 prepared input files that will run concurrently:

 ![3](https://fluka-forum.web.cern.ch/uploads/default/original/1X/0c2cde992a7319cf6ea95bca129f923c0c924a46.png)

Flair takes care to set different random seeds for each of the 8 spawned cases.

Keeping the top level “myrun” selected as in the screenshot, you can click the “Start” button. You should see that, for each cycle, 8 concurrent runs are happily running in independent threads. The processing stage should take care to merge all 5 cycles (each with its respective 8 contributions).

Hopefully this (or a minor variation thereof) helps!

Cheers,

Cesc

---

_[View the full topic](https://fluka-forum.web.cern.ch/t/how-to-utilize-multi-core-thread-to-speed-up-the-simulation/604)._
