mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2003-12-09, 18:22   #1
hbock
 
hbock's Avatar
 
Feb 2003

163 Posts
Default P-1 stage 2 with GMP-ECM 5 ?

GMP-ECM 5.x can use the ecm stage1 results of prime95 as described somewhere in the forum.

Is there any way to use the P-1 results (mxxxxxxx or lxxxxxxx files) of stage 1 generated by prime95, either for extended stage 1 work and/or maybe more interesting for stage 2 (faster and B2>4290000000) ?
hbock is offline   Reply With Quote
Old 2003-12-09, 21:31   #2
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

1E1D16 Posts
Default

From undoc.txt
Quote:
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.ini. 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.
Xyzzy is offline   Reply With Quote
Old 2003-12-10, 22:14   #3
hbock
 
hbock's Avatar
 
Feb 2003

163 Posts
Default

Well, I knew that the undoc.txt refers to ecm, but I'm interested in an extended P-1 stage. And for ecm GMP-ECM 5 is much faster in stage 2, so it could do a p-1 stage2 probably much faster, too.
hbock is offline   Reply With Quote
Old 2004-04-25, 15:52   #4
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13×89 Posts
Default

Quote:
Originally Posted by hbock
Is there any way to use the P-1 results (mxxxxxxx or lxxxxxxx files) of stage 1 generated by prime95, either for extended stage 1 work and/or maybe more interesting for stage 2 (faster and B2>4290000000) ?
I want to write a program that takes as input a Prime95 P-1 save file with stage one completed to limit B1, and as output writes a gmp-ecm format save file.

I think the only information needed is the number N being tested, the B1 bound, and the P-1 residue X at the end of stage one, which are all in the save file. The program just needs to read the save file, convert the numbers to standard hex/decimal format, and format the results for gmp-ecm to read.

Has anyone tried to do this already, or have any suggestions?
geoff is offline   Reply With Quote
Old 2004-04-25, 20:30   #5
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

25×7×11 Posts
Default

Sorry for the late reply, I didn't see the thread when it was openend and usually don't read these forums very frequently.

I once started to write a tool to convert Prime95 P-1 save files to gmp-ecm format but never quite finished it. In fact, I think it worked o.k. on x86 but portability was not complete. If only I could find that code now.. Anyhow, the Prime95 P-1 save file format changed in the meantime, the changes mostly affecting save files from within stage 2 afaik which is not important to getting stage 1 residues over to gmp-ecm, but will probably prompt a few changes nonetheless.

I'll try to find the old code and see what needs to be done. Teaching gmp-ecm to directly read Prime95 P-1 save files is something I'd like to include in the next release, if the other developers agree to the idea.

Alex
akruppa is offline   Reply With Quote
Old 2004-04-26, 19:27   #6
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13×89 Posts
Default

I have attached a program pm1dump, I haven't done a lot of testing but it works for the tests I have done. It can be compiled with 'gcc -o pm1dump pm1dump.c' and then run as

$ mprime; pm1dump mNNNNNNN | ecm -resume - B1 B2

where mNNNNNNN (or lNNNNNNN) is the mprime stage 1 save file and B1, B2 are the new bounds.

I have noticed that compared to running stage 1 with gmp-ecm and using the -save option that a different residue X is created, and that there is no entry for the initial point X0. Despite this the stage 2 completes and finds the expected factors for the few exponents I have tested.

I will post updates to this thread if I find any bugs.
Attached Files
File Type: zip pm1dump-0.1.zip (3.4 KB, 116 views)
geoff is offline   Reply With Quote
Old 2004-04-27, 15:40   #7
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

48516 Posts
Default pm1dump 0.2

I have attached a new version of pm1dump. It now divides the number being P-1 tested by the known factors in lowm.txt or lowp.txt before generating the new save file. It uses libgmp to do the arithmetic, so add '-lgmp' to the compile line.
Attached Files
File Type: zip pm1dump-0.2.zip (4.1 KB, 101 views)
geoff is offline   Reply With Quote
Old 2004-04-27, 16:06   #8
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13·89 Posts
Default

