mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > FermatSearch

Reply
 
Thread Tools
Old 2016-09-26, 07:24   #1
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

12A016 Posts
Default Fermat code

Rogue graciously provided vversion 2.5 of his GMP-Fermat code: it has embedded assembly routines and corrected a couple of small bugs of the previous versions. It may be used to chase double Mersennes factors.

Last fiddled with by ET_ on 2016-09-26 at 07:26
ET_ is offline   Reply With Quote
Old 2016-11-07, 14:46   #2
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

27·37 Posts
Default

Luigi, can you compile GMP-Fermat version 2.5 for windows 64 bit?
pinhodecarlos is offline   Reply With Quote
Old 2016-11-07, 16:19   #3
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

25·149 Posts
Default

Quote:
Originally Posted by pinhodecarlos View Post
Luigi, can you compile GMP-Fermat version 2.5 for windows 64 bit?
I' afraid I can't, I have no computer with Windows anymore

But I would place the executble online if someoe could provide it...
ET_ is offline   Reply With Quote
Old 2016-11-07, 17:38   #4
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

23·7·53 Posts
Default

I can try and see if I can compile it with Msys2 and Mingw64, where is the code?
ATH is online now   Reply With Quote
Old 2016-11-07, 18:48   #5
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

27·37 Posts
Default

Quote:
Originally Posted by ATH View Post
I can try and see if I can compile it with Msys2 and Mingw64, where is the code?
Source code can be downloaded from here: http://www.fermatsearch.org/gmp-fermat_2.5.zip

Thank you.
pinhodecarlos is offline   Reply With Quote
Old 2016-11-07, 21:02   #6
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

23×7×53 Posts
Default

I compiled it, and it seems fermat64.exe and fermat64_redc.exe is working. But dm.exe (Double-Mersenne) does not seem to do anything, even though it compiled without errors:
gmp-fermat.zip
ATH is online now   Reply With Quote
Old 2016-11-08, 10:03   #7
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

25·149 Posts
Default

Quote:
Originally Posted by ATH View Post
I compiled it, and it seems fermat64.exe and fermat64_redc.exe is working. But dm.exe (Double-Mersenne) does not seem to do anything, even though it compiled without errors:
gmp-fermat.zip
Thank you Andreas I will update the file on the site later today.
I used the following makefile:
Code:
Executables were compiled with gcc version 5.4.0 20160609 using these command lines:

gcc -Wall -m64 -march=native -O2 -o fermat64 fermat_redc.c -lgmp -lm
gcc -Wall -m64 -march=native -O2 -DUSE_REDC -o fermat64_redc fermat_redc.c *.S -lgmp -lm
gcc -Wall -m64 -march=native -O2 -DUSE_REDC -D_DM_ -o dm fermat_redc.c *.S -lgmp -lm
If you compiled using a similar makefile, the programs should work. In particular, dm is the code to look for double Mersenne factors, and requires a different .INI file...

Luigi
ET_ is offline   Reply With Quote
Old 2016-11-08, 10:40   #8
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

27×37 Posts
Default

Andreas,

I get this error on my Sandy Bridge laptop.

Code:
Problem signature:
  Problem Event Name:    APPCRASH
  Application Name:    fermat64.exe
  Application Version:    0.0.0.0
  Application Timestamp:    5820e7d0
  Fault Module Name:    fermat64.exe
  Fault Module Version:    0.0.0.0
  Fault Module Timestamp:    5820e7d0
  Exception Code:    c000001d
  Exception Offset:    000000000000167e
  OS Version:    6.1.7601.2.1.0.256.48
  Locale ID:    2057
  Additional Information 1:    732c
  Additional Information 2:    732c1a33d5a194e791bc6d9948b039ca
  Additional Information 3:    acfe
  Additional Information 4:    acfe00ad04837015f217bd304564160f

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
pinhodecarlos is offline   Reply With Quote
Old 2016-11-09, 09:51   #9
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

23·7·53 Posts
Default

Quote:
Originally Posted by ET_ View Post
If you compiled using a similar makefile, the programs should work. In particular, dm is the code to look for double Mersenne factors, and requires a different .INI file...

Luigi
Ok, that might explain it. What is the format of the .ini-file?

@Carlos: Try this one I compiled on my Sandy Bridge laptop. I renamed the other one to Haswell:

gmpfermat-sandybridge.zip

gmpfermat-haswell.zip
ATH is online now   Reply With Quote
Old 2016-11-09, 10:24   #10
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

473610 Posts
Default

Thank you Andreas.
pinhodecarlos is offline   Reply With Quote
Old 2016-11-09, 13:54   #11
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

25·149 Posts
Default

Quote:
Originally Posted by ATH View Post
Ok, that might explain it. What is the format of the .ini-file?

@Carlos: Try this one I compiled on my Sandy Bridge laptop. I renamed the other one to Haswell:

gmpfermat-sandybridge.zip

gmpfermat-haswell.zip
Here is an example of the .INI file:

Code:
kStart=1
kEnd=500000
nStart=17
nEnd=17
FilterPrimes=10000
This code will find the 2 known factors of M(M(17)):

Code:
GMP-Double-Mersenne version 2.5

kStart from fermat.ini is odd, it will be made even.
Processing range of k from 2 to 500000 and range of n from 17 to 17

Testing for n = 17

Found factor 1768*(2^17-1)+1 of 2^(2^17-1)-1

Found factor 490546*(2^17-1)+1 of 2^(2^17-1)-1

Overall rate for n=17:  tested 11517 of 499999 numbers ( 2.30 pct) in     0.01 seconds at 64699664 k per second

Done

real	0m0.576s
user	0m0.448s
sys	0m0.000s
Two advices:

1 - Keep SievePrimes lower than the value used for Fermat factors, as the initialization for (say) 100,000 primes is about 60 seconds, while the gain in percent is not so high.
2 - The k here is seen as 2*k, both in the kStart/kEnd pair and in the result (1768 = 2*884).

As a comparative benchmark, here is the same range, with kEnd = 50000000 and SievePrimes = 100000:

Code:
GMP-Double-Mersenne version 2.5

kStart from fermat.ini is odd, it will be made even.
Processing range of k from 2 to 50000000 and range of n from 17 to 17

Testing for n = 17

Found factor 1768*(2^17-1)+1 of 2^(2^17-1)-1

Found factor 490546*(2^17-1)+1 of 2^(2^17-1)-1

Overall rate for n=17:  tested 913353 of 49999999 numbers ( 1.83 pct) in     0.57 seconds at 87506058 k per second

Done

real	1m4.643s
user	0m55.148s
sys	0m0.180s

Now, my questions/requests:
May I have a link where your Windows executables are? I might either download the differently optimized codes or link your page from FermatSearch download page...

Last fiddled with by ET_ on 2016-11-09 at 13:57
ET_ is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fermat code performances ET_ FermatSearch 29 2018-03-15 19:06
Rho code Happy5214 YAFU 3 2015-11-01 21:54
Please help me with my code daxmick Programming 15 2014-02-14 11:57
Code Help Andrew Programming 12 2013-02-16 20:53
New Code JohnFullspeed Programming 20 2011-09-04 04:28

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

Wed Oct 28 00:42:00 UTC 2020 up 47 days, 21:52, 2 users, load averages: 2.24, 2.19, 1.98

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.