*** empty log message ***

svn path=/trunk/boinc/; revision=6204
This commit is contained in:
David Anderson 2005-05-20 17:57:10 +00:00
parent d0418dcf9a
commit c459be7828
5 changed files with 33 additions and 6 deletions

View File

@ -6800,3 +6800,17 @@ David 20 May 2005
doc/
download.php
versions.inc (new)
David 20 May 2005
- Added mechanism to report results sooner in some cases.
- results have a new field "completed time":
the time when ready_to_report was set.
- a project's completed results are reported when either
1) the time is within a day of a report deadline, or
2) the time is more than work_buf_min_days after
r.completed_time for some result r.
client/
client_state.C
client_types.C,h
cs_scheduler.C

View File

@ -1029,6 +1029,7 @@ bool CLIENT_STATE::update_results(double now) {
case RESULT_FILES_UPLOADING:
if (rp->is_upload_done()) {
rp->ready_to_report = true;
rp->completed_time = now;
rp->state = RESULT_FILES_UPLOADED;
action = true;
}
@ -1079,6 +1080,7 @@ int CLIENT_STATE::report_result_error(
}
res.ready_to_report = true;
res.completed_time = dtime();
va_list va;
va_start(va, format);

View File

@ -1120,6 +1120,7 @@ void RESULT::clear() {
output_files.clear();
state = RESULT_NEW;
ready_to_report = false;
completed_time = 0;
got_server_ack = false;
final_cpu_time = 0;
exit_status = 0;
@ -1191,6 +1192,7 @@ int RESULT::parse_state(MIOFILE& in) {
else if (parse_int(buf, "<exit_status>", exit_status)) continue;
else if (match_tag(buf, "<got_server_ack/>")) got_server_ack = true;
else if (match_tag(buf, "<ready_to_report/>")) ready_to_report = true;
else if (parse_double(buf, "<completed_time>", completed_time)) continue;
else if (match_tag(buf, "<suspended_via_gui/>")) suspended_via_gui = true;
else if (match_tag(buf, "<aborted_via_gui/>")) aborted_via_gui = true;
else if (parse_int(buf, "<state>", state)) continue;
@ -1255,6 +1257,7 @@ int RESULT::write(MIOFILE& out, bool to_server) {
} else {
if (got_server_ack) out.printf(" <got_server_ack/>\n");
if (ready_to_report) out.printf(" <ready_to_report/>\n");
if (completed_time) out.printf(" <completed_time>%f</completed_time>\n", completed_time);
if (suspended_via_gui) out.printf(" <suspended_via_gui/>\n");
if (aborted_via_gui) out.printf(" <aborted_via_gui/>\n");
out.printf(
@ -1294,6 +1297,7 @@ int RESULT::write_gui(MIOFILE& out) {
);
if (got_server_ack) out.printf(" <got_server_ack/>\n");
if (ready_to_report) out.printf(" <ready_to_report/>\n");
if (completed_time) out.printf(" <completed_time>%f</completed_time>\n", completed_time);
if (suspended_via_gui) out.printf(" <suspended_via_gui/>\n");
if (aborted_via_gui) out.printf(" <aborted_via_gui/>\n");
ACTIVE_TASK* atp = gstate.active_tasks.lookup_result(this);

View File

@ -334,6 +334,8 @@ struct RESULT {
// we're ready to report this result to the server;
// either computation is done and all the files have been uploaded
// or there was an error
double completed_time;
// time when ready_to_report was set
bool got_server_ack;
// we're received the ack for this result from the server
double final_cpu_time;

View File

@ -333,8 +333,13 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p, double work_req) {
return 0;
}
// find a project with results that are overdue to report,
// and which we're allowed to contact.
// find a project with finished results that should be reported.
// This means:
// - we're not backing off contacting the project
// - 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.
//
PROJECT* CLIENT_STATE::find_project_with_overdue_results() {
unsigned int i;
@ -344,9 +349,6 @@ PROJECT* CLIENT_STATE::find_project_with_overdue_results() {
for (i=0; i<results.size(); i++) {
r = results[i];
// return the project for this result to report if:
// - we're not backing off a scheduler request for its project
// - we're ready_to_report (compute done; files uploaded)
// - we're almost at the report_deadline
//
PROJECT* p = r->project;
@ -354,7 +356,10 @@ PROJECT* CLIENT_STATE::find_project_with_overdue_results() {
if (p->suspended_via_gui) continue;
if (!r->ready_to_report) continue;
if (r->report_deadline <= (now + REPORT_DEADLINE_CUSHION)) {
if (now > r->report_deadline - REPORT_DEADLINE_CUSHION) {
return p;
}
if (now > r->completed_time + global_prefs.work_buf_min_days) {
return p;
}
}