use modem connections fully

svn path=/trunk/boinc/; revision=8495
This commit is contained in:
David Anderson 2005-10-05 19:34:54 +00:00
parent bf7985ca68
commit 0de3ff4fdf
12 changed files with 184 additions and 56 deletions

View File

@ -12751,4 +12751,21 @@ Rom 5 Oct 2005
Events.h
MainFrame.cpp, .h
ViewProjects.cpp, .h
David 5 Oct 2005
- In the confirm-before-connect modem case,
do as much communication as possible.
E.g. report all ready-to-report results.
Implementation:
Add new variable CLIENT_STATE::have_sporadic_connection.
Set to true on network_available RPC.
Set to false when want_network returns false.
Change CLIENT_STATE::want_network() so it waits 10 seconds
after core client stops using network before returning false.
If have_sporadic_connection is true, report results immediately.
client/
client_state.C,h
cs_scheduler.C
net_xfer.C

View File

@ -119,6 +119,7 @@ CLIENT_STATE::CLIENT_STATE() {
total_wall_cpu_time_this_period = 0;
must_schedule_cpus = true;
want_network_flag = false;
have_sporadic_connection = false;
no_gui_rpc = false;
have_tentative_project = false;
}
@ -1370,17 +1371,37 @@ int CLIENT_STATE::detach_project(PROJECT* project) {
return 0;
}
// Return true if the core client wants a network connection.
// Don't return false if we've actually been using the network
// in the last 10 seconds (so that polling mechanisms
// have a change to trigger)
//
bool CLIENT_STATE::want_network() {
if (http_ops->nops()) return true;
if (network_suspended) return false;
if (want_network_flag) return true;
if (active_tasks.want_network()) return true;
return false;
static double last_true_return=0;
double now = dtime();
if (http_ops->nops()) goto return_true;
if (network_suspended) goto return_false;
if (want_network_flag) goto return_true;
if (active_tasks.want_network()) goto return_true;
return_false:
if ((now - last_true_return) > 10) {
have_sporadic_connection = false;
return false;
}
return true;
return_true:
last_true_return = now;
return true;
}
// There's now a network connection, after some period of disconnection.
// Do all communication that we can.
//
void CLIENT_STATE::network_available() {
unsigned int i;
have_sporadic_connection = true;
for (i=0; i<pers_file_xfers->pers_file_xfers.size(); i++) {
PERS_FILE_XFER* pfx = pers_file_xfers->pers_file_xfers[i];
pfx->next_request_time = 0;
@ -1389,6 +1410,9 @@ void CLIENT_STATE::network_available() {
PROJECT* p = projects[i];
p->min_rpc_time = 0;
}
// tell active tasks that network is available (for Folding@home)
//
active_tasks.network_available();
}

View File

@ -204,6 +204,7 @@ public:
int report_result_error(RESULT&, const char *format, ...);
int reset_project(PROJECT*);
bool want_network_flag;
bool have_sporadic_connection;
bool want_network();
void network_available();
bool no_gui_rpc;

View File

@ -428,7 +428,8 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) {
// - the result is ready_to_report (compute done; files uploaded)
// - we're either within a day of the report deadline,
// or at least work_buf_min_days time has elapsed since
// result was completed.
// result was completed,
// or we have a sporadic connection
//
PROJECT* CLIENT_STATE::find_project_with_overdue_results() {
unsigned int i;
@ -444,6 +445,9 @@ PROJECT* CLIENT_STATE::find_project_with_overdue_results() {
if (p->suspended_via_gui) continue;
if (!r->ready_to_report) continue;
if (have_sporadic_connection) {
return p;
}
if (gstate.now > r->report_deadline - REPORT_DEADLINE_CUSHION) {
return p;
}

View File

@ -96,6 +96,10 @@ int NET_XFER::open_server() {
retval = resolve_hostname(hostname, ipaddr, msg);
if (retval) {
// If we can't resolve the hostname it generally means that
// there's no physical network connection.
// Make a note of this.
//
gstate.want_network_flag = true;
msg_printf(0, MSG_ERROR, "%s\n", msg);
return retval;

View File

@ -7,7 +7,7 @@ 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).
Linux and Intel/x86).
<p>
BOINC-based projects compile program versions for common platforms

View File

@ -6,8 +6,8 @@ echo "
<p>
<ul>
<li> <a href=contact.php>Project personnel and structure</a>
<li> <a href=dev_flow.php>BOINC Development information flow</a>.
<li> <a href=contact.php>Personnel and contributors</a>
<li> <a href=dev_flow.php>Development information flow</a>
<li> The <a href=http://bbugs.axpr.net/index.php>BOINCzilla bug database</a>.
<li> <a href=email_lists.php>boinc_dev</a>,
an email list for BOINC developers.

View File

@ -5,30 +5,30 @@ echo "
<h2> All languages</h2>
<h3> Code factoring</h3>
<ul>
<li> if code is repeated, factor it out and make it into a function
<li> if a function becomes longer than 100 lines or so, split it up
<li> If code is repeated, factor it out and make it into a function
<li> If a function becomes longer than 100 lines or so, split it up
<li> If a file is becoming 'landfill', split it up.
<li> C++ .h files often contain both interface and implementation.
Clearly divide these.
</ul>
<h3> code documentation</h3>
<h3> Code documentation</h3>
<ul>
<li> every .C file has a comment at the top saying what's
<li> .C files have a comment at the top saying what's
in the file (and perhaps what isn't).
If a file is becoming 'landfill', split it up.
<li> every function is preceded by a comment saying what it does
<li> every struct/class is preceded by a comment saying what it is
<li> Functions are preceded by a comment saying what they do.
<li> Structs and classes are preceded by a comment saying what they are.
</ul>
<h3> Naming</h3>
<ul>
<li> Names should be descriptive without being verbose
(local variables names may be short)
<li> Class names, #defined symbols, and type names are all upper case,
<li> Class and type names, and #defined symbols, are all upper case,
with underscores to separate words.
<li> Variable and function names are all lower case,
with underscores to separate words.
<li> no mixed case names
<li> No mixed case names
</ul>
<h3> Indentation</h3>
@ -131,8 +131,10 @@ echo "
<ul>
<li> (almost) all functions should return an integer error code.
Nonzero means error.
<li> All calls to functions that return an error code should
check the code. Generally they should return on error, e.g.:
See lib/errornumbers.h for a list of error codes.
<li> Calls to functions that return an error code should
check the code.
Generally they should return on error, e.g.:
<pre>
retval = blah();
if (retval) return retval;

View File

@ -18,7 +18,8 @@ echo "
<br>
<h1>Berkeley Open Infrastructure for Network Computing</h1>
An open-source software platform for computing using volunteered
resources
resources.
<a href=intro.php>... more</a>
<br>
</center>
@ -33,7 +34,8 @@ resources
</td></tr>
<tr><td>
<p>
BOINC lets you donate computing power to scientific research projects:
BOINC lets you donate computing power
to scientific research projects such as:
<ul>
<li>
<a href=http://climateprediction.net>Climateprediction.net</a>:
@ -49,7 +51,7 @@ resources
investigate protein-related diseases
<li>
<a href=http://boinc.bakerlab.org/rosetta/>Rosetta@home<a>:
help researchers develop cures for human diseases.
help researchers develop cures for human diseases
<li><a href=http://setiweb.ssl.berkeley.edu/>SETI@home</a>:
Look for radio evidence of extraterrestrial life
<li><a href=http://www.cellcomputing.net/>Cell Computing</a>
@ -62,21 +64,13 @@ resources
<br>
2) <a href=download.php>Download</a> and run BOINC software.
<p>
You can participate in any or all projects,
You can participate in more than one project,
and you control the fraction of your computing power
that goes to each project.
If you participate in several projects,
your computer will be kept busy even when one project has no work.
<p>
There are several Wikis
with information and documentation about BOINC:
<ul>
<li> <a href=http://boinc-doc.net/boinc-wiki/>The Unofficial BOINC Wiki</a> (in English)
<li> <a href=http://faq.boinc.de/>Deutsche BOINC FAQ</a> (in German)
<li> <a href=http://www.boincfrance.org/wakka.php?wiki=BienVenue>BOINCFrance.org</a> (in French)
</ul>
<p>
... and many other <a href=links.php>web sites for BOINC participants</a>.
<a href=links.php>Web sites for BOINC participants</a>.
<p>
<a href=participate.php>... more</a>
@ -88,28 +82,34 @@ resources
may be able to use BOINC.
A BOINC project requires just a single Linux server,
and can provide computing power equivalent
to a cluster with tens of thousands of nodes.
<p>
<a href=create_project.php>
... more
</a>
to a cluster with tens of thousands of CPUs.
<a href=create_project.php>... more</a>
<br><br>
</td></tr>
<tr><td bgcolor=$light_blue><h2>Software</h2></td></tr>
<tr><td>
<ul>
<li> <a href=source_code.php>Getting source code</>
<li> <a href=boinc_dev.php>Software development and testing</a>
<li> <a href=translation.php>Translation</a> of web and GUI text
<li> Write <a href=download_network.php>'add-on' software</a>:
<ul>
<li> <a href=gui_rpc.php>Client GUIs</a>
<li> <a href=db_dump.php>Credit statistics web sites</a>
<li> <a href=acct_mgt.php>Account managers</a>
<li> <a href=server_status.php>Server status web sites</a>
<li> <a href=web_rpc.php>Web RPCs</a> for info about users and hosts
</ul>
</ul>
</td></tr>
<tr><td bgcolor=$light_blue><h2>Other info</h2></td></tr>
<tr><td>
<ul>
<li> <a href=contact.php>Personnel and contact info</a>
<li> <a href=contact.php>Personnel and contributors</a>
<li> BOINC <a href=email_lists.php>email lists</a>
<li> BOINC <a href=dev/>message boards</a>
<li> An <a href=intro.php>overview of BOINC</a>
<li> <a href=papers.php>Papers about BOINC</a>
<li> How to get involved in
<ul>
<li> <a href=boinc_dev.php>Software development and testing</a>
<li> <a href=translation.php>Translation</a> of web and GUI text.
</ul>
<li>
<a href=logo.php>Logos and graphics</a>
<li> <a href=logo.php>Logos and graphics</a>
</ul>
<br>
</td></tr>

View File

@ -22,14 +22,29 @@ function site($url, $name) {
page_head("Web sites for BOINC participants");
echo "
<h2>Project status</h2>
<a href=http://boincprojectstatus.ath.cx/boinc/>BOINC project status</a>:
shows whether the servers of various projects are up or down.
<h2>Statistics</h2>
<table cellpadding=8><tr><td valign=top>
<h2>Wikis</h2>
User-editable
sites with information and documentation about BOINC.
<ul>
<li> <a href=http://boinc-doc.net/boinc-wiki/>The Unofficial BOINC Wiki</a> (in English)
<li> <a href=http://www.seti-argentina.com.ar/instrucciones-boinc-manager>BOINC Argentina</a> (in Spanish)
<li> <a href=http://faq.boinc.de/>Deutsche BOINC FAQ</a> (in German)
<li> <a href=http://www.boincfrance.org/wakka.php?wiki=BienVenue>BOINCFrance.org</a> (in French)
</ul>
<h2>Project status sites</h2>
Show if the servers of various projects are up or down.
<ul>
<li> <a href=http://boincprojectstatus.ath.cx/boinc/index.html>BOINCProjectStatus.ath.cx/index.html</a>:
</ul>
</td><td valign=top>
<h2>Credit statistics</h2>
";
site_list($stats_sites);
echo "
<h2>Informational sites</h2>
</td></tr></table>
<h2>Information, message boards, and teams</h2>
";
list_start();
echo "

53
doc/server_status.php Normal file
View File

@ -0,0 +1,53 @@
<?php
require_once("docutil.php");
page_head("Server status XML export");
echo "
BOINC-based projects offer the following XML export
at <code>URL/server_status.php</code>.
These are generally updated every 10 minutes or so -
do not poll more often than that.
These can be used to make web sites showing
the server status of multiple BOINC projects.
<p>
";
echo html_text("
<server_status>
<update_time>1128535206</update_time>
<daemon_status>
<daemon>
<host>jocelyn</host>
<command>BOINC database</command>
<status>running</status>
</daemon>
<daemon>
<host>castelli</host>
<command>master science database</command>
<status>running</status>
</daemon>
<daemon>
<host>klaatu</host>
<command>data-driven web pages</command>
<status>disabled</status>
</daemon>
<daemon>
<host>galileo</host>
<command>feeder</command>
<status>not running</status>
</daemon>
</daemon_status>
<database_file_states>
<results_ready_to_send>614830</results_ready_to_send>
<results_in_progress>1208959</results_in_progress>
<workunits_waiting_for_validation>8</workunits_waiting_for_validation>
<workunits_waiting_for_assimilation>2</workunits_waiting_for_assimilation>
<workunits_waiting_for_deletion>4</workunits_waiting_for_deletion>
<results_waiting_for_deletion>15</results_waiting_for_deletion>
<transitioner_backlog_hours>0.00083333334</transitioner_backlog_hours>
</database_file_states>
</server_status>");
page_tail();
?>

View File

@ -26,6 +26,10 @@ boinc_core_release_x_y_z
<dd>
The source code for version x.y.z.
</dl>
For a list of available tags, go
<a href=http://boinc.berkeley.edu/cgi-bin/cvsweb.cgi/boinc/>here</a>,
scroll to the bottom of the page,
and look at the popup menu after 'tag:'.
<h2>Source code</h2>
You can get the BOINC source code in two ways:
@ -33,19 +37,23 @@ You can get the BOINC source code in two ways:
<li>
Access the CVS repository directly, e.g. with a command like
<pre>
cvs -d :pserver:anonymous@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc
cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout boinc
</pre>
to get the development version, or
<pre>
cvs -d :pserver:anonymous@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout -r stable boinc
cvs -d :pserver:anonymous:@alien.ssl.berkeley.edu:/home/cvs/cvsroot checkout -r stable boinc
</pre>
to get the stable version.
<p>
<li>
Browse the CVS repository via a
<a href=http://boinc.berkeley.edu/cgi-bin/cvsweb.cgi/>web-based interface</a>.
<a href=http://boinc.berkeley.edu/cgi-bin/cvsweb.cgi/boinc/>web-based interface</a>
(this is useful for getting individual files,
or seeing the revision history).
</ul>
<p>
The BOINC source code is about 20-25 Mbytes.
<p>
Source code for a typical BOINC application,
SETI@home, is <a href=http://setiweb.ssl.berkeley.edu/sah/sah_porting.php>here</a>.