*** empty log message ***

svn path=/trunk/boinc/; revision=2490
This commit is contained in:
David Anderson 2003-10-16 18:10:56 +00:00
parent fed956310f
commit b089311fc3
6 changed files with 48 additions and 5 deletions

View File

@ -6826,3 +6826,14 @@ David 15 Oct 2003
graphics.php
lib/
error_numbers.h
David 16 Oct 2003
- add "userid" to result table
- send at most one result per WU per user
db/
boinc_db.C,h
schema.sql
constraints.sql
sched/
handle_request.C

View File

@ -444,7 +444,8 @@ void DB_RESULT::db_print(char* buf){
buf,
"id=%d, create_time=%d, workunitid=%d, "
"server_state=%d, outcome=%d, client_state=%d, "
"hostid=%d, report_deadline=%d, sent_time=%d, received_time=%d, "
"hostid=%d, userid=%d, "
"report_deadline=%d, sent_time=%d, received_time=%d, "
"name='%s', cpu_time=%.15e, "
"xml_doc_in='%s', xml_doc_out='%s', stderr_out='%s', "
"batch=%d, file_delete_state=%d, validate_state=%d, "
@ -452,7 +453,8 @@ void DB_RESULT::db_print(char* buf){
"client_version_num=%d",
id, create_time, workunitid,
server_state, outcome, client_state,
hostid, report_deadline, sent_time, received_time,
hostid, userid,
report_deadline, sent_time, received_time,
name, cpu_time,
xml_doc_in, xml_doc_out, stderr_out,
batch, file_delete_state, validate_state,
@ -472,6 +474,7 @@ void DB_RESULT::db_parse(MYSQL_ROW &r) {
outcome = atoi(r[i++]);
client_state = atoi(r[i++]);
hostid = atoi(r[i++]);
userid = atoi(r[i++]);
report_deadline = atoi(r[i++]);
sent_time = atoi(r[i++]);
received_time = atoi(r[i++]);

View File

@ -346,11 +346,12 @@ struct RESULT {
int server_state; // see above
int outcome; // see above; defined if server state OVER
int client_state; // phase that client contacted us in.
// iff it is UPLOADED then outcome is success.
// if UPLOADED then outcome is success.
// error details are in stderr_out.
// The values for this field are defined
// in lib/result_state.h
int hostid; // host processing this result
int userid; // user processing this result
int report_deadline; // deadline for receiving result
int sent_time; // when result was sent to host
int received_time; // when result was received from host

View File

@ -42,6 +42,7 @@ alter table result
add index ind_res_st (server_state, random),
add index res_filedel (file_delete_state),
add index res_hostid (hostid),
add index res_wu_user (workunitid, userid),
add index received_time (received_time);
alter table host

View File

@ -181,6 +181,7 @@ create table result (
outcome integer not null,
client_state integer not null,
hostid integer not null,
userid integer not null,
report_deadline integer not null,
sent_time integer not null,
received_time integer not null,

View File

@ -674,10 +674,11 @@ static void scan_work_array(
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
SCHED_SHMEM& ss
) {
int i, retval;
int i, retval, n;
WORKUNIT wu;
DB_RESULT result;
double wu_seconds_filled;
char buf[256];
for (i=0; i<ss.nwu_results && seconds_to_fill>0; i++) {
WU_RESULT& wu_result = ss.wu_results[i];
@ -698,8 +699,32 @@ static void scan_work_array(
continue;
}
// don't send if we've already a result of this WU to this user
//
sprintf(buf,
"where workunitid=%d and userid=%d",
wu_result.workunit.id, reply.user.id
);
retval = result.count(n, buf);
if (retval) {
log_messages.printf(
SchedMessages::CRITICAL,
"send_work: can't get result count (%d)\n", retval
);
continue;
} else {
if (n>0) {
log_messages.printf(
SchedMessages::NORMAL,
"send_work: user %d already has %d result for WU %d\n",
reply.user.id, n, wu_result.workunit.id
);
}
}
// don't sent if host can't handle it
//
wu = wu_result.workunit;
if (!wu_is_feasible(wu, reply.host)) {
log_messages.printf(
SchedMessages::DEBUG, "[HOST#%d] [WU#%d %s] WU is infeasible\n",
@ -736,6 +761,7 @@ static void scan_work_array(
//
result.server_state = RESULT_SERVER_STATE_IN_PROGRESS;
result.hostid = reply.host.id;
result.userid = reply.user.id;
result.sent_time = time(0);
result.report_deadline = result.sent_time + wu.delay_bound;
result.update();