SETI@HOME Hard Copy Credit Updates

Message boards : Number crunching : SETI@HOME Hard Copy Credit Updates
Message board moderation

To post messages, you must log in.

AuthorMessage
Nathan B

Send message
Joined: 21 Dec 12
Posts: 6
Credit: 1,910,583
RAC: 0
United States
Message 1477298 - Posted: 14 Feb 2014, 20:26:16 UTC

So I run SETI on many computers and I am out of the house often. So I came up with an idea to output my current account credits to an old dot matrix printer I had laying around. Each project already provides XML data that is mostly used to create the images that you see as footers of many user posts. So with a bit of php magic, I wrote a simple script to do just this.

NOTE: Make sure you do not update more than once an hour. The Boinc pages say this as to not put a unneeded load on their servers.

<?php
$user = simplexml_load_file('http://setiathome.berkeley.edu/show_user.php?userid=XXXXXXX&format=xml');
echo "User: " . $user->name . "\nTotal Credit: " . $user->total_credit . "\nAvg. Credit: " . $user->expavg_credit;
?>

Make sure to change the 7 X's to your user ID that is on you account page. This php script creates an output that looks like this:

User: Nathan B
Total Credit: 357888.465010488
Avg. Credit: 381.64551342653

I have not worked on the script to cut off the extra places, for it just looks messy, and it also needs to include a timer of sorts, but maybe that will come as an update.

You can run this in a Linux shell or using the php.exe for Windows folks. You can simply redirect the output into either a printer or a text file. The dot matrix works because it will allow me to print a few lines at a time, without using a whole sheet of paper just on one output.

Feel free to change and workshop in anyway you see fit.

Nathan B
ID: 1477298 · Report as offensive
Profile HAL9000
Volunteer tester
Avatar

Send message
Joined: 11 Sep 99
Posts: 6534
Credit: 196,805,888
RAC: 57
United States
Message 1477306 - Posted: 14 Feb 2014, 20:53:27 UTC

You could also just parse statistics_setiathome.berkeley.edu.xml on your machines whenever they change.
Then all data collection is local rather than extra load on the server.
SETI@home classic workunits: 93,865 CPU time: 863,447 hours
Join the [url=http://tinyurl.com/8y46zvu]BP6/VP6 User Group[
ID: 1477306 · Report as offensive
Nathan B

Send message
Joined: 21 Dec 12
Posts: 6
Credit: 1,910,583
RAC: 0
United States
Message 1477484 - Posted: 15 Feb 2014, 6:22:27 UTC - in response to Message 1477306.  

I would imagine that the server already has a large load. I have my Network+ and own 3 domains. Would I be correct to assume that this file is updated every time the client connects to the project? If this is true, then I would only need to phrase this one file on my main machine, and not actually worry about getting stats off of the server itself. Thank you for the idea. I have only crunched numbers for some time and decided it was time to get more involved.
ID: 1477484 · Report as offensive
Nathan B

Send message
Joined: 21 Dec 12
Posts: 6
Credit: 1,910,583
RAC: 0
United States
Message 1477485 - Posted: 15 Feb 2014, 6:23:18 UTC - in response to Message 1477484.  

Whoops, sorry. That message was really redundant. Long night.
ID: 1477485 · Report as offensive
Profile HAL9000
Volunteer tester
Avatar

Send message
Joined: 11 Sep 99
Posts: 6534
Credit: 196,805,888
RAC: 57
United States
Message 1477597 - Posted: 15 Feb 2014, 14:25:48 UTC
Last modified: 15 Feb 2014, 14:36:06 UTC

statistics_setiathome.berkeley.edu.xml is updated each time the host talks to the server. If there is no server communication, as such as during maintenance, I am not sure if the time stamp on the file changes.

You could direct the @ECHO to your printer. You could also direct the output to a text file. Then once the file had 60 lines you could send that data to a page printer.

As I have several machines I tend to add the host name to the file. So I can just copy and rename the file for each host.
statistics_print_HAL9000II.bat
@ECHO OFF
pushd %~dp0
set machine=%~n0
set machine=%machine:~17,10%
set CMDPATH=\\%machine%\z$\Boinc\
set statfile=%CMDPATH%statistics_setiathome.berkeley.edu.xml
:start
set /a skipval=-3 & set /a descval=1
:loopy
set /a skipval=%skipval%+7
FOR /F "skip=%skipval% tokens=2 delims=>< " %%a in (%statfile%) do set desc%descval%=%%a & goto loopy
set /a skipval=-1 & set /a descval=%descval%+1
if %descval%==2 goto loopy
@ECHO %date% %time% user_total_credit %desc1% %machine% host_total_credit %desc2%
timeout 3600 /NOBREAK & goto start

Notes: (for others what may want to use this)
1) When using a local path instead of remote change
set CMDPATH=\\%machine%\z$\Boinc\
set statfile=%CMDPATH%statistics_setiathome.berkeley.edu.xml

to
set CMDPATH="C:\Program Files\Boinc\"
pushd %CMDPATH%
set statfile=statistics_setiathome.berkeley.edu.xml

2) Remove timeout 3600 /NOBREAK & goto start & setup a schedule to run the file once whenever you like.
3) To output to a file add >> filename to the @ECHO such as:
@ECHO %date% %time% user_total_credit %desc1% %machine% host_total_credit %desc2%
to
@ECHO %date% %time% user_total_credit %desc1% %machine% host_total_credit %desc2% >> statistics_print_%machine%.txt
4) To collect stats from other projects change statfile to file name for that project.
set statfile=statistics_setiathome.berkeley.edu.xml
to
set statfile=statistics_www.primegrid.com.xml
5) When renaming the file and still wanting to get the machine name from the file name modify set machine=%machine:~17,10%. The First value is the number of characters to skip and the 2nd is the number to use. So with the file statistics_print_HAL9000II.bat it skips the first 17 characters and uses up to 10 of the next for %machine%. In this case there are only 9 more characters to use, but you can change this if your machine name is longer.
SETI@home classic workunits: 93,865 CPU time: 863,447 hours
Join the [url=http://tinyurl.com/8y46zvu]BP6/VP6 User Group[
ID: 1477597 · Report as offensive

Message boards : Number crunching : SETI@HOME Hard Copy Credit Updates


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.