mersenneforum.org How to use prime95 for stage 1 & GMP-ECM for stage 2
 Register FAQ Search Today's Posts Mark Forums Read

2015-03-02, 00:41   #1
Prime95
P90 years forever!

Aug 2002
Yeehaw, FL

11111011000012 Posts
How to use prime95 for stage 1 & GMP-ECM for stage 2

Quote:
 Originally Posted by lycorn Well, finding factors this large is hard. It takes a lot of curves to get one. I´m currently putting M11423 through the same process. There are still 4000 curves to run @B1=11000000. If nothing comes up. I´ll move to B1=44000000. But that yes, will be really tough...
Are you using GMP-ECM for stage 2?? Can you shed any light on what size exponents benefit from GMP-ECM stage 2?

 2015-03-02, 00:59 #2 lycorn     "GIMFS" Sep 2002 Oeiras, Portugal 23×3×5×13 Posts No. I´m using Prime95 for both stages. Is there any GMP-ECM version for windows? And if yes, can you point me to the binaries? I´m assuming GMP-ECM brings some advantage over Prime95 for stage 2, otherwise you wouldn´t have posed the question.
 2015-03-02, 04:34 #3 Prime95 P90 years forever!     Aug 2002 Yeehaw, FL 29·277 Posts I don't know about binaries -- I expect there are some available. Yes, GMP-ECM, given enough memory, is vastly superior for small exponents. It runs a much deeper stage 2, which lets you run far fewer curves. I'm not sure about exponents near 20000, if you decide to investigate I'd be curious as to what you find out. You'll need to look up the GmpEcmHook=1 option in undoc.txt.
2015-03-02, 22:25   #4
VBCurtis

"Curtis"
Feb 2005
Riverside, CA

13×421 Posts

Quote:
 Originally Posted by lycorn No. I´m using Prime95 for both stages. Is there any GMP-ECM version for windows? And if yes, can you point me to the binaries? I´m assuming GMP-ECM brings some advantage over Prime95 for stage 2, otherwise you wouldn´t have posed the question.
Here's the repository:
http://gilchrist.ca/jeff/factoring/index.html

The maintainer is an infrequent poster here.

The fastest use is Prime95 for stage1, save residues, use them as input for GMP-ECM stage 2. George is asking about memory requirements for exponents under 20k; I have a 16Gb system so I may be able to answer this if you cannot. Use the "-v" flag when experimenting with B2 bounds to see how much memory is needed and how many curves make a t45 with each setting of B2. The higher your B2, the higher the chance to find a factor per curve, thus the required curve count for each level decreases.

Last fiddled with by VBCurtis on 2015-03-02 at 22:27

2015-03-03, 01:43   #5
lycorn

"GIMFS"
Sep 2002
Oeiras, Portugal

23×3×5×13 Posts

Quote:
 Originally Posted by VBCurtis Here's the repository: http://gilchrist.ca/jeff/factoring/index.html The maintainer is an infrequent poster here. The fastest use is Prime95 for stage1, save residues, use them as input for GMP-ECM stage 2. George is asking about memory requirements for exponents under 20k; I have a 16Gb system so I may be able to answer this if you cannot. Use the "-v" flag when experimenting with B2 bounds to see how much memory is needed and how many curves make a t45 with each setting of B2. The higher your B2, the higher the chance to find a factor per curve, thus the required curve count for each level decreases.
Thanks a lot. I just started trying it. Some questions will most probably arise...
For now, just one: the advantage of running Stage 1 on Prime95 and Stage 2 on GMP-ECM holds only for small exponents, as I understood it. But, how small?

2015-03-03, 04:22   #6
Prime95
P90 years forever!

Aug 2002
Yeehaw, FL

29·277 Posts

Quote:
 Originally Posted by lycorn For now, just one: the advantage of running Stage 1 on Prime95 and Stage 2 on GMP-ECM holds only for small exponents, as I understood it. But, how small?
That is what we'd like to find out. It may depend on how much memory GMP-ECM is allowed to use.

 2015-03-03, 04:37 #7 philmoore     "Phil" Sep 2002 Tracktown, U.S.A. 100010111112 Posts I had good results running stage 2 with GMP-ECM on M8191 using 3 MB of allocated memory, so I am pretty sure that you should still find it useful on M11243. The one problem I had was that the only way I could get GMP-ECM to log its results was to write the entire log file to memory, which gave me one huge file. I would have liked the capability to just log results if a factor was found. If anyone has a suggestion of how to do that, I would love to hear about it.
2015-03-03, 06:04   #8
axn

Jun 2003

10101000111002 Posts

