mersenneforum.org  

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

Reply
 
Thread Tools
Old 2014-11-26, 00:37   #1
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

1011110001112 Posts
Default -save question

If I run a P-1 on for example M1277 and use -save to save the residue at the end of stage1, the save file takes ~ 470 bytes. If I run P-1 with Prime95 on M1277 the savefile at the end of stage1 takes ~ 250.000.000 bytes.

So GMP-ECM only saves a small residue but somehow it can still continute from it? How is Prime95 generating 250Mb from a "small" 385 digit number?

Last fiddled with by ATH on 2014-11-26 at 00:38
ATH is offline   Reply With Quote
Old 2014-11-26, 00:44   #2
MatWur-S530113
 
MatWur-S530113's Avatar
 
Apr 2007
Spessart/Germany

A216 Posts
Default

250 MB save file for a P-1 stage 1 sounds curious, indeed....
but can you tell me how you get a GMP-ECM compatible save-file from a *P-1*-stage 1 ?
I'm doing this with ECM-curves, but never got it to work with P-1.

edit: if the P-1 already startet with only 1 calculation (in prime95) in stage 2 done and the save-file was written after this calculation it sounds more normal

Last fiddled with by MatWur-S530113 on 2014-11-26 at 00:47
MatWur-S530113 is offline   Reply With Quote
Old 2014-11-26, 10:16   #3
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

32·5·67 Posts
Default

Quote:
Originally Posted by MatWur-S530113 View Post
but can you tell me how you get a GMP-ECM compatible save-file from a *P-1*-stage 1 ?
I'm doing this with ECM-curves, but never got it to work with P-1.
You can add the -save option and run P-1 either with B2=1 or some B2 value you want to test before taking B1 higher:

ecm -pm1 -save pm1save.txt 1e8 1e10 < number.txt
or
ecm -pm1 -save pm1save.txt 1e8 1 < number.txt

and then you can take B1 higher later:
ecm -pm1 -resume pm1save.txt -save pm1save2.txt 1e9 1 < number.txt (Will run P-1 with B1 from 1e8 to 1e9)



You can actually run B1 from 1e8 to 1e9 without any save file as well, not sure if there is any benefit using the save file? :
ecm -pm1 1e8-1e9 1e11 < number.txt

Last fiddled with by ATH on 2014-11-26 at 10:21
ATH is offline   Reply With Quote
Old 2014-11-26, 18:18   #4
MatWur-S530113
 
MatWur-S530113's Avatar
 
Apr 2007
Spessart/Germany

101000102 Posts
Default

thanks, but I still don't understand how you get a save-file from a P-1 stage 1, which was done with prime95.
The directives to resume such a file with GMP-ECM are similar to resuming an ECM-curve stage 1 (of course with an additional -pm1 directive).
....hmmm.... or do you use the *.bu; *.bu1 and*.bu2 files generatet by prime95 as a save-file?
MatWur-S530113 is offline   Reply With Quote
Old 2014-11-26, 22:57   #5
Jayder
 
Jayder's Avatar
 
Dec 2012

2·139 Posts
Default

Is this what you are looking for? From undoc.txt:

Code:
Alexander Kruppa wrote some code that allows the output of ECM stage 1 to
be passed to Paul Zimmermann's more efficient GMP-ECM stage 2.  This program
is usually faster in stage 1.  You can activate this feature by entering
	GmpEcmHook=1
in prime.txt.  Then select ECM bound #2 between 1 and bound #1.  Results.txt
will contain data that can be fed to GMP-ECM for stage 2.
Jayder is offline   Reply With Quote
Old 2014-11-27, 10:17   #6
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·29·83 Posts
Default

That's for ECM stage 1, not P-1 stage 1 as was apparently used.
Dubslow is offline   Reply With Quote
Old 2014-11-27, 16:29   #7
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

1011110001112 Posts
Default

I was not trying to do P-1 stage1 on Prime95 and then stage2 on GMP-ECM. Unfortunately that is only for ECM.

