Message boards : Project Staging Area : FFT size for factorials and primorials

 Subscribe SortOldest firstNewest firstHighest rated posts first
Author Message
Bur
Volunteer tester

Joined: 25 Feb 20
Posts: 511
ID: 1241833
Credit: 408,631,476
RAC: 28,313

Message 146064 - Posted: 3 Dec 2020 | 17:50:51 UTC

There seem to be some versions of pfgw that support multithreading and I was wondering if it'd be worth already to look into it for current factorials/primorials in PSA.

But apparently, pfgw doesn't output the FFT size. Does anyone know it or how to get the FFT size from the respective number by other means?
____________
1281979 * 2^485014 + 1 is prime ... no further hits up to: n = 5,700,000

rogue
Volunteer developer

Joined: 8 Sep 07
Posts: 1249
ID: 12001
Credit: 18,565,548
RAC: 0

Message 146534 - Posted: 11 Dec 2020 | 13:15:11 UTC - in response to Message 146064.

There seem to be some versions of pfgw that support multithreading and I was wondering if it'd be worth already to look into it for current factorials/primorials in PSA.

But apparently, pfgw doesn't output the FFT size. Does anyone know it or how to get the FFT size from the respective number by other means?

Use the command line switch of -V and it will print the FFT size for each test.

Bur
Volunteer tester

Joined: 25 Feb 20
Posts: 511
ID: 1241833
Credit: 408,631,476
RAC: 28,313

Message 146580 - Posted: 12 Dec 2020 | 6:48:19 UTC - in response to Message 146534.

Thanks!

In case anyone else is interested:

n!+-1 n FFT 100,000 160K 250,000 448K 500,000 896K 750,000 1440K 1,000,000 1920K 1,250,000 2560K 1,500,000 3000K 1,750,000 3584K 2,000,000 4000K

n#+-1 n FFT 1,250,000 192K 1,750,000 256K 2,500,000 384K 3,000,000 448K 4,000,000 640K 5,000,000 768K 7,500,000 1120K 10,000,000 1536K 20,000,000 3000K

So it will take some years at PSA until MT might begin to make sense even on older CPUs.

pfgw also outputs the number of bits, is that actually the size on powers of two? Then it'd be easy to calculate the number of digits if a prime is found.
____________
1281979 * 2^485014 + 1 is prime ... no further hits up to: n = 5,700,000

rogue
Volunteer developer

Joined: 8 Sep 07
Posts: 1249
ID: 12001
Credit: 18,565,548
RAC: 0

Message 146601 - Posted: 12 Dec 2020 | 14:23:17 UTC - in response to Message 146580.

Note that the FFT sizes are dependent upon the CPU as not all FFT routines are available on all CPUs.

PRPNet computes the decimal length of primorials and factorials when loaded into the database, so if a prime is found the length on the User Primes page will be the actual decimal length.

But you can use the number of bits to estimate the decimal length. I don't recall if it is the exact number of bits.

Bur
Volunteer tester

Joined: 25 Feb 20
Posts: 511
ID: 1241833
Credit: 408,631,476
RAC: 28,313

Message 149289 - Posted: 9 Mar 2021 | 18:43:41 UTC - in response to Message 146601.

I recently learned that to estimate whether a calculation fits into L3 cache the FFT size should be multiplied by 8.

Factorial primes are around 450K FFT size now, that'd be 3.6 MB of L3 cache required. Is that really the case? If so, contrary to what I wrote before, multi threading would be recommended on most CPUs. But as far as I know openPFGW doesn't support MT, or does it?
____________
1281979 * 2^485014 + 1 is prime ... no further hits up to: n = 5,700,000

JeppeSN

Joined: 5 Apr 14
Posts: 1727
ID: 306875
Credit: 41,442,443
RAC: 13,406

Message 149290 - Posted: 9 Mar 2021 | 22:00:57 UTC - in response to Message 149289.

But as far as I know openPFGW doesn't support MT, or does it?

No, it does not. /JeppeSN

Michael Goetz
Volunteer moderator

Joined: 21 Jan 10
Posts: 13804
ID: 53948
Credit: 345,369,032
RAC: 2,648

Message 149294 - Posted: 10 Mar 2021 | 0:27:13 UTC - in response to Message 149290.

But as far as I know openPFGW doesn't support MT, or does it?

No, it does not. /JeppeSN

Actually, it does -- at least if you use the correct version. But faking things such that PRPNet uses it is non-trivial.

You'll want the 4.x.x release of PFGW to do multithreading. I know others have managed to finagle PRPNet into running LLR multithreaded, but I don't know if anyone did it with PFGW. Search the forums for advice if you want to try it.
____________
My lucky number is 75898524288+1

JeppeSN

Joined: 5 Apr 14
Posts: 1727
ID: 306875
Credit: 41,442,443
RAC: 13,406

Message 149324 - Posted: 10 Mar 2021 | 22:10:08 UTC - in response to Message 149294.

But as far as I know openPFGW doesn't support MT, or does it?

No, it does not. /JeppeSN

Actually, it does -- at least if you use the correct version. But faking things such that PRPNet uses it is non-trivial.

You'll want the 4.x.x release of PFGW to do multithreading. I know others have managed to finagle PRPNet into running LLR multithreaded, but I don't know if anyone did it with PFGW. Search the forums for advice if you want to try it.

You are right! I checked a version 3.8.3 I had. I see now, the version 4 has a -T switch for multithreading. /JeppeSN

Odicin

Joined: 30 May 10
Posts: 126
ID: 61485
Credit: 566,175,102
RAC: 23,302

Message 151060 - Posted: 9 Aug 2021 | 6:08:39 UTC - in response to Message 149294.

I know others have managed to finagle PRPNet into running LLR multithreaded, but I don't know if anyone did it with PFGW. Search the forums for advice if you want to try it.

Confirmed. It also works with pfgw 4.0 or newer in the same way like llr. (Original instructions here)

Instead of changing the "llrexe=" in prpclient.ini, you change the "pfgwexe=" line with the created batch file.

In the batch file, you only write the line:
@pfgw64.exe %* -T4

Change the number in your desired number of cores.

Before, you must update the pfgw.exe file with a newer version (>4.0) than the included version in the prpnet package.

Regards Odi
____________

Bur
Volunteer tester

Joined: 25 Feb 20
Posts: 511
ID: 1241833
Credit: 408,631,476
RAC: 28,313

Message 151068 - Posted: 9 Aug 2021 | 16:53:17 UTC

Thanks, that's much easier than I expected.

FFT is currently at 480K, so modern CPUs won't benefit from multithreading yet. I tested my laptop Ryzen 5 2500U and up to 1500K single-threaded still had the most throughput - I have to admit I'm a bit surprised by that, as it only has 4 MB of L3 cache, so maybe the tests were screwed up by something.

If it was correct, it's way out of the range PRPnet will likely ever reach. But the more I think about it, the less I trust the results. My Ryzen 9 3600X went better with 2 threads at around 640k if I remember correctly.

Hmm, kind of pointless post now, but I leave it here for the record. ;)
____________
1281979 * 2^485014 + 1 is prime ... no further hits up to: n = 5,700,000

Message boards : Project Staging Area : FFT size for factorials and primorials