mersenneforum.org  

Go Back   mersenneforum.org > Prime Search Projects > Twin Prime Search

Reply
 
Thread Tools
Old 2009-08-12, 02:07   #232
Ken_g6
 
Ken_g6's Avatar
 
Jan 2005
Caught in a sieve

5·79 Posts
Default

From what I've seen on my Core 2 Quad, I got about a 2x speedup from a better memory access pattern, then a 3x speedup on top of that, for 32-bit only, from SSE2. So if 6x is expected, I suppose 7-8x isn't unreasonable.

I'm kind of in shock, too. But Geoff always said his code wasn't optimized for this many N's.
Ken_g6 is offline   Reply With Quote
Old 2009-08-12, 02:20   #233
axn
 
axn's Avatar
 
Jun 2003

23×683 Posts
Default

Quote:
Originally Posted by Ken_g6 View Post
From what I've seen on my Core 2 Quad, I got about a 2x speedup from a better memory access pattern, then a 3x speedup on top of that, for 32-bit only, from SSE2. So if 6x is expected, I suppose 7-8x isn't unreasonable.

I'm kind of in shock, too. But Geoff always said his code wasn't optimized for this many N's.
Actually, the latest speed I'm getting is about 3.9M @ 100G. That's another 3x speed increase over the speed at 30G (on same binary). And it's just getting faster and faster. I bet it'd be _even_ faster if I can suppress the screen output. Is there an option to do that? If not, can I get a build which suppresses the factor output?
axn is offline   Reply With Quote
Old 2009-08-12, 03:04   #234
Ken_g6
 
Ken_g6's Avatar
 
Jan 2005
Caught in a sieve

5·79 Posts
Default

There doesn't seem to be a way to supresss the factor output to the screen. (Yet.) But you can add "> NUL" at the end on Windows ("> /dev/null" on Linux) to get rid of the output from any app.

I'm thinking next I should look at profiling the program. I can't think of a reason increasing P like that would speed it up, except maybe that factor output is more expensive than I realized.
Ken_g6 is offline   Reply With Quote
Old 2009-08-12, 03:32   #235
axn
 
axn's Avatar
 
Jun 2003

546410 Posts
Default

Quote:
Originally Posted by Ken_g6 View Post
There doesn't seem to be a way to supresss the factor output to the screen. (Yet.) But you can add "> NUL" at the end on Windows ("> /dev/null" on Linux) to get rid of the output from any app.
Don't want that. I still want to see the progress reports.

Quote:
Originally Posted by Ken_g6 View Post
I'm thinking next I should look at profiling the program. I can't think of a reason increasing P like that would speed it up, except maybe that factor output is more expensive than I realized.
False alarm. For some odd reason, it was only considering the first 2000 or so n's. The memory usage was around 400mb, and the factor density was much less. Wasted 2 hrs. Anyway, rerunning the range from start, and now it is back to around 1.45M (still faster than at 30G, but only slightly). I would still love to see if there is any potential speed gains from suppressing the screen output. Can you make a version with the relevant code commented out?

Last fiddled with by axn on 2009-08-12 at 03:33
axn is offline   Reply With Quote
Old 2009-08-12, 03:45   #236
geoff
 
geoff's Avatar
 
Mar 2003
New Zealand

13×89 Posts
Default

I've uploaded tpsieve 0.2.4 at http://www.geocities.com/g_w_reynolds/testing/ which just fixes the bug that prevented the proper nmax value being set ffrom a multi-n input file.

I don't have much time online at the moment, so I can't respond to all the issues about the program. But note that the multithreading is not ideal, only one thread at a time can be in certain parts of the prime generation code, so for benchmarking purposes it is best to use just a single thread. As the range of n changes, and also as the factor size changes, you will need to adjust the --qmax parameter to suit. (larger range of n and/or larger factor range should use a larger --qmax). Memory use can be reduced by using a hashtable instead of a bitmap, and reduced more by using a type of binary search of an ordered list, but there will be some performance tradeoff.

Anyway the source code is there, feel free to make changes.

Edit: The version numbering for source and binary are different, because I use the source to build a number of programs that share some of the code.

