On 10/8/07, mabshoff <[EMAIL PROTECTED]> wrote:
> On Oct 8, 3:31 pm, David Harvey <[EMAIL PROTECTED]> wrote:
>
> Hello David,
>
> > When I start up sage, I get different random number seeds every time,
> > e.g.
> >
> > $ ./sage
> > sage: ZZ.random_element()
> > 2
> >
> > .....
> >
> > $ ./sage
> > sage: ZZ.random_element()
> > -4
> >
> > The seeding --- at least for this case --- seems to be happening in
> > random.pxi.
> >
> > We *really* need a way of specifying a random seed at startup.
> >
>
> When we fixed all the leaks in the random seed code William wrote some
> code to specify the random seed via an environment variable. I grepped
> $SAGE_LOCAL/bin and couldn't find anything, so maybe it wasn't merged.

I removed it because the implementation was way too hack-ish.  It was
mainly for experimenting.

I do encourage David to open a trac ticket about this.  He's right that
seeding the random number generator should be possible via a command
line argument at startup.

One perhaps reasonable way to do this is by setting an environment variable
in local/bin/sage-sage if a certain command line option is set, then in
ext/random.pxi (and anywhere else), somehow using that environment variable
(if set) to seed the random number generator.     The tricky part is one has
to also make sure in all cases that all seeding is done from one place, and
that the random seed is easily available from Sage on startup or in
crash messages.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to