Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
svn path=/trunk/boinc/; revision=11337
  • Loading branch information
davidpanderson committed Oct 22, 2006
1 parent c98a241 commit 190f7d1
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 62 deletions.
14 changes: 14 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -11370,3 +11370,17 @@ David 21 Oct 2006
sched_locality.C
sched_send.C,h
server_types.h

David 21 Oct 2006
- small cleanups to the above

db/
boinc_db.C,h
schema.sql
html/ops/
db_update.php
py/Boinc/
database.py
sched/
sched_send.C
server_types.h
3 changes: 2 additions & 1 deletion db/boinc_db.C
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ void DB_APP::db_print(char* buf){
"create_time=%d, name='%s', min_version=%d, "
"deprecated=%d, user_friendly_name='%s', homogeneous_redundancy=%d, weight=%f, beta=%d",
create_time, name, min_version,
deprecated?1:0, user_friendly_name, homogeneous_redundancy?1:0, weight, beta
deprecated?1:0, user_friendly_name, homogeneous_redundancy?1:0, weight,
beta?1:0
);
}

Expand Down
2 changes: 1 addition & 1 deletion db/boinc_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct APP {
bool homogeneous_redundancy;
double weight; // tells the feeder what fraction of results
// should come from this app
int beta;
bool beta;

int write(FILE*);
void clear();
Expand Down
1 change: 1 addition & 0 deletions db/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ create table app (
user_friendly_name varchar(254) not null,
homogeneous_redundancy smallint not null,
weight double not null,
beta smallint not null,
primary key (id)
) type=InnoDB;

Expand Down
3 changes: 2 additions & 1 deletion doc/download.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ function show_download($pname) {
| <a href=release_notes.php><nobr>".tr(DL_RELNOTES)."</nobr></a>
";
if ($pname) {
echo " | <a href=download.php?all_platforms=1><nobr>".tr(DL_OTHERSYS)."</nobr></a>
//echo " | <a href=download.php?all_platforms=1><nobr>".tr(DL_OTHERSYS)."</nobr></a>
echo " | <a href=download_all.php></nobr>".tr(DL_ALLVERSIONS)."</nobr></a>
";
} else {
echo " | <a href=download_all.php></nobr>".tr(DL_ALLVERSIONS)."</nobr></a>
Expand Down
2 changes: 1 addition & 1 deletion doc/download_all.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

$xml = $_GET["xml"];
$dev = $_GET["dev"];
$dev=1;
$pname = $_GET["platform"];
$min_version = $_GET["min_version"];
$max_version = $_GET["max_version"];
Expand Down Expand Up @@ -200,7 +201,6 @@ function show_platform_xml($short_name, $p, $dev) {
We are now using mirrored download servers at partner institutions.
Your download will come from a randomly-chosen server.
Thanks to these partners for their help.
<p>
<b>If you have trouble downloading a file,
please reload this page in your browser and try again.
This will link to a different download mirror and may
Expand Down
40 changes: 32 additions & 8 deletions doc/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,46 @@
<p>
Once a file is created (on a data server or a participant host) it
is <b>immutable</b>.
This means that all replicas of that file are assumed (and required) to be identical.
This means that all replicas of that file are assumed (and required)
to be identical.
If a file is changed, even by a single byte, it becomes a new file,
and must be given a different name than the original.
<a name=file></a>
<h3>File properties</h3>
Files have various <b>properties</b>, including:
Files have various properties, including:
<ul>
<li> <b>Name</b>: unique identifier for the file.
<li> <b>Sticky</b>: don't delete file on client (see below).
<li> <b>Report on RPC</b>: include a description of this file
in scheduler requests.
<li> <b>Maximum size</b>: if an output file exceeds its maximum size,
the computation is aborted.
</ul>
File properties are specified in XML.
For example, the properties of input files are described in
the <a href=tools_work.php>workunit template</a>,
and XML document describing the task.
The XML format is described <a href=xml.php>here</a>.
File properties are specified in <a href=xml.php>XML elements</a>
that appear, for example, in <a href=tools_work.php>workunit templates</a>.
<a name=file_ref></a>
<h3>File references</h3>
In addition to the properties of a file itself,
there are several properties of the way a particular
application uses a file;
this is called a <b>file reference</b>.
<ul>
<li> <b>open_name</b> (or 'logical name'):
the name by which the program will refer to the file
(BOINC provides a mechanism for mapping logical names
to physical names, so that your applications don't
have to know the physical names of their input and output files).
<li> <b>copy file</b>: use this if your application
doesn't use BOINC's filename-mapping mechanism.
<li> <b>optional</b>: Use this for output files, to indicate
that the application doesn't always generate the file,
and that its absence should not be treated as an error.
</ul>
File reference properties are specified in
<a href=xml.php#file_ref>XML elements</a>.
<a name=file_ref></a>
<h3>File management</h3>
Expand Down Expand Up @@ -110,7 +134,7 @@
<h3>Compression of output files</h3>
<p>
If you include the <code>&lt;gzip_when_done&gt;</code>
tag in an <a href=xml.php>output file description</a>,
tag in an <a href=xml.php#file>output file description</a>,
the file will be gzip-compressed after it has been generated.
";
page_tail();
Expand Down
4 changes: 2 additions & 2 deletions doc/tools_work.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
";
list_start();
list_item(htmlspecialchars("<file_info>, <file_ref>"),
"Each pair describes an <a href=files.php>input file</a>
and <a href=files.php#file_ref>the name by which it's referenced</a>.");
"Each pair describes an <a href=files.php#file>input file</a>
and <a href=files.php#file_ref>the way it's referenced</a>.");
list_item(htmlspecialchars("<command_line>"),
"The command-line arguments to be passed to the main program.");
list_item("Other elements",
Expand Down
24 changes: 15 additions & 9 deletions doc/xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
BOINC uses XML to describe various entities.
These XML elements appear in:
<ul>
<li> <a href=tools_work.php>Workunit and result templates</a>
<li> <a href=database.php>The BOINC database</a>
<li> <a href=protocol.php>Scheduler request and reply messages</a>
<li> <a href=client_files.php>The client state file</a>
Expand All @@ -16,7 +17,7 @@
<a name=file></a>
<h3>Files</h3>
<p>
A file is described by an XML element of the form
A <a href=files.php>file</a> is described by an element of the form
".html_text("
<file_info>
<name>foobar</name> *
Expand Down Expand Up @@ -133,6 +134,7 @@
[ <open_name>input</open_name> ]
[ <main_program/> ]
[ <copy_file/> ]
[ <optional/> ]
</file_ref>
")."
The elements are as follows:
Expand All @@ -144,10 +146,9 @@
Applications access files using
<a href=api.php>the following functions</a>:
<pre>
char physical_name[256];
boinc_resolve_filename(\"input\", physical_name, 256);
fopen(physical_name, \"r\")
</pre>
char physical_name[256];
boinc_resolve_filename(\"input\", physical_name, 256);
fopen(physical_name, \"r\")</pre>
In this example, open_name is 'input'.
It is mapped, at runtime, to a path that includes
the filename ('foobar' in the example above).
Expand All @@ -157,14 +158,19 @@
It indicates that this file is the application's main program.
");
list_item("copy_file",
"Use this when an application doesn't use
"Use this if your application doesn't use
boinc_resolve_filename() to make logical to physical filenames
(for example, executables without source code).
If present on an input file,
copy the file to the slot directory before starting application.
BOINC will copy the file to the slot directory
before starting the application.
If present on an output file,
move the file from the slot directory to the project directory
after the application."
BOINC will move the file from the slot directory to the project directory
after the application has finished."
);
list_item("optional",
"Use this for output files that may not be created by the application.
Otherwise, missing output files are treated as an error."
);
list_end();

Expand Down
6 changes: 5 additions & 1 deletion html/ops/db_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ function update_8_8_2006() {
do_query("alter table forum_preferences add banished_until integer not null default 0");
}

//update_8_8_2006();
function update_10_21_2006() {
do_query("alter table app add beta smallint not null default 0");
}

//update_10_21_2006();

?>
5 changes: 4 additions & 1 deletion py/Boinc/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ class App(DatabaseObject):
'min_version',
'deprecated',
'user_friendly_name',
'homogeneous_redundancy' ])
'homogeneous_redundancy',
'weight',
'beta'
])

class AppVersion(DatabaseObject):
_table = DatabaseTable(
Expand Down
54 changes: 23 additions & 31 deletions sched/sched_send.C
Original file line number Diff line number Diff line change
Expand Up @@ -248,31 +248,31 @@ static double estimate_wallclock_duration(
return ewd;
}

// Find or compute various details for the host.
// Find or compute various info about the host.
// These parameters affect how work is sent to the host
//
static int get_host_details(SCHEDULER_REPLY& reply) {
static int get_host_info(SCHEDULER_REPLY& reply) {
char buf[8096];
std::string str;
extract_venue(reply.user.project_prefs, reply.host.venue, buf);
str = buf;
unsigned int pos = 0;
int temp_int;
USER_APP_DTL* app_dtl;

// scan user's project prefs for elements of the form <app_id>N</app_id>,
// indicating the apps they want to run.
//
reply.wreq.host_info.preferred_apps.clear();
while (parse_int(str.substr(pos,str.length()-pos).c_str(), "<app_id>", temp_int)) {
app_dtl = new USER_APP_DTL();
app_dtl->appid = temp_int;
app_dtl->work_available=0;
reply.wreq.host_dtls.preferred_apps.push_back(app_dtl);
APP_INFO ai;
ai.appid = temp_int;
ai.work_available=0;
reply.wreq.host_info.preferred_apps.push_back(ai);

pos = str.find("<app_id>", pos) + 1;
}
temp_int = parse_int(buf,"<allow_beta_work>",temp_int);
reply.wreq.host_dtls.allow_beta_work = temp_int;
reply.wreq.host_info.allow_beta_work = temp_int;

// Decide whether or not this computer is a 'reliable' computer
//
Expand All @@ -285,7 +285,7 @@ static int get_host_details(SCHEDULER_REPLY& reply) {
if (((expavg_credit/reply.host.p_ncpus) > config.reliable_min_avg_credit || config.reliable_min_avg_credit == 0)
&& (avg_turnaround < config.reliable_min_avg_turnaround || config.reliable_min_avg_turnaround == 0)
){
reply.wreq.host_dtls.reliable = true;
reply.wreq.host_info.reliable = true;
log_messages.printf(SCHED_MSG_LOG::MSG_NORMAL,
"[HOST#%d] is reliable (OS = %s) expavg_credit = %.0f avg_turnaround(hours) = %.0f \n",
reply.host.id, reply.host.os_name, expavg_credit,
Expand All @@ -296,7 +296,7 @@ static int get_host_details(SCHEDULER_REPLY& reply) {
if (((expavg_credit/reply.host.p_ncpus) > config.reliable_min_avg_credit*.75 || config.reliable_min_avg_credit == 0)
&& (avg_turnaround < config.reliable_min_avg_turnaround*1.25 || config.reliable_min_avg_turnaround == 0)
){
reply.wreq.host_dtls.reliable = true;
reply.wreq.host_info.reliable = true;
log_messages.printf(SCHED_MSG_LOG::MSG_NORMAL,
"[HOST#%d] is reliable (OS = %s) expavg_credit = %.0f avg_turnaround(hours) = %.0f \n",
reply.host.id, reply.host.os_name, expavg_credit,
Expand All @@ -309,8 +309,8 @@ static int get_host_details(SCHEDULER_REPLY& reply) {

int find_preferred_app_index(SCHEDULER_REPLY& reply, int appid) {
int result = -1;
for (int i=0; i<reply.wreq.host_dtls.preferred_apps.size(); i++) {
if (reply.wreq.host_dtls.preferred_apps[i]->appid == appid ) {
for (int i=0; i<reply.wreq.host_info.preferred_apps.size(); i++) {
if (reply.wreq.host_info.preferred_apps[i].appid == appid ) {
result = i;
break;
}
Expand Down Expand Up @@ -341,17 +341,16 @@ int wu_is_infeasible(
// TODO: call find_allowed_apps() only once, not once for each WU!!
//
bool app_allowed = false;
if (reply.wreq.host_dtls.preferred_apps.size() > 0) {
for (i=0; i<reply.wreq.host_dtls.preferred_apps.size(); i++) {
if (reply.wreq.host_info.preferred_apps.size() > 0) {
for (i=0; i<reply.wreq.host_info.preferred_apps.size(); i++) {
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG,
"Scanning preferred apps. index=%d, appid=%d, work_avail=%d\n",
i, reply.wreq.host_dtls.preferred_apps[i]->appid,
reply.wreq.host_dtls.preferred_apps[i]->work_available
i, reply.wreq.host_info.preferred_apps[i].appid,
reply.wreq.host_info.preferred_apps[i].work_available
);
if (wu.appid==reply.wreq.host_dtls.preferred_apps[i]->appid) {

if (wu.appid==reply.wreq.host_info.preferred_apps[i].appid) {
app_allowed = true;
reply.wreq.host_dtls.preferred_apps[i]->work_available=1;
reply.wreq.host_info.preferred_apps[i].work_available=1;
break;
}
}
Expand Down Expand Up @@ -725,7 +724,7 @@ int add_result_to_reply(
// then shorten the delay bound by the percent specified
//
int delay_bound = wu.delay_bound;
if (config.reliable_time && reply.wreq.host_dtls.reliable && config.reliable_reduced_delay_bound > 0.01) {
if (config.reliable_time && reply.wreq.host_info.reliable && config.reliable_reduced_delay_bound > 0.01) {
if ((wu.create_time + config.reliable_time) <= time(0)) {
delay_bound = (int) (delay_bound * config.reliable_reduced_delay_bound);
}
Expand Down Expand Up @@ -838,7 +837,7 @@ int send_work(
reply.wreq.core_client_version = sreq.core_client_major_version*100
+ sreq.core_client_minor_version;
reply.wreq.nresults = 0;
get_host_details(reply); // parse project prefs for app details
get_host_info(reply); // parse project prefs for app details
reply.wreq.beta_only = false;

log_messages.printf(
Expand Down Expand Up @@ -873,7 +872,7 @@ int send_work(
} else {
// give top priority to results that require a 'reliable host'
//
if (reply.wreq.host_dtls.reliable) {
if (reply.wreq.host_info.reliable) {
reply.wreq.reliable_only = true;
reply.wreq.infeasible_only = false;
scan_work_array(sreq, reply, platform, ss);
Expand All @@ -884,7 +883,7 @@ int send_work(
// (projects should load beta work with care
// otherwise your users won't get production work done!
//
if (reply.wreq.host_dtls.allow_beta_work) {
if (reply.wreq.host_info.allow_beta_work) {
reply.wreq.beta_only=true;
log_messages.printf(
SCHED_MSG_LOG::MSG_DEBUG,
Expand All @@ -893,7 +892,7 @@ int send_work(
);
scan_work_array(sreq, reply, platform, ss);
}
reply.wreq.beta_only=false;
reply.wreq.beta_only = false;

// give next priority to results that were infeasible for some other host
//
Expand Down Expand Up @@ -1020,13 +1019,6 @@ int send_work(
}
}

// free memory
//
for (int i=0; i<reply.wreq.host_dtls.preferred_apps.size(); i++) {
delete(reply.wreq.host_dtls.preferred_apps[i]);
}
reply.wreq.host_dtls.preferred_apps.clear();

return 0;
}

Expand Down
Loading

0 comments on commit 190f7d1

Please sign in to comment.