mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > Prime Gap Searches

Reply
 
Thread Tools
Old 2017-07-04, 17:49   #1
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

5×7×139 Posts
Default Prime Gap Search latest version of the c code

Here is the latest version of the c code (version 0.05.g), along with Windows executables and linux binaries.

Quote:
Originally Posted by Antonio View Post
Here is the latest version of the c code (version 0.05.g), along with Windows executables (now reduced to two versions - one for pre-Haswell the other for Haswell and later processors, as discussed in earlier posts).
There are only minor changes in this version:

Code:
// version 0.05.g    Fixed quick sort, added optimized bubble sort.            Antonio Key
//                    Replaced add30 & sub30 constant arrays with a single
//                    wheel30 constant array - they became identical in 0.05.
//                    Added ETA to status display line.
//                    Removed some of the old commented-out code.
//                    Modified the smart check on input data.

// version 0.05.f    next_prime, prec_prime tuning.                            Antonio Key

// version 0.05.e    Hensel lifting.                                            Robert Gerbicz

// version 0.05.d    Fermat & Euler-Plumb PRP tests using Montgomery math.    Dana Jacobsen

// version 0.05        Bug fix.                                                Robert Gerbicz
The compiled versions use the optimized bubble sort, I don't think there is any advantage to using the quick sort for the small number of items we have to order at the end of each stage and the bubble sort may be faster.
The modification to the input data smart check came about as a result of my further investigation into tuning the code. I have found that for my i5-3570k running 4 threads I can increase the throughput to 27.5e9 n/sec using bs= 18, the old smart check would issue a warning for bs > 16, which didn't seem reasonable. The smart check now only displays a warning if sb <16 or (sb - bs) < 3.
My input parameters have now changed from (ignore the n1 and n2 parameters - which are my test range values only):
Code:
gap5_f_ivybridge  -n1 4248785e12 -n2 4248789e12 -gap 1250 -delta 150 -sb 24 -bs 16 -t 4  -mem 12
throughput 26.4e9 n/sec.
to:
Code:
gap5_g -n1 4248785e12 -n2 4248789e12 -gap 1250 -delta 155 -sb 24 -bs 18 -t 4 -mem 12
throughput 27.5e9 n/sec.
Antonio and Thomas, please use this thread so people can easily follow up the latest binaries.
Attached Files
File Type: zip gap5_g_code.zip (15.4 KB, 174 views)
File Type: zip cygwin1.zip (1.08 MB, 181 views)
File Type: zip gap5_g.zip (411.0 KB, 189 views)
File Type: zip gap5_g_linux_static.zip (1.09 MB, 155 views)
File Type: zip gap5_g_linux.zip (42.3 KB, 158 views)

Last fiddled with by pinhodecarlos on 2017-07-04 at 17:50
pinhodecarlos is offline   Reply With Quote
Old 2017-07-13, 17:37   #2
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

114018 Posts
Default

What's the relation between the client speed and memory used? Let´s imagine I have a bunch of cores with only 1 to 2GB of memory available per core. Is it worth to have for example a client that uses 500MB memory/core?
pinhodecarlos is offline   Reply With Quote
Old 2017-07-13, 17:50   #3
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

10010110000002 Posts
Default

Quote:
Originally Posted by pinhodecarlos View Post
What's the relation between the client speed and memory used? Let´s imagine I have a bunch of cores with only 1 to 2GB of memory available per core. Is it worth to have for example a client that uses 500MB memory/core?
I asked the same question to run on an Odroid-C2 (2GB). The answer (with the related command-line and source modifications) should be buried inside this thread.

I will search for it, be back soon.

P.S. Here it is: Here starting from post #70.

Last fiddled with by ET_ on 2017-07-13 at 17:53
ET_ is offline   Reply With Quote
Old 2017-07-13, 17:56   #4
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

486510 Posts
Default

Thank you Luigi. Did try to run on my wife's laptop but the client needs at least 3GB. Also I am thinking on something else....

