mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2003-10-31, 05:52   #1
GP2
 
GP2's Avatar
 
Sep 2003

5·11·47 Posts
Default C program to rapidly verify all factors in GIMPS database

This was already posted in the Data forum.

Attached is a C program that can be used to verify factors of Mersenne exponents. It's intended for use under Unix (and uses the GMP multiple-precision library that comes with most Linux distributions).

On a 2.8GHz Pentium 4, it verifies all 2.6 million factors in the GIMPS database in less than 20 seconds.
Attached Files
File Type: zip factorverify.zip (1.4 KB, 396 views)
GP2 is offline   Reply With Quote
Old 2004-01-25, 16:24   #2
junky
 
junky's Avatar
 
Jan 2004

7·19 Posts
Default

hi GP2, im checking the code, and at the beginning, im seeing:
#include <gmp.h>

is it a custom header ya made ?
could ya attach that file please ?

im using windows.
gonna make some tests, but if ya could attach a windows version of gmp, that would be great.

thanks.

Last fiddled with by junky on 2004-01-25 at 16:28
junky is offline   Reply With Quote
Old 2004-01-25, 19:34   #3
dsouza123
 
dsouza123's Avatar
 
Sep 2002

2·331 Posts
Default

That verification speed is incredible.

I wrote a program in windows that just reads each line of the file ( 59 MB),
separates the exponent and factor into two strings,
converts each to a large binary integer,
it takes 27 seconds on an 1.17 Ghz Athlon.

The powermod function in the gmp library must be incredibly fast.
dsouza123 is offline   Reply With Quote
Old 2004-01-26, 15:34   #4
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

103×113 Posts
Default

Quote:
Originally Posted by GP2
On a 2.8GHz Pentium 4, it verifies all 2.6 million factors in the GIMPS database in less than 20 seconds.
Quote:
Originally Posted by dsouza123
The powermod function in the gmp library must be incredibly fast.
Let's see - 2.6 million factors verified in ~20 seconds on a 2.8GHz machine corresponds to ~10,000 cycles per factor. Let's assume that the average exponent in the GIMPS database is ~2^23 bits (it doesn't matter whether it's a a few more or less, this is just for ballpark-style estimation purposes.) Using the standard left-to-right binary exponentiation, we'll need ~20 modular multiplies for each powermod, which works out to ~500 cycles per modmul, which is no great shakes - a good sieving program will be roughly 20-50x as fast.

I'm sure the GMP stuff is quite good as far as generic arithmetic functionality is concerned, but my point is, specialized code for doing these operations is much, much faster. Of course, strictly for purposes of verification of factors, speed is not terribly important.
ewmayer is offline   Reply With Quote
Old 2004-01-29, 22:58   #5
michael
 
Dec 2003
Belgium

5×13 Posts
Default

Is it possible to use this program in windows?

-michael
michael is offline   Reply With Quote
Old 2004-01-29, 23:30   #6
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

25×257 Posts
Default

Quote:
Originally Posted by michael
Is it possible to use this program in windows?
You can use this one:

http://www.mersenneforum.org/showpos...05&postcount=3
Xyzzy is offline   Reply With Quote
Old 2004-01-29, 23:34   #7
michael
 
Dec 2003
Belgium

5×13 Posts
Default

I don't think i can do a list of exponents there...i don't fancy typing out 40.000 probably factors.

-michael
michael is offline   Reply With Quote
Old 2004-04-10, 01:03   #8
FeLiNe
 
FeLiNe's Avatar
 
Dec 2003

101112 Posts
Default

Quote:
Originally Posted by ewmayer
Let's see - 2.6 million factors verified in ~20 seconds on a 2.8GHz machine corresponds to ~10,000 cycles per factor. {...}
Uh - I don't think so. This sentence and the math that follows it are true only if every single cycle in those 20 seconds were spent on doing math. A someone else pointed out, there's considerable overhead in sheer file-I/O for a big file, for example. If you wanted to judge the efficiency of the math-code, you'd have to run the test twice, once with the math itself commented out (where you're opening the file and reading it and performing all kinds of oprations and conversions) and then a second time where you're doing the same thing but this time doing the actual verification itself as well as all the other stuff.
FeLiNe is offline   Reply With Quote
Old 2005-01-03, 07:49   #9
HiddenWarrior
 
HiddenWarrior's Avatar
 
Jun 2003
Russia, Novosibirsk

2·107 Posts
Default

The new project MPA 2005 needs a lot in a compiled version of verifyfactors! I wrote my own, but it is still are very slow... Compiled version for WinXP is very good! Maybe after I'll place documentation to the MPA plugins structure someone will code it using ASM?
HiddenWarrior is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extending the database/limits of GIMPS NBtarheel_33 Data 9 2010-11-29 06:19
program to verify factors found by sr(x)sieve? mdettweiler Software 16 2009-03-08 02:06
Program to verify factors HiddenWarrior LMH > 100M 5 2005-04-18 09:00
Home-grown GIMPS database with Python/MySQL leifbk Programming 6 2005-02-09 02:43
More factors found with a new program alpertron ElevenSmooth 8 2003-10-15 10:29

All times are UTC. The time now is 23:29.


Fri Jul 16 23:29:03 UTC 2021 up 49 days, 21:16, 1 user, load averages: 1.87, 1.69, 1.65

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.