*** empty log message ***

svn path=/trunk/boinc/; revision=3127
This commit is contained in:
David Anderson 2004-03-23 01:44:47 +00:00
parent cff8239e37
commit 4c2b30ae95
11 changed files with 61 additions and 29 deletions

View File

@ -567,12 +567,22 @@ int CLIENT_STATE::handle_scheduler_reply(
if (!f) return ERR_FOPEN;
fprintf(f,
"<global_preferences>\n"
" <source_project>%s</source_project>\n"
" <source_scheduler>%s</source_scheduler>\n"
);
// tag with the project and scheduler URL,
// but only if not already tagged
//
if (!strstr(sr.global_prefs_xml, "<source_project>")) {
fprintf(f,
" <source_project>%s</source_project>\n"
" <source_scheduler>%s</source_scheduler>\n",
project->master_url,
scheduler_url
);
}
fprintf(f,
"%s"
"</global_preferences>\n",
project->master_url,
scheduler_url,
sr.global_prefs_xml
);
fclose(f);

View File

@ -90,7 +90,7 @@ void show_message(PROJECT *p, char* msg, int priority) {
if (p) {
x = p->get_project_name();
} else {
x = "BOINC";
x = "---";
}
switch (priority) {
case MSG_ERROR:

View File

@ -35,6 +35,7 @@
#include "message.h"
#include "file_names.h"
#include "client_state.h"
#include "prefs.h"
// the following values determine how the client behaves
@ -111,9 +112,9 @@ int GLOBAL_PREFS::parse(FILE* in, char* host_venue) {
}
if (match_tag(buf, "<global_preferences>")) {
continue;
} else if (match_tag(buf, "<source_project>")) {
} else if (parse_str(buf, "<source_project>", source_project)) {
continue;
} else if (match_tag(buf, "<source_scheduler>")) {
} else if (parse_str(buf, "<source_scheduler>", source_scheduler)) {
continue;
} else if (parse_int(buf, "<mod_time>", mod_time)) {
continue;
@ -173,11 +174,18 @@ int GLOBAL_PREFS::parse(FILE* in, char* host_venue) {
msg_printf(NULL, MSG_INFO, "GLOBAL_PREFS::parse: unrecognized: %s\n", buf);
}
}
PROJECT* pp = gstate.lookup_project(source_project.c_str());
if (pp) {
msg_printf(NULL, MSG_INFO, "Using general preferences from %s\n", pp->get_project_name());
} else {
msg_printf(NULL, MSG_INFO, "Using general preferences from unknown project %s\n", source_project.c_str());
}
msg_printf(NULL, MSG_INFO, "General preferences last updated %s\n", time_to_string(mod_time));
if (strlen(host_venue)) {
if (found_venue) {
msg_printf(NULL, MSG_INFO, "Using your general preferences for %s\n", host_venue);
} else {
msg_printf(NULL, MSG_INFO, "General preferences for %s not found; using your default preferences\n", host_venue);
msg_printf(NULL, MSG_INFO, "No separate general preferences given for %s; using your default preferences\n", host_venue);
}
} else {
msg_printf(NULL, MSG_INFO, "Using your default general preferences\n");

View File

@ -59,6 +59,8 @@ struct GLOBAL_PREFS {
int max_memory_mbytes;
int proc_priority;
int cpu_affinity;
string source_project;
string source_scheduler;
GLOBAL_PREFS();
void init();

View File

@ -33,7 +33,7 @@ void show_message(PROJECT* p, char* msg, int priority) {
if (p) {
x = p->get_project_name();
} else {
x = "BOINC";
x = "---";
}
if(g_myWnd) {

View File

@ -6,9 +6,6 @@ echo "
<p>
Each project gives you <b>credit</b> for the computations your
computers performs for the project.
These credits are used to generate web-site 'leaderboards' showing
individuals, teams, and categories (countries, CPU types, etc.)
ranked by credit.
<p>
BOINC's credit system is based on a 'reference computer' that can do
@ -21,6 +18,10 @@ BOINC's credit system is based on a 'reference computer' that can do
BOINC's unit of credit, the <b>Cobblestone</b> <sup>1</sup>,
is 1/300 day of CPU time on the reference computer.
<p>
Some BOINC projects grant credit only after
results have been <a href=intro_user.php#credit>validated</a>.
<p>
Each project maintains two types of credit:
<ul>
@ -37,8 +38,7 @@ Both types of credit (total and recent average)
are maintained for each user and host.
<h3>Leader boards</h3>
The PHP pages supplied by BOINC include basic leaderboards:
top users and hosts, by total and average.
BOINC lets projects export the credit-related
parts of their database as XML files.
These XML files can be used to generate
@ -69,6 +69,10 @@ Each time new credit granted,
the following function is used to update the
recent average credit of the host, user and team:
<pre>
#define LOG2 M_LN2
// log(2)
#define SECONDS_IN_DAY (3600*24)
#define AVG_HALF_LIFE (SECONDS_IN_DAY*7)
// decay an exponential average of credit per day,
// and possibly add an increment for new credit
@ -95,7 +99,7 @@ void update_average(
avg_time = now;
}
</pre>
This function is also invoked
<hr noshade size=1>
<sup>1</sup> Named after Jeff Cobb of SETI@home
";

View File

@ -48,16 +48,16 @@ Help debug and enhance BOINC software.
<b>Other resources</b>
<br>
&nbsp;&nbsp;&nbsp;
<a href=source/><font size=-2>Source code (download)</font></a>
<br>
&nbsp;&nbsp;&nbsp;
<a href=http://boinc.berkeley.edu/cgi-bin/cvsweb.cgi/><font size=-2>Source code (CVS)</font></a>.
<font size=-2>Source code:</font>
<a href=source/><font size=-2>download</font></a> |
<a href=http://boinc.berkeley.edu/cgi-bin/cvsweb.cgi/><font size=-2>CVS</font></a>.
<br>
&nbsp;&nbsp;&nbsp;
<a href=http://setiathome.ssl.berkeley.edu/taskbase/database.cgi><font size=-2>bug-tracking database</font></a>
<br>
&nbsp;&nbsp;&nbsp;
<a href=translations.php><font size=-2>Non-English sites about BOINC</font></a>
&nbsp;&nbsp;&nbsp;
<br><br>
<a href=contact.php><b>Contact us</b></a>

View File

@ -5,6 +5,11 @@ echo"
<p>
BOINC is a software platform for distributed computing
using volunteer computer resources.
<p>
A paper about BOINC's design goals is here:
<a href=http://boinc.berkeley.edu/talks/madrid_03/madrid.html>HTML</a> |
<a href=boinc2.pdf>PDF</a>.
<p>
The BOINC's features fall into several areas:
<h3>Resource sharing among independent projects</h3>

View File

@ -51,10 +51,13 @@ echo "
</ol>
This cycle is repeated indefinitely.
BOINC does this all automatically; you don't have to do anything.
<a name=credit></a>
<h2>Credit</h2>
The project's server keeps track of how much work
your computer has done; this is called <b>credit</b>.
To ensure that credit is granted fairly, BOINC works as follows:
To ensure that credit is granted fairly,
most BOINC projects work as follows:
<ul>
<li> Each work unit may be sent to several computers.
<li> When a computer reports a result,

View File

@ -418,18 +418,17 @@ void safe_strncpy(char* dst, const char* src, int len) {
dst[len-1]=0;
}
char* time_to_string(time_t x) {
static char buf[100];
struct tm* tm = localtime(&x);
strftime(buf, sizeof(buf)-1, "%Y-%m-%d %H:%M:%S", tm);
return buf;
}
// return current time of day as ASCII string, no CR
//
char* timestamp() {
// time_t now = time(0);
// char* p = ctime(&now);
// *(strchr(p, '\n')) = 0;
// return p;
static char buf[100];
time_t now = time(0);
struct tm* tm = localtime(&now);
strftime(buf, sizeof(buf)-1, "%Y-%m-%d %H:%M:%S", tm);
return buf;
return time_to_string(time(0));
}
// set by command line

View File

@ -49,6 +49,7 @@ extern void canonicalize_master_url(char *url);
extern void safe_strncpy(char*, const char*, int);
#define safe_strcpy(x, y) safe_strncpy(x, y, sizeof(x))
#define safe_strcat(x, y) if (strlen(x)+strlen(y)<sizeof(x)) strcat(x, y)
extern char* time_to_string(time_t);
extern char* timestamp();
string timediff_format(long tdiff);
int read_file_string(const char* pathname, string& result);