![]() |
![]() |
#1 |
Mar 2006
Germany
33·113 Posts |
![]()
i looked around the LLRnet sources (*.lua files) and wonder if there is a way to print the date/time in the lresults-file like on the LLRnet-server results.
and i found a way! it's not the best way but it works fine! insert the following lines (in red) in the "llrnet.lua" in the function Work() (little above the end of the function, around line 229): Code:
(...) else ClearWorkfile() end local file = openfile("lresults.txt", "a") write(file, format("[%s] ", date("%c"))) closefile(file) if not asynchronous then SendAllResults((sendRetries or 0) + 1) end SendStructureToAllGUIs("tosend", tosend, 1) (...) Code:
329*2^387216-1 is not prime. Res64: 471878A4A7F58281 Time : 160.390 sec. Result 329/387216 succesfully sent to the server. Code:
329*2^387216-1 is not prime. Res64: 471878A4A7F58281 Time : 160.390 sec. [03/09/08 20:37:46] Result 329/387216 succesfully sent to the server. the time in the result-file and on the client console differ by 2 seconds (result-file minus 2 seconds from console)! if there're any issues please post them here! karsten Last fiddled with by kar_bon on 2008-03-09 at 19:52 |
![]() |
![]() |
![]() |
#2 |
Mar 2006
Germany
33·113 Posts |
![]()
here is another enhancement for LLRnet:
insert the following red lines into 'llrnet.lua' (around line# 187, function 'Work()') and all found primes will be written in a seperate file called 'primes.txt': Code:
(...) -- check user interruption if stopCheck() then return -- return with no error end end if result == 0 then local file = openfile("primes.txt", "a") write(file, format("%s %s\n", k, n)) closefile(file) end SemaWait(semaphore) -- add the result in tosend table and file local tbl = { t = t, k = k, n = n, (...) karsten |
![]() |
![]() |
![]() |
#3 |
I ♥ BOINC!
Oct 2002
Glendale, AZ. (USA)
3·7·53 Posts |
![]()
I have used that and it works fine listing out just the primes.
I'd like it to report the user that found it and the date to. Anyway to make it do all that? |
![]() |
![]() |
![]() |
#4 |
A Sunny Moo
Aug 2007
USA
22×112×13 Posts |
![]() |
![]() |
![]() |
![]() |
#5 |
I ♥ BOINC!
Oct 2002
Glendale, AZ. (USA)
45916 Posts |
![]()
This is what I use on the Server.
Code:
function OnPrime(t, k, n, job) local fileprime = openfile("primes.txt", "a") if fileprime then write(fileprime, format("[%s]\n", job.resultdate)) write(fileprime, format(displayFormat.." is prime! Time : %d.0 sec.\n", k, n, Seconds() - job.seconds)) closefile(fileprime) end end Last fiddled with by IronBits on 2008-03-26 at 03:29 |
![]() |
![]() |
![]() |
#6 | |
A Sunny Moo
Aug 2007
USA
22×112×13 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#7 |
Jul 2007
Tennessee
25×19 Posts |
![]()
Isn't "job" the array from the joblist file?
You could just add: Code:
write(fileprime, format("user=%s\n", job.user)) Code:
function OnPrime(t, k, n, job) local fileprime = openfile("primes.txt", "a") if fileprime then write(fileprime, format("user=%s\n", job.user)) write(fileprime, format("[%s]\n", job.resultdate)) write(fileprime, format(displayFormat.." is prime! Time : %d.0 sec.\n", k, n, Seconds() - job.seconds)) closefile(fileprime) end end |
![]() |
![]() |
![]() |
#8 | |
A Sunny Moo
Aug 2007
USA
22·112·13 Posts |
![]() Quote:
![]() |
|
![]() |
![]() |
![]() |
#9 |
Mar 2006
Germany
1011111010112 Posts |
![]()
to print all found primes in a seperate file (like Adams version) you can edit 'llrserver.lua' too.
the function 'WriteResultToFile' does such a thing (line 108): Code:
function WriteResultToFile(job, filename) -- write result into lresults file local file = openfile(filename, "a") if file then write(file, format("user=%s\n", job.user)) write(file, format("[%s]\n", job.resultdate)) if job.result ~= "0" then write(file, format(displayFormat.." is not prime. Res64: %s Time : %d.0 sec.\n", job.k, job.n, job.result, Seconds() - job.seconds)) else write(file, format(displayFormat.." is prime! Time : %d.0 sec.\n", job.k, job.n, Seconds() - job.seconds)) local fileprime = openfile("primes.txt", "a") if fileprime then write(fileprime, format("%s %s %s\n", job.k, job.n, job.user)) closefile(fileprime) end end closefile(file) end end karsten |
![]() |
![]() |
![]() |
#10 |
I ♥ BOINC!
Oct 2002
Glendale, AZ. (USA)
3·7·53 Posts |
![]()
Thanks, I'll give it a try.
![]() |
![]() |
![]() |
![]() |
#11 |
Mar 2006
Germany
33×113 Posts |
![]()
in post #2 i gave the hint to create a seperate file for found primes (the client version).
for llrnet users like me with several folders of llrnet-ports/servers (i use a Quad so i got four folders for each of the two servers now) here is another hint: my folders looks like this: Code:
[LLRnet_A300_1] [LLRnet_A300_2] [LLRnet_A300_3] [LLRnet_A300_4] [LLRnet_I5000_1] [LLRnet_I5000_2] [LLRnet_I5000_3] [LLRnet_I5000_4] prim.bat tests.bat now, edit one line from post #2: Code:
local file = openfile("..\\primes.txt", "a") so every found prime from every server/port will be written there. another point: if any prime is found the file exists. after checking you can delete this file and go on. -> [PseudoCode on] Code:
if exists(primes.txt) ALARM("prime found!") endif ![]() karsten Last fiddled with by kar_bon on 2008-03-28 at 11:23 |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
srsieve/sr2sieve enhancements | rogue | Software | 304 | 2021-11-06 13:51 |
Intel announces multi-core enhancements for Haswell chips | ixfd64 | Hardware | 8 | 2012-02-10 20:32 |
llrnet 64 bit | balachmar | Prime Sierpinski Project | 4 | 2008-07-19 08:21 |
TODO list and suggestions/comments/enhancements | Greenbank | Octoproth Search | 2 | 2006-12-03 17:28 |
Suggestions for future enhancements | Reboot It | Software | 16 | 2003-10-17 01:31 |