mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2018-02-21, 05:43   #12
S485122
 
S485122's Avatar
 
Sep 2006
Brussels, Belgium

35·7 Posts
Default

Quote:
Originally Posted by petrw1 View Post
So it seems a n efficient method to maximize factors and minimize work (ummm PC work...actually more manual labor) is to start with a relatively low B1 only...and increment it in steps to a desired maximum or until it finds a factor and only run B2 as a last step if necessary
This way of working would mean that Primenet should adapt it's way to award credit for P-1 factoring : the previous P-1 work should be deduced (even if done by another user.) This has been discussed before, or at least there is one example op a person who increased his P-1 standings by slowly increasing the bounds, just to prove the point. Of course the credits mean nothing, but if some work goes into computing them, it should be done as well as possible.
S485122 is offline   Reply With Quote
Old 2018-02-21, 07:57   #13
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

2×1,579 Posts
Default

Doing stage1 in increments has no advantage except when doing huge B1 values with GMPECM, then it is nice to have intermediate savefiles in case of a crash. Prime95 is doing its own savefiles along the way.
ATH is offline   Reply With Quote
Old 2018-02-21, 09:40   #14
axn
 
axn's Avatar
 
Jun 2003

10011110110102 Posts
Default

Quote:
Originally Posted by petrw1 View Post
So it seems a n efficient method to maximize factors and minimize work (ummm PC work...actually more manual labor) is to start with a relatively low B1 only...and increment it in steps to a desired maximum or until it finds a factor and only run B2 as a last step if necessary
This is an _inefficient_ method of doing things.

1) The way P95 does stage 1, incremental calculation uses a slower powering routine than starting from scratch.
2) Each B1 run will have a GCD calculation at the end -- this is not free.
3) Stage 2 is a relatively cheap way to find factors that simple minded stage 1 can't find. So you really want to run some stage 2 (say B1 * 20) after each B1.

Now, if you're planning to run super deep B1 (say you plan to run a 100 hr stage 1), then you can probably break it up into 2-3 stretches. This way, if you find a factor in between, the savings would be non-negligible (and your incremental probability of finding a factor would also be non-negligible). However, if you're doing shorter runs (few hours), then it would probably be not worth it.
axn is offline   Reply With Quote
Old 2018-02-21, 14:34   #15
lycorn
 
lycorn's Avatar
 
"GIMFS"
Sep 2002
Oeiras, Portugal

147310 Posts
Default

Quote:
Originally Posted by ATH View Post
(...) except when doing huge B1 values with GMPECM (...)
IIRC, GMPECM P-1 Stage 1 is much less efficient than Prime95´s. That´s a non-negligible weakness in the strategy of doing large P-1 runs using GMPECM. It would be nice to be able to run Stage 1 with Prime95 and then Stage 2 with GMPECM, like some of us do for ECM on small numbers, but I think that is still not possible.
lycorn is offline   Reply With Quote
Old 2018-02-21, 14:57   #16
Uncwilly
6809 > 6502
 
Uncwilly's Avatar
 
"""""""""""""""""""
Aug 2003
101×103 Posts

2·4,909 Posts
Default

Quote:
Originally Posted by axn View Post
Now, if you're planning to run super deep B1 (say you plan to run a 100 hr stage 1), then you can probably break it up into 2-3 stretches. This way, if you find a factor in between, the savings would be non-negligible (and your incremental probability of finding a factor would also be non-negligible). However, if you're doing shorter runs (few hours), then it would probably be not worth it.
People are doing P-1 on numbers in the 332,000,000 range. Would it be worthwhile for George to have Prime95 do this automatically? They run about 100 GHz/days per test.
Uncwilly is offline   Reply With Quote
Old 2018-02-21, 18:08   #17
axn
 
axn's Avatar
 
Jun 2003

117328 Posts
Default

Quote:
Originally Posted by Uncwilly View Post
People are doing P-1 on numbers in the 332,000,000 range. Would it be worthwhile for George to have Prime95 do this automatically? They run about 100 GHz/days per test.
Perhaps I didn't make myself quite clear. It is my fault, really. I started talking about "deep" B1, but used time instead of concrete B1 values to describe it. I was thinking of running high B1 (hundreds of millions to billions range) on small exponents (where LL is already done and/or some factors are known).

Regular GIMPS work will not benefit, as the B1 is not large enough to split. You want to do these stage 1s in a single stretch.
axn is offline   Reply With Quote
Old 2018-02-21, 20:43   #18
ATH
Einyen
 
