# Cycles vs spawns

**URL:** <https://fluka-forum.web.cern.ch/t/cycles-vs-spawns/2193>\
**Category:** Running and Runtime Errors\
**Created:** [24 August 2021 03:31 UTC](https://fluka-forum.web.cern.ch/t/cycles-vs-spawns/2193 "2021-08-24T03:31:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shusheng](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/s/ccd318/32.png) [@shusheng](https://fluka-forum.web.cern.ch/u/shusheng)\
**Post date:** [24 August 2021 03:31 UTC](https://fluka-forum.web.cern.ch/t/cycles-vs-spawns/2193/1 "2021-08-24T03:31:38Z")

</div>

Dear @cesc, I read your reply under the topic of [How to utilize multi-core/thread to speed up the simulation? - #2 by cesc](https://fluka-forum.web.cern.ch/t/how-to-utilize-multi-core-thread-to-speed-up-the-simulation/604/2). And I have a question: when I click on the grey rectangle in column"Spawn", if I enter 5, can I select the number of cycles as 1? In other words, I want to get a result with relative error, if I don’t set Spawn, I usually need to select the number of cycles as 5(≥5). Whether the above two cases have the same result？

---

<div class="post-metadata">

**Author:** ![amario](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/a/47e85d/32.png) [@amario](https://fluka-forum.web.cern.ch/u/amario)\
**Post date:** [24 August 2021 04:25 UTC](https://fluka-forum.web.cern.ch/t/cycles-vs-spawns/2193/2 "2021-08-24T04:25:00Z")

</div>

> [@shusheng](#):
>
> Dear @cesc, I read your reply under the topic of [How to utilize multi-core/thread to speed up the simulation? - #2 by cesc](https://fluka-forum.web.cern.ch/t/how-to-utilize-multi-core-thread-to-speed-up-the-simulation/604/2). And I have a question: when I click on the grey rectangle in column"Spawn", if I enter 5, can I select the number of cycles as 1?

Yes

> [@shusheng](#):
>
> In other words, I want to get a result with relative error, if I don’t set Spawn, I usually need to select the number of cycles as 5(≥5). Whether the above two cases have the same result？

A simulation that runs, without using spawn, for 5 cycles and n primaries (total number of simulated primaries N = 5n ) and a simulations that spawns over 5 cores each using 1 cycle with n primaries (total number of simulated primaries N = 5n ), have the same statistical significance. The numerical result might be slightly different (as different random number sequences would be used) but in lim\_{n\rightarrow \infty} then they will be the same.

Have a look at [this lecture](https://indico.cern.ch/event/1012211/contributions/4247770/attachments/2254500/3825142/02_Introduction_to_Monte_Carlo_2021_online.pdf) for more details.

---

<div class="post-metadata">

**Author:** ![shusheng](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/s/ccd318/32.png) [@shusheng](https://fluka-forum.web.cern.ch/u/shusheng)\
**Post date:** [24 August 2021 06:44 UTC](https://fluka-forum.web.cern.ch/t/cycles-vs-spawns/2193/3 "2021-08-24T06:44:17Z")

</div>

Thanks for taking time to reply my question!

---

<div class="post-metadata">

**Author:** ![rversaci](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/r/cc9497/32.png) [@rversaci](https://fluka-forum.web.cern.ch/u/rversaci)\
**Post date:** [24 August 2021 06:56 UTC](https://fluka-forum.web.cern.ch/t/cycles-vs-spawns/2193/4 "2021-08-24T06:56:23Z")

</div>

Closed on 24 August 2021 06:56 UTC


