![]() |
|
|
#12 | |
|
Nov 2003
746010 Posts |
Quote:
Hi, I just got the code. I will look at it ASAP. You seem to have implemented some kind of bucket sieve. However, I need to look closely at what you did. I tried a bucket sieve before and it was ineffective. I believe your claims of speed improvement. If it truly reduces sieve time by 2/3, then I can turn to optimizing some other things that were not worth doing before. Thanks for the help. If you have any further comments on the code, let me know. I suspect that the code that does the resieving will need to be modified in a different way from the primary sieve. Instead of adding a logarithm to sieve[d][c], it instead checks to see if (sieve[d][c] == GOOD) then stores the prime, along with d and c. This storage does not happen too often as most points are not successful candidates. However, I expect that fetching sieve[d][c] to see if it is GOOD (i.e. a potential candidate) is causing cache misses. |
|
|
|
|
|
|
#13 | |
|
Aug 2004
8216 Posts |
Quote:
[I have had a go at your example with my siever, but there are a few problems, e.g. I haven't tried it with such a large factor base before, and my code only allows special q primes for the non-linear polynomial at the moment, so it's not been a very successful test so far.] Chris |
|
|
|
|
|
|
#14 | |
|
Nov 2003
22×5×373 Posts |
Quote:
I chose to do special q's for the linear polynomial, because for most factorizations the linear norm is larger. BTW, George Woltman got my code, got it running, and modified it in less than 2 days. Kudos to George!! I was astonished at how fast he did this! |
|
|
|
|
|
|
#15 | |
|
P90 years forever!
Aug 2002
Yeehaw, FL
2·53·71 Posts |
Quote:
The bucket sorting of vectors worked for dense smaller primes but not for the larger primes. The good news is we can make these larger primes cache-friendly too. I allocate 128MB to hold the pending sieve updates. As I accumulate these I sort every 256KB while it is still in the L2 cache. When were done accumulating, we reread the 128MB from the beginning of each sorted chunk to insure that we update the sieve array in a cache-friendly way. The improvements are significant. Source code is available for those that want to try something similar with their programs. |
|
|
|
|
|
|
#16 | |
|
Banned
"Luigi"
Aug 2002
Team Italia
10010110011112 Posts |
Quote:
Thank you Luigi |
|
|
|
|
|
|
#17 |
|
"Robert Gerbicz"
Oct 2005
Hungary
5CC16 Posts |
Mr. Silverman can you send me the old and the new code, only the sieving part. To
robert ( DOT ) gerbicz ( AT ) gmail ( DOT ) com Can you post some timings for the new code ( if it is possible for the same input numbers) ? To see exactly what has been done Mr. Woltman and what is in while loop, I can't figure out. And also to speed up the code if I can, not very probable, but say. For an average p prime there are about area/p sieve updates, is it correct? Last fiddled with by R. Gerbicz on 2006-01-12 at 23:02 |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I'm getting an error when yafu wants to start lattice sieving | Hailstone | YAFU | 30 | 2018-05-23 19:33 |
| Lattice Sieving Parameters | paul0 | Factoring | 6 | 2015-11-20 21:12 |
| Lattice Sieving - where do I start? | paul0 | Factoring | 3 | 2015-03-09 13:54 |
| Line sieving vs. lattice sieving | JHansen | NFSNET Discussion | 9 | 2010-06-09 19:25 |
| A question on lattice sieving | joral | Factoring | 5 | 2008-04-03 08:01 |