ATH's Avatar
 
Dec 2003
Denmark

2·1,579 Posts
Default

Quote:
Originally Posted by lycorn View Post
IIRC, GMPECM P-1 Stage 1 is much less efficient than Prime95´s. That´s a non-negligible weakness in the strategy of doing large P-1 runs using GMPECM. It would be nice to be able to run Stage 1 with Prime95 and then Stage 2 with GMPECM, like some of us do for ECM on small numbers, but I think that is still not possible.
Yes, I know Prime95 is much faster, but I'm not only talking about Mersenne and Fermat numbers, but also general numbers like HP49 and EM52 where you cannot use Prime95.
ATH is offline   Reply With Quote
Old 2018-02-21, 22:07   #19
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

2·5·7·67 Posts
Default

My experience shows that prime95 P1 stage 1 only checks for factors at the end of the run.

So my thinking is that if for exponent "X" B1=100000 would find a factor then running B1 to the standard 500000 would waste time.

I was also assuming that 5 runs with B1=100000, ... 500000 would take the same elapsed time as 1 run to 500000.

It was also confirmed that B2 always runs from the start as I personally witnessed.

So If I ran stage 2 with each of the above stage 1 runs they would take progressively longer; much more than 1 B2 run at the end with the highest B2.
petrw1 is offline   Reply With Quote
Old 2018-02-22, 14:36   #20
lycorn
 
lycorn's Avatar
 
"GIMFS"
Sep 2002
Oeiras, Portugal

3×491 Posts
Default

Quote:
Originally Posted by ATH View Post
Yes, I know Prime95 is much faster, but I'm not only talking about Mersenne and Fermat numbers, but also general numbers like HP49 and EM52 where you cannot use Prime95.
Fair enough...
lycorn is offline   Reply With Quote
Old 2018-02-24, 10:10   #21
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

72·197 Posts
Default

Well... now, to put it plain, and satisfy my SIWOTI syndrome, stage 1 is not exactly incremental, and stage 2 is not exactly from scratch.

Say you have B1=25 and B2=100, what you will do, you need to compute the E=LCM of all numbers under 25, and compute b^E. That is, take all primes p lower than (or equal to) 25, with all their max powers x in such a way that p^x is not larger than 25, and make their product.

That is E= 2^4 * 3^2 * 5^2 * 7 * 11 * 13 * 17 * 19 * 23. Compute b^E, do GCD, that is your stage 1.

Stage 2 will take care of the primes between 26 and 100, one by one, or 2 by 2, or n by n, depending of your available memory.

To extend B1 to (say) 50, it is not enough to add the primes in between 26 and 50 to E. You need to do that, of course, like multiply E with 29, 31, 37, 41, 43, 47 (here is where the "incremental" part comes in, and yes, I know that you won't make products here, but do directly exponentiation of the formerly computed b^E, but that is beside the point). The new calculated E is not anymore the LCM of all numbers under 50, because that LCM contains a second power of 7 (49<50), a third power of 3 (27<50), a fifth power of 2 (32<50). So, if you do not include these in E, you may (in fact, you will) miss factors. So, extending B1 is "incremental, plus a little bit".

Now , if you do stage 2, you only need to repeat this from the new B1 upward, no matter if you extend B2 or not, but this is not exactly "from scratch" (which, in my mind, would be to make it from the former B1, as it was initially, hehe). In fact, if you used a lot of memory first time, and gulped a lot of primes in a single block, you may only need to repeat stage 2 from the second former block (which can be larger than the new B1).

Well... I don't want to go too deep here. Siwoti fixed...
LaurV is offline   Reply With Quote
Old 2018-02-24, 14:16   #22
petrw1
1976 Toyota Corona years forever!
 
petrw1's Avatar
 
"Wayne"
Nov 2006
Saskatchewan, Canada

2·5·7·67 Posts
Default

Laurv: I accept you understand the math behind this much better than I do.
I did some tests.
P1: 59M B1=1000000 B2=20000000
Slight increase in B1 only = minimal Stage 1 time and same Stage 2 time.
Slight increase in B2 only = no Stage 1 and slightly more Stage 2
petrw1 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Old Savefiles Not Getting Deleted Unregistered Software 5 2004-02-18 04:43

All times are UTC. The time now is 17:29.


Sun Aug 1 17:29:58 UTC 2021 up 9 days, 11:58, 0 users, load averages: 1.46, 1.39, 1.32

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.