mersenneforum.org How can one benchmark P-1 testing?
 Register FAQ Search Today's Posts Mark Forums Read

 2021-05-06, 19:18 #1 drkirkby   "David Kirkby" Jan 2021 Althorne, Essex, UK 2·3·5·7 Posts How can one benchmark P-1 testing? I understand the latest version of mprime can use quite a bit or RAM for P-1 testing. I have 384 GB, and wanted to know how much RAM to allocate on a dual CPU system. Each CPU has 192 GB local to it, so access that RAM faster than the other 192 GB. So I want wonder if its best to 1) Use most of the RAM - I have currently configured 320 GB 2) Use a bit less than half (say 180 GB), so that the RAM will be local to the one CPU. It's not so obvious to me how one would test what is best. Can one double-check a previous P-1 test for timing purposes? I'm thinking it might be wise to try to check one that's known to have large factors, so are not easy to find. Dave Last fiddled with by drkirkby on 2021-05-06 at 19:18
 2021-05-06, 20:30 #2 firejuggler     Apr 2010 Over the rainbow 22·641 Posts M27155813 has a 112.563-bit (34-digit) factor: 7669084564727955238545079945517857 (P-1,B1=1350000,B2=109350000) I have an i7 8700,3 core, 7 G of ram used at the time and it took me about 4H10 min Code: [Mon Apr 5 18:22:15 2021] {"status":"NF", "exponent":27155767, "worktype":"P-1", "b1":1350000, "b2":109350000, "fft-length":1474560, "security-code":"B8093FA5", "program":{"name":"Prime95", "version":"30.4", "build":9, "port":4}, "timestamp":"2021-04-05 16:22:15", "user":"firejuggler", "computer":"Maison", "aid":"FDC98300316E54D7F1FFCD2D72772124"} [Mon Apr 5 22:32:58 2021] {"status":"F", "exponent":27155813, "worktype":"P-1", "factors":["7669084564727955238545079945517857"], "b1":1350000, "b2":109350000, "fft-length":1474560, "security-code":"B8163FB2", "program":{"name":"Prime95", "version":"30.4", "build":9, "port":4}, "timestamp":"2021-04-05 20:32:58", "user":"firejuggler", "computer":"Maison", "aid":"4F6AE55CF923BB50B3A542D7A37C3803"}
 2021-05-06, 21:51 #3 kriesel     "TF79LL86GIMPS96gpu17" Mar 2017 US midwest 3·29·59 Posts For exponents closer to the current wavefront, therefore quicker to test, try those in the middle of https://www.mersenneforum.org/showpo...51&postcount=3 For a list of P-1 self test candidates with known factors, throughout the mersenne.org exponent range, see https://www.mersenneforum.org/showpo...8&postcount=31 Use the reference info instead of starting a new thread for everything! Last fiddled with by kriesel on 2021-05-06 at 21:54
2021-05-06, 22:05   #4
VBCurtis

"Curtis"
Feb 2005
Riverside, CA

2·2,393 Posts

Quote:
 Originally Posted by kriesel Use the reference info instead of starting a new thread for everything!
This. Please, you're long past a clueless beginner now, and you're surely bright enough to answer many of your own questions.
The forum generally likes having threads of reasonable questions with answers for future interested parties- you could take advantage of this history and browse lots of threads that might match your interests.

2021-05-07, 08:54   #5
drkirkby

"David Kirkby"
Jan 2021
Althorne, Essex, UK

2×3×5×7 Posts

Quote:
 Originally Posted by VBCurtis This. Please, you're long past a clueless beginner now, and you're surely bright enough to answer many of your own questions. The forum generally likes having threads of reasonable questions with answers for future interested parties- you could take advantage of this history and browse lots of threads that might match your interests.
It's far from clear how to benchmark this - the links did not help. There are several issues
1) The new version of mprime is supposed to be much better for P-1 factoring than older versions. That's why I upgraded yesterday.

2) Based on a P-1 factoring I performed yesterday on M108399059
https://www.mersenne.org/report_expo...8399059&full=1
* GHz days = 21.7308
* B1=893 000, B2=51 571 000
That used significantly more GHz days than any previous attempt. The longest previous attempt was M110600107
https://www.mersenne.org/report_expo...0600107&full=1
* 13.2595 GHz days
* B1=813 000, B2=24 770 000, E=12
3) So I conclude
a) More RAM takes much longer
b) More RAM significantly increases B2.

If I allocate more RAM (339 GB was the largest mprime would accept), that can
a) Take longer (more GHz days)
b) Increase B2 which has a better chance of finding a factor.
c) Increase access time to the RAM, if the amount of RAM exceeds that local to a CPU.

