mersenneforum.org easiest way to check if you found prime
 Register FAQ Search Today's Posts Mark Forums Read

 2008-02-25, 20:55 #1 Mini-Geek Account Deleted     "Tim Sorbera" Aug 2006 San Antonio, TX USA 17·251 Posts 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.
2008-02-25, 21:13   #2
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

186916 Posts

Quote:
 Originally Posted by Mini-Geek 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.
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.

Last fiddled with by mdettweiler on 2008-02-25 at 21:14 Reason: typo

2008-02-25, 21:28   #3
gd_barnes

May 2007
Kansas; USA

276516 Posts

Quote:
 Originally Posted by Mini-Geek 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.
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
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
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

2008-02-25, 21:33   #4
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

3×2,083 Posts

Quote:
 Originally Posted by gd_barnes 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.
Yep, that's the plan--if and when I can get it finished, I'll be sure to post it here.

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 http://www.activeperl.com. (Installing it, and running programs with it, is a pretty straightforward process.)

 2008-02-25, 21:49 #5 kar_bon     Mar 2006 Germany 22·691 Posts 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 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 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
 2008-02-25, 21:50 #6 Mini-Geek Account Deleted     "Tim Sorbera" Aug 2006 San Antonio, TX USA 10AB16 Posts 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 http://www.download.com/File-Monitor...html?tag=lst-1 and http://www.plsys.com/products/filemonitor/. 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: http://www.download.com/logview4net/...html?tag=lst-4 http://www.download.com/File-Alert-M...html?tag=lst-4 Last fiddled with by Mini-Geek on 2008-02-25 at 21:56
2008-02-25, 21:54   #7
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

624910 Posts

Quote:
 Originally Posted by Mini-Geek 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.
I'll give myself a day or two to get it written.

When completed, I'm hoping for it to be able to send email notifications of new primes found automatically.

 2008-02-25, 21:55 #8 gd_barnes     May 2007 Kansas; USA 5·2,017 Posts 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.
2008-02-25, 22:09   #9
Mini-Geek
Account Deleted

"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17·251 Posts

Quote:
 Originally Posted by Anonymous I'll give myself a day or two to get it written. When completed, I'm hoping for it to be able to send email notifications of new primes found automatically.
Cool.
Quote:
 Originally Posted by kar_bon 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 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 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
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

Last fiddled with by Mini-Geek on 2008-02-25 at 22:52

2008-02-28, 12:28   #10
Mini-Geek
Account Deleted

"Tim Sorbera"
Aug 2006
San Antonio, TX USA

17×251 Posts

Quote:
 Originally Posted by Anonymous I'll give myself a day or two to get it written. When completed, I'm hoping for it to be able to send email notifications of new primes found automatically.
So how's it coming? Not trying to rush you, just looking for a status update.

2008-02-28, 16:15   #11
mdettweiler
A Sunny Moo

Aug 2007
USA (GMT-5)

3·2,083 Posts

Quote:
 Originally Posted by Mini-Geek So how's it coming? Not trying to rush you, just looking for a status update.
Sorry, I didn't get to start on it yet. Thanks for the reminder--I'll see about getting it started today.

 Similar Threads Thread Thread Starter Forum Replies Last Post bloodIce PrimeNet 10 2011-03-12 18:51 Vandor Information & Answers 3 2008-11-27 15:25 Vandor Software 1 2008-10-10 05:52 bggashnik Information & Answers 10 2007-04-07 15:26 Unregistered Software 6 2004-06-19 08:18

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

Tue Mar 31 10:06:52 UTC 2020 up 6 days, 7:39, 0 users, load averages: 1.26, 1.30, 1.25

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.