I was just trying P-1 on Prime95 and then wanted to test on GMP-ECM as well, and noted the strange file sizes, and then I started wondering what GMP-ECM uses from those small ~ 470 bytes savefiles - if anything - when you -resume from them.

Quote:
By default P-1 work does not delete the save files when the work unit completes.
This lets you run P-1 to a higher bound at a later date. You can force
the program to delete save files by adding this line to prime.txt:
KeepPminus1SaveFiles=0
Apparantly Prime95 does use something from its savefiles to continue to higher bounds.

I noticed the Prime95 file size seems to be dependent on B1 more than the number. P-1 on M1277 to B1=1011 takes 250Mb as I wrote earlier, but P-1 on a 1M exponent to B1=108 takes only 129 Kb.

Last fiddled with by ATH on 2014-11-27 at 16:37
ATH is offline   Reply With Quote
Old 2014-11-27, 16:51   #8
axn
 
axn's Avatar
 
Jun 2003

113578 Posts
Default

Quote:
Originally Posted by ATH View Post
P-1 on M1277 to B1=1011 takes 250Mb as I wrote earlier
That sounds wrong. It should have taken about 200 bytes (1277 bit residue + book keeping).

Quote:
Originally Posted by ATH View Post
but P-1 on a 1M exponent to B1=108 takes only 129 Kb.
Sounds about right. 1M bits ~= 125 KB.
axn is online now   Reply With Quote
Old 2014-11-27, 19:19   #9
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

32×5×67 Posts
Default

I tested that GMP-ECM actually uses the save file. I created a C88 = P29*P60 where:
P29 = 2*3234251*1532541289*1332541234207 + 1
so it will be found with P-1 with B1>1.6*109 and B2>1.4*1012

I ran B1 to 109 and saved a file. Then resumed the file and ran B1 to 1.7*109 and B2 = 2*1012 and it found the factor. Then I tried without resuming the savefile, just running B1=1*109 - 1.7*109 and B2=1012 and it did not find the factor.
ATH is offline   Reply With Quote
Old 2014-11-28, 02:53   #10
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

9,161 Posts
Default

For my curiosity, if it is not much trouble, can you try again for these two composites, save a partial to B1=10^9, and then resume with new B1 larger, same as in your example, and see if the factor is found. In the past I tried different "resume" features of different programs and I remember that resuming was not always right, if higher powers were involved, the additional prime from the power (the one which falls between the first B1 and the second B1 given after resuming) was not added to the exponent correctly. The "resuming" function has to parse all the smaller primes again and see if any of their power falls between old_B1 and new_B1, and if so, add them to exponent. Sometime this is "forgotten" and only new primes between old _B1 and new _B1 are added, therefore some "special" (rare, with high powers) factors will be missed.

Code:
A=18736359401021997693580332360210999173784687303545931753247634609406352840483449758684477
B=17318123479662276388571151809789728736219948022190985454837264839039662335893382229861517
LaurV is online now   Reply With Quote
Old 2014-11-28, 05:36   #11
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

BC716 Posts
Default

Quote:
Originally Posted by LaurV View Post
For my curiosity, if it is not much trouble, can you try again for these two composites, save a partial to B1=10^9, and then resume with new B1 larger, same as in your example, and see if the factor is found.
This is what I did. I ran B1 to 1e9 then saved, then resumed and ran B1 to 1.7e9 and B2 to 2e12 and it found it. I now also tried saving again at 1.7e9 and running stage2 separately and it still found it.

I also created a new composite where the factor would be found in stage1, and it found it when resuming from the B1 = 1e9 save file.

.
ATH is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about save & resume frmky GMP-ECM 7 2012-08-02 08:22
Save a piece of history! Xyzzy Programming 8 2012-07-31 00:57
How to save someone who was electrocuted in water? Stargate38 Lounge 13 2012-07-09 02:27
-save not working R.D. Silverman GMP-ECM 2 2011-02-01 17:47
P-1 save files didn't save work outlnder Software 1 2003-01-19 23:01

All times are UTC. The time now is 12:28.

Tue Jan 26 12:28:37 UTC 2021 up 54 days, 8:39, 0 users, load averages: 3.48, 2.74, 2.59

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.