mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2016-08-06, 04:16   #100
WraithX
 
WraithX's Avatar
 
Mar 2006

23·59 Posts
Default Announcing ecm.py v0.39...

Quote:
Originally Posted by UBR47K View Post
Is there anyway to specify B1 value when using the "-resume" switch?
I'd like to use GMP-ECM for stage 2 with Prime95 stage 1 results.txt
I have updated ecm.py to accept a B1 option so that you can resume Prime95 files. Here is the note added for this update:
Quote:
# 6) Update so we can pass B1 values to gmp-ecm when resuming Prime95 resume files, which don't include B1 info in the resume line...
# * Important note: Pass in the B1 value you used as a range, if you used B1=43e6 in Prime95, then pass in 43e6-43e6 as B1 here.
# * If you only pass in 43e6, then gmp-ecm will run all of B1 again for each resume line.
Quote:
Originally Posted by cgy606 View Post
I tried running the script on a resume file produced from a gpu stage 1 run. I am getting the following error:

python ecm.py -threads 8 -resume gpu.save
->
NameError: name 'xrange' is not defined

Any ideas about what is going wrong?
As mentioned before, xrange only worked in Python 2. I have replaced xrange with range and this bug should now be fixed. I don't have Python 3 installed, so I cannot test it out. cyg606, could you let me know how this version works for you?

Announcing ecm.py v0.39:
Quote:
New feature: Added the ability to pass B1 to gmp-ecm to support resuming Prime95 resume files.
Bug fix: replaced xrange, which is not available in Python 3, with range, which is available in both Python 2 and 3.
Attached Files
File Type: zip ecm-py_v0.39.zip (23.3 KB, 94 views)
WraithX is offline   Reply With Quote
Old 2016-08-06, 06:22   #101
cgy606
 
Feb 2012

3F16 Posts
Default

Quote:
Originally Posted by UBR47K View Post
Try running with python2. That error happens when you try to run the script with python 3
I just installed the latest version of python 2 (2.7.12) on my machine. How do I run python 2 from the command prompt if both python 2 and 3 are installed? Do I have to change the environmental "PATH" variable or is there some other way? Typing 'python' at the command prompt still uses python 3...
cgy606 is offline   Reply With Quote
Old 2016-08-06, 06:28   #102
cgy606
 
Feb 2012

32×7 Posts
Default

Quote:
As mentioned before, xrange only worked in Python 2. I have replaced xrange with range and this bug should now be fixed. I don't have Python 3 installed, so I cannot test it out. cgy606, could you let me know how this version works for you?
I just tested it now. Getting another error:

Code:

python ecm.py -threads 7 -resume 167fac3_43e6_0.save
-> ___________________________________________________________________
-> | Running ecm.py, a Python driver for distributing GMP-ECM work   |
-> | on a single machine.  It is copyright, 2011-2016, David Cleaver |
-> | and is a conversion of factmsieve.py that is Copyright, 2010,   |
-> | Brian Gladman. Version 0.39 (Python 2.6 or later)  5th Aug 2016 |
-> |_________________________________________________________________|

-> Resuming work from resume file: 167fac3_43e6_0.save
-> Spreading the work across 7 thread(s)
->=============================================================================
-> Working on the number(s) in the resume file: 167fac3_43e6_0.save
-> Using up to 7 instances of GMP-ECM...
-> Found 1024 unique resume lines to work on.
-> Will start working on the 1024 resume lines.
Traceback (most recent call last):
  File "ecm.py", line 2428, in <module>
    parse_ecm_options(sys.argv, set_args = True, first = True)
  File "ecm.py", line 2270, in parse_ecm_options
    run_ecm_resume_job(p95_b1)
  File "ecm.py", line 1890, in run_ecm_resume_job
    for j in range(start, end):
TypeError: 'float' object cannot be interpreted as an integer
I guess some variable is set as a float instead of an integer, but I don't know which variable in the script is throwing this error...
cgy606 is offline   Reply With Quote
Old 2016-08-06, 07:25   #103
cgy606
 
Feb 2012

32×7 Posts
Default

Quote:
Originally Posted by cgy606 View Post
I just installed the latest version of python 2 (2.7.12) on my machine. How do I run python 2 from the command prompt if both python 2 and 3 are installed? Do I have to change the environmental "PATH" variable or is there some other way? Typing 'python' at the command prompt still uses python 3...
Never-mind, I figured out how to use python 2.7 when two versions of python are installed. However, python 3.6 doesn't work for ecm.py (39) whereas python 2.7 does...
cgy606 is offline   Reply With Quote
Old 2016-08-06, 09:32   #104
henryzz
Just call me Henry
 
henryzz's Avatar
 
"David"
Sep 2007
Cambridge (GMT/BST)

165A16 Posts
Default

Quote:
Originally Posted by UBR47K View Post
Is there anyway to specify B1 value when using the "-resume" switch?
I'd like to use GMP-ECM for stage 2 with Prime95 stage 1 results.txt
I think you just specify it as normal.
henryzz is offline   Reply With Quote
Old 2016-08-06, 14:18   #105
WraithX
 
WraithX's Avatar
 
Mar 2006

23×59 Posts
Default Announcing ecm.py v0.40...

Quote:
Originally Posted by cgy606 View Post
I just tested it now. Getting another error:

Code:
    for j in range(start, end):
