mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2841
This commit is contained in:
parent
f4d30aa220
commit
d3495ba47f
|
@ -8840,3 +8840,15 @@ David 31 Dec 2003
|
|||
validate.C
|
||||
test/
|
||||
testbase.py
|
||||
|
||||
David 31 Dec 2003
|
||||
- Added Python assimilator, courtesy of Stephen Pellicer
|
||||
All the back-end programs could be implemented in Python;
|
||||
CPU usage is a non-factor.
|
||||
Some people might prefer this to C++.
|
||||
No reason not to have both, as long as the logic stays in synch.
|
||||
|
||||
py/Boinc/
|
||||
sched_messages.py
|
||||
sched/
|
||||
assimilator.py
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
<?
|
||||
require_once("docutil.php");
|
||||
page_head("Compile-it-yourself BOINC");
|
||||
echo "
|
||||
BOINC applications, and the BOINC core client, are native-mode programs,
|
||||
so different versions are required for each platform
|
||||
(a 'platform' is the combination of an operating
|
||||
system and a processor type: e.g., Linux/IntelX86).
|
||||
BOINC provides two ways to deal with the problem
|
||||
of making programs available for different platforms.
|
||||
|
||||
<h3>The project-compiles-it-for-you model</h3>
|
||||
<p>
|
||||
In this approach, the BOINC-based project
|
||||
compiles program versions for common platforms
|
||||
(Windows/Intel, Linux/Intel, Mac OS/X. etc.),
|
||||
and places them on its servers.
|
||||
A participant downloads the core client for his platform
|
||||
(assuming that it's supported by the project).
|
||||
When the core client requests work from the project's scheduling server,
|
||||
it tells the server its platform,
|
||||
and the scheduling server instructs it to download
|
||||
the appropriate application executables.
|
||||
<p>
|
||||
Although this addresses the needs of most BOINC participants,
|
||||
there are two groups for whom it is inadequate:
|
||||
<ul>
|
||||
<li>
|
||||
People who, for security reasons,
|
||||
want to only run executables they have compiled themselves.
|
||||
<li>
|
||||
People whose computers have platforms not supported by the project
|
||||
(projects are generally resource-limited and cannot support all platforms).
|
||||
</ul>
|
||||
|
||||
<h3>The compile-it-yourself model</h3>
|
||||
<p>
|
||||
In this model participants compile programs themselves
|
||||
rather than downloading them from the project.
|
||||
Here's how it works:
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Download the source code for the BOINC core client,
|
||||
and for the project's applications,
|
||||
and compile them for your computer.
|
||||
Alternatively, you might download the programs from
|
||||
a server of your choosing.
|
||||
<li>
|
||||
Run the core client with a option telling
|
||||
it where to find the applications;
|
||||
it incorporates them
|
||||
into its state file and directory structure,
|
||||
as if it had been downloaded from the server.
|
||||
<li>
|
||||
When the core client requests work from the scheduling server,
|
||||
it reports its platform as 'anonymous',
|
||||
and provides a list of the applications it has.
|
||||
The server then just sends whatever work is available for those applications.
|
||||
</ul>
|
||||
|
||||
This model is possible only with projects that make their application
|
||||
source code available.
|
||||
<p>
|
||||
<b>
|
||||
Note: the compile-it-yourself model is under development,
|
||||
and is not currently available.
|
||||
Participants with uncommon platforms can prepare by porting
|
||||
the current core client and applications to their platforms.
|
||||
</b>
|
||||
";
|
||||
page_tail();
|
||||
?>
|
|
@ -114,12 +114,9 @@ The work manager's menu items are as follows:
|
|||
</ul>
|
||||
|
||||
<p>
|
||||
Menu names and other text in the work manager are stored in
|
||||
a file called <i>language.ini</i>.
|
||||
The release uses American English.
|
||||
Other languages are available
|
||||
<a href=http://216.198.119.31/BOINC/language_ini/language.htm>here</a>
|
||||
(thanks to Robi Buechler and other volunteers for this).
|
||||
The text displayed by the work manager (menu names, etc.)
|
||||
can be translated to languages other than English;
|
||||
information about this is <a href=language.php>here</a>.
|
||||
|
||||
<p>
|
||||
The <b>BOINC screensaver</b> can be selected using the Display Properties dialog.
|
||||
|
|
|
@ -29,6 +29,8 @@ Janus Kristensen
|
|||
<br>
|
||||
Tim Lan
|
||||
<br>
|
||||
Stephen Pellicer
|
||||
<br>
|
||||
Rom Walton
|
||||
<br>
|
||||
Oliver Wang
|
||||
|
|
|
@ -6,6 +6,13 @@ echo "
|
|||
<p>
|
||||
BOINC projects may export data describing teams, users and hosts.
|
||||
This data is exported in XML files that can be downloaded via HTTP.
|
||||
<p>
|
||||
This data can be summarized and represented as Web pages.
|
||||
An example (implemented using PHP) is at
|
||||
<a href=http://www.boinc.dk/index.php?page=statistics>http://www.boinc.dk</a>.
|
||||
If you are interested in using or contributing to this code,
|
||||
please contact the developer,
|
||||
<a href=mailto:stats@boinc.dk>Janus Kristensen</a>.
|
||||
|
||||
<p>
|
||||
The data is presented in several different 'views':
|
||||
|
|
|
@ -13,6 +13,8 @@ echo "
|
|||
<li> <a href=credit.php>Computation credit</a>
|
||||
<li> <a href=teams.php>Teams</a>
|
||||
<li> <a href=db_dump.php>Downloading statistics data</a>
|
||||
<li> <a href=language.php>Language customization</a>
|
||||
<li> <a href=anonymous_platform.php>Compile-it-yourself BOINC</a>
|
||||
</ul>
|
||||
";
|
||||
page_tail();
|
||||
|
|
|
@ -5,45 +5,27 @@ echo "
|
|||
Information about BOINC is available in the following languages:
|
||||
<ul>
|
||||
<li> Chinese
|
||||
<ul>
|
||||
<li><a href=http://www.equn.com/boinchina><font size=-2>www.equn.com/boinchina</font></a>
|
||||
</ul>
|
||||
<br><a href=http://www.equn.com/boinchina><font size=-2>www.equn.com/boinchina</font></a>
|
||||
<li> Estonian
|
||||
<ul>
|
||||
<li><a href=http://boinc.tmac.pri.ee><font size=-2>boinc.tmac.pri.ee</font></a>
|
||||
</ul>
|
||||
<br><a href=http://boinc.tmac.pri.ee><font size=-2>boinc.tmac.pri.ee</font></a>
|
||||
<li> Danish
|
||||
<ul>
|
||||
<li><a href=http://www.boinc.dk><font size=-2>www.boinc.dk</font></a>
|
||||
</ul>
|
||||
<br><a href=http://www.boinc.dk><font size=-2>www.boinc.dk</font></a>
|
||||
<li> Dutch
|
||||
<ul>
|
||||
<li><a href=http://www.seti-nl.org/content.php?c=boinc_berkeley_main><font size=-2>www.seti-nl.org</font></a>
|
||||
</ul>
|
||||
<br><a href=http://www.seti-nl.org/content.php?c=boinc_berkeley_main><font size=-2>www.seti-nl.org</font></a>
|
||||
<li> Finnish
|
||||
<br><a href=http://www.universe-examiners.org/boinc_faq.php><font size=-2>Universe Examiners</font></a>
|
||||
<li> French
|
||||
<ul>
|
||||
<li><a href=http://www.boinc-fr.net><font size=-2>www.boinc-fr.net</font></a>
|
||||
</ul>
|
||||
<br><a href=http://www.boinc-fr.net><font size=-2>www.boinc-fr.net</font></a>
|
||||
<li> German
|
||||
<ul>
|
||||
<li><a href=http://www.boinc.de/><font size=-2>www.boinc.de</font></a>
|
||||
</ul>
|
||||
<br><a href=http://www.boinc.de/><font size=-2>www.boinc.de</font></a>
|
||||
<li> Italian
|
||||
<ul>
|
||||
<li><a href=http://boinc.homeunix.org/><font size=-2>boinc.homeunix.org</font></a>
|
||||
</ul>
|
||||
<br><a href=http://boinc.homeunix.org/><font size=-2>boinc.homeunix.org</font></a>
|
||||
<li> Japanese
|
||||
<ul>
|
||||
<li><a href=http://members.fortunecity.com/je2bwm/indexj.html#next2ads><font size=-2>fortunecity.com</a> (by Komori Hitoshi) </font>
|
||||
</ul>
|
||||
<br><a href=http://members.fortunecity.com/je2bwm/indexj.html#next2ads><font size=-2>fortunecity.com</a> (by Komori Hitoshi) </font>
|
||||
<li> Russian
|
||||
<ul>
|
||||
<li><a href=http://www.boinc.narod.ru><font size=-2>www.boinc.narod.ru</font></a>
|
||||
</ul>
|
||||
<br><a href=http://www.boinc.narod.ru><font size=-2>www.boinc.narod.ru</font></a>
|
||||
<li> Turkish
|
||||
<ul>
|
||||
<li><a href=http://www.turksetiteam.org/boinc/index.html><font size=-2>www.turksetiteam.org</a>
|
||||
</ul>
|
||||
<br><a href=http://www.turksetiteam.org/boinc/index.html><font size=-2>www.turksetiteam.org</a>
|
||||
</ul>
|
||||
If you'd like to add a web site to this list, please
|
||||
<a href=mailto:davea@ssl.berkeley.edu>contact us</a>.
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
import sys, time
|
||||
|
||||
CRITICAL=0
|
||||
NORMAL=1
|
||||
DEBUG=2
|
||||
|
||||
class SchedMessages:
|
||||
def __init__(self):
|
||||
self.debug_level = 0
|
||||
|
||||
def set_debug_level(self, level):
|
||||
self.debug_level = int(level)
|
||||
|
||||
def printf(self, kind, format, *args):
|
||||
if kind <= self.debug_level:
|
||||
if kind==CRITICAL:
|
||||
kind = "CRITICAL"
|
||||
elif kind==NORMAL:
|
||||
kind = "normal "
|
||||
elif kind==DEBUG:
|
||||
kind = "debug "
|
||||
else:
|
||||
kind = "*** internal error: invalid MessageKind ***";
|
||||
sys.stderr.write("%s [%s] " % (time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()), kind))
|
||||
sys.stderr.write(format % args)
|
|
@ -0,0 +1,135 @@
|
|||
#!/usr/bin/python
|
||||
'''
|
||||
Python implementation of an assimilator
|
||||
Contributed by Stephen Pellicer
|
||||
'''
|
||||
|
||||
import os, re, boinc_path_config, signal, sys, time
|
||||
from Boinc import database, boinc_db, configxml, sched_messages
|
||||
|
||||
STOP_TRIGGER_FILENAME = os.path.join('..', 'stop_servers')
|
||||
caught_sig_int = False
|
||||
log_messages=sched_messages.SchedMessages()
|
||||
|
||||
def check_stop_trigger():
|
||||
global caught_sig_int, log_messages
|
||||
try:
|
||||
junk = open(STOP_TRIGGER_FILENAME, 'r')
|
||||
except IOError:
|
||||
if caught_sig_int:
|
||||
log_messages.printf(sched_messages.CRITICAL, "Caught SIGINT\n")
|
||||
sys.exit(1)
|
||||
else:
|
||||
log_messages.printf(sched_messages.CRITICAL, "Found stop trigger\n")
|
||||
sys.exit(1)
|
||||
|
||||
def sigint_handler(sig, stack):
|
||||
global caught_sig_int
|
||||
log_messages.printf(sched_messages.DEBUG, "Handled SIGINT\n")
|
||||
caught_sig_int = True
|
||||
|
||||
def get_file_path(result):
|
||||
return os.path.join(config.upload_dir, re.search('<name>(.*)</name>', result.xml_doc_out).group(1))
|
||||
|
||||
def assimilate_handler(wu, results, canonical_result):
|
||||
# check for valid wu.canonical_resultid
|
||||
if wu.canonical_result:
|
||||
# do application specific processing
|
||||
log_messages.printf(sched_messages.NORMAL, "[%s] Found canonical result\n", wu.name)
|
||||
question = open(os.path.join('..', 'question'), 'r').read()[:32]
|
||||
log_messages.printf(sched_messages.DEBUG, "Comparing to %s\n", question)
|
||||
if len(question) != 32:
|
||||
log_messages.printf(sched_messages.CRITICAL, "Question %s is wrong length\n", question)
|
||||
else:
|
||||
result = get_file_path(canonical_result)
|
||||
for line in open(result, 'r').readlines():
|
||||
line = line.strip()
|
||||
log_messages.printf(sched_messages.DEBUG, " [%s] Answer found %s %s\n", canonical_result.name, line[-32:], line[:-33])
|
||||
if line[-32:] == question:
|
||||
log_messages.printf(sched_messages.CRITICAL, "[RESULT#%d %s] Found Answer %s\n", canonical_result.id, canonical_result.name, line[:-33])
|
||||
else:
|
||||
log_messages.printf(sched_messages.NORMAL, "[%s] No canonical result\n", wu.name)
|
||||
|
||||
if wu.error_mask&boinc_db.WU_ERROR_COULDNT_SEND_RESULT:
|
||||
log_messages.printf(sched_messages.CRITICAL, "[%s] Error: couldn't send a result\n", wu.name)
|
||||
if wu.error_mask&boinc_db.WU_ERROR_TOO_MANY_ERROR_RESULTS:
|
||||
log_messages.printf(sched_messages.CRITICAL, "[%s] Error: too many error results\n", wu.name)
|
||||
if wu.error_mask&boinc_db.WU_ERROR_TOO_MANY_TOTAL_RESULTS:
|
||||
log_messages.printf(sched_messages.CRITICAL, "[%s] Error: too many total results\n", wu.name)
|
||||
if wu.error_mask&boinc_db.WU_ERROR_TOO_MANY_SUCCESS_RESULTS:
|
||||
log_messages.printf(sched_messages.CRITICAL, "[%s] Error: too many success results\n", wu.name)
|
||||
# check for error conditions
|
||||
|
||||
def do_pass(app):
|
||||
did_something=False
|
||||
# check for stop trigger
|
||||
check_stop_trigger()
|
||||
|
||||
# look for workunits with correct appid and assimilate_state==ASSIMILATE_READY
|
||||
for wu in database.Workunits.find(app=app, assimilate_state=boinc_db.ASSIMILATE_READY):
|
||||
did_something=True
|
||||
canonical_result=None
|
||||
results=None
|
||||
log_messages.printf(sched_messages.DEBUG, "[%s] assimilating: state=%d\n", wu.name, wu.assimilate_state)
|
||||
results = database.Results.find(workunit=wu)
|
||||
# look for canonical result for workunit in results
|
||||
for result in results:
|
||||
if result == wu.canonical_result:
|
||||
canonical_result=result
|
||||
|
||||
# assimilate handler
|
||||
assimilate_handler(wu, results, canonical_result)
|
||||
|
||||
# tag wu as ASSIMILATE_DONE
|
||||
wu.assimilate_state = boinc_db.ASSIMILATE_DONE
|
||||
wu.transition_time = int(time.time())
|
||||
wu.commit()
|
||||
|
||||
# set wu transition_time
|
||||
|
||||
# return did something result
|
||||
return did_something
|
||||
|
||||
# main function
|
||||
asynch = False
|
||||
one_pass = False
|
||||
appname = ''
|
||||
|
||||
# check for asynch one_pass, debug, app
|
||||
args = sys.argv[1:]
|
||||
args.reverse()
|
||||
while(len(args)):
|
||||
arg = args.pop()
|
||||
if arg == '-asynch':
|
||||
asynch = True
|
||||
elif arg == '-one_pass':
|
||||
one_pass = True
|
||||
elif arg == '-d':
|
||||
arg = args.pop()
|
||||
log_messages.set_debug_level(arg)
|
||||
elif arg == '-app':
|
||||
arg = args.pop()
|
||||
appname = arg
|
||||
else:
|
||||
log_messages.printf(sched_messages.CRITICAL, "Unrecognized arg: %s\n", arg)
|
||||
|
||||
config = configxml.default_config().config
|
||||
database.connect()
|
||||
|
||||
# fork if asynch
|
||||
if(asynch):
|
||||
# add fork code
|
||||
pass
|
||||
|
||||
# retrieve app where name = app.name
|
||||
app=database.Apps.find1(name=appname)
|
||||
signal.signal(signal.SIGINT, sigint_handler)
|
||||
|
||||
# do one pass or execute main loop
|
||||
if one_pass:
|
||||
do_pass(app)
|
||||
else:
|
||||
# main loop
|
||||
while(1):
|
||||
if not do_pass(app):
|
||||
time.sleep(10)
|
Loading…
Reference in New Issue