mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=4290
This commit is contained in:
parent
4fc2e50397
commit
92db7284e4
|
@ -18040,3 +18040,16 @@ David 4 Oct 2004
|
|||
db/
|
||||
boinc_db.C,h
|
||||
db_base.C,h
|
||||
|
||||
Lana 4 Oct 2004
|
||||
- changed most of the update() statements to update_field() statements
|
||||
to improve server performance
|
||||
|
||||
sched/
|
||||
assimilator.C
|
||||
feeder.C
|
||||
file_deleter.C
|
||||
update_stats.C
|
||||
validator.C
|
||||
wu_check.C
|
||||
|
||||
|
|
|
@ -489,7 +489,8 @@ RESULT* CLIENT_STATE::lookup_result(PROJECT* p, const char* name) {
|
|||
}
|
||||
|
||||
WORKUNIT* CLIENT_STATE::lookup_workunit(PROJECT* p, const char* name) {
|
||||
for (unsigned int i=0; i<workunits.size(); i++) {
|
||||
print_summary();
|
||||
for (unsigned int i=0; i<workunits.size(); i++) {
|
||||
WORKUNIT* wup = workunits[i];
|
||||
if (wup->project == p && !strcmp(name, wup->name)) return wup;
|
||||
}
|
||||
|
@ -666,7 +667,6 @@ int CLIENT_STATE::link_result(PROJECT* p, RESULT* rp) {
|
|||
void CLIENT_STATE::print_summary() {
|
||||
unsigned int i;
|
||||
int t;
|
||||
if (!log_flags.state_debug) return;
|
||||
|
||||
SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_STATE);
|
||||
scope_messages.printf("CLIENT_STATE::print_summary(): Client state summary:\n");
|
||||
|
|
|
@ -55,7 +55,7 @@ bool do_pass(APP& app) {
|
|||
DB_RESULT canonical_result, result;
|
||||
bool did_something = false;
|
||||
char buf[256];
|
||||
// int retval;
|
||||
int retval;
|
||||
|
||||
|
||||
check_stop_daemons();
|
||||
|
@ -79,9 +79,17 @@ bool do_pass(APP& app) {
|
|||
|
||||
assimilate_handler(wu, results, canonical_result);
|
||||
|
||||
wu.assimilate_state = ASSIMILATE_DONE;
|
||||
wu.transition_time = time(0);
|
||||
wu.update();
|
||||
sprintf(
|
||||
buf, "assimilate_state=%d, transition_time=%d",
|
||||
ASSIMILATE_DONE, time(0)
|
||||
);
|
||||
retval = wu.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
|
||||
"[%s] update failed: %d\n", wu.name, retval
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
return did_something;
|
||||
}
|
||||
|
|
|
@ -142,6 +142,7 @@ int check_reread_trigger() {
|
|||
|
||||
#ifdef REMOVE_INFEASIBLE_ENTRIES
|
||||
static int remove_infeasible(int i) {
|
||||
char buf[256];
|
||||
int retval;
|
||||
DB_RESULT result;
|
||||
DB_WORKUNIT wu;
|
||||
|
@ -159,7 +160,11 @@ static int remove_infeasible(int i) {
|
|||
|
||||
result.server_state = RESULT_SERVER_STATE_OVER;
|
||||
result.outcome = RESULT_OUTCOME_COULDNT_SEND;
|
||||
retval = result.update();
|
||||
sprintf(
|
||||
buf, "server_state=%d, outcome=%d",
|
||||
result.server_state, result.outcome
|
||||
);
|
||||
retval = result.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
@ -169,7 +174,8 @@ static int remove_infeasible(int i) {
|
|||
return retval;
|
||||
}
|
||||
wu.transition_time = time(0);
|
||||
retval = wu.update();
|
||||
sprintf(buf, "transition_time=%d", wu.transition_time);
|
||||
retval = wu.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
|
|
@ -131,6 +131,7 @@ bool do_pass() {
|
|||
DB_RESULT result;
|
||||
bool did_something = false;
|
||||
char buf[256];
|
||||
int retval;
|
||||
|
||||
check_stop_daemons();
|
||||
|
||||
|
@ -139,7 +140,14 @@ bool do_pass() {
|
|||
did_something = true;
|
||||
wu_delete_files(wu);
|
||||
wu.file_delete_state = FILE_DELETE_DONE;
|
||||
wu.update();
|
||||
sprintf(buf, "file_delete_state=%d", wu.file_delete_state);
|
||||
retval= wu.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
|
||||
"[%s] workunit failed to update file_delete_state with %d\n",
|
||||
wu.name, retval
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(buf, "where file_delete_state=%d limit 1000", FILE_DELETE_READY);
|
||||
|
@ -147,7 +155,14 @@ bool do_pass() {
|
|||
did_something = true;
|
||||
result_delete_files(result);
|
||||
result.file_delete_state = FILE_DELETE_DONE;
|
||||
result.update();
|
||||
sprintf(buf, "file_delete_state=%d", result.file_delete_state);
|
||||
retval= result.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
|
||||
"[%s] result failed to update file_delete_state with %d\n",
|
||||
result.name, retval
|
||||
);
|
||||
}
|
||||
}
|
||||
return did_something;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
using std::vector;
|
||||
|
||||
static const double MIN_CPU_TIME = 10000;
|
||||
static const double MIN_CPU_TIME = 0;
|
||||
|
||||
int init_result_trivial(RESULT const& result, void*& data) {
|
||||
return 0;
|
||||
|
|
|
@ -48,11 +48,16 @@ double update_time_cutoff;
|
|||
int update_users() {
|
||||
DB_USER user;
|
||||
int retval;
|
||||
char buf[256];
|
||||
|
||||
while (!user.enumerate()) {
|
||||
if (user.expavg_time > update_time_cutoff) continue;
|
||||
update_average(0, 0, CREDIT_HALF_LIFE, user.expavg_credit, user.expavg_time);
|
||||
retval = user.update();
|
||||
sprintf(
|
||||
buf,"expavg_credit=%f, expavg_time=%f",
|
||||
user.expavg_credit, user.expavg_time
|
||||
);
|
||||
retval = user.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "Can't update user %d\n", user.id);
|
||||
return retval;
|
||||
|
@ -65,11 +70,16 @@ int update_users() {
|
|||
int update_hosts() {
|
||||
DB_HOST host;
|
||||
int retval;
|
||||
char buf[256];
|
||||
|
||||
while (!host.enumerate()) {
|
||||
if (host.expavg_time > update_time_cutoff) continue;
|
||||
update_average(0, 0, CREDIT_HALF_LIFE, host.expavg_credit, host.expavg_time);
|
||||
retval = host.update();
|
||||
sprintf(
|
||||
buf,"expavg_credit=%f, expavg_time=%f",
|
||||
host.expavg_credit, host.expavg_time
|
||||
);
|
||||
retval = host.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "Can't update host %d\n", host.id);
|
||||
return retval;
|
||||
|
@ -103,6 +113,7 @@ int get_team_totals(TEAM& team) {
|
|||
int update_teams() {
|
||||
DB_TEAM team;
|
||||
int retval;
|
||||
char buf[256];
|
||||
|
||||
while (!team.enumerate()) {
|
||||
retval = get_team_totals(team);
|
||||
|
@ -118,7 +129,11 @@ int update_teams() {
|
|||
if (team.expavg_time < update_time_cutoff) {
|
||||
update_average(0, 0, CREDIT_HALF_LIFE, team.expavg_credit, team.expavg_time);
|
||||
}
|
||||
retval = team.update();
|
||||
sprintf(
|
||||
buf, "expavg_credit=%f, expavg_time=%f",
|
||||
team.expavg_credit, team.expavg_time
|
||||
);
|
||||
retval = team.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "Can't update team %d\n", team.id);
|
||||
return retval;
|
||||
|
|
|
@ -63,6 +63,7 @@ int grant_credit(DB_RESULT& result, double credit) {
|
|||
DB_HOST host;
|
||||
DB_TEAM team;
|
||||
int retval;
|
||||
char buf[256];
|
||||
|
||||
retval = host.lookup_id(result.hostid);
|
||||
if (retval) {
|
||||
|
@ -85,7 +86,12 @@ int grant_credit(DB_RESULT& result, double credit) {
|
|||
|
||||
user.total_credit += credit;
|
||||
update_average(result.sent_time, credit, CREDIT_HALF_LIFE, user.expavg_credit, user.expavg_time);
|
||||
retval = user.update();
|
||||
sprintf(
|
||||
buf, "total_credit=%f, expavg_credit=%f, expavg_time=%f",
|
||||
user.total_credit, user.expavg_credit,
|
||||
user.expavg_time
|
||||
);
|
||||
retval = user.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
@ -96,7 +102,12 @@ int grant_credit(DB_RESULT& result, double credit) {
|
|||
|
||||
host.total_credit += credit;
|
||||
update_average(result.sent_time, credit, CREDIT_HALF_LIFE, host.expavg_credit, host.expavg_time);
|
||||
retval = host.update();
|
||||
sprintf(
|
||||
buf, "total_credit=%f, expavg_credit=%f, expavg_time=%f",
|
||||
host.total_credit, host.expavg_credit,
|
||||
host.expavg_time
|
||||
);
|
||||
retval = host.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
@ -117,7 +128,12 @@ int grant_credit(DB_RESULT& result, double credit) {
|
|||
}
|
||||
team.total_credit += credit;
|
||||
update_average(result.sent_time, credit, CREDIT_HALF_LIFE, team.expavg_credit, team.expavg_time);
|
||||
retval = team.update();
|
||||
sprintf(
|
||||
buf, "total_credit=%f, expavg_credit=%f, expavg_time=%f",
|
||||
team.total_credit, team.expavg_credit,
|
||||
team.expavg_time
|
||||
);
|
||||
retval = team.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
@ -224,7 +240,18 @@ void handle_wu(DB_WORKUNIT& wu) {
|
|||
);
|
||||
}
|
||||
if (update_result) {
|
||||
retval = result.update();
|
||||
sprintf(
|
||||
buf, "validate_state=%d, granted_credit=%f",
|
||||
result.validate_state,
|
||||
result.granted_credit
|
||||
);
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::NORMAL,
|
||||
"[RESULT#%d %s] granted_credit %f",
|
||||
result.id, result.name, result.granted_credit
|
||||
);
|
||||
|
||||
retval = result.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
@ -332,7 +359,18 @@ void handle_wu(DB_WORKUNIT& wu) {
|
|||
);
|
||||
}
|
||||
|
||||
retval = result.update();
|
||||
sprintf(buf,
|
||||
"validate_state=%d, granted_credit=%f",
|
||||
result.validate_state,
|
||||
result.granted_credit
|
||||
);
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::NORMAL,
|
||||
"[RESULT#%d %s] granted_credit %f",
|
||||
result.id, result.name, result.granted_credit
|
||||
);
|
||||
|
||||
retval = result.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
@ -351,7 +389,12 @@ void handle_wu(DB_WORKUNIT& wu) {
|
|||
while (!result.enumerate(buf)) {
|
||||
result.server_state = RESULT_SERVER_STATE_OVER;
|
||||
result.outcome = RESULT_OUTCOME_DIDNT_NEED;
|
||||
retval = result.update();
|
||||
sprintf(buf,
|
||||
"server_state=%d, outcome=%d",
|
||||
result.server_state,
|
||||
result.outcome
|
||||
);
|
||||
retval = result.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
@ -383,7 +426,13 @@ void handle_wu(DB_WORKUNIT& wu) {
|
|||
// clear WU.need_validate
|
||||
//
|
||||
wu.need_validate = 0;
|
||||
retval = wu.update();
|
||||
sprintf(buf,
|
||||
"need_validate=%d, transition_time=%d, canonical_resultid=%d,
|
||||
canonical_credit=%f, assimilate_state=%d",
|
||||
wu.need_validate, wu.transition_time, wu.canonical_resultid,
|
||||
wu.canonical_credit, wu.assimilate_state
|
||||
);
|
||||
retval = wu.update_field(buf);
|
||||
if (retval) {
|
||||
log_messages.printf(
|
||||
SCHED_MSG_LOG::CRITICAL,
|
||||
|
|
|
@ -51,6 +51,7 @@ int handle_result(DB_RESULT& result) {
|
|||
DB_WORKUNIT wu;
|
||||
int retval;
|
||||
char path[256];
|
||||
char buf[256];
|
||||
FILE* f;
|
||||
|
||||
retval = wu.lookup_id(result.workunitid);
|
||||
|
@ -73,7 +74,18 @@ int handle_result(DB_RESULT& result) {
|
|||
if (result.server_state == RESULT_SERVER_STATE_UNSENT) {
|
||||
result.server_state = RESULT_SERVER_STATE_OVER;
|
||||
result.outcome = RESULT_OUTCOME_COULDNT_SEND;
|
||||
result.update();
|
||||
sprintf(
|
||||
buf,"server_state=%d, outcome=%d",
|
||||
result.server_state, result.outcome
|
||||
);
|
||||
retval = result.update_field(buf);
|
||||
if (retval) {
|
||||
printf(
|
||||
"ERROR: can't update result %d\n",
|
||||
result.id
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue