Opened 7 years ago

Last modified 5 years ago

#14202 new defect

Change interface to qsieve to not use system time command

Reported by: jpflori Owned by: was
Priority: minor Milestone: sage-6.4
Component: interfaces: optional Keywords: time optional sieve
Cc: kcrisman, dimpase Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

On some systems (including but not limited to Cygwin), there is a bash "time" keyword but no time command.

This is problematic in sage/interfaces/qsieve.py (see optional - time) doctests.

See also:

Change History (11)

comment:1 Changed 7 years ago by jdemeyer

  • Description modified (diff)
  • Summary changed from Workaround potential absence of time command on Cygwin to Workaround potential absence of time command

comment:2 Changed 7 years ago by dimpase

Cygwin has /usr/bin/time, it just needs to be installed. Thus, I propose making the presence of time a Cygwin prereq.

Last edited 7 years ago by dimpase (previous) (diff)

comment:3 follow-up: Changed 7 years ago by jdemeyer

  • Keywords cygwin removed

This ticket has absolutely nothing to do with Cygwin.

Regardless, making time a prereq is not needed, it would be easy to fix the qsieve code not to rely on a time command.

comment:4 in reply to: ↑ 3 Changed 7 years ago by jpflori

Replying to jdemeyer:

This ticket has absolutely nothing to do with Cygwin.

Regardless, making time a prereq is not needed, it would be easy to fix the qsieve code not to rely on a time command.

I agree with that, and would really not like to add new prereqs on any platform.

comment:5 follow-up: Changed 7 years ago by kcrisman

  • Component changed from cygwin to interfaces
  • Keywords sieve added
  • Owner changed from tbd to was
  • Summary changed from Workaround potential absence of time command to Change interface to qsieve to not use system time command

I'm changing the summary. This is really a bug, if it's a bug, in the way interface/qsieve.py is written. Could we use whatever does time or timeit in Sage?

comment:6 in reply to: ↑ 5 Changed 7 years ago by jdemeyer

Replying to kcrisman:

I'm changing the summary. This is really a bug, if it's a bug, in the way interface/qsieve.py is written. Could we use whatever does time or timeit in Sage?

Try this:

sage: ?walltime
Type:       function
String Form:<function walltime at 0xb9d488>
File:       /usr/local/src/sage-5.7.beta1/local/lib/python2.7/site-packages/sage/misc/misc.py
Definition: walltime(t=0)
Docstring:
   Return the wall time in second, or with optional argument t, return
   the wall time since time t. "Wall time" means the time on a wall
   clock, i.e., the actual time.

   INPUT:

   * "t" - (optional) float, time in CPU seconds

   OUTPUT:

   * "float" - time in seconds

   EXAMPLES:

      sage: w = walltime()
      sage: F = factor(2^199-1)
      sage: walltime(w)   # somewhat random
      0.8823847770690918

comment:7 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:8 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:9 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:10 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:11 Changed 5 years ago by jdemeyer

  • Component changed from interfaces to interfaces: optional
Note: See TracTickets for help on using tickets.