svn path=/trunk/boinc/; revision=685
This commit is contained in:
David Anderson 2002-12-05 19:13:06 +00:00
parent 5ed6b781dc
commit ed72992ee4
27 changed files with 183 additions and 68 deletions

View File

@ -422,11 +422,8 @@ bool ACTIVE_TASK_SET::poll() {
}
return found;
#endif
#else
#if HAVE_SYS_RESOURCE_H
#if HAVE_SYS_WAIT_H
#if HAVE_SYS_TIME_H
struct rusage rs;
int pid;
int stat;
@ -455,8 +452,6 @@ bool ACTIVE_TASK_SET::poll() {
atp->state = PROCESS_EXIT_UNKNOWN;
atp->result->exit_status = -1;
}
#endif
#endif
#endif
atp->read_stderr_file();

View File

@ -20,15 +20,6 @@
#ifndef _TASK_
#define _TASK_
// Possible states of a process in an ACTIVE_TASK
#define PROCESS_UNINITIALIZED 0
#define PROCESS_RUNNING 1
#define PROCESS_EXITED 2
#define PROCESS_WAS_SIGNALED 3
#define PROCESS_EXIT_UNKNOWN 4
typedef int PROCESS_ID;
#include "windows_cpp.h"
#ifdef _WIN32
#include <afxwin.h>
@ -39,11 +30,21 @@ typedef int PROCESS_ID;
#include "client_types.h"
// Possible states of a process in an ACTIVE_TASK
#define PROCESS_UNINITIALIZED 0
#define PROCESS_RUNNING 1
#define PROCESS_EXITED 2
#define PROCESS_WAS_SIGNALED 3
#define PROCESS_EXIT_UNKNOWN 4
#define PROCESS_ABORTED 5
// process exceeded time or disk limits
typedef int PROCESS_ID;
class CLIENT_STATE;
// The following classes provide an interface for task execution
// represents a task in progress
// ACTIVE_TASK represents a task in progress.
// Written to the client state file so that tasks can be restarted.
//
class ACTIVE_TASK {
public:

View File

@ -506,6 +506,8 @@ int WORKUNIT::parse(FILE* in) {
app = NULL;
project = NULL;
seconds_to_complete = 0;
max_processing = DEFAULT_MAX_PROCESSING;
max_disk = DEFAULT_MAX_DISK;
while (fgets(buf, 256, in)) {
if (match_tag(buf, "</workunit>")) return 0;
else if (parse_str(buf, "<name>", name, sizeof(name))) continue;
@ -514,6 +516,8 @@ int WORKUNIT::parse(FILE* in) {
else if (parse_str(buf, "<command_line>", command_line, sizeof(command_line))) continue;
else if (parse_str(buf, "<env_vars>", env_vars, sizeof(env_vars))) continue;
else if (parse_double(buf, "<seconds_to_complete>", seconds_to_complete)) continue;
else if (parse_double(buf, "<max_processing>", max_processing)) continue;
else if (parse_double(buf, "<max_disk>", max_disk)) continue;
else if (match_tag(buf, "<file_ref>")) {
file_ref.parse(in);
input_files.push_back(file_ref);

View File

@ -35,6 +35,8 @@
#include "hostinfo.h"
#define STDERR_MAX_LEN 4096
#define DEFAULT_MAX_PROCESSING 1
#define DEFAULT_MAX_DISK 1000000
class PERS_FILE_XFER;
struct RESULT;
@ -181,7 +183,9 @@ struct WORKUNIT {
APP* app;
APP_VERSION* avp;
int ref_cnt;
double seconds_to_complete; //needs to be initialized
double seconds_to_complete; // needs to be initialized
double max_processing; // abort if use this many cobblestones
double max_disk; // abort if use this much disk
int parse(FILE*);
int write(FILE*);
@ -193,7 +197,7 @@ struct WORKUNIT {
#define RESULT_FILES_DOWNLOADED 1
// Files are downloaded, result can be computed
#define RESULT_COMPUTE_DONE 2
// Computation is done, files need to be uploaded
// Computation is done, if no error then files need to be uploaded
#define RESULT_READY_TO_ACK 3
// Files are uploaded, notify scheduling server
#define RESULT_SERVER_ACK 4
@ -206,7 +210,7 @@ struct RESULT {
vector<FILE_REF> output_files;
bool is_active; // an app is currently running for this
double final_cpu_time;
int state; // status of this result
int state; // status of this result
int exit_status; // return value from the application
char stderr_out[STDERR_MAX_LEN];
APP* app;

View File

@ -114,6 +114,12 @@ create table host (
primary key (id)
);
/*
* Only information needed by the server or other backend components
* is broken out into separate fields.
* Other info, i.e. that needed by the client (files, etc.)
* is stored in the XML doc
*/
create table workunit (
id integer not null auto_increment,
create_time integer not null,

View File

@ -13,34 +13,55 @@ The attributes of a workunit include:
(see below).
<li> The estimated resource requirements of the work unit
(computation, memory, disk space).
<li> A <b>delay bound</b>: upper bound on how long
<li> The maximum processing
(measured in <a href=credit.html>Cobblestones</a>)
and maximum disk space to be used for the computation.
An instance of the computation that exceeds either of these bounds
will be aborted.
This mechanism is used to prevent an infinite-loop bug from
indefinitely incapacitating a host.
<li> A <b>delay bound</b>: upper bound on how long (in real time)
a result associated with this work unit should take to complete.
This determines which hosts the workunit can be sent to,
and it's used to assign result deadlines and
times for retrying results.
</ul>
<p>
The inputs to a workunit are described by an XML document of the form
Some parameters of a workunit are described by an XML document of the form
<pre>
[ &lt;file_info>...&lt;/file_info> ]
[ ... ]
&lt;workunit>
[ &lt;command_line>-flags xyz&lt;/command_line> ]
[ &lt;env_vars>name=val&amp;name=val&lt;/env_vars> ]
[ &lt;max_processing>...&lt;/max_processing> ]
[ &lt;max_disk>...&lt;/max_disk> ]
[ &lt;file_ref>...&lt;/file_ref> ]
[ ... ]
&lt;/workunit>
</pre>
The components are:
<ul>
<li> The <b>&lt;command_line></b> element, if present, is the
command-line arguments to be passed to the main program.
<li> The <b>&lt;env_vars></b> element, if present, is a list of
environment variables to be passed to the main program.
<li> Each <b>&lt;file_ref></b> element describes a <a
<table border=1 cellpadding=6>
<tr><td>&lt;command_line></td>
<td>The command-line arguments to be passed to the main program.
</td></tr>
<tr><td>&lt;env_vars></td>
<td>A list of environment variables in the form
name=value&name=value&name=value.
</td></tr>
<tr><td>&lt;max_processing></td>
<td>Maximum processing (in Cobblestones).
The default is determined by the client; typically it is 1.
</td></tr>
<tr><td>&lt;max_disk></td>
<td>Maximum disk usage (in bytes).
The default is determined by the client; typically it is 1,000,000.
</td></tr>
<tr><td>&lt;file_ref></td>
<td> describes a <a
href="files.html">reference</a> to an input file, each of which is
described by a <b>&lt;file_info></b> element.
</ul>
</td></tr></table>
<p>
A workunit is associated with an application, not with a particular
version or range of versions.

View File

@ -16,7 +16,7 @@
add_core_client(null);
add_user(null);
add_app("setiathome-3.06",null,null);
create_work("-appname setiathome-3.06 -wu_name sah_wu -wu_template sah_wu -result_template sah_result -nresults 1 work_unit.sah");
create_work("-appname setiathome-3.06 -wu_name sah_wu -wu_template sah_wu -result_template sah_result -redundancy 1 work_unit.sah");
echo "starting feeder\n";
start_feeder();
echo "started feeder\n";

View File

@ -616,7 +616,7 @@ class Work {
var $app;
var $wu_template;
var $result_template;
var $nresults;
var $redundancy;
var $input_files;
var $rsc_iops;
var $rsc_fpops;
@ -630,6 +630,7 @@ class Work {
$this->rcs_fpops = 100000000000;
$this->rcs_disk = 1000000;
$this->delay_bound = 1000;
$this->redundancy = 1;
}
function install($project) {
@ -674,9 +675,9 @@ if (false) { // doesn't belong here; needs comment
}
}
fclose($f);
}
$cmd = "create_work -db_name $project->db_name -download_dir $project->project_dir/download -upload_url $project->upload_url -download_url $project->download_url -keyfile $project->key_dir/upload_private -appname $app->name -rsc_iops $this->rcs_iops -rsc_fpops $this->rsc_fpops -rsc_disk $this->rsc_disk -wu_template $this->wu_template -result_template $this->result_template -redundancy $this->redundancy -wu_name $this->wu_template -delay_bound $this->delay_bound";
$cmd = "create_work -db_name $project->db_name -download_dir $project->project_dir/download -upload_url $project->upload_url -download_url $project->download_url -keyfile $project->key_dir/upload_private -appname $app->name -rsc_iops $this->rcs_iops -rsc_fpops $this->rsc_fpops -rsc_disk $this->rsc_disk -wu_template $this->wu_template -result_template $this->result_template -nresults $this->nresults -wu_name $this->wu_template -delay_bound $this->delay_bound";
for ($i=0; $i<sizeof($this->input_files); $i++) {
$x = $this->input_files[$i];
$cmd = $cmd." ".$x;

View File

@ -39,7 +39,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 5;
$work->redundancy = 5;
$work->delay_bound = 60;
array_push($work->input_files, "input");
$work->install($project1);

View File

@ -23,7 +23,7 @@
$work = new Work($app);
$work->wu_template = "concat_wu";
$work->result_template = "concat_result";
$work->nresults = 2;
$work->redundancy = 2;
array_push($work->input_files, "input");
array_push($work->input_files, "input");
$work->install($project);

View File

@ -32,7 +32,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
$work->delay_bound = 10;
array_push($work->input_files, "input");
$work->install($project);

View File

@ -25,7 +25,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
array_push($work->input_files, "input");
$work->install($project);

View File

@ -32,7 +32,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
$work->delay_bound = 10;
array_push($work->input_files, "input");
$work->install($project);

View File

@ -32,7 +32,7 @@
$work = new Work($app);
$work->wu_template = "uc_multiple_download_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
$work->delay_bound = 10;
array_push($work->input_files, "input");
$work->install($project);

View File

@ -26,7 +26,7 @@ echo "adding work\n";
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
array_push($work->input_files, "input");
$work->install($project);
$project->start_feeder();

View File

@ -25,7 +25,6 @@
$work = new Work($app);
$work->wu_template = "ucs_wu";
$work->result_template = "ucs_result";
$work->nresults = 1;
array_push($work->input_files, "small_input");
$work->install($project);

View File

@ -25,7 +25,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 1;
$work->redundancy = 1;
$work->rsc_disk = 1000000000000; // 1 TB
$work->rsc_fpops = 0;
array_push($work->input_files, "input");

View File

@ -32,7 +32,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
$work->delay_bound = 10;
array_push($work->input_files, "input");
$work->install($project);

View File

@ -24,7 +24,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu_sticky";
$work->result_template = "uc_result_sticky";
$work->nresults = 2;
$work->redundancy = 2;
array_push($work->input_files, "input");
$work->install($project);

View File

@ -24,7 +24,7 @@
$work = new Work($app);
$work->wu_template = "uccpu_wu";
$work->result_template = "uccpu_result";
$work->nresults = 1;
$work->redundancy = 1;
array_push($work->input_files, "small_input");
$work->install($project);

View File

@ -33,7 +33,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
$work->delay_bound = 10;
array_push($work->input_files, "input");
$work->install($project);

View File

@ -25,7 +25,6 @@
$work = new Work($app);
$work->wu_template = "ucs_wu";
$work->result_template = "ucs_result";
$work->nresults = 1;
array_push($work->input_files, "small_input");
$work->install($project);

View File

@ -24,7 +24,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
array_push($work->input_files, "input");
$work->install($project);

View File

@ -32,7 +32,7 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->nresults = 2;
$work->redundancy = 2;
$work->delay_bound = 10;
array_push($work->input_files, "input");
$work->install($project);

25
todo
View File

@ -1,3 +1,28 @@
Windows hostinfo: CPU, #cpus, OS, memory, domain, IP address,
swap, disk, free
validate in crontab
email account ID
formatting of team, top user page
top hosts page is screwed up
make "external user view" page (no private info)
list hosts 1 per line, linked
Windows client
"bring up graphics" button in core client
make mini-logo
test uninstall
fix "unable to calculate"
fix disk usage labels, limit size of pie
choose GB or MB correctly
get rid of xfers, results eventually
"free avail for boinc should be nonzero"
messages: prepend project name, have date/time
xfers: show file size,
done xfers: show elapsed time
done results: show used CPU time
notation for CPU time: HH:MM:SS
-----------------------
test feeder reread-DB mechanism
use PHP session mechanism instead of our own cookies

View File

@ -82,12 +82,14 @@ static int process_wu_template(
bool found;
int i, retval;
double nbytes;
assert(wu_name!=NULL);
assert(tmplate!=NULL);
assert(out!=NULL);
assert(dirpath!=NULL);
assert(infiles!=NULL);
assert(n>=0);
strcpy(out, tmplate);
while (1) {
found = false;
@ -244,3 +246,42 @@ int create_work(
}
return 0;
}
int create_sequence(
WORKUNIT& wu,
char* wu_template,
char* result_template_filename,
int redundancy,
char* infile_dir,
char** infiles,
int ninfiles,
R_RSA_PRIVATE_KEY& key,
char* upload_url, char* download_url,
int nsteps
) {
int i, retval;
retval = db_workseq_new(ws);
if (retval) return retval;
for (i=0; i<nsteps; i++) {
}
}
int create_sequence_group(
WORKUNIT& wu,
char* wu_template,
char* result_template_filename,
int redundancy,
char* infile_dir,
char** infiles,
int ninfiles,
R_RSA_PRIVATE_KEY& key,
char* upload_url, char* download_url,
int nsteps
) {
WORKSEQ ws;
int i;
for (i=0; i<redundancy; i++) {
}
}

View File

@ -22,7 +22,7 @@
// -wu_name name
// -wu_template filename
// -result_template filename
// -nresults n
// -redundancy n
// -db_name x
// -db_passwd x
// -upload_url x
@ -34,6 +34,7 @@
// -rsc_disk n
// -keyfile path
// -delay_bound x
// -sequence n
// infile1 infile2 ...
//
// Create a workunit and results.
@ -60,7 +61,7 @@ int main(int argc, char** argv) {
char wu_template_file[256], result_template_file[256];
char keyfile[256];
char** infiles;
int i, ninfiles, nresults;
int i, ninfiles, redundancy, sequence=0;
R_RSA_PRIVATE_KEY key;
char download_dir[256], db_name[256], db_passwd[256];
char upload_url[256], download_url[256];
@ -69,7 +70,7 @@ int main(int argc, char** argv) {
strcpy(app.name, "");
strcpy(db_passwd, "");
strcpy(keyfile, "");
nresults = 1;
redundancy = 1;
i = 1;
ninfiles = 0;
memset(&wu, 0, sizeof(wu));
@ -92,8 +93,8 @@ int main(int argc, char** argv) {
strcpy(wu_template_file, argv[++i]);
} else if (!strcmp(argv[i], "-result_template")) {
strcpy(result_template_file, argv[++i]);
} else if (!strcmp(argv[i], "-nresults")) {
nresults = atoi(argv[++i]);
} else if (!strcmp(argv[i], "-redundancy")) {
redundancy = atoi(argv[++i]);
} else if (!strcmp(argv[i], "-rsc_fpops")) {
wu.rsc_fpops = atof(argv[++i]);
} else if (!strcmp(argv[i], "-rsc_iops")) {
@ -106,6 +107,8 @@ int main(int argc, char** argv) {
strcpy(keyfile, argv[++i]);
} else if (!strcmp(argv[i], "-delay_bound")) {
wu.delay_bound = atoi(argv[++i]);
} else if (!strcmp(argv[i], "-sequence")) {
sequence = atoi(argv[++i]);
} else {
infiles = argv+i;
ninfiles = argc - i;
@ -149,18 +152,34 @@ int main(int argc, char** argv) {
exit(1);
}
retval = create_work(
wu,
wu_template,
result_template_file,
nresults,
download_dir,
infiles,
ninfiles,
key,
upload_url,
download_url
);
if (retval) fprintf(stderr, "create_work: %d\n", retval);
if (sequence) {
retval = create_sequence(
wu,
wu_template,
result_template_file,
redundancy,
download_dir,
infiles,
ninfiles,
key,
upload_url,
download_url,
sequence
);
} else {
retval = create_work(
wu,
wu_template,
result_template_file,
redundancy,
download_dir,
infiles,
ninfiles,
key,
upload_url,
download_url
);
if (retval) fprintf(stderr, "create_work: %d\n", retval);
}
db_close();
}