mersenneforum.org Formulas for calculating GHz-days credit
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

2008-11-08, 20:16   #1
James Heinrich

"James Heinrich"
May 2004
ex-Northern Ontario

55 Posts
Formulas for calculating GHz-days credit

I noticed that my previous formulas for calculating P90-years credit for various assignment types has become outdated -- a simple scaling by 5.075 from my PII-400 formulas is loosely correct, but still fairly far off the current credit that PrimeNet is giving.

Can someone enlighten me with correct formulas for calculating GHz-Days credit for the various work types (LL, TF, P-1, ECM)?

My current (PHP) code for calculating TF credit is derived from commonc.c and looks like this:
Code:
	// If factoring, guess how long that will take.  Timings are based on
// the factoring benchmark for my 2 GHz P4.
//	Best time for 58 bit trial factors: 15.065 ms.
//	Best time for 59 bit trial factors: 15.123 ms.
//	Best time for 60 bit trial factors: 15.021 ms.
//	Best time for 61 bit trial factors: 15.080 ms.
//	Best time for 62 bit trial factors: 16.127 ms.
//	Best time for 63 bit trial factors: 16.143 ms.
//	Best time for 64 bit trial factors: 20.230 ms.
//	Best time for 65 bit trial factors: 20.212 ms.
//	Best time for 66 bit trial factors: 20.244 ms.
//	Best time for 67 bit trial factors: 20.205 ms.
// Factoring M35000011 from 2^60 to 2^61 takes 513 seconds.  Solve for
// constant C in this formula:  15.1 ms * 2^61 * C = 513 seconds
//	C = 513 sec / 2^61 / 15.1 ms
//	C = 513000 ms / 2^61 / 15.1 ms = 33974 / 2^61
// Our estimate for factoring Mp to 2^i is then:
//	time_in_ms = benchmark_in_ms * 2^i * C * (35,000,011 / p)
// Which simplifies to:
//	time_in_seconds = benchmark_in_ms * 2^(i-48) * 145000 / p

if ($limit >= 64) { // 64+$benchmarktime = 20.223;
} elseif ($limit >= 62) { // 62-63$benchmarktime = 16.135;
} else {                  // 58-61
$benchmarktime = 15.072; } // time_in_seconds = benchmark_in_ms * 2^(i-48) * 145000 / p // (seconds on a 2.0GHz benchmark machine)$time_in_seconds = $benchmarktime * pow(2,$limit - 48) * 145000 / $exponent;$magic_number_I_dont_understand = 2.381; // for reasons I don't understand, my numbers are off by a factor of 2.381
return GHzDays2P90years($time_in_seconds / (86400 / 2.0)) /$magic_number_I_dont_understand;
I have a magic number in there (2.381) that I have no idea where it comes from. I just noticed that all my calculations were off by the same ratio, and with that correction in there I come up with the same numbers that Primenet does... usually. For example:
Quote:
 Sending result to server: M269571271 no factor from 2^58 to 2^61, Wd4: 1B4A01E5 PrimeNet success code with additional info: CPU credit is 0.00099707508074924 GHz-days.
Note this is from 58-61 -- I get the nearly-identical value of 0.00096850645639275 if I calulate M269571271 from 59-61 (for 58-61 I get 0.0011299241991249).

What am I doing wrong?
What is the magical 2.381?
Why does PrimeNet 58-61 match my 59-61?

 2008-11-09, 08:59 #2 tmorrow     Jan 2004 1468 Posts I too am interested in the new V5 formulae for credit, in particular for Trial Factoring. On the new V5 server at the rate I'm going, I will eclipse my entire previous 5 years all time effort in 6 months. I've heard that the TF credit was undercredited on V4 server and is roughly 50% better on the V5 server. Your "magic number" might be the "found it" fudge factor applied when a factor is found. I know it doesn't answer your question but here's the old V4 TF formula for reference (obtained from an old post): Case 1: No factor found Let b=How far Mp was previously factored to in bits (before) Let a=How far you factored Mp to in bits (after) Let FC(p,b,a)=Factoring Credit in P90-years for trial factoring Mp=2^p-1 from b to a bits Define magic constants c_1 = 5.0000E-17 (used for factoring up to 62 bits) c_2 = 2.1725E-14 (used for factoring up to 63-64 bits) c_3 = 1.6310E-14 (used for factoring up to 65 bits and above) The factoring credit formula is then FC(p,b,a)=found_it_factor*Sum{c_i(2^a-2^b)}/p where there is 1, 2 or 3 terms to sum depending on where a,b fall in the bit range. Case 2: factor found Let f be the bit level where the factor was actually found: b
 2008-12-13, 19:45 #3 James Heinrich     "James Heinrich" May 2004 ex-Northern Ontario 55 Posts George kindly provided his code in this post (see further posts in that thread regarding modifications and bugfixes).
 2008-12-13, 22:55 #4 James Heinrich     "James Heinrich" May 2004 ex-Northern Ontario 55 Posts As a result of the provided formulae, I have made this page which should let you calculate applicable PrimeNet credit for any assignment. Let me know if I missed anything, or if something seems buggy: http://mersenne-aries.sili.net/credit.php
 2008-12-15, 21:05 #5 petrw1 1976 Toyota Corona years forever!     "Wayne" Nov 2006 Saskatchewan, Canada 2×2,213 Posts A simple Spreadsheet option for LL/DC This table shows, for the Low and High Exponent ranges, the Points Per Million Iterations. It covers the current LL/DC assignment ranges. It should be correct to at least 4 or 5 places after the decimal point. Code:  Low High PPMI 17550000 20050000 0.647222 20050000 24930000 0.811111 24930000 29690000 0.994444 29690000 34560000 1.183333 34560000 39500000 1.316666 39500000 49100000 1.736111
2008-12-15, 21:15   #6
petrw1
1976 Toyota Corona years forever!

"Wayne"
Nov 2006

2·2,213 Posts

Quote:
 Originally Posted by James Heinrich As a result of the provided formulae, I have made this page which should let you calculate applicable PrimeNet credit for any assignment. Let me know if I missed anything, or if something seems buggy: http://mersenne-aries.sili.net/credit.php
Cool!!!

Seems to be right on for P-1 and LL but for a TF(Factor found):
Quote:
 Trial Factoring on "102723617" with factor "242141490392365247":
Your table shows .0003 Ghz Days. I got .0001 in my Results.

P.S. Have you given any thought to also "estimating" how long the assignment should take given a few specifics about the PC?

Last fiddled with by petrw1 on 2008-12-15 at 21:20 Reason: P.S.

2008-12-16, 03:44   #7
James Heinrich

"James Heinrich"
May 2004
ex-Northern Ontario

55 Posts

Quote:
 Originally Posted by petrw1 Have you given any thought to also "estimating" how long the assignment should take given a few specifics about the PC?
It's something to put on my wishlist. Perhaps sometime I'll be inspired and come up with something workable.

As for the miscalculated TF credit, you're right -- thanks. I was miscalculating the value of a TF found factor. It has been fixed.

2008-12-16, 15:37   #8
petrw1
1976 Toyota Corona years forever!

"Wayne"
Nov 2006

114A16 Posts

Quote:
 Originally Posted by James Heinrich It's something to put on my wishlist. Perhaps sometime I'll be inspired and come up with something workable.
George had done this on the benchmark page on the v4 server for LL tests...maybe the code is available.

Quote:
 As for the miscalculated TF credit, you're right -- thanks. I was miscalculating the value of a TF found factor. It has been fixed.
Yes, thanks

 2008-12-18, 01:27 #9 James Heinrich     "James Heinrich" May 2004 ex-Northern Ontario 55 Posts One thing I just realized I don't have accounted for: How is PrimeNet credit given for Fermat ECM? (for example: "F23 completed 3 ECM curves, B1=250000, B2=25000000" == 4.1562GHz-days) I speculated that credit for ECM on (2^2^23+1) would be roughly equivalent to that for M8388608 (2^23), but based on my interpretation of George's code, I only get 3.72GHz-days, which is in the general range of the right number, but not really that close. Any suggestions for what the right formula might be?
 2008-12-18, 02:13 #10 Prime95 P90 years forever!     Aug 2002 Yeehaw, FL 11011111000102 Posts There are only half as many FFT lengths to choose from for 2^n+1 FFTs. So, if M8388608 used a 5*2^n or 7*2^n FFT length, then the Fermat FFT used a 6*2^n or 8*2^n FFT length.
2008-12-18, 03:15   #11
James Heinrich

"James Heinrich"
May 2004
ex-Northern Ontario

55 Posts

Quote:
 Originally Posted by Prime95 There are only half as many FFT lengths to choose from for 2^n+1 FFTs. So, if M8388608 used a 5*2^n or 7*2^n FFT length, then the Fermat FFT used a 6*2^n or 8*2^n FFT length.
Unfortunately I don't quite follow the math well enough to translate your answer into a modified version of credit_cpu_ECM, which looks like this for Mersenne ECM credit:
Code:
// ECM (whether factor found or not)
// timing / 86400 * curves * (13.0 * B1 + 0.06 * B2)
// Note: the user gets a slight cpu bonus when factor found in stage 1
function credit_cpu_ECM( $exponent,$fftlen, $curves_run,$B1, $B2 ) {$timing = credit_get_FFT_timing( $exponent,$fftlen );
return ( $timing *$curves_run * ( 13.0 * $B1 + 0.06 *$B2) / 86400.0 );
}
Can you share your PHP function for determining Fermat ECM credit, please?

 Similar Threads Thread Thread Starter Forum Replies Last Post columbus Information & Answers 49 2013-03-07 22:36 skan Miscellaneous Math 6 2012-12-14 12:56 alpertron Forum Feedback 4 2011-05-26 20:37 Unregistered Information & Answers 2 2011-01-14 17:19 Cyclamen Persicum Math 10 2003-03-29 07:08

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

Tue Oct 27 13:06:37 UTC 2020 up 47 days, 10:17, 0 users, load averages: 2.52, 2.86, 2.73