A calculator at
https://www.mersenne.ca/prob.php?exp...747177&prob=30
indicates the time and RAM for any given probability of finding a factor. But it seems to be outdated, as the RAM I used on that exponent was considerably more than the calculator gives, so I think it is probably outdated.

So I'm still puzzled on how to work out optimal settings for RAM. I'm not convinced that retesting old exponents with known factors is that helpful, but I may be wrong. What seems more important is
a) The probability of finding a factor given particular value of B1 and B2.
b) The time on my computer (not GHz days) to work with those values of B1 and B2.

Given the time to do the P-1 test, and the fact sizes of exponents that need testing will keep increases, it is probably impractical to build up statistically significant data based on the number of times I find a factor. I generally run the PRP tests so that one exponent is around 50% complete when the other starts. So the chances of two exponents both doing P-1 tests at the same time is pretty close to zero.

Last fiddled with by drkirkby on 2021-05-07 at 09:15

2021-05-07, 09:03   #6
axn

Jun 2003

10011011001102 Posts

Quote:
 Originally Posted by drkirkby 3) So I conclude a) More RAM takes much longer b) More RAM significantly increases B2.
Apples and oranges. More RAM wasn't the only variable in your test. The P-1 alogrithm also changed drastically between versions. Do comparisons with the same version only.

Quote:
 Originally Posted by drkirkby If I allocate more RAM (339 GB was the largest mprime would accept), that can a) Take longer b) Increase B2 which has a better chance of finding a factor.
It is possible. Only way to know is to try it.

Quote:
 Originally Posted by drkirkby A calculator at https://www.mersenne.ca/prob.php?exp...747177&prob=30 indicates the time and RAM for any given probability of finding a factor. But it seems to be outdated, as the RAM I used on that exponent was considerably more than the calculator gives, so I think it is probably outdated.
Yes, it has not (yet) been updated to account for the new algorithm.

Quote:
 Originally Posted by drkirkby So I'm still puzzled on how to work out optimal settings for RAM.
Give the maximum amount of RAM you can spare. Let the software manage the rest.

 2021-05-07, 09:44 #7 kriesel     "TF79LL86GIMPS96gpu17" Mar 2017 US midwest 3×29×59 Posts Again, use the reference info. P-1 bounds And read and understand https://www.mersenne.org/various/math.php Also your post was vague. Thread title does not indicate your interest is specifically in mprime or prime95. Last fiddled with by kriesel on 2021-05-07 at 09:48
2021-05-07, 10:57   #8
drkirkby

"David Kirkby"
Jan 2021
Althorne, Essex, UK

2×3×5×7 Posts

Quote:
 Originally Posted by kriesel Again, use the reference info. P-1 bounds And read and understand https://www.mersenne.org/various/math.php Also your post was vague. Thread title does not indicate your interest is specifically in mprime or prime95.
True, the title does not says mprime, but the first sentence does. I thought the two programs were essentially identical. When I run mprime, and request the version, it actually says Prime95, not mprime.