It is possible to do stage one P-1 on 2^2N-1 with Prime95 then continue with stage two on 2^N-1 or 2^N+1 separately with gmp-ecm by using the splitcf program (see http://www.mersenneforum.org/showpos...7&postcount=13). Here is a (trivial) example of doing P-1 on 2^893+1 using this method (some output snipped):

$
$ cat worktodo.ini
Pminus1=1786,3000,1,0,0
$
$ cat lowm.txt
M( 1786 )C: 3
M( 1786 )C: 283
M( 1786 )C: 1787
M( 1786 )C: 174763
M( 1786 )C: 2351
M( 1786 )C: 4513
M( 1786 )C: 524287
M( 1786 )C: 13264529
M( 1786 )C: 6705767506519
$
$ mprime -d
Mersenne number primality test program version 23.5
P-1 on M1786 with B1=3000, B2=3000
M1786 stage 1 complete. 8682 transforms. Time: 0.032 sec.
Stage 1 GCD complete. Time: 0.002 sec.
$
$ pm1dump m0001786 | splitcf -p | ecm -resume - 3000 16000
GMP-ECM 5.0.3 [powered by GMP 4.1.2] [ECM]
Resuming P-1 residue
Input number is 249060...665097 (258 digits)
Using B1=3000-3000, B2=16000, polynomial Dickson(4)
Step 1 took 0ms
Step 2 took 33ms
********** Factor found in step 2: 165768537521
Found probable prime factor of 12 digits: 165768537521
Composite cofactor 150245...858457 has 247 digits

This might be useful for doing P-1 of the Fermat numbers, stage one could be done just once on F(N)-2 with mprime, then using the same save file in each case, do stage two with gmp-ecm on F(N-1), F(N-2), F(N-3), etc.

E.g. if stage one has been done on 2^262144-1 to B1 and the save file is called m0262144, then run these commands (with appropriate low[mp].txt in the current directory) to do stage two on 2^131072+1, 2^65536+1, and 2^32768+1.

pm1dump m0262144 | splitcf -p | ecm -resume - B1 B2
pm1dump m0262144 | splitcf -m | splitcf -p | ecm -resume - B1 B2
pm1dump m0262144 | splitcf -m | splitcf -m | splitcf -p | ecm -resume - B1 B2
geoff is offline   Reply With Quote
Old 2004-05-05, 21:31   #9
nuutti
 
Jan 2003

378 Posts
Default

How much faster GMP-ECM 5 is in p-1 factoring in the stage 2?

I am currently running P-1 for:
Pminus1=67108864,4000000,5000000,0,0

Can I use GMP-ECM 5 for runnig stage 2 in my test ?
(I have 2 Gbytes of memoy)


Nuutti
nuutti is offline   Reply With Quote
Old 2004-05-06, 10:42   #10
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13×89 Posts
Default

Quote:
Originally Posted by nuutti
How much faster GMP-ECM 5 is in p-1 factoring in the stage 2?

I am currently running P-1 for:
Pminus1=67108864,4000000,5000000,0,0

Can I use GMP-ECM 5 for runnig stage 2 in my test ?
(I have 2 Gbytes of memoy)
For a number this large Prime95 is faster. Gmp-ecm can test to higher bounds than Prime95, for 2^67108864-1 this is probably not a consideration, but I have done some timings on the smaller fermat numbers and I estimate that a P4 2.66GHz could test 2^262144-1 to B1=4290M in about 28 days with Prime95, or 2^524288-1 in about 60 days. From that point the fastest way to either extend stage 1 or start stage 2 is to use gmp-ecm separately on F18, F17, F16, etc.

According to http://www.mersenne.org/ecmf.htm, F18, F17, F16, F15 have only been tested to B1=32M, 64M, 250M, 1000M respectively.
geoff is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use prime95 for stage 1 & GMP-ECM for stage 2 Prime95 Lone Mersenne Hunters 111 2015-06-13 03:18
Stage 1 G_A_FURTADO Information & Answers 1 2008-10-26 15:21
Stage 1 with mprime/prime95, stage 2 with GMP-ECM D. B. Staple Factoring 2 2007-12-14 00:21
Need help to run stage 1 and stage 2 separately jasong GMP-ECM 9 2007-10-25 22:32
Stage 1 and stage 2 tests missing Matthias C. Noc PrimeNet 5 2004-08-25 15:42

All times are UTC. The time now is 13:51.

Thu Oct 29 13:51:46 UTC 2020 up 49 days, 11:02, 2 users, load averages: 1.80, 1.72, 1.68

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.