On Tue, Dec 16, 2008 at 7:41 AM, Justin C. Walker <jus...@mac.com> wrote:
>
>
> On Dec 16, 2008, at 07:17 , William Stein wrote:
>
>>
>> On Tue, Dec 16, 2008 at 12:50 AM, achrzesz <achrz...@wp.pl> wrote:
>>>
>>> Hallo,
>>> I'm wondering what goes  wrong with tis:
>>>
>>> (sage 3.2 compiled from sources, ubuntu 8.04, quad core 2.4 GHz)
>>>
>>>
>>> sage: for k in range(14,21):
>>> ....:     f=2^2^k+1;w=ecm.find_factor(f);[w[0],prod(w)==f]
>>> ....:
>>> [2, False]
>>> [523923, False]
>>> [1901173, False]
>>> [2, False]
>>> [2, False]
>>> [30539, False]
>>> [2, False]
>>>
>>> Are the exponents to big?
>>>
>>> Andrzej Chrzeszczyk
>>
>> Yes, I think there must be a hard limit on the input line for GMP-ECM.
>>   If I try the first number directly on the command line, it says
>> "Factor found in step 1: 2".  However the first number is *odd*, so 2
>> can't be a factor!
>> What's really happening is that GMP-ECM is ignoring everything after
>> the first 4095 digits when I paste the input in.
>
> I think you are running into a system limit, not an ECM limit.  Even
> emacs seems to have a problem when I paste in "2^2^14+1".
>
> I finally got this to work by doing
>
> f = open("/tmp/foo", "w")
> print >> f, 2^2^14+1
> f.close()
>
> in Sage, and then
>
> ecm < /tmp/foo
>
> in the shell:
>
> $ ecm 10000000 100000 < /tmp/foo
> GMP-ECM 6.1.3 [powered by GMP 4.2.1] [ECM]
> Input number has 4933 digits
> Using B1=10000000, B2=100000, polynomial x^1, sigma=3668583302
> ...
>
> It's likely that the "expect" interface is running into the same
> limit, since it uses the tty sub-system.
>
> All those "bings" are a signal from the system (tty driver) that it's
> choking, and isn't reading what you are throwing at it.

Yes, I agree that is likely what is happening.   In fact, most ptty
interfaces in sage would simply freeze given that many characters of
input, which is why they all use files when given more than about 2000
characters input.

> http://trac.sagemath.org/sage_trac/ticket/4814

I posted a patch there that does some error checking at least.  It's
minimal.  I hope somebody will referee it asap so it can go in
sage-3.2.2.

The real longterm solution to this problem is to totally rewrite the
GMP interface so that it uses Cython and doesn't use expect at all.
That's for another ticket.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to