On 2015-11-13 22:53, Nils Bruin wrote:
You might want to use a better source, because the pid will not have
much entropy.
It has sufficient entropy to be different in every parallel process. So
I think it is a good solution.
Jeroen.
--
You received this message because you are subscribed to
There are python modules that provide cryptografically secure RNG's.:
sage: from Crypto.Random.random import randint
sage: @parallel
: def f(a):
: return a+randint(int(0),int(2^64-1))/2.0^64
:
sage: [ v for _,v in f(range(10))]
[0.448332695597944,
1.1694151387
On Saturday, November 14, 2015 at 2:52:15 AM UTC-8, Thierry
(sage-googlesucks@xxx) wrote:
>
> Why not simply get a fresh seed ?
>
> sage: @parallel
> : def f(a):
> : sage.misc.randstate.set_random_seed()
> : return a+random()
>
If os.urandom works then that's a good option
Hi,
On Fri, Nov 13, 2015 at 01:53:25PM -0800, Nils Bruin wrote:
> On Friday, November 13, 2015 at 1:18:07 PM UTC-8, Dima Pasechnik wrote:
> >
> > how one would then run a randomised algorithm in parallel? (e.g. testing
> > property with random input)
> > In such a case one certainly need somethin
> Feature - the calls all happen at once starting with the same state of
>> sage including the random state.
>>
>>
>
> how one would then run a randomised algorithm in parallel? (e.g. testing
> property with random input)
> In such a case one certainly need something orthogonal to this.
>
Ca
On Friday, November 13, 2015 at 1:53:25 PM UTC-8, Nils Bruin wrote:
>
> I would think this is the kind of thing that is worth documenting
> somewhere.
>
Particularly because the behaviour depends on the underlying
parallellization mechanism:
@parallel(p_iter="multiprocessing")
def f(a):
ret
On Friday, November 13, 2015 at 1:18:07 PM UTC-8, Dima Pasechnik wrote:
>
> how one would then run a randomised algorithm in parallel? (e.g. testing
> property with random input)
> In such a case one certainly need something orthogonal to this.
>
Something like this?
@parallel
> def f(a):
>
On Friday, 13 November 2015 18:02:14 UTC, William wrote:
>
>
>
> On Friday, November 13, 2015, Sébastien Labbé > wrote:
>
>> Is this a feature or a bug?
>>
>>
> Feature - the calls all happen at once starting with the same state of
> sage including the random state.
>
how one would then run a
On Friday, November 13, 2015, Sébastien Labbé wrote:
> Is this a feature or a bug?
>
>
Feature - the calls all happen at once starting with the same state of sage
including the random state.
>
> sage: @parallel
> : def f(a):
> : return a+random()
> :
> sage: [v for _,v in f(ran