Edit2: The compiler I use for the 64-bit Windows executable is available here http://mingw-w64.sourceforge.net/ It can be used from Linux to produce Windows executables.

Last fiddled with by geoff on 2009-08-12 at 03:59
geoff is offline   Reply With Quote
Old 2009-08-12, 04:37   #237
Ken_g6
 
Ken_g6's Avatar
 
Jan 2005
Caught in a sieve

5×79 Posts
Default

Quote:
Originally Posted by axn View Post
For some odd reason, it was only considering the first 2000 or so n's. The memory usage was around 400mb, and the factor density was much less. Wasted 2 hrs. Anyway, rerunning the range from start, and now it is back to around 1.45M (still faster than at 30G, but only slightly). I would still love to see if there is any potential speed gains from suppressing the screen output. Can you make a version with the relevant code commented out?
I've added Geoff's fix to my zipfile, and added a flag "-q" to suppress factor output to the screen.

axn, is it possible that you gave the wrong value for the -N argument? (The new version doesn't need that.) If that's not what happened, could you please PM me with the command line you used, if you have it? (In case you didn't know, pressing the up arrow at the same command prompt might show it.)
Ken_g6 is offline   Reply With Quote
Old 2009-08-12, 09:47   #238
cipher
 
cipher's Avatar
 
Feb 2007

211 Posts
Default

Quote:
Originally Posted by geoff View Post
Memory use can be reduced by using a hashtable instead of a bitmap
Geoff i thought that setting was only available with sr2sieve and not tpsieve? How do you use hashtable with tpsieve?
thanks
cipher
cipher is offline   Reply With Quote
Old 2009-08-12, 10:48   #239
Flatlander
I quite division it
 
Flatlander's Avatar
 
"Chris"
Feb 2005
England

31·67 Posts
Default

I'm fiddling with tpsieve trying to get the hang of it. I now have a file tpfactors.txt that I want to remove from allc.txt but srfile doesn't like the file type. How do I remove the factors?

(100 ns in file. Windows.)
Flatlander is offline   Reply With Quote
Old 2009-08-12, 11:19   #240
cipher
 
cipher's Avatar
 
Feb 2007

D316 Posts
Default

Flatlander check with gribozavr he has a perl script, to do that.
cipher is offline   Reply With Quote
Old 2009-08-12, 12:38   #241
TimSorbet
Account Deleted
 
TimSorbet's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

11×389 Posts
Default

Quote:
Originally Posted by Ken_g6 View Post
I've added Geoff's fix to my zipfile, and added a flag "-q" to suppress factor output to the screen.


Can -q be set in tpconfig.txt? If so, would it be with -q or q or what?

Last fiddled with by TimSorbet on 2009-08-12 at 12:42
TimSorbet is offline   Reply With Quote
Old 2009-08-12, 13:28   #242
axn
 
axn's Avatar
 
Jun 2003

23×683 Posts
Default

Quote:
Originally Posted by Ken_g6 View Post
axn, is it possible that you gave the wrong value for the -N argument? (The new version doesn't need that.) If that's not what happened, could you please PM me with the command line you used, if you have it? (In case you didn't know, pressing the up arrow at the same command prompt might show it.)
The cmd line was fine. I aborted that run and restarted with the exact same command line, and things were fine. Must've been a freak mishap, is all I can think of.
Code:
<sse2-exe> -i <480kfile> -p 1e11 -P 2e11 -N 485000

Last fiddled with by axn on 2009-08-12 at 13:28
axn is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
S9 and general sieving discussion Lennart Conjectures 'R Us 31 2014-09-14 15:14
Sieving discussion thread philmoore Five or Bust - The Dual Sierpinski Problem 66 2010-02-10 14:34
Combined sieving discussion ltd Prime Sierpinski Project 76 2008-07-25 11:44
Sieving Discussion ltd Prime Sierpinski Project 26 2005-11-01 07:45
Sieving Discussion R.D. Silverman Factoring 7 2005-09-30 12:57

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


Fri Jul 7 13:33:06 UTC 2023 up 323 days, 11:01, 0 users, load averages: 1.19, 1.22, 1.20

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

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