![]() |
![]() |
#1 |
Jul 2021
3×11 Posts |
![]()
Good day! Is it possible to use prime95 program or even better gwnum C library for PRP checking of any number?
Of cause it is usually used for Mersenne numbers 2^p-1, but now I want to use gwnum library to check probable primeness (PRP) of any arbitrary number. I have numbers of totally different sizes, some are of size around 32K bits, some are of size 30M bits. And I need fast PRP check of both K and M ranges. Can anyone suggest which header file from gwnum C library to use and what function to call with what params, if I have just raw number represented as a block of bytes? Sure, if necessary for each number I can call some init or prepare function before. And of cause I need very high performance! Meaning that gwnum should use most optimal algorithm including using SSE2/AVX1/AVX512 if they are available on CPU. Also if it will help gwnum should use all cores of CPU. Even better if I can run separate number PRP check on each core, is it possible (because I have very many numbers to check)? For numbers of size 32K bits I need maximal throughoutput, meaning checking as many different numbers per hour as possible on multi core CPU. For 30M-bit numbers I need performance of checking single number, meaning single number should be checked as fast as possible using all my CPU cores. Am I right that gwnum uses Fermat Primality Test (e.g. with bases 3, 5, 7) for PRP checking? |
![]() |
![]() |
![]() |
#2 |
Sep 2002
Database er0rr
100318 Posts |
![]()
Have you tried (GWNUM-based) OpenPFGW 4.0.0 available on sourceforge?
![]() |
![]() |
![]() |
![]() |
#3 | |
"University student"
May 2021
Beijing, China
2×53 Posts |
![]() Quote:
So you could run smaller numbers in CPU cache, while simultaneously running bigger numbers in RAM. |
|
![]() |
![]() |
![]() |
#4 | |
Jul 2021
2116 Posts |
![]() Quote:
But actually more preferable way for me would be to have C or C++ library that checks PRP-ness of a number, because I want to embed this check as a part of my software. That's why I preferr to use gwnum library if possible. Can anyone suggest what function and what header of gwnum to use and what params to do PRP check? |
|
![]() |
![]() |
![]() |
#5 | |
Sep 2002
Database er0rr
13×317 Posts |
![]() Quote:
![]() Basically, you'll need to compile Prime95/mprime source and the use some of its files to link against for you own program. Have a look at gwnum.h and giants.h for more info and also read up on GMP. Last fiddled with by paulunderwood on 2021-08-11 at 17:58 |
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
checking big digit number as prime | drmurat | Miscellaneous Math | 16 | 2020-05-15 18:59 |
checking very large number for primality. | WhoCares | Math | 51 | 2017-04-20 17:17 |
Round Off Checking and Sum (Inputs) Error Checking | Forceman | Software | 2 | 2013-01-30 17:32 |
is GGNFS checking for SNFS number? | Washuu | Factoring | 10 | 2005-08-11 05:09 |
checking smaller number | fortega | Data | 2 | 2005-06-16 22:48 |