From 01786cde8735f1e47b33d4479fed86969d708420 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 10 Oct 2004 03:16:30 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4312 --- checkin_notes | 16 ++++++ db/boinc_db.C | 2 +- db/boinc_db.h | 1 + html/ops/cancel_wu.php | 34 ++++++++++++ sched/assimilator.C | 2 +- sched/db_purge.C | 2 +- sched/validator.C | 116 ++++++++++++++++++++--------------------- 7 files changed, 111 insertions(+), 62 deletions(-) create mode 100644 html/ops/cancel_wu.php diff --git a/checkin_notes b/checkin_notes index 434729f7a2..c1d2493946 100755 --- a/checkin_notes +++ b/checkin_notes @@ -18223,3 +18223,19 @@ David 9 Oct 2004 forum_reply.php forum_thread.php unread_post.png (new) + +David 9 Oct 2004 + - added script to cancel a WU + + html/ops/ + cancel_wu.php (new) + +David 9 Oct 2004 + - finished changes to validator to user DB_VALIDATOR_ITEM_SET + + db/ + boinc_db.C,h + sched/ + assimilator.C + db_purge.C + validator.C diff --git a/db/boinc_db.C b/db/boinc_db.C index ba4293e938..3529bb7575 100644 --- a/db/boinc_db.C +++ b/db/boinc_db.C @@ -906,7 +906,7 @@ int DB_VALIDATOR_ITEM_SET::enumerate( } new_item.parse(row); nitems_this_query++; - if (new_item.id != last_item.id) { + if (new_item.wu.id != last_item.wu.id) { last_item = new_item; return 0; } diff --git a/db/boinc_db.h b/db/boinc_db.h index 9497b70322..5627bf19ef 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -293,6 +293,7 @@ struct HOST { #define WU_ERROR_TOO_MANY_ERROR_RESULTS 2 #define WU_ERROR_TOO_MANY_SUCCESS_RESULTS 4 #define WU_ERROR_TOO_MANY_TOTAL_RESULTS 8 +#define WU_ERROR_CANCELLED 16 struct WORKUNIT { int id; diff --git a/html/ops/cancel_wu.php b/html/ops/cancel_wu.php new file mode 100644 index 0000000000..691eaf6351 --- /dev/null +++ b/html/ops/cancel_wu.php @@ -0,0 +1,34 @@ + diff --git a/sched/assimilator.C b/sched/assimilator.C index 98e903d170..ca60fdff48 100644 --- a/sched/assimilator.C +++ b/sched/assimilator.C @@ -81,7 +81,7 @@ bool do_pass(APP& app) { sprintf( buf, "assimilate_state=%d, transition_time=%d", - ASSIMILATE_DONE, time(0) + ASSIMILATE_DONE, (int)time(0) ); retval = wu.update_field(buf); if (retval) { diff --git a/sched/db_purge.C b/sched/db_purge.C index 9a794d9666..e89023d150 100644 --- a/sched/db_purge.C +++ b/sched/db_purge.C @@ -57,7 +57,7 @@ int open_archive(char* filename_prefix, FILE*& f){ int retval=0; char path[256]; - sprintf(path,"../archives/%s_%d.xml", filename_prefix, time(0)); + sprintf(path,"../archives/%s_%d.xml", filename_prefix, (int)time(0)); log_messages.printf(SCHED_MSG_LOG::CRITICAL, "Opening archive %s\n", path); diff --git a/sched/validator.C b/sched/validator.C index 4d64cff283..8d86e6998f 100644 --- a/sched/validator.C +++ b/sched/validator.C @@ -158,10 +158,8 @@ void handle_wu( int retval = 0, canonicalid = 0; double credit = 0; unsigned int i; - RESULT result, canonical_result; - VALIDATOR_ITEM& wu_vi = items[0]; - WORKUNIT& wu = wu_vi.wu; + WORKUNIT& wu = items[0].wu; if (wu.canonical_resultid) { log_messages.printf( @@ -175,41 +173,42 @@ void handle_wu( // Get unchecked results and see if they match the canonical result // for (i=0; i= (unsigned int)wu_vi.min_quorum) { + if (results.size() >= (unsigned int)wu.min_quorum) { log_messages.printf( SCHED_MSG_LOG::DEBUG, - "[WU#%d %s] Enough for quorum, checking set.\n", wu_vi.id, - wu_vi.name + "[WU#%d %s] Enough for quorum, checking set.\n", + wu.id, wu.name ); - wu= wu_vi.wu; retval = check_set(results, wu, canonicalid, credit, retry); if (retval) { log_messages.printf( SCHED_MSG_LOG::CRITICAL, "[WU#%d %s] check_set returned %d, exiting\n", - wu_vi.id, wu_vi.name, retval + wu.id, wu.name, retval ); exit(retval); } @@ -323,7 +322,7 @@ void handle_wu( // See if any results had nonrecoverable errors // for (i=0; i wu_vi.max_success_results) { - wu_vi.error_mask |= WU_ERROR_TOO_MANY_SUCCESS_RESULTS; + if ((int)results.size() > wu.max_success_results) { + wu.error_mask |= WU_ERROR_TOO_MANY_SUCCESS_RESULTS; need_immediate_transition = true; } } @@ -422,21 +422,19 @@ void handle_wu( --log_messages; if (need_immediate_transition) { - wu_vi.transition_time = time(0); + wu.transition_time = time(0); } else if (need_delayed_transition) { int x = time(0) + 6*3600; - if (x < wu_vi.transition_time) wu_vi.transition_time = x; + if (x < wu.transition_time) wu.transition_time = x; } - // update workunit clears WU.need_validate - // - wu= wu_vi.wu; + wu.need_validate = 0; retval = validator.update_workunit(wu); if (retval) { log_messages.printf( SCHED_MSG_LOG::CRITICAL, - "[WU#%d %s] wu_vi.update() failed: %d; exiting\n", wu_vi.id, - wu_vi.name, retval + "[WU#%d %s] update_workunit() failed: %d; exiting\n", + wu.id, wu.name, retval ); exit(1); }