From 2e7b82b6317730d8af4a4e12d7b1e6e23e18f604 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 30 Apr 2007 21:19:24 +0000 Subject: [PATCH] - scheduler: added (correct this time!) support for tags in scheduler requests. - file_deleter: add check for -dont_delete_batches sched/ file_deleter.C handle_request.C sched_array.C,h sched_locality.C,h sched_resend.C,h sched_send.C,h server_types.h svn path=/trunk/boinc/; revision=12512 --- checkin_notes | 13 ++++++++++ doc/addon_data.php | 48 ++++++++++++++++++++-------------- sched/file_deleter.C | 2 ++ sched/handle_request.C | 23 ++++++++--------- sched/sched_array.C | 8 +++--- sched/sched_array.h | 4 +-- sched/sched_locality.C | 50 ++++++++++++++++++------------------ sched/sched_locality.h | 6 ++--- sched/sched_resend.C | 8 +++--- sched/sched_resend.h | 2 +- sched/sched_send.C | 58 ++++++++++++++++++++++-------------------- sched/sched_send.h | 12 ++++----- sched/server_types.h | 4 +++ 13 files changed, 132 insertions(+), 106 deletions(-) diff --git a/checkin_notes b/checkin_notes index e17b8c9d49..98945a84fa 100755 --- a/checkin_notes +++ b/checkin_notes @@ -4135,3 +4135,16 @@ Rom 30 Apr 2007 (HEAD) - Tag for 5.9.5 release, all platforms boinc_core_release_5_9_5 +David 30 Apr 2007 + - scheduler: added (correct this time!) support for + tags in scheduler requests. + - file_deleter: add check for -dont_delete_batches + + sched/ + file_deleter.C + handle_request.C + sched_array.C,h + sched_locality.C,h + sched_resend.C,h + sched_send.C,h + server_types.h diff --git a/doc/addon_data.php b/doc/addon_data.php index 78f3ab1576..2d19d4130d 100644 --- a/doc/addon_data.php +++ b/doc/addon_data.php @@ -20,26 +20,36 @@ array( '', 1168202706 ), -array('boinc-irc.exe', - 'Boinc mIRC', - '1.0', - 'A ready setup mIRC to take you straight there', - 'http://comatosed.net/boinc/boinc-irc.exe', - 'Windows', - 'Built in security systems for DCC and MSG systems and some other nice toys 2.00MB', - 1089651337 -), -array('boinc.mrc', - 'Boinc mircstats', - '0.4', - 'Script to show your Boinc stats on IRC (with mIRC)', - 'http://sqreal.no-ip.org/boinc.mrc', - 'Windows', - 'This addon shows your boinc details to IRC like Credits, current progress , pulse, gaussian, spike, team ... -
- Put the .mrc on your mIRC main dir and type', - 1162833635 +array( + 'http://www.weebl00.nl/leiterow/zowtar/BOINC/', + 'BOINC mIRC', + '0.1', + 'MRC file for sending your BOINC status on IRC', + 'http://www.weebl00.nl/leiterow/zowtar/BOINC/', + 'all', + '', + 1177964485 ), +//array('boinc-irc.exe', +// 'Boinc mIRC', +// '1.0', +// 'A ready setup mIRC to take you straight there', +// 'http://comatosed.net/boinc/boinc-irc.exe', +// 'Windows', +// 'Built in security systems for DCC and MSG systems and some other nice toys 2.00MB', +// 1089651337 +//), +//array('boinc.mrc', +// 'Boinc mircstats', +// '0.4', +// 'Script to show your Boinc stats on IRC (with mIRC)', +// 'http://sqreal.no-ip.org/boinc.mrc', +// 'Windows', +// 'This addon shows your boinc details to IRC like Credits, current progress , pulse, gaussian, spike, team ... +//
+// Put the .mrc on your mIRC main dir and type', +// 1162833635 +//), array('boincdv_v0306.zip', 'BoincDV', '', diff --git a/sched/file_deleter.C b/sched/file_deleter.C index 475823aef0..718b3ad7b5 100644 --- a/sched/file_deleter.C +++ b/sched/file_deleter.C @@ -565,6 +565,8 @@ int main(int argc, char** argv) { id_remainder = atoi(argv[++i]); } else if (!strcmp(argv[i], "-dont_delete_antiques")) { dont_delete_antiques = true; + } else if (!strcmp(argv[i], "-dont_delete_batches")) { + dont_delete_batches = true; } else { log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, "Unrecognized arg: %s\n", argv[i] diff --git a/sched/handle_request.C b/sched/handle_request.C index f99df70cfe..2e28b1bb95 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -487,8 +487,7 @@ static int update_host_record(HOST& initial_host, HOST& xhost, USER& user) { } int send_result_abort( - SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform, - SCHED_SHMEM& ss + SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, SCHED_SHMEM& ss ) { int aborts_sent = 0; DB_IN_PROGRESS_RESULT result; @@ -1187,6 +1186,7 @@ void process_request( SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, SCHED_SHMEM& ss, char* code_sign_key ) { + PLATFORM_LIST platforms; PLATFORM* platform; int retval; double last_rpc_time; @@ -1318,16 +1318,15 @@ void process_request( } retval = modify_host_struct(sreq, reply.host); - // look up the client's platform in the DB + // look up the client's platform(s) in the DB // platform = ss.lookup_platform(sreq.platform.name); - if (!platform) { - for (i=0; i100000) { int until=time(0)-config.locality_scheduling_send_timeout; - int retval_sow=send_old_work(sreq, reply, platform, ss, INT_MIN, until); + int retval_sow=send_old_work(sreq, reply, platforms, ss, INT_MIN, until); if (retval_sow==ERR_NO_APP_VERSION || retval_sow==ERR_INSUFFICIENT_RESOURCE) return; } @@ -1103,7 +1103,7 @@ void send_work_locality( if (!reply.work_needed(true)) break; FILE_INFO& fi = sreq.file_infos[k]; retval_srff=send_results_for_file( - fi.name, nsent, sreq, reply, platform, ss, false + fi.name, nsent, sreq, reply, platforms, ss, false ); if (retval_srff==ERR_NO_APP_VERSION || retval_srff==ERR_INSUFFICIENT_RESOURCE) return; @@ -1126,7 +1126,7 @@ void send_work_locality( // send new files if needed // if (reply.work_needed(true)) { - send_new_file_work(sreq, reply, platform, ss); + send_new_file_work(sreq, reply, platforms, ss); } } diff --git a/sched/sched_locality.h b/sched/sched_locality.h index d6ab6448d6..31d0cc0207 100644 --- a/sched/sched_locality.h +++ b/sched/sched_locality.h @@ -18,13 +18,11 @@ // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA extern void send_work_locality( - SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform, - SCHED_SHMEM& ss + SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM_LIST&, SCHED_SHMEM& ); extern int decrement_disk_space_locality( - WORKUNIT& wu, SCHEDULER_REQUEST& request, - SCHEDULER_REPLY& reply + WORKUNIT& wu, SCHEDULER_REQUEST& request, SCHEDULER_REPLY& reply ); extern int delete_file_from_host(SCHEDULER_REQUEST&, SCHEDULER_REPLY&); diff --git a/sched/sched_resend.C b/sched/sched_resend.C index 37a4aab4e9..32ed9baf89 100644 --- a/sched/sched_resend.C +++ b/sched/sched_resend.C @@ -85,8 +85,8 @@ static int possibly_give_result_new_deadline( } bool resend_lost_work( - SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform, - SCHED_SHMEM& ss + SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, + PLATFORM_LIST& platforms, SCHED_SHMEM& ss ) { DB_RESULT result; std::vectorresults; @@ -142,7 +142,7 @@ bool resend_lost_work( sreq.core_client_major_version*100 + sreq.core_client_minor_version; retval = get_app_version( - wu, app, avp, sreq, reply, platform, ss + wu, app, avp, sreq, reply, platforms, ss ); if (retval) { log_messages.printf( SCHED_MSG_LOG::MSG_CRITICAL, @@ -201,7 +201,7 @@ bool resend_lost_work( } retval = add_result_to_reply( - result, wu, sreq, reply, platform, app, avp + result, wu, sreq, reply, platforms, app, avp ); if (retval) { log_messages.printf( SCHED_MSG_LOG::MSG_CRITICAL, diff --git a/sched/sched_resend.h b/sched/sched_resend.h index b7d70dc98c..f8a9318fed 100644 --- a/sched/sched_resend.h +++ b/sched/sched_resend.h @@ -1,4 +1,4 @@ extern bool resend_lost_work( - SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM&, SCHED_SHMEM& + SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM_LIST&, SCHED_SHMEM& ); diff --git a/sched/sched_send.C b/sched/sched_send.C index 478b8aa9b0..4fa664b779 100644 --- a/sched/sched_send.C +++ b/sched/sched_send.C @@ -60,8 +60,8 @@ const int MAX_SECONDS_TO_SEND = (28*SECONDS_IN_DAY); const double DEFAULT_RAM_SIZE = 64000000; // if host sends us an impossible RAM size, use this instead -bool anonymous(PLATFORM& platform) { - return (!strcmp(platform.name, "anonymous")); +bool anonymous(PLATFORM* platform) { + return (!strcmp(platform->name, "anonymous")); } bool SCHEDULER_REQUEST::has_version(APP& app) { @@ -76,15 +76,15 @@ bool SCHEDULER_REQUEST::has_version(APP& app) { return false; } -// Find the app and app_version for the client's platform. +// Find an app and app_version for the client's platform(s). // int get_app_version( WORKUNIT& wu, APP* &app, APP_VERSION* &avp, - SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform, + SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms, SCHED_SHMEM& ss ) { bool found; - if (anonymous(platform)) { + if (anonymous(platforms.list[0])) { app = ss.lookup_app(wu.appid); found = sreq.has_version(*app); if (!found) { @@ -95,7 +95,7 @@ int get_app_version( } avp = NULL; } else { - found = find_app_version(reply.wreq, wu, platform, ss, app, avp); + found = find_app_version(reply.wreq, wu, platforms, ss, app, avp); if (!found) { log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG, "Didn't find app version\n"); return ERR_NO_APP_VERSION; @@ -486,7 +486,7 @@ int insert_wu_tags(WORKUNIT& wu, APP& app) { // return false if none // bool find_app_version( - WORK_REQ& wreq, WORKUNIT& wu, PLATFORM& platform, SCHED_SHMEM& ss, + WORK_REQ& wreq, WORKUNIT& wu, PLATFORM_LIST& platforms, SCHED_SHMEM& ss, APP*& app, APP_VERSION*& avp ) { app = ss.lookup_app(wu.appid); @@ -496,17 +496,19 @@ bool find_app_version( ); return false; } - avp = ss.lookup_app_version(app->id, platform.id, app->min_version); - if (!avp) { - log_messages.printf( - SCHED_MSG_LOG::MSG_DEBUG, - "no app version available: APP#%d PLATFORM#%d min_version %d\n", - app->id, platform.id, app->min_version - ); - wreq.no_app_version = true; - return false; + unsigned int i; + for (i=0; iid, p->id, app->min_version); + if (avp) return true; } - return true; + log_messages.printf( + SCHED_MSG_LOG::MSG_DEBUG, + "no app version available: APP#%d PLATFORM#%d min_version %d\n", + app->id, platforms.list[0]->id, app->min_version + ); + wreq.no_app_version = true; + return false; } // verify that the given APP_VERSION will work with the core client @@ -531,7 +533,7 @@ bool app_core_compatible(WORK_REQ& wreq, APP_VERSION& av) { // Add the app and app_version to the reply also. // int add_wu_to_reply( - WORKUNIT& wu, SCHEDULER_REPLY& reply, PLATFORM& platform, + WORKUNIT& wu, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms, APP* app, APP_VERSION* avp ) { int retval; @@ -551,8 +553,8 @@ int add_wu_to_reply( reply.insert_app_version_unique(*avp2); log_messages.printf( SCHED_MSG_LOG::MSG_DEBUG, - "[HOST#%d] Sending app_version %s %s %d\n", - reply.host.id, app->name, platform.name, avp2->version_num + "[HOST#%d] Sending app_version %s %d %d\n", + reply.host.id, app->name, avp2->platformid, avp2->version_num ); } @@ -690,14 +692,14 @@ void SCHEDULER_REPLY::got_bad_result() { int add_result_to_reply( DB_RESULT& result, WORKUNIT& wu, SCHEDULER_REQUEST& request, - SCHEDULER_REPLY& reply, PLATFORM& platform, + SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms, APP* app, APP_VERSION* avp ) { int retval; double wu_seconds_filled; bool resent_result = false; - retval = add_wu_to_reply(wu, reply, platform, app, avp); + retval = add_wu_to_reply(wu, reply, platforms, app, avp); if (retval) return retval; // in the scheduling locality case, @@ -814,7 +816,7 @@ int add_result_to_reply( } int send_work( - SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform, + SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms, SCHED_SHMEM& ss ) { #if 1 @@ -864,14 +866,14 @@ int send_work( if (config.locality_scheduling) { reply.wreq.infeasible_only = false; - send_work_locality(sreq, reply, platform, ss); + send_work_locality(sreq, reply, platforms, ss); } else { // give top priority to results that require a 'reliable host' // if (reply.wreq.host_info.reliable) { reply.wreq.reliable_only = true; reply.wreq.infeasible_only = false; - scan_work_array(sreq, reply, platform, ss); + scan_work_array(sreq, reply, platforms, ss); } reply.wreq.reliable_only = false; @@ -886,17 +888,17 @@ int send_work( "[HOST#%d] will accept beta work. Scanning for beta work.\n", reply.host.id ); - scan_work_array(sreq, reply, platform, ss); + scan_work_array(sreq, reply, platforms, ss); } reply.wreq.beta_only = false; // give next priority to results that were infeasible for some other host // reply.wreq.infeasible_only = true; - scan_work_array(sreq, reply, platform, ss); + scan_work_array(sreq, reply, platforms, ss); reply.wreq.infeasible_only = false; - scan_work_array(sreq, reply, platform, ss); + scan_work_array(sreq, reply, platforms, ss); } log_messages.printf( diff --git a/sched/sched_send.h b/sched/sched_send.h index 495e541414..5f5601e1f0 100644 --- a/sched/sched_send.h +++ b/sched/sched_send.h @@ -19,23 +19,23 @@ extern int get_app_version( WORKUNIT& wu, APP* &app, APP_VERSION* &avp, - SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform, - SCHED_SHMEM& ss + SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, + PLATFORM_LIST& platforms, SCHED_SHMEM& ss ); extern int send_work( - SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM&, SCHED_SHMEM& + SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM_LIST&, SCHED_SHMEM& ); extern int add_result_to_reply( DB_RESULT& result, WORKUNIT& wu, SCHEDULER_REQUEST&, SCHEDULER_REPLY&, - PLATFORM&, APP* app, APP_VERSION* avp + PLATFORM_LIST&, APP* app, APP_VERSION* avp ); -extern bool anonymous(PLATFORM&); +extern bool anonymous(PLATFORM*); extern bool find_app_version( - WORK_REQ& wreq, WORKUNIT& wu, PLATFORM& platform, SCHED_SHMEM& ss, + WORK_REQ& wreq, WORKUNIT& wu, PLATFORM_LIST& platform, SCHED_SHMEM& ss, APP*& app, APP_VERSION*& avp ); diff --git a/sched/server_types.h b/sched/server_types.h index 1624d2aac2..a8be56dd9a 100644 --- a/sched/server_types.h +++ b/sched/server_types.h @@ -138,6 +138,10 @@ struct CLIENT_PLATFORM { int parse(FILE*); }; +struct PLATFORM_LIST { + std::vector list; +}; + struct SCHEDULER_REQUEST { char authenticator[256]; CLIENT_PLATFORM platform;