mersenneforum.org  

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

Reply
 
Thread Tools
Old 2021-08-11, 04:41   #1
moytrage
 
Jul 2021

3×11 Posts
Default 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^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?
moytrage is offline   Reply With Quote
Old 2021-08-11, 07:32   #2
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

2×3×52×29 Posts
Default

Have you tried (GWNUM-based) OpenPFGW 4.0.0 available on sourceforge?
paulunderwood is offline   Reply With Quote
Old 2021-08-11, 08:27   #3
Zhangrc
 
"University student"
May 2021
Beijing, China

10D16 Posts
Default

Quote:
Originally Posted by moytrage View Post
I have numbers of totally different sizes, some are of size around 32K bits, some are of size 30M bits.
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)?
According to my experiences with Prime95, you could run multiple instances ("workers"). One core for each instance is the easiest configuration, but we are now limited by memory bandwidth.
So you could run smaller numbers in CPU cache, while simultaneously running bigger numbers in RAM.
Zhangrc is offline   Reply With Quote
Old 2021-08-11, 17:33   #4
moytrage
 
Jul 2021

3×11 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
Have you tried (GWNUM-based) OpenPFGW 4.0.0 available on sourceforge?
It looks like executable program. It is nice, especially if it is possible to run it as command line.

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?
moytrage is offline   Reply With Quote
Old 2021-08-11, 17:53   #5
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

2×3×52×29 Posts
Default

Quote:
Originally Posted by moytrage View Post
It looks like executable program. It is nice, especially if it is possible to run it as command line.

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?
Have a look through this thread, working backwards. You'll have to write your own Fermat PRP tests and Lucas tests.

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
paulunderwood is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
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

All times are UTC. The time now is 06:33.


Sun Nov 27 06:33:52 UTC 2022 up 101 days, 4:02, 0 users, load averages: 0.99, 0.94, 0.92

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, 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.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