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

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:

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:

avg_PAR_absorbed_per_plant_second_umol 0.3994945095922717
avg 176.8666809884359

Run 2:

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?

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

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?