On 20 Apr 00, at 7:47, David Campeau wrote:

> Seeing that not every time a stage 1 gcd will result in a factor found,
> are we not better to wait until the end of stage 2? This way, we could
> factor deeper.
> 
> Perhaps this could be yet another option?

Maybe I'm guilty here; the very first pre-pre-release didn't run the 
GCD after Stage 1 unless an "undocumented" option was set in 
prime.ini (Stage1GCD=1). I commented on this to George and he changed 
it. My reasoning was that early timings on exponents typical of 
"real" PrimeNet assignments seemed to suggest that it made sense to 
run the Stage1 GCD automatically.

There's also a slight edge in clarity from this approach. If you run 
a GCD at the end of each stage then you know where you are. If you 
run GCD only at the end of Stage 2 but then don't run Stage 2 because 
of memory constraints (which is effectively the default option, given 
DayMemory = NightMemory = 8 MBytes) you might as well not bother 
running Stage 1 either, since you won't find any factors that Stage 1 
uncovered until you eventually run the GCD.

There's another consideration, too, in so far that running Stage 2 is 
expensive in terms of memory resources; avoiding this complication 
tends to push the balance in favour of running the extra GCD.

However, there may be a case for changing the strategy - either just 
running one GCD when you're not going to go any further, or to 
(optionally) omit the Stage 1 GCD. This becomes more relevant as 
exponent sizes increase, as the stage run time appears to be (more or 
less) linearly related to both exponent size and B limit, whereas the 
run time of the GCD is independent of the B limit but increases very 
non-linearly with exponent size.

The cost/benefit of running the extra Stage 1 GCD is zero if GCD run 
time is equal to Stage 2 run time * probability of finding a factor 
in Stage 1. If the GCD runs more quickly than this, it's definitely 
worth running. The point is that running Stage 2 is a waste of time 
if you already have a factor in Stage 1 but you just haven't bothered 
to unearth it. If you're working with small exponents, it may be 
that, although the extra GCD is relatively cheap, it's still not 
worth running it because e.g. heavy trial factoring has made the 
chance of actually finding a factor in Stage 1 very low - i.e. in 
this case we're running Stage 1 only as a means of getting to Stage 
2.

It _may_ be sensible & cost effective to automate this decision (i.e. 
"guess" the probability of finding a factor in Stage 1 from the B1 
limit and the trial factoring depth, and estimate the GCD & Stage 2 
run times) & use that as the default option. In which case we should 
probably have manual override capability in _both_ directions.


Regards
Brian Beesley
_________________________________________________________________
Unsubscribe & list info -- http://www.scruz.net/~luke/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to