#5313: patch singular so that when it runs out of memory the error message says
"singular" in it
-----------------------------------+----------------------------------------
Reporter: was | Owner: malb
Type: enhancement | Status: new
Priority: major | Milestone: sage-4.5
Component: commutative algebra | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------------------+----------------------------------------
Comment(by was):
To get rid of the "exit of out sage" issue hackishly:
1. Modify src/kernel/mminit.cc and put abort() right after the first
fprintf in the function void omSingOutOfMemoryFunc().
2. Edit the file devel/sage/sage/libs/singular/polynomial.pyx by
adding _sig_on/_sig_off around {{{ret[0] = pp_Mult_qq(p, q, r)}}} in the
function singular_polynomial_mul.
Then we have:
{{{
----------------------------------------------------------------------
| Sage Version 4.4.4.1, Release Date: 2010-06-28 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: sage: n = 1000
sage: sage: R = PolynomialRing(QQ,n,names='x')
sage: sage: f = sum(R.gens())
sage: sage: g = f*f
2 - Singular error: no more memory
calling abort
sage:
}}}
Note that strangely there is no traceback. But at least one gets the sage
prompt back.
Regarding speed:
WITH the _sig_on/_sig_off stuff:
{{{
sage: R.<x,y,z> = PolynomialRing(QQ)
sage: f = (x+y+z)^2
sage: timeit('f*(f+1)')
625 loops, best of 3: 12.6 µs per loop
sage: f = (x+y+z)
sage: timeit('f*(f+1)')
625 loops, best of 3: 11.4 µs per loop
sage: f = (x+y+z)^10+1
sage: timeit('f*(f+1)')
625 loops, best of 3: 168 µs per loop
sage: timeit('x*x')
625 loops, best of 3: 410 ns per loop
}}}
and without it:
{{{
sage: sage: R.<x,y,z> = PolynomialRing(QQ)
sage: sage: f = (x+y+z)^2
sage: timeit('f*(f+1)')
625 loops, best of 3: 12.4 µs per loop
sage: sage: f = (x+y+z)
sage: sage: timeit('f*(f+1)')
625 loops, best of 3: 11.2 µs per loop
sage: sage: f = (x+y+z)^10+1
sage: sage: timeit('f*(f+1)')
625 loops, best of 3: 167 µs per loop
sage: timeit('x*x')
625 loops, best of 3: 290 ns per loop
}}}
This is all on sage.math.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5313#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en.