Quote:
 Originally Posted by philmoore I had good results running stage 2 with GMP-ECM on M8191 using 3 MB of allocated memory
MB or GB?

 2015-03-03, 15:11 #9 lycorn     "GIMFS" Sep 2002 Oeiras, Portugal 30308 Posts So I have given GMP-ECM a try, and as expected some questions popped up. Don´t want to be a PITA, but can´t help bring some to the thread. May some knowledgeable (and patient) member shed any light on my confused mind... I started by running Prime95 ECM, using B1=B2=11000000, on M11423. I inserted the GmpEcmHook=1 line in prime.txt. All fine, Prime95 ran Stage 1 only, and wrote a residue to the results file. I copied said residue to a file named work.txt, and ran GMP-ECM using the following command: ecm -v -resume work.txt 11000000 The program started, by printing some lines of info, including the value I had given for B1 and a calculated value B2=30114149530. It also listed the expected number of curves for finding factors of different sizes. It also mentioned that it was resuming a residue saved with Prime95, which I took as a sign things were going as expected. After a while, the message Step 1 took 2510343 ms popped up. My first question: is this Step 1 the Stage 1? If yes, what is the point in running it in Prime95 only to have it re-run by GMP-ECM? I was under the impression that GMP-ECM would only run the Stage 2 in this "resume" situation. It then gave a memory usage estimation of 2749M, which is fine, as I have over 6G available. So I think at this point it started running Stage 2. Severall lines regarding initializations and computations of different sorts followed, then the message Step 2 took 652360 ms popped up. Below it, the program displayed a list of expected times to find a factor of n digits. Last line was: Save file line has no equal sign after: UID: lycorn/ast. And that was it. I think in general terms it went well, but in order to make some sense of it and using it regularly, I need to understand a couple of things: First, I was really confused by the fact that the Stage 1 was apparently run by GMP-ECM - in fact it took way longer than Stage 2, and also much longer than Stage 1 run by Prime95. As it is resuming a computation that has finished Stage 1, I supposed it would only run Stage 2. How can we get it to do it ? Second, where have the results gone, so they can be reported to Primenet? I suspect nowhere, which means the program doesn´t automatically create something similar to the "results" file of Prime95. Does it have to be created at runtime, using the -save switch? Third, If my interpretation is correct: - I ran just one curve, which took 2510343 + 652360 ms ~ 52.71 minutes - The prescribed number of curves for finding a 45 digit factor (in line with a B1=11000000) is 4630 (this number was taken from the list given at the end of Stage 1). At the end of Stage 2, the listed expected time to find a 45 digit factor was 169.49 days, which matches perfectly the figures for number of curves and duration of each one. On my computer, Prime95 runs a curve on M11423, @B1=11000000 in 16 minutes, and the prescribed number of curves is 9700, which gives 107,(7) days. This shows that using Prime95 only would be much faster. There´s certainly something I´m missing here - I guess it has to do with running the Stage 1 on GMP-ECM and on Prime95, Stage 1 takes so long that it more than makes up for the gain in running less curves at a higher B2, on GMP-ECM. Any clarification would be much appreciated. Thanks in advance Last fiddled with by lycorn on 2015-03-03 at 15:26
 2015-03-03, 16:22 #10 axn     Jun 2003 10101000111002 Posts I think you need to give both B1 and B2, like so: Code:  ecm -v -resume work.txt 1 11e6-30e9 i.e. B1=1, and B2=11e6 to 30e9
2015-03-03, 16:40   #11
VictordeHolland

"Victor de Hollander"
Aug 2011
the Netherlands

32×131 Posts

Quote:
 Originally Posted by lycorn Last line was: Save file line has no equal sign after: UID: lycorn/ast.
I believe you can't use userid/computerid when doing stage1 Prime95 and stage2 on GMP-ECM.
It should say something like this:
Code:
Resuming ECM residue saved with Prime95
Input number is x (x digits)
Using B1=1, B2=x polynomial Dickson(x), sigma=x
Step 1 took x ms
Step 2 took x ms
Step 1 should take only a few ms.

Last fiddled with by VictordeHolland on 2015-03-03 at 16:40

 Similar Threads Thread Thread Starter Forum Replies Last Post Gordon GMP-ECM 3 2016-01-08 12:44 D. B. Staple Factoring 2 2007-12-14 00:21 jasong GMP-ECM 9 2007-10-25 22:32 Angular Hardware 18 2004-11-15 07:04 Matthias C. Noc PrimeNet 5 2004-08-25 15:42

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

Thu Sep 29 07:42:48 UTC 2022 up 42 days, 5:11, 0 users, load averages: 1.17, 0.84, 0.82