Code:
[dkirkby@jackdaw ~]$mprime -v Mersenne Prime Test Program: Linux64,Prime95,v30.6,build 4 I will look at the maths is more detail, although not being a mathematician, I don't know whether I will follow it. But given the P-1 code has changed substantially very recently, is all that information still current? Last fiddled with by drkirkby on 2021-05-07 at 11:00 2021-05-07, 15:11 #9 kriesel "TF79LL86GIMPS96gpu17" Mar 2017 US midwest 513310 Posts Quote:  Originally Posted by drkirkby I thought the two programs were essentially identical. I meant as opposed to P-1 factoring in Gpuowl, CUDAPm1, gmp-ecm, something in perl or in Pari/GP, etc. Attachment of https://www.mersenneforum.org/showpo...91&postcount=2 is basic knowledge and shows multiple programs for most computation types, including P-1. Mprime/prime95 are great but not the whole story. From the readme.txt packaged with mprime or prime95: Code: FILE LIST --------- readme.txt This file. prime95.exe The windows program to trial factor and primality test Mersenne numbers. mprime The Linux program to trial factor and primality test Mersenne numbers. Last fiddled with by kriesel on 2021-05-07 at 15:40 2021-05-07, 15:38 #10 masser Jul 2003 wear a mask 110010011012 Posts Quote:  Originally Posted by drkirkby I understand the latest version of mprime can use quite a bit or RAM for P-1 testing. I have 384 GB, and wanted to know how much RAM to allocate on a dual CPU system. Each CPU has 192 GB local to it, so access that RAM faster than the other 192 GB. So I want wonder if its best to 1) Use most of the RAM - I have currently configured 320 GB 2) Use a bit less than half (say 180 GB), so that the RAM will be local to the one CPU. It's not so obvious to me how one would test what is best. Can one double-check a previous P-1 test for timing purposes? I'm thinking it might be wise to try to check one that's known to have large factors, so are not easy to find. Dave A few questions to help us better answer your questions. 1. You have two cpus. Are you running two instances of mprime? 2. You mentioned mprime. That means you're using linux, right? 3. What type of P-1 work would you like to do? Wavefront P-1 (to help the search for the next large prime), 100M P-1 (to help find the $$-prize winning large prime) or to participate in some other factoring challenge? My generic suggestion would be to a. Determine what type of work you would like to do and reserve/acquire a good sized set (many days worth of work) of assignments. Choose appropriate B1 bounds for the tasks. b. Split the assignments over two worktodo files and run each of the files with a separate instance of mprime. c. In each version of mprime, allocate less than half of your system RAM. d. Monitor your results for a day, then adjust the B1 bounds or the allocated RAM. Repeat this step until you are happy with system utilization, work credits, whatever your goal is. Last fiddled with by masser on 2021-05-07 at 15:39 2021-05-07, 19:18 #11 drkirkby "David Kirkby" Jan 2021 Althorne, Essex, UK 2×3×5×7 Posts Quote:  Originally Posted by masser A few questions to help us better answer your questions. 1. You have two cpus. Are you running two instances of mprime? No. One instance, two workers. Each worker has 26 cores. From the benchmarks I have done, two workers seems optimal for maximum throughput. Running two instances works poorly - see more comments below about this. Quote:  Originally Posted by masser 2. You mentioned mprime. That means you're using linux, right? Yes. CentOS 7.9. Quote:  Originally Posted by masser 3. What type of P-1 work would you like to do? Wavefront P-1 (to help the search for the next large prime), 100M P-1 (to help find the$$$-prize winning large prime) or to participate in some other factoring challenge?
PRP tests with the exponents just above 100 million, so they would be a world record. I done one 100 million decimal digit attempt at winning \$'s, and that one attempt was enough to convince me it was not much fun. But often those assignments for PRP tests first require one to run a P-1 test, if someone else has not run it. I think sometimes a P-1 test is run, even if someone has done one before, the bounds they did it over are not considered optimal.
Quote:
 Originally Posted by masser My generic suggestion would be to a. Determine what type of work you would like to do and reserve/acquire a good sized set (many days worth of work) of assignments. Choose appropriate B1 bounds for the tasks.
That does present a problem, in that the exponents will be larger, as one can't keep more than 3 days worth of category 0 exponents, or 5 days worth of category 1 exponents.
https://www.mersenne.org/thresholds/

Someone bought this to my attention a few days ago, so now I have been allocated a couple of category 1 exponents.
Quote:
 Originally Posted by masser b. Split the assignments over two worktodo files and run each of the files with a separate instance of mprime.
I have tried running two instances of mprime in the past, and it seemed to have poor performance. I even tried tying one to a particular CPU and RAM, but it was never successful. I could see a dramatic (factor of 4) or so increase in the ms per iteration of the PRP test when a second instance was run.

Quote:
 Originally Posted by masser c. In each version of mprime, allocate less than half of your system RAM. d. Monitor your results for a day, then adjust the B1 bounds or the allocated RAM. Repeat this step until you are happy with system utilization, work credits, whatever your goal is.
I am not interested in CPU credits. My goal is to maximise the chances of finding the next Mersenne prime (if one even exists). If the calculator at

https://www.mersenne.ca/prob.php?exp...747177&prob=30
could be updated to accurately reflect the probability of finding a factor with the current algorithm, I could probably work out a sweet spot.

I might find this becomes irrelevant if I offer mprime 339 GB (maximum it will accept on my machine), but it actually chooses to use less than half my RAM (192 GB).

The next exponent I commence will be this one, in about 13 hours from now.
https://www.mersenne.org/report_expo...0000000&full=1
That has already been P-1 factored to B1=860 000, B2=17 415 000, E=6. I don't know whether mprime will just start straight on the PRP test, or perhaps do some more P-1 factoring with a larger value of B2.

Last fiddled with by drkirkby on 2021-05-07 at 19:19

 Similar Threads Thread Thread Starter Forum Replies Last Post GP2 Wagstaff PRP Search 414 2020-12-27 08:11 JuanTutors Hardware 3 2019-08-01 00:34 Prime95 Software 69 2017-05-23 23:49 kladner Soap Box 3 2016-10-14 18:43 eepiccolo Math 6 2006-03-28 20:53

All times are UTC. The time now is 03:48.

Sun May 16 03:48:58 UTC 2021 up 37 days, 22:29, 0 users, load averages: 1.26, 1.21, 1.41