# How to make GroIMP simulations fully reproducible across runs (same random seed)?

**URL:** <https://fspm.discourse.group/t/how-to-make-groimp-simulations-fully-reproducible-across-runs-same-random-seed/384>\
**Category:** GroIMP\
**Created:** [November 3, 2025, 1:26pm UTC](https://fspm.discourse.group/t/how-to-make-groimp-simulations-fully-reproducible-across-runs-same-random-seed/384 "2025-11-03T13:26:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![michele.butturini](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@michele.butturini](https://fspm.discourse.group/u/michele.butturini)\
**Post date:** [November 3, 2025, 1:26pm UTC](https://fspm.discourse.group/t/how-to-make-groimp-simulations-fully-reproducible-across-runs-same-random-seed/384/1 "2025-11-03T13:26:12Z")

</div>

Hi everyone,

I’m trying to make my GroIMP-based model give identical results across repeated runs under the same input conditions. My goal is full reproducibility for debugging and validation.

Currently, I’m setting the random seed explicitly in my code like this:

```auto
protected static void update_light() {
    lmGPU.setSeed(1); // 2 for dynamic with static
    lmGPU.compute();
    derive();
}

static void resetCounters() {
    time = 0;
    setSeed(SET_SEED);
}

```

However, even with this setup, I still get slightly different results across runs. For example:

Run 1:

```auto
avg_PAR_absorbed_per_plant_second_umol 0.3994945095922717
avg 176.8666809884359

```

Run 2:

```auto
avg_PAR_absorbed_per_plant_second_umol 0.3994945092374999
avg 176.86668094852257

```

The differences are small but consistent across executions.

Is there a way to obtain full reproducibility in GroIMP simulations that use GPU computations?

---

<div class="post-metadata">

**Author:** ![michele.butturini](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@michele.butturini](https://fspm.discourse.group/u/michele.butturini)\
**Post date:** [November 3, 2025, 1:46pm UTC](https://fspm.discourse.group/t/how-to-make-groimp-simulations-fully-reproducible-across-runs-same-random-seed/384/2 "2025-11-03T13:46:19Z")

</div>

Interesting fact: **the higher the number of rays the bigger the error!**

---

<div class="post-metadata">

**Author:** ![gaetanH](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@gaetanH](https://fspm.discourse.group/u/gaetanH)\
**Post date:** [November 28, 2025, 9:05am UTC](https://fspm.discourse.group/t/how-to-make-groimp-simulations-fully-reproducible-across-runs-same-random-seed/384/3 "2025-11-28T09:05:15Z")

</div>

Hi Michele,

I did not manage to reproduce your issue. I set up few light nodes, few volumes, and once the seed is set I get exactly the same result every time.

Maybe you could send a small example that reproduce your issue?
