O2-sim problems with custom seeds

Hello!

I have experienced weird behavior with o2-sim when manually adjusting seeds.
For instance, the following command works without problems:
“o2-sim --seed 2145555555”
(I check the o2sim_serverlog or the o2sim_workerlog0 to verify which RNG INITIAL SEED that was used)

However, the following command throws errors:
“o2-sim --seed 2155555555”
(“the argument (‘2155555555’) for option ‘–seed’ is invalid”)

And the following command again works without problems:
“o2-sim --seed 2222222222”

I don’t understand this behavior. How does o2-sim decide which values are valid for seed and which aren’t? Is this a bug? If not: Which algorithm can tell me if a given seed will work or not?

Thanks for your help. I am using o2-sim version 1.2.0 (6593894a7) btw.

Looks like boost cannot parse these numbers (or there is a type mismatch). I’ll take a look. Definitely weird.

For me it also complains with 2222222222.

Currently, the seed is parsed as a 32 signed bit integer. The largest value should therefore be 2147483647 and this seems to work. I will try to change the type to 64bit but for the moment you could use seeds in that range.

Thanks a lot, this fixes the issue for me. I tried 2222222222 again and it throws an error for me too, so I probably accidently only put nine 2’s when it worked. Sorry for the confusion.

Greetings,
Felix

f.y.i, o2-sim: Promote random seed to 64bit int (or ULong_t) by sawenzel · Pull Request #9641 · AliceO2Group/AliceO2 · GitHub which promotes to ULong_t.

1 Like

Thanks, I appreciate the change. We can also update some comments in O2DPG/o2dpg_sim_workflow.py at master · AliceO2Group/O2DPG · GitHub. The comment in line 228 was probably directly related to this issue (900mil is just below 10 digits), and since in line 225 the current time would be used in RNDSEED in some instance there would have been errors after the day Tuesday, January 19, 2038 because then epoch time is just above (2^31)-1.

Ok. I would invite you to propose a PR to O2DPG directly.