TypeError: 'float' object cannot be interpreted as an integer
I guess some variable is set as a float instead of an integer, but I don't know which variable in the script is throwing this error...
Thank you for finding this, and I apologize for these errors. I've just installed Python 3.4 and found a couple of other Python 2/3 problems. I have fixed those in the attached version.

Announcing ecm.py v0.40:
Quote:
Bug fix: Some parts of the script that worked with Python 2 would fail with Python 3. Fixed the code to work with both Python 2 and 3.
Attached Files
File Type: zip ecm-py_v0.40.zip (23.3 KB, 93 views)
WraithX is offline   Reply With Quote
Old 2016-09-03, 13:31   #106
WraithX
 
WraithX's Avatar
 
Mar 2006

23×59 Posts
Default Announcing ecm.py v0.41...

Announcing ecm.py v0.41:
Quote:
Bug fix: Fixed new num_digits() function, which didn't reference ECM_PATH.
Change: Removed (what should be) an extraneous './' from ECM on linux systems. Be sure to set ECM_PATH as appropriate.
Attached Files
File Type: zip ecm-py_v0.41.zip (23.3 KB, 156 views)
WraithX is offline   Reply With Quote
Old 2016-10-02, 14:39   #107
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

3·5·223 Posts
Default

Probably not a script problem, but I'll post it here anyways, in case there is an interest other than mine.

Three of my machines greeted me this morning with:
Code:
~/Math/Aliperl/ecm$ python ecm.py -c 30 -threads 4 850000000 <number
-> ___________________________________________________________________
-> | Running ecm.py, a Python driver for distributing GMP-ECM work   |
-> | on a single machine.  It is Copyright, 2012, David Cleaver and  |
-> | is a conversion of factmsieve.py that is Copyright, 2010, Brian |
-> | Gladman.   Version 0.10 (Python 2.6 or later) 30th Sep 2012.    |
-> |_________________________________________________________________|
 
-> Number(s) to factor:
-> 273160738474933720738173971888648839004631254638334337328524154446360567876622758785071571728319901973105785355719274809547476812666409616142295140388748295147911 (162 digits)
->=============================================================================
-> Working on number: 273160738474933720...140388748295147911 (162 digits)
-> Currently working on: job3699.txt
-> Starting 4 instances of GMP-ECM...
-> ./ecm -c 8 850000000 < job3699.txt > job3699_t00.txt
-> ./ecm -c 8 850000000 < job3699.txt > job3699_t01.txt
-> ./ecm -c 7 850000000 < job3699.txt > job3699_t02.txt
-> ./ecm -c 7 850000000 < job3699.txt > job3699_t03.txt
 
GMP-ECM 7.0.3 [configured with GMP 6.1.1, --enable-asm-redc] [ECM]
Using B1=850000000, B2=15892628251516, polynomial Dickson(30), 4 threads
Done 8/30; avg s/curve: stg1  3624s, stg2  1001s; runtime: 37909s

-> *** Error: unexpected return value: -9
EdH is offline   Reply With Quote
Old 2019-05-29, 05:04   #108
SethTro
 
SethTro's Avatar
 
"Seth"
Apr 2019

16110 Posts
Default

I added these small diffs to your wonderful ecm.py script to make it work with python3 and to fix a small issue with ETA not working if you use "-thread" from the cli instead of the config.
Attached Files
File Type: log ecm_py_python3.diff.log (2.4 KB, 46 views)
SethTro is offline   Reply With Quote
Old 2019-06-01, 04:23   #109
WraithX
 
WraithX's Avatar
 
Mar 2006

1110110002 Posts
Default

Announcing ecm.py version 0.44:
Code:
 - Updated to better support python 3
 - Bug fix: fixed eta when using -threads on the command line
 - Better handling of resume files
 - Support for the -param command line option in gmp-ecm 7
Attached Files
File Type: zip ecm-py_v0.44.zip (23.3 KB, 87 views)
WraithX is offline   Reply With Quote
Old 2019-11-26, 07:07   #110
Belteshazzar
 
Feb 2011

25 Posts
Default popen creationflags error on Linux

Here's what I get when I try to run this:
Code:
Traceback (most recent call last):
  File "./ecm.py", line 2510, in <module>
    start_ecm_threads()
  File "./ecm.py", line 714, in start_ecm_threads
    procs.append(run_exe(ECM, ecm_args1, in_file = ecm_job, out_file = file_name, wait = False))
  File "./ecm.py", line 471, in run_exe
    p = subprocess.Popen(args.split(' '), **al)
  File "/usr/lib/python3.7/subprocess.py", line 692, in __init__
    raise ValueError("creationflags is only supported on Windows "
ValueError: creationflags is only supported on Windows platforms
Same if I run under python2. Only happens when verbose=0.

Last fiddled with by Belteshazzar on 2019-11-26 at 07:09 Reason: narrow down problem.
Belteshazzar is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python Coding Help? kelzo Programming 3 2016-11-27 05:16
PHP vs. Python vs. C (all with GMP) daxmick Programming 2 2014-02-10 01:45
Python... Xyzzy Programming 20 2009-09-08 15:51
using libecm from python yqiang GMP-ECM 2 2007-04-22 00:14
Help w/ python. a216vcti Programming 7 2005-10-30 00:37

All times are UTC. The time now is 18:09.

Sun Sep 20 18:09:15 UTC 2020 up 10 days, 15:20, 0 users, load averages: 1.05, 1.28, 1.45

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.