mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Msieve

Reply
 
Thread Tools
Old 2010-01-13, 07:51   #1
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

22×7×19 Posts
Default Python Driver for GGNFS and MSIEVE

Hi Everyone,

I have now published my initial version of a Python driver for GGNFS and MSIEVE. It is available here:

http://gladman.plushost.co.uk/oldsit.../factoring.php

It has been developed on Windows and will probably need a bit of work to get it working on Linux. Also, while the main operation has been tested by myself and Jeff Gilchrist, some of the less used features still need testing.

Jeff has kindly modified his guide here:

http://gilchrist.ca/jeff/factoring/n...ers_guide.html

to describe how factmsieve.py can be used.

Bear in mind that it is new and will contain bugs. I would be most grateful for feedback on bugs and suggestions for improvement.

In broad terms it duplicates the functions of factmsieve.pl but can also use MSIEVE for polynomial selection.

I would like to thank Jeff Gilchrist for the extensive help he has given during its development.

best regards,

Brian Gladman
Brian Gladman is offline   Reply With Quote
Old 2010-01-13, 10:46   #2
Jeff Gilchrist
 
Jeff Gilchrist's Avatar
 
Jun 2003
Ottawa, Canada

117310 Posts
Default

A couple of nice features that this python driver has over the
factmsieve.pl perl script besides a lot of the bugs that Brian fixed
is: clean stopping and re-starting, plus it supports doing polynomial
selection with msieve (default) and pol51 whichever you prefer. It
also accepts reading in msieve polynomial files (.fb) so you don't
need to worry about converting them from msieve to ggnfs format to use
with the script. So now you can easily do an msieve -> ggnfs ->
msieve factoring.

Great work Brian!

Jeff.
Jeff Gilchrist is offline   Reply With Quote
Old 2010-01-13, 17:25   #3
dekcarki
 
Aug 2009
Magdeburg, Germany

6110 Posts
Default Error

'SAVEPAIRS = True'
Quote:
compressing spairs.out to spairs.save.gz
Traceback (most recent call last):
File "../factmsieve.py", line 1928, in <module>
run_siever(CLIENT_ID, NUM_THREADS, fact_p, lats_p)
File "../factmsieve.py", line 1659, in run_siever
gzip_f('spairs.out', 'spairs.save.gz')
File "../factmsieve.py", line 214, in gzip_f
with gzip.open(to, 'wb') as out_file:
AttributeError: GzipFile instance has no attribute '__exit__'
'SAVEPAIRS = False' runs without problems
system: Debian/sid - sidux, python2.6 from experimental
dekcarki is offline   Reply With Quote
Old 2010-01-13, 17:55   #4
mdettweiler
A Sunny Moo
 
mdettweiler's Avatar
 
Aug 2007
USA (GMT-5)

3×2,083 Posts
Default

When I try to run this on Windows XP/cygwin with python 2.5.2, I get:
Code:
factmsieve.py:188: Warning: 'with' will become a reserved keyword in Python 2.6
  File "factmsieve.py", line 188
    with open(file_path, 'r') as in_file:
            ^
SyntaxError: invalid syntax
mdettweiler is offline   Reply With Quote
Old 2010-01-13, 18:04   #5
dekcarki
 
Aug 2009
Magdeburg, Germany

61 Posts
Default

Quote:
Originally Posted by mdettweiler View Post
When I try to run this on Windows XP/cygwin with python 2.5.2
from http://gladman.plushost.co.uk/oldsit...factoring.php:
Quote:
This program, which needs either Python 2.6 or 3.1 ...
dekcarki is offline   Reply With Quote
Old 2010-01-13, 19:11   #6
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

22·7·19 Posts
Default

Quote:
Originally Posted by dekcarki View Post
'SAVEPAIRS = True'
'SAVEPAIRS = False' runs without problems
system: Debian/sid - sidux, python2.6 from experimental
Hi

It looks like your distribution's gzip module can't handle the 'with' contexts that I use in the gzip subroutine:
Code:
    with open(fr, 'rb') as in_file:
      with gzip.open(to, 'wb') as out_file:
        out_file.writelines(in_file)
You could try:
Code:
    with open(fr, 'rb') as in_file:
      out_file = gzip.open(to, 'wb')
      out_file.writelines(in_file)
      out_file.close()
Python uses indentation for defining blocks - the last three lines need to be indented when compared with the first (forum posting didn't preserve my indents :-()
code tags added in moderation

Thanks for trying the program and reporting this.

Brian Gladman



Last fiddled with by wblipp on 2010-01-14 at 07:29 Reason: add code tags
Brian Gladman is offline   Reply With Quote
Old 2010-01-13, 19:28   #7
mataje
 
mataje's Avatar
 
Jan 2009
Bilbao, Spain

28310 Posts
Default

It works great.
Thank you Brian and Jeff.
mataje is offline   Reply With Quote
Old 2010-01-13, 19:55   #8
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

22×7×19 Posts
Default

Quote:
Originally Posted by mataje View Post
It works great.
Thank you Brian and Jeff.
Hi Guys,

Thanks for the feedback.

If it works (or fails) it would help if you could specify the environment in which you have tested it.

Brian
Brian Gladman is offline   Reply With Quote
Old 2010-01-13, 20:16   #9
smh
 
smh's Avatar
 
"Sander"
Oct 2002
52.345322,5.52471

29·41 Posts
Default

Quote:
Originally Posted by Brian Gladman View Post
Python uses indentation for defining blocks - the last three lines need to be indented when compared with the first (forum posting didn't preserve my indents :-()
Thats what the [ CODE] tags are for.
smh is offline   Reply With Quote
Old 2010-01-13, 21:15   #10
mataje
 
mataje's Avatar
 
Jan 2009
Bilbao, Spain

283 Posts
Default

Quote:
Originally Posted by Brian Gladman View Post
Hi Guys,

Thanks for the feedback.

If it works (or fails) it would help if you could specify the environment in which you have tested it.

Brian
Windows Vista 32 bits. Tomorrow I will try on Windows 7 64 bits.
mataje is offline   Reply With Quote
Old 2010-01-13, 21:39   #11
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

10000101002 Posts
Default

Quote:
Originally Posted by mataje View Post
Windows Vista 32 bits. Tomorrow I will try on Windows 7 64 bits.
Thanks - it should work on Windows 7 x64 as that is what I am using for its development.

I can also confirm that the modification I gave above for the gzip issue is generally necessary.

Brian
Brian Gladman is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Msieve & ggnfs on MacOS xilman Msieve 8 2017-05-20 00:12
Factorizing with MSIEVE, GGNFS & Factmsieve.py Romuald Msieve 24 2015-11-09 20:16
Infinite loop for ggnfs or msieve Greebley Aliquot Sequences 4 2013-02-06 19:28
Error running GGNFS+msieve+factmsieve.py D. B. Staple Factoring 6 2011-06-12 22:23
A new driver? (or type of driver?) 10metreh Aliquot Sequences 3 2010-02-15 15:57

All times are UTC. The time now is 07:46.


Mon Aug 2 07:46:34 UTC 2021 up 10 days, 2:15, 0 users, load averages: 1.68, 1.50, 1.41

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.