![]() |
|
|
#1 |
|
"Nathan"
Jul 2008
Maryland, USA
5×223 Posts |
I've read the description of the P-1 algorithm at http://www.mersenne.org/various/math.php, but there is no explanation of what the difference is between Stage 1 of P-1 and Stage 2 of P-1 that makes Stage 2 require so much more memory. My guess is that the same calculation is being performed in both stages, but there are many more primes to be included in the product E in Stage 2, and that the extra memory is used to hold these extra primes. I'm also guessing that the reason the save files for a P-1 double in size between Stages 1 and 2 is because of the (much) larger product that is being formed in Stage 2. Is that the right idea?
Also, in Stage 2, I've seen Prime95 display messages about processing "relative primes". What does this mean? Are these numbers that are relatively prime to one another? Typically, there is some number of relative primes - e.g. 480 - that are getting processed; are these selected out of the primes that lie between B1 and B2? And if so, how does Prime95 decide which primes get selected? Finally, I've heard of users with lots of RAM performing a "Brent-Suyama Extension" of P-1 with a value of E, where E is something like 6, 8, or 12. What exactly is this, and how much more does it increase the chances of P-1 finding a factor? How much RAM does one need before this extension becomes feasible? Enlightenment from the P-1 crowd is much appreciated!
|
|
|
|
|
|
#2 | |
|
"Forget I exist"
Jul 2009
Dartmouth NS
8,461 Posts |
Quote:
Last fiddled with by science_man_88 on 2011-02-20 at 13:13 |
|
|
|
|
|
|
#3 |
|
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
11×389 Posts |
I'm afraid I don't know too much myself, but this page has some more detail on P-1, including the best explanation of stage 2 I can find on the web (though I'm still not clear on why stage 2 needs lots of memory, if I were to work out an example using the math there, I'd probably see).
http://mersennewiki.org/index.php/P-...ization_Method Last fiddled with by TimSorbet on 2011-02-20 at 13:49 |
|
|
|
|
|
#4 | |||
|
"Richard B. Woods"
Aug 2002
Wisconsin USA
22×3×641 Posts |
Quote:
So, it's not so much a matter of Stage 2's requiring lots of memory as it is a matter of a classic space-time tradeoff that saves significant time if Stage 2 can allocate many work areas. Quote:
The number of work areas allocated limits the number of relative primes that can be processed in a single pass. For instance, for a certain allocation amount Stage 2 will process 40 relative primes (out of 480) in each of 12 passes. With slightly larger allocations it will process 41, 42, or 43 relative primes in each pass, but there will still be 12 passes (43 * 11 = 473, so a twelfth pass is required for the last 7 relative primes). If the allocation allows processing 44 relative primes in each pass, the number of required passes declines to 11 (44*10 + 40*1 = 480), which will be faster. Quote:
There's some formula for determining when the tradeoff (for increased probability of finding a factor) is worth the extra effort or not, but I can't find it handily right now. One could look at the source code (probably module ecm.c) to find it. :-) Last fiddled with by cheesehead on 2011-02-21 at 23:46 |
|||
|
|
|
|
|
#5 | |
|
Jun 2003
116910 Posts |
Quote:
See post #29 in this thread, and subsequent discussion. Last fiddled with by Mr. P-1 on 2011-02-22 at 00:22 |
|
|
|
|
|
|
#6 | |||||
|
Jun 2003
7×167 Posts |
Quote:
The save file is larger, not because the numbers are larger, but because you need to save more of them, including the current running value of the stage 2 product, the last term that was multiplied into it and the original result of stage 1. Quote:
Quote:
Quote:
Quote:
Last fiddled with by Mr. P-1 on 2011-02-22 at 00:23 |
|||||
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Two questions: | Dubslow | GPU Computing | 1 | 2011-08-05 18:22 |
| Questions about the QS | Carmichael | Factoring | 8 | 2007-04-10 11:30 |
| Questions | OmbooHankvald | Prime Sierpinski Project | 2 | 2005-08-01 20:18 |
| LLR questions | OmbooHankvald | Math | 6 | 2005-06-23 11:42 |
| A few questions :) | xtreme2k | Lounge | 59 | 2002-10-31 06:20 |