Last fiddled with by pinhodecarlos on 2017-07-13 at 17:57
pinhodecarlos is offline   Reply With Quote
Old 2017-07-13, 20:24   #5
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

26·3·52 Posts
Default

Quote:
Originally Posted by pinhodecarlos View Post
Thank you Luigi. Did try to run on my wife's laptop but the client needs at least 3GB. Also I am thinking on something else....
I was running gap on my i5: 2 threads, 2.1GB (of 4GB present on the PC), so I assume you can run it safely on the laptop...

Wait... you are on Windows, aren't you?

Last fiddled with by ET_ on 2017-07-13 at 20:25 Reason: Windows...
ET_ is offline   Reply With Quote
Old 2017-07-13, 20:30   #6
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

5·7·139 Posts
Default

Yes, I am on windows.
pinhodecarlos is offline   Reply With Quote
Old 2017-07-13, 20:44   #7
danaj
 
"Dana Jacobsen"
Feb 2011
Bangkok, TH

22×227 Posts
Default

I was able to get it running with 3 threads on Windows in about 2GB. I used "-sb 23 -bs 14", and lowered MAX_SIZE to 1LL<<26. The latter didn't have nearly the memory impact I thought it would from the comments (lowering it further seemed to have basically no memory effect).

I wrote some debugging printfs to help figure out where memory was going ... Perhaps I should write those up in a more friendly one-line output. As we progress higher in the search the memory use will get worse.

Unfortunately the PC has 4GB and for some reason that gives it under 3GB actually usable with Windows 10 64-bit. Task Viewer says it has about 600MB free when running the gap program, and firing up Firefox or Emby is much slower.
danaj is offline   Reply With Quote
Old 2017-07-14, 06:12   #8
Antonio
 
Antonio's Avatar
 
"Antonio Key"
Sep 2011
UK

21316 Posts
Default

The (Windows) version of code attached requires -mem (1.55 + 0.05t) to run, where t is the number of threads.
To test it I used the command line:- gap5_size -n1 5501904e12 -n2 5501907e12 -gap 1340 -delta 150 -sb 23 -bs 14 -t 1 -mem 1.6
It is about 1/2 the speed of the 0.05_g code on my machine, although I didn't try re-tuning delta, which may help.
Attached Files
File Type: zip gap5_size.zip (205.4 KB, 147 views)
Antonio is offline   Reply With Quote
Old 2017-07-14, 13:03   #9
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

5×7×139 Posts
Default

Was wondering if I will be able to run the client on a MINIX NEO Z83-4.
pinhodecarlos is offline   Reply With Quote
Old 2017-07-14, 13:20   #10
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

26·3·52 Posts
Default

Quote:
Originally Posted by pinhodecarlos View Post
Was wondering if I will be able to run the client on a MINIX NEO Z83-4.
The code has a couple of function hand-tuned in x86 assembler.
They don't compile on ARM machines.
ET_ is offline   Reply With Quote
Old 2017-07-14, 13:29   #11
pinhodecarlos
 
pinhodecarlos's Avatar
 
"Carlos Pinho"
Oct 2011
Milton Keynes, UK

5·7·139 Posts
Default

Quote:
Originally Posted by ET_ View Post
The code has a couple of function hand-tuned in x86 assembler.
They don't compile on ARM machines.
This one has an Intel processor.
pinhodecarlos is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
The lasieve5 latest code and patches frmky Factoring 36 2016-08-13 16:32
PFGW latest well-tested version mdettweiler Conjectures 'R Us 109 2010-09-29 20:20
where can I download the latest version of GMP-ECM aaa120 GMP-ECM 2 2008-10-31 14:28
Is 23.8.1 the latest Version of Prime95? Bundu Software 1 2004-11-03 23:18
Latest version? [CZ]Pegas Software 3 2002-08-23 17:05

All times are UTC. The time now is 18:40.

Sat Feb 27 18:40:12 UTC 2021 up 86 days, 14:51, 0 users, load averages: 1.40, 1.44, 1.56

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