On Apr 19, 1:33 pm, David Harvey <[EMAIL PROTECTED]> wrote:
> A user has been asking on sage-support about issues with cputime()...
> it sounds like some kind of "wrap-around" resolution bug on his
> platform. Every 35 minutes it wraps around to zero or something. He
> describes his system as
>
> > I have a Toshiba Laptop with Intel centrino processor, 1,73 Ghz and
> > 1GB Ram and windows XP on it.
>

So does the person use cygwin? It seems likely, but I am not 100%
sure.

> I don't know anything about windows, maybe someone else here has some
> idea what's going on.
>
> Here's what happens:
>
>
<SNIP>
>
> > and so on, so the sign of the time changes about around every 2100
> > seconds.
>
> david

As far as I can tell cputime() is a sage function. Grepping for it
found lots of use of the function, but if someone could point me to
the right place where it is implemented I can investigate further.

I would assume cputime() uses getrusage(), hence it uses native
timers. On Windows that timer (one jiffie on Linux speak) has a length
of 100ns, i.e. 10E-7 seconds length. Compare that to linux where one
jiffie equals 1/100, 1/250 or 1/1000 of a second (depending on the
kernel) one can get an idea why this might cause trouble on windows
with overflows or wraps.

There is a proper interface defined in Windows.h that provides all the
bits and pieces to get cputime() that wraps every ~43 days, but
because we use cygwin that is properly not an option.

Cheers,

Michael



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
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