[ot-users] Fwd: [OpenTURNS] #703: Question about random generator state

D. Barbier bouzim at gmail.com
Tue Apr 8 17:54:19 CEST 2014


On 2014-04-03 15:14 GMT+02:00 Ivan Panin wrote:
>
> Hi!
>
>  I'd like to know, is there a way to set the initial seed of random
> generators for all
> OpenTURNS objects that use random generators?
>
>  Do I understand correctly that
>  {{{
>  RandomGenerator.SetSeed(123)
>  }}}
>  is the only way to do it for all cases?

Hello,

Yes, you are right.

>  I mean, is it sufficient to set
>  RandomGenerator seed to ensure that the result of a script will be the
>  same at different runs and on different computers?

No.  You will have different results on different computers because
compilers will not generate  the same code, and systems may behave
differently (think about extended precision on Linux x86 for
instance).
You may have different results at different runs on the same machine
if parallelism has been enabled (via TBB or openmp).

>  Isn't it used randomization in OpenTURNS optimization algorithms (e.g. for
>  FORM/SORM methods or for building of LogNornal distribution based on the
>  sample), in underlying C++ libraries?

Looking at the code, there does not seem to be any randomization, but
I am not sure.

> How to set the initial state of  random generator in this case?

Denis



More information about the users mailing list