mersenneforum.org  

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

Reply
 
Thread Tools
Old 2022-03-13, 12:59   #23
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018

71 Posts
Default

In case anyone did not see this thread, @Prime95 updated the PrimeNet API to return 1.3 instead of 2 for the ll_tests_saved_if_factor_found parameter of P-1 assignments. This unfortunately broke our PrimeNet script, as it uses a regular expression to parse the assignment lines, which was expecting an integer. However, I just pushed a simple update to fix it. See here for the full changes.

Anyone who is using our PrimeNet script to get P-1 assignments (worktype 4) will need to update as soon as possible. The PrimeNet script ignores lines in the worktodo file that it cannot parse, so this issue will cause it to get a new assignment for every run/worker every 6 hours by default...

Linux users could just run this from their mlucas_v20.1.1 directory to update:
Code:
killall python3
rm primenet.py
wget https://raw.github.com/tdulcet/Distributed-Computing-Scripts/master/primenet.py -nv
@ewmayer - This may cause problems for Mlucas as well, as from looking at your code, it is expecting an unsigned integer.
tdulcet is offline   Reply With Quote
Old 2022-03-13, 14:02   #24
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

33·263 Posts
Default

Indeed. Only 3 tests_saved values are supported; 0, 1, 2.
In Mlucas.c, dated 2021-10-18, starting line 561, following fragment assumes the PRP worktodo line will contain tests_saved value 0, 1, or 2 only;
Code:
            tests_saved = strtoul(++char_addr, (char**)NULL, 10);
            if(tests_saved > 2) {
                sprintf(cbuf, "ERROR: the specified tests_saved field [%u] should be 0,1 or 2!\n",tests_saved); fprintf(stderr,"%s",cbuf);
line 377, types as uint32 and initializes, tests_saved = 0

starting line 580, splitting nonzero tests_saved assignment to separate P-1 and PRP will fail because it assumes tests_saved occupies a single character, not 3 as in "1.3" or "0.9" or "1.1" or 4 as in "1.05";
Code:
                // Copy up to the final (tests_saved) char of the assignment into cstr and append tests_saved = 0;
                // A properly formatted tests_saved field is 1 char wide and begins at the current value of char_addr:
                i = char_addr - in_line; strncpy(cstr,in_line, i); cstr[i] = '0'; cstr[i+1] = '\0';
                // Append the rest of the original assignment. If original lacked a linefeed, add one to the edited copy:
                strcat(cstr,in_line + (i + 1));
                if(cstr[strlen(cstr)-1] != '\n') {
                    strcat(cstr,"\n");
                }
kriesel is online now   Reply With Quote
Old 2022-03-13, 22:56   #25
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

2×32×653 Posts
Default

@tdulcet: I saw the thread in question and had a look at what happens with such fractional-test-saved assignment. Long story short - there should be no problem for Mlucas users.

Step-through debug of George's example Pfactor assignment did, however, turn up a bug in the parsing code for that assignment type, which leads to nonsense values for the TF_BITS and tests_saved variables. For instance for the example assignment

PFactor=9A0F34B929B282C41C75682C9496D92B,1,2,109343671,-1,76,1.3

after the k,b,n,c data quartet - '1,2,109343671,-1' here - used to encode the modulus as k*b^n+c is (correctly) processed, instead of the char* used as a placeholder for where-to-resume-parsing advancing to the ',76', it gets reset to the '=9A0F...'. That results in both TF_BITS and tests_saved getting assigned the largest parseable decimal-int following the '=', which is 9 in this case. Again not an issue since the ensuing p-1 bounds-setting currently ignores those values, but fixed in my dev-branch version of the code, obviously.

I also tried swapping the leading '9' in the above AID from the left to right end, yielding A0F34B929B282C41C75682C9496D92B9, to see what happens when the first char after the '=' is not a decimal integer, that causes TF_BITS and tests_saved to retain their default init values of 0, again not a problem.

Ken's code-snips which check that tests_saved <= 2 are for PRP-assignment parsing, which are not being changed to support such fractional values, at least as yet. But just to see what would happen with the current v20.1.1 release were such to occur, I modified the assignment type in the above example from PFactor to PRP:

PRP=A0F34B929B282C41C75682C9496D92B9,1,2,109343671,-1,76,1.3

The parsing code again ignored the '.3' fractional part, yielding tests_saved = 1 and the original assignment was overwritten by the following split form:

Pminus1=A0F34B929B282C41C75682C9496D92B9,1,2,109343671,-1,1200000,0
PRP=A0F34B929B282C41C75682C9496D92B9,1,2,109343671,-1,76,0.3

That is still potentially problematic, since the split-off PRP assignment gets set not to the intended 0, but to 0 followed by the unmodified .3 fraction from the original 1.3. But, once the p-1 assignment completes, assuming no factor is found, we move on the PRP assignment, and now the same parsing code again ignores the .3, yielding tests_saved = 0 and proceeding to the PRP test. For PRP assignments, the only problematic tests_saved values would be ones >= 3, with or without a nonzero fractional part.

If anyone does encounter any crash or untowardness-in-practice resulting from such fractional test-saved values, please post details here, as usual.
ewmayer is offline   Reply With Quote
Old 2022-03-20, 19:29   #26
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

2·32·653 Posts
Default

Small patch uploaded - The bug only manifests for users doing PRP tests and who have set CheckInterval = 1000, the minimal allowable value, in their mlucas.ini file. (Such a low value is not generally recommended since on all but the slowest systems it wastes 1-2% runtime doing excessively frequent savefile writes.)

As always, post #1 in this thread has updated MD5 value for the release tarball, and the README linked there has details about the issue addressed.
ewmayer is offline   Reply With Quote
Old 2022-03-29, 19:18   #27
christian_
 
christian_'s Avatar
 
Jan 2016
Mighty Black Stump

17 Posts
Default

Hey, I just finished a PRP on 113091931. For whatever reason, my primenet.py has stopped working so I have had to upload the result manually. Do I need to upload a proof file anywhere? Sorry if I am mistaken somehow.
christian_ is offline   Reply With Quote
Old 2022-03-29, 19:57   #28
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

33×263 Posts
Default

Quote:
Originally Posted by christian_ View Post
Do I need to upload a proof file anywhere?
Mlucas proof file generation has not been released yet, AFAIK, so, no, not if it was an Mlucas PRP result. A PRPDC will be necessary someday.
kriesel is online now   Reply With Quote
Old 2022-07-12, 22:57   #29
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

2×32×653 Posts
Default

Small patch which fixes an infrequent (but run-killing when it occurs) issue with multithreaded runs of p-1 stage 2.

As always, post #1 in this thread has updated MD5 value for the release tarball, and the README linked there has details about the issue addressed, and download links.
ewmayer is offline   Reply With Quote
Old 2022-07-13, 10:54   #30
tdulcet
 
tdulcet's Avatar
 
"Teal Dulcet"
Jun 2018

71 Posts
Default

Quote:
Originally Posted by ewmayer View Post
Those of you using tdulcet's mlucas.sh install script will want to grab the latest version, but check the SUM-field value and if it differs from the one (8d8851f5e383d8a74cf067192474256a) for the current-download of v20.1.1, manually change it to the md5 checksum listed for the latter at the README.
I just pushed the new md5sum to my repository. See here for the change.
tdulcet is offline   Reply With Quote
Old 2022-08-26, 09:10   #31
kriesel
 
kriesel's Avatar
 
"TF79LL86GIMPS96gpu17"
Mar 2017
US midwest

11011101111012 Posts
Default

Quote:
Originally Posted by christian_ View Post
Hey, I just finished a PRP on 113091931.
Result was confirmed via gpuowl PRP DC & proof gen & CERT.
kriesel is online now   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mlucas v20.1 available ewmayer Mlucas 7 2021-09-19 17:39
Mlucas v20 available ewmayer Mlucas 9 2021-09-02 20:36
Mlucas v19.1 available ewmayer Mlucas 46 2021-07-06 19:40
Mlucas v19 available ewmayer Mlucas 89 2021-02-01 20:37
mlucas on sun delta_t Mlucas 14 2007-10-04 05:45

All times are UTC. The time now is 01:05.


Wed Nov 30 01:06:00 UTC 2022 up 103 days, 22:34, 0 users, load averages: 0.70, 0.78, 0.82

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, 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.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