20210811, 04:41  #1 
Jul 2021
3·11 Posts 
prime95/gwnum for PRP checking of any number?
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^p1, 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 30Mbit 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? 
20210811, 07:32  #2 
Sep 2002
Database er0rr
3978_{10} Posts 
Have you tried (GWNUMbased) OpenPFGW 4.0.0 available on sourceforge?

20210811, 08:27  #3  
"University student"
May 2021
Beijing, China
305_{8} Posts 
Quote:
So you could run smaller numbers in CPU cache, while simultaneously running bigger numbers in RAM. 

20210811, 17:33  #4  
Jul 2021
21_{16} Posts 
Quote:
But actually more preferable way for me would be to have C or C++ library that checks PRPness 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? 

20210811, 17:53  #5  
Sep 2002
Database er0rr
F8A_{16} 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 20210811 at 17:58 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
checking big digit number as prime  drmurat  Miscellaneous Math  16  20200515 18:59 
checking very large number for primality.  WhoCares  Math  51  20170420 17:17 
Round Off Checking and Sum (Inputs) Error Checking  Forceman  Software  2  20130130 17:32 
is GGNFS checking for SNFS number?  Washuu  Factoring  10  20050811 05:09 
checking smaller number  fortega  Data  2  20050616 22:48 