![]() |
easiest way to check if you found prime
I finished that GIMPS number today and started on my NPLB range, and it's brought up this question in my mind: What would be a good way to easily see if my LLR found a prime? It's just one core on my computer, so no worries about getting it from multiple files.
Maybe a program to monitor the result file? (referring to the one you name, but lresults.txt would work too, just in a different way) It only puts the primes in there, right? So if somebody has some script to see when it gets edited, that'd work. |
[quote=Mini-Geek;126961]I finished that GIMPS number today and started on my NPLB range, and it's brought up this question in my mind: What would be a good way to easily see if my LLR found a prime? It's just one core on my computer, so no worries about getting it from multiple files.
Maybe a program to monitor the result file? (referring to the one you name, but lresults.txt would work too, just in a different way) It only puts the primes in there, right? So if somebody has some script to see when it gets edited, that'd work.[/quote] The lresults.txt file logs everything--primes and non-primes. You have to either attach that to your post when you mark the range complete, or email the file to Gary, after you've finished the range, because it contains all the residuals. The file that you pick a name for only logs primes, and in the same format that the input file comes in. To check if you found a prime, open the file that you chose as an LLR output file, and if there's two or more lines in there (the first one is just the NewPGen header line, so you can ignore it), you've found some primes! (The lines listing actual primes are formatted like this: "k n".) As for an automated program to notify you when you've found a prime, I know LLRnet can be set up to execute a given shell script/batch file/program whenever it finds a prime, but manual LLR has no such function. However, it would be possible to write a program to watch the LLR output file (the one containing primes only) for primes, and notify you when you find one. I'd be glad to try making a little program to do the trick. :smile: |
[quote=Mini-Geek;126961]I finished that GIMPS number today and started on my NPLB range, and it's brought up this question in my mind: What would be a good way to easily see if my LLR found a prime? It's just one core on my computer, so no worries about getting it from multiple files.
Maybe a program to monitor the result file? (referring to the one you name, but lresults.txt would work too, just in a different way) It only puts the primes in there, right? So if somebody has some script to see when it gets edited, that'd work.[/quote] I thought I'd throw a "real world" example at you here from a range that I recently processed. Here's an LLR output primes file with a prime in it: [code] 5000000000000:M:1:2:258 945 350126 [/code] So the 2nd line means that 945*2^350126-1 is prime. It's formatted just like your sieve file coming in but only has primes in it. Here's a file with no primes: [code] 5000000000000:M:1:2:258 [/code] Because it only has the header of your sieve file, there are no primes. Anon, that'd be cool to have a notifying program. I'd be interested in getting it from you or if you can post it here, I'm sure some others might be interested also. Gary |
[quote=gd_barnes;126970]Anon, that'd be cool to have a notifying program. I'd be interested in getting it from you or if you can post it here, I'm sure some others might be interested also.[/quote]
Yep, that's the plan--if and when I can get it finished, I'll be sure to post it here. :smile: Please note that it will almost definitely be written in Perl, which means that if you're using Windows (which doesn't come with Perl by default) you'll need to download and install Perl from [URL]http://www.activeperl.com[/URL]. (Installing it, and running programs with it, is a pretty straightforward process.) |
i'm using (for my quad with now many folders on LLRnet) a batch file like this:
[code] @echo off echo Port 100 cd LLRnet100_1 find "is prim" lresults.txt cd.. cd LLRnet100_2 find "is prim" lresults.txt cd.. cd LLRnet100_3 find "is prim" lresults.txt cd.. cd LLRnet100_4 find "is prim" lresults.txt cd.. pause [/code] make a text-file, rename it *.bat and everytime you want to know a prime is found, double-click and a dos-window stays open, until closed or key is pressed. the 'find' command is here because LLRnet does not save found primes in a seperate file. for 'normal' LLR you can use this batch: [code] @echo off echo My primes cd nplb_1 type prim.txt cd.. cd nplb_2 type prim.txt cd.. cd nplb_3 type prim.txt cd.. cd nplb_4 type prim.txt cd.. pause [/code] here for example are four folders with the lresults.txt in it and the file with current primes found (i named it 'prim.txt' in LLR). hope this helps. best would be something that popup a request/window whenever a prime is found! karsten |
Thanks for all the info. I actually already knew a good portion of it, since I've been playing around with LLR in the last month, but I guess I should've said what I know already if I didn't want to get the whole info.
Any rough ETA on when you could make that Perl program? In the mean time, I'm going to google around for a program to monitor file changes. Edit: I just found [URL]http://www.download.com/File-Monitor/3000-12565_4-10709849.html?tag=lst-1[/URL] and [URL]http://www.plsys.com/products/filemonitor/[/URL]. The second looks like a more mature product, but seems Mac-focused. I'm going to try out that first one... Edit2: The first one is a Yahoo Widget...well never mind that. Two more: [url]http://www.download.com/logview4net/3000-2086_4-10658456.html?tag=lst-4[/url] [url]http://www.download.com/File-Alert-Monitor/3000-2248_4-10221584.html?tag=lst-4[/url] |
[quote=Mini-Geek;126979]Thanks for all the info. I actually already knew a good portion of it, since I've been playing around with LLR in the last month, but I guess I should've said what I know already if I didn't want to get the whole info.
Any rough ETA on when you could make that Perl program? In the mean time, I'm going to google around for a program to monitor file changes.[/quote] I'll give myself a day or two to get it written. :smile: When completed, I'm hoping for it to be able to send email notifications of new primes found automatically. :smile: |
Karsten's idea seems very good and very easy. Would that suit your needs?
I think I may do Karsten's idea myself, especially for rallies. |
[quote=Anonymous;126981]I'll give myself a day or two to get it written. :smile:
When completed, I'm hoping for it to be able to send email notifications of new primes found automatically. :smile:[/quote] Cool. [quote=kar_bon;126978]i'm using (for my quad with now many folders on LLRnet) a batch file like this: [code] @echo off echo Port 100 cd LLRnet100_1 find "is prim" lresults.txt cd.. cd LLRnet100_2 find "is prim" lresults.txt cd.. cd LLRnet100_3 find "is prim" lresults.txt cd.. cd LLRnet100_4 find "is prim" lresults.txt cd.. pause [/code]make a text-file, rename it *.bat and everytime you want to know a prime is found, double-click and a dos-window stays open, until closed or key is pressed. the 'find' command is here because LLRnet does not save found primes in a seperate file. for 'normal' LLR you can use this batch: [code] @echo off echo My primes cd nplb_1 type prim.txt cd.. cd nplb_2 type prim.txt cd.. cd nplb_3 type prim.txt cd.. cd nplb_4 type prim.txt cd.. pause [/code]here for example are four folders with the lresults.txt in it and the file with current primes found (i named it 'prim.txt' in LLR). hope this helps. best would be something that popup a request/window whenever a prime is found! karsten[/quote] You posted this right before my earlier post. I didn't notice it until just now. That works way better than the things I found, and, although it lacks an automatic popup on new prime found, in a way that's good, because it doesn't steal CPU cycles (one I tried was using all of one core...the core with LLR on it). Edit: I edited it to the following. It only checks the one file, and automatically closes after 2 seconds. Also, I had it find it off of lresults.txt because then it returns the longer, nicer-looking full result line, instead of just a few numbers. And it means that if there's none it shows dashes instead of just one line of numbers, making it stick out even more when there is a prime. Some of this is more useful/necessary because I only have it up 2 seconds.[code]@echo off echo My primes find "!" lresults.txt ping -n 2 127.0.0.1 > NUL[/code] |
[quote=Anonymous;126981]I'll give myself a day or two to get it written. :smile:
When completed, I'm hoping for it to be able to send email notifications of new primes found automatically. :smile:[/quote] So how's it coming? Not trying to rush you, just looking for a status update. |
[quote=Mini-Geek;127256]So how's it coming? Not trying to rush you, just looking for a status update.[/quote]
Sorry, I didn't get to start on it yet. Thanks for the reminder--I'll see about getting it started today. :smile: |
| All times are UTC. The time now is 11:12. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.