mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   kriesel (https://www.mersenneforum.org/forumdisplay.php?f=154)
-   -   Reference material discussion thread (https://www.mersenneforum.org/showthread.php?t=23383)

nomead 2019-05-20 02:59

About the manual assignment progress reports. Different programs have wildly different progress logs. Example from Mlucas:

[C][May 20 03:38:41] M50346019 Iter# = 24280000 [48.23% complete] clocks = 00:26:42.587 [160.2587 msec/iter] Res64: 54912F2731A45A41. AvgMaxErr = 0.042192089. MaxErr = 0.062500000. Residue shift count = 12144693.
[/C]
But minimum common requirements should be current iteration count and Res64/shift so that interim residues could be stored, if needed.

I propose that instead of having the manual results submission form decipher many different log formats, there should be a simple common format, and let the client submission script do the conversion to that.

kriesel 2019-05-21 02:20

[QUOTE=nomead;517219]About the manual assignment progress reports. Different programs have wildly different progress logs. Example from Mlucas:

[C][May 20 03:38:41] M50346019 Iter# = 24280000 [48.23% complete] clocks = 00:26:42.587 [160.2587 msec/iter] Res64: 54912F2731A45A41. AvgMaxErr = 0.042192089. MaxErr = 0.062500000. Residue shift count = 12144693.
[/C]
But minimum common requirements should be current iteration count and Res64/shift so that interim residues could be stored, if needed.

I propose that instead of having the manual results submission form decipher many different log formats, there should be a simple common format, and let the client submission script do the conversion to that.[/QUOTE]
I'm not concerned about Mlucas format, because the word is Madpoo and EWMayer were working together on implementation of the Primenet API in Mlucas v19, in development now. Mlucas is a cpu application, which is what the Primenet API was designed for and implemented for on the server and in prime95 & mprime.

I requested only CUDALucas progress reporting support, initially.

But what client submission script? Some gpu applications lack any client submission script, so all work reservation and submission is manual. Manual progress updates will be done only as needed in that use case. CUDALucas, for example, and CUDAPm1, have no client submission scripts. (Also many earlier versions of gpuowl, but there are so many log styles in gpuowl versus version, and many different gpuowl versions are fastest depending on the exponent / fft length, so I think supporting all the older useful versions of gpuowl progress reporting by the manual submission page is too much to ask.)

nomead 2019-05-21 04:08

[QUOTE=kriesel;517312]I'm not concerned about Mlucas format, because the word is Madpoo and EWMayer were working together on implementation of the Primenet API in Mlucas v19, in development now. [/QUOTE]
And it currently uses a Python script adapted from mfloop.py, works well enough but of course doesn't handle progress reports.

[QUOTE] But what client submission script? [/QUOTE]
For CUDALucas / clLucas, there's llloop.py included in [URL="https://github.com/MarkRose/primetools"]primetools[/URL] - haven't tested it though, since I put about 99% of GPU effort into factoring now. But it shouldn't be that hard to adapt to other GPU LL / PRP applications.

[QUOTE](Also many earlier versions of gpuowl, but there are so many log styles in gpuowl versus version, and many different gpuowl versions are fastest depending on the exponent / fft length, so I think supporting all the older useful versions of gpuowl progress reporting by the manual submission page is too much to ask.)[/QUOTE]

Pretty much what my point was, choose some simple common format and then stick to it. So if the client output format changes, adapt the script, not the submission page. Like worktodo.txt - easy to parse and it's been around long enough that pretty much everything should support it directly. mfaktc seems to be pretty flexible with its output even now, but I see that as less of a problem anyway. I mean, how many people do GPU trial factoring work that takes so long, that expiration without progress reports could be a problem?

kriesel 2019-05-21 17:17

[QUOTE=nomead;517325]
For CUDALucas / clLucas, there's llloop.py included in [URL="https://github.com/MarkRose/primetools"]primetools[/URL] - haven't tested it though, since I put about 99% of GPU effort into factoring now. But it shouldn't be that hard to adapt to other GPU LL / PRP applications.[/QUOTE]I contacted the author some time ago; essentially no one used lloop.py and it was abandoned years ago. And it does not do progress reports.

[QUOTE]how many people do GPU trial factoring work that takes so long, that expiration without progress reports could be a problem?[/QUOTE]Agreed. And why I emphasized gpu primality test progress reporting, not P-1 or TF. Weeks-long TF or P-1 assignments are possible but not common.

A possible benefit of CUDALucas or cllucas progress reporting, that is not very relevant to the other gpu applications, is early detection of pathological runs that are producing all 0x0 or 0x02 or 0xfffffff800000000 interim res64, with potential savings of days or weeks of wasted run time. Some users don't recognize those as an issue, but if they could be persuaded to do interim progress reports, the server might educate them!
Mainly though, manual progress reporting is about preventing expiration of computations that are progressing, and reducing the chafing of other users who see no indicated progress at server reports and imagine wrongly that means no progress is occurring.

kriesel 2019-07-13 14:47

Background
 
The purpose of this post is to describe a shared foundation. Posting claims counter to what's here may indicate someone is an unaware novice, or is a troll. (Once I'm done weeding out my errors, with some help from others, that is.) This necessarily covers some points and leaves out much other material; whole books have been written about individual aspects, such as factorization. It's probably a good idea to read [URL]https://www.mersenne.org/various/math.php[/URL] and then maybe return and resume here. [LIST=1][*]"Natural numbers" are the counting numbers 1, 2, 3, ... [URL]https://en.wikipedia.org/wiki/Natural_number[/URL][*]Expression of math operations here follow usual conventions and so are indicated as follows: addition +, subtraction -, division /, multiplication * or implied (as in the expression 2 k p = 2 * k * p), exponentiation of a to the b power a[SUP]b[/SUP], square root sqrt(), modulo a mod b, equal =, less than or equal <=.[*]I use here n, a, b, f or k for natural numbers that may be composite or prime, but p for primes. Occasionally a hopefully helpful subscript is attached.[*]Natural numbers are either prime (having no natural numbers greater than one but smaller than themselves as exact integer divisors), or composite with factor(s) greater than one and less than the composite number. Five is an example of a prime. Six is an example of a composite: 6 = 2 * 3.[*]Finding and verifying a single nontrivial factor (a natural number 1 < f < n) of a natural number n proves it is composite, not prime. By definition. [URL]https://en.wikipedia.org/wiki/Prime_number[/URL][*]One is not considered a prime, but a more special case.[*]Smallest possible factor candidates are more likely to be factors than larger candidates. Two divides half the natural numbers, 3 a third, 5 1/5, f 1/f. So it's more efficient to search for factors with the smallest potential factors first.[*]The largest possible smallest prime factor of a natural number is, the largest natural number no greater than the square root of the number. f[SUB]max[/SUB] <= sqrt(n)[*]To search for factors of a number, it's sufficient to check only the primes below the square root of the number. Composite numbers can be skipped as potential factors, since their prime factors will divide any number they would, and some the composites won't. For example, 4 = 2 * 2, 6 = 2 * 3, 2 divides 14, 3 divides 15, but 4 or 6 divide neither. Thirteen is prime and it is sufficient to trial factor it with 2 and 3, since sqrt(13) ~3.6055 and the next prime, 5, exceeds 13's square root.[*]Mersenne numbers are a small subset of the natural numbers, having the form of a simple function M(n) = 2[SUP]n[/SUP] - 1 where n is a natural number greater than 1.[*]Given a factor a of a number n = a b, the cofactor of a is b = n / a. (definition copied from [URL]http://mathworld.wolfram.com/Cofactor.html[/URL])[*]Any Mersenne number with a composite exponent n is composite; cannot be a prime. See [URL]https://www.mersenneforum.org/showpost.php?p=512813&postcount=4[/URL][*]Mersenne primes are a small subset of the set of Mersenne numbers with prime exponents.[*]Any factors of Mersenne numbers with prime exponents are of the form f = 2 k p + 1, where p is the prime exponent, and k is a natural number.[*]Numbers 2 k p + 1 can only be factors of Mersenne numbers with prime exponent if 2 k p + 1 = either 1 or 7, mod 8.[*]Multiple methods of computerized factoring are employed for Mersenne numbers. Which are worthwhile, and the extent or level of effort to which they are worthwhile, depend on the size of the exponent, the efficiency of algorithm and implementation, and characteristics of the hardware involved.[*]For some additional background, see [URL]https://www.mersenne.org/various/math.php[/URL] regarding trial factoring, P-1 factoring, and the Lucas Lehmer test, [URL]https://www.mersenneforum.org/showpost.php?p=514417&postcount=9[/URL] regarding probable prime testing and the Gerbicz error check, and [URL]https://magazine.odroid.com/article/prime-number-discovery-use-odroid-c2-make-mathematical-history/[/URL] for an excellent backgrounder including FFT based multiplication of very large numbers[*]Large amounts of effort have been invested in developing and optimizing factoring and primality testing code relevant to Mersenne numbers for Intel cpus, nonIntel cpus, and gpus from NVIDIA, AMD and also trial factoring on Intel integrated graphics processors. There is summary info about these at [URL]http://www.mersenneforum.org/showpost.php?p=488291&postcount=2[/URL][*]Trial division is one factorization method. Much more about it is available at [URL]https://www.mersenneforum.org/showpost.php?p=508523&postcount=6[/URL] and [URL]https://www.mersenneforum.org/showpost.php?p=505634&postcount=18[/URL] and elsewhere[*]For exponents much smaller than the current GIMPS search area, ECM (elliptic curve method) is also useful. But not at the current Great Internet Mersenne Prime Search (GIMPS) first-test or double-check wavefront of activity.[*]P-1 factoring is another useful method, including at currently active and higher exponents. See also [URL="https://en.wikipedia.org/wiki/Pollard%27s_p_%E2%88%92_1_algorithm"]https://en.wikipedia.org/wiki/Pollard%27s_p_%E2%88%92_1_algorithm[/URL] and [URL]https://www.mersenneforum.org/showpost.php?p=501984&postcount=17[/URL][*]Eventually, factorization attempts produce diminishing returns, declining to the point where it is more efficient to run either a conclusive primality test (Lucas-Lehmer test), or a quite reliable probable-prime test (PRP3) that can prove a number composite but cannot prove it prime. See also [URL]https://www.mersenneforum.org/showpost.php?p=488897&postcount=12[/URL][*]In such lengthy computations, errors will sometimes occur. For error rates see [URL]https://www.mersenneforum.org/showpost.php?p=509283&postcount=19[/URL][*]The programs contain various error checks that are performed during the computation. These often allow retreating to the point before an error was detected and attempting that portion of the computation again, which can save the lengthy computation if the error is not reproducible.[*]Some applications report the final error counts with the result. Results with counts of detected errors that may be serious concerning result accuracy can be scheduled for early checking.[*]Primality tests are done at least twice, to catch the approximately 2 percent chance of incorrect result per test, with certain precautions taken to ensure results are arrived at independently. The final result of a test mod 2[SUP]64[/SUP] (called 64-bit residue or res64) is reported to the primenet server. In the case of mismatches for the same exponent and primality test type, additional runs are made until matches are obtained. A coordinated effort to follow up on mismatches is at [URL]https://www.mersenneforum.org/showthread.php?t=24148[/URL][*]Much more on error types and handling is available at [URL]https://www.mersenneforum.org/showthread.php?t=24136[/URL][/LIST]Some additional reading that may be of use at some point includes:
"A Friendly Introduction to Number Theory", Joseph H. Silverman, [URL]https://www.math.brown.edu/~jhs/frint.html[/URL]
The Prime Pages [URL]https://primes.utm.edu/[/URL]
Knuth's Algorithms, Donald Knuth
Prime Numbers and Computer Methods for Factorization, Hans Riesel
Number Theory Web [URL]http://www.numbertheory.org/ntw/[/URL]
"Prime Numbers: A Computational Perspective", Crandall and Pomerance
"Humble Pi", Matt Parker
"The C Programming Language", Kernighan and Ritchie [URL]https://en.wikipedia.org/wiki/The_C_Programming_Language[/URL]

(Thanks to Batalov, Dylan14, and LaurV for contributing to the accuracy and readability of this post.)

kriesel 2019-07-14 15:11

[QUOTE=Batalov;521567]Sorry, no, not better. Now this post looks like a tumor. Volume keeps growing, information content stays constant.

To quote from Linda Richman, "A little basic background" is neither little nor basic. "Talk amongst yourselves. I am feeling varklempt" (...after reading just 1/3 of it).

Sticking to the same question as before (and just that, for brevity): "current item #14" still says "For example, 2[SUP]6[/SUP] - 1 = (2[SUP]2[/SUP]-1)[SUP]2[/SUP] 2[SUP]3[/SUP]-1." Which neither explains the point, nor is (ahem) correct.

(2[SUP]2[/SUP]-1)[SUP]2[/SUP] 2[SUP]3[/SUP]-1 = 71, not 63.[/QUOTE]
I began writing this is an attempt to go from beginning definitions to a rudimentary basis for understanding or a bit more, with links forward, both for sincere newbies, and as a place to point nonsensical trolls and perhaps save time correcting or countering them. (Trolls can be initially amusing but quickly become tiresome.)

I'm open to constructive suggestions for the title, organization, and content.
Re [URL]https://www.mersenneforum.org/showpost.php?p=521532&postcount=2[/URL], I saw M6 != M(6) and previously missed the missing parentheses, since added. (In the usual notation, M6=2[SUP]17[/SUP]-1; for other readers, [URL]https://www.mersenne.org/primes/[/URL])

Dylan14 2019-07-14 15:54

A few suggestions:
For 5. it should be that a single nontrivial factor of a natural number proves the number composite (meaning a number other than 1 or the number itself).
For 20. link to the full list of programs (which is [url]https://www.mersenneforum.org/showpost.php?p=488291&postcount=2[/url]).
And finally, perhaps after 28., we should note that some tests need to be done 3 times (or more) due to mismatches, and that there is a dedicated effort to handle these ([url]https://www.mersenneforum.org/showthread.php?t=24148[/url]).

kriesel 2019-07-14 18:26

[QUOTE=LaurV;521611]You do not need to write 2kp+1 with spaces. My joke related to the "operation of k" was to say that you need to be constant in notation, and do not use "x" for multiplication, but it was not my intention to say that writing 2kp with no spaces is wrong. :blush:[/QUOTE]
No worries. Your post led me to more generally reviewing conventions used, and state them, and getting rid of some ambiguities and inconsistencies along with making it I think more readable in spots. For example I had used f2 when meaning f[SUB]2[/SUB] not f times 2.
Thanks also to Dylan14.

Batalov 2019-07-14 20:56

Parentheses are important but that is only the first problem that comes up with that explanation.

[QUOTE=kriesel;521531]For example, 2[SUP]6[/SUP] - 1 = 2[SUP](2*3)[/SUP] - 1 = (2[SUP]2[/SUP]-1)[SUP]2[/SUP] (2[SUP]3[/SUP]-1)[/QUOTE]
No. That's not algebra, that's like explaining that "this chemical reaction works because of... alchemistry!"
"Abracadabra, 63 = 3 * 3 * 7 = {and because of that} = (2[SUP]2[/SUP]-1)[SUP]2[/SUP] (2[SUP]3[/SUP]-1)"

No, the "3"s here are not (2[SUP]2[/SUP]-1)[SUP]2[/SUP]. they are (2+1)(2[SUP]2[/SUP]-2[SUP]1[/SUP]+1)

Straightforward explanation:
2[SUP]6[/SUP] - 1 = (2[SUP]3[/SUP])[SUP]2[/SUP] - 1 = (2[SUP]3[/SUP]+1)(2[SUP]3[/SUP]-1), because this is a x[SUP]2[/SUP] - 1 and you learned this at school.
Or
2[SUP]6[/SUP] - 1 = (2[SUP]2[/SUP])[SUP]3[/SUP] - 1 = (2[SUP]2[/SUP]-1)(2[SUP]4[/SUP]+2[SUP]2[/SUP]+1), because this is a x[SUP]3[/SUP] - 1 and you learned this at school or you learned this now. Take a piece of paper, open the parentheses, and observe how everything cancels.
That is sufficient. If you want to get fancy, you can continue and say, "but there is more,
(2[SUP]3[/SUP]+1) = (2+1)(2[SUP]2[/SUP]-2[SUP]1[/SUP]+1) and [B]that [/B]equals 3 *3 "

[QUOTE=kriesel;521531]...and 2[SUP]15[/SUP]-1 = 2[SUP](3*5)[/SUP] - 1 = 32767 = 7 * 31 * 151 = (2[SUP]3[/SUP] - 1) (2[SUP]5[/SUP] - 1) 151.[/QUOTE]
Same thing. Because there is no explanation what 151 is, there is no coherent story just "this is so, because I said so".

Instead:
2[SUP]15[/SUP] - 1 = (2[SUP]5[/SUP])[SUP]3[/SUP] - 1 = (2[SUP]5[/SUP]-1)(2[SUP]10[/SUP]+2[SUP]5[/SUP]+1)
Or
2[SUP]15[/SUP] - 1 = (2[SUP]3[/SUP])[SUP]5[/SUP] - 1 = (2[SUP]3[/SUP]-1)(2[SUP]12[/SUP]+2[SUP]9[/SUP]+2[SUP]6[/SUP]+2[SUP]3[/SUP]+1)
What's more for every 2[SUP](r*s)[/SUP] - 1 (with s>1), have a look at how the above factorization repeats every time: [url]https://primes.utm.edu/notes/proofs/Theorem2.html[/url]

And finally, there is a much better way. Just say - "you will benefit from reading this ( [url]https://www.mersenne.org/various/math.php[/url] ). Ask questions if you will have them."
P95's webpage is coherent, brief and convincing, and has links to more detailed explanations. Yours leaves the reader more confused that they were when they started reading it.

Dr Sardonicus 2019-07-15 12:57

Composite exponents
 
As is well known,

(x[sup]n[/sup] - 1) /(x - 1) = x[sup]n-1[/sup] + x[sup]n-2[/sup] + ... + 1.

Now let a > 1 and b > 1 be integers. We apply the above formula to x[sup]ab[/sup] - 1. If we substitute x[sup]a[/sup] for x and b for n, we obtain

(x[sup]ab[/sup] - 1)/(x[sup]a[/sup] - 1) = x[sup]ab - a[/sup] + x[sup]ab-2a[/sup] + ... + 1.

Similarly, substituting x^b for x and a for n,

(x[sup]ab[/sup] - 1)/(x[sup]b[/sup] - 1) = x[sup]ab - b[/sup] + x[sup]ab-2b[/sup] + ... + 1.

The [i]ne plus ultra[/i] of this is the "cyclotomic factorization" corresponding to the factorization into cyclotomic polynomials

[tex]x^{n}\; -\; 1\; =\; \prod_{d\mid n}\Phi_{d}(x)\text{.}[/tex]

Examples of its application may be found in this Forum, e.g. [url=https://www.mersenneforum.org/showpost.php?p=486009&postcount=13]here[/url]

For more on the application of cyclotomic polynomials to integer factorization I suggest [url=https://www.maths.lancs.ac.uk/~jameson/cyp.pdf]this paper[/url].

hansl 2019-07-15 17:55

From new participant reference:
[QUOTE=kriesel;521664]
Mersenneforum.org covers many different ways of aiding the GIMPS progress, through trial factoring, P-1 factoring, Lucas-Lehmer testing, probable-prime testing, double checking, etc. of Mersenne numbers, 2p-1.[/QUOTE]

Needs a superscript: 2[sup]p[/sup]-1
[code]2[b][[/b]sup[b]][/b]p[b][[/b]/sup[b]][/b]-1[/code]


All times are UTC. The time now is 18:58.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.