From 580e4a2e789e3178be5e4c995064cc81e9efaeb2 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 6 Feb 2004 23:31:27 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2976 --- checkin_notes | 93 ++++++++++++++++++++++++++------------ client/check_state.C | 5 +- client/client_state.C | 5 +- client/client_state.h | 2 +- client/cs_scheduler.C | 25 +++++----- client/file_xfer.C | 6 +-- win_build/boinc_cli.vcproj | 3 ++ win_build/boinc_gui.vcproj | 37 ++++++++------- 8 files changed, 108 insertions(+), 68 deletions(-) diff --git a/checkin_notes b/checkin_notes index deabf0c79a..9721b9040e 100755 --- a/checkin_notes +++ b/checkin_notes @@ -9641,16 +9641,16 @@ David Jan 31 2004 makefile.gui_test David Feb 2 2004 - - escape all user-supplied text in XML (messages and files) - e.g. user name, team name - - added functions xml_escape() and xml_unescape() - (very simple versions; just escape < and &) + - escape all user-supplied text in XML (messages and files) + e.g. user name, team name + - added functions xml_escape() and xml_unescape() + (very simple versions; just escape < and &) - parse_str() does unescape - client/ - client_types.C - lib/ - parse.C,h + client/ + client_types.C + lib/ + parse.C,h sched/ server_types.C @@ -9747,16 +9747,16 @@ Rom Feb 4 2004 win_screensaver.cpp David Feb 4 2004 - - BOINC API: if get a REREAD_PREFS message from core client, - only call the app's reread_prefs function if there's a window open - (the SETI@home reread_prefs function goes into an infinite loop - if there's not a window open) - - change copyright year to 2004 + - BOINC API: if get a REREAD_PREFS message from core client, + only call the app's reread_prefs function if there's a window open + (the SETI@home reread_prefs function goes into an infinite loop + if there's not a window open) + - change copyright year to 2004 - api/ - windows_opengl.C - client/win/ - resource.rc + api/ + windows_opengl.C + client/win/ + resource.rc Karl 2004-02-03 - more misc. make_project fixes @@ -9784,14 +9784,14 @@ David Feb 4 2004 cs_scheduler.C David Feb 4 2004 - - Cleaned up the project-reset logic a little: - - first garbage-collect, THEN unlink and delete the apps and app_versions - - When detach project, delete FILE_INFO*s. + - Cleaned up the project-reset logic a little: + - first garbage-collect, THEN unlink and delete the apps and app_versions + - When detach project, delete FILE_INFO*s. - NOTE: there are lots of loose ends, e.g. files/sockets left open etc. + NOTE: there are lots of loose ends, e.g. files/sockets left open etc. - client/ - client_state.C + client/ + client_state.C David Feb 4 2004 - Released version 2.24 of core client @@ -9852,14 +9852,14 @@ David Feb 5 2004 pers_file_xfer.C David Feb 5 2004 - - skip over elements while parsing - (they're there for the benefit of GUI RPC) - - removed old TRACEs from Win code + - skip over elements while parsing + (they're there for the benefit of GUI RPC) + - removed old TRACEs from Win code - client/ - client_types.C - win/ - wingui_mainwindow.cpp + client/ + client_types.C + win/ + wingui_mainwindow.cpp Rom Feb 5 2004 - Moved the unhandled exception filter back into boinc_api.c where it was orginally. @@ -9890,3 +9890,36 @@ Rom Feb 6 2004 api/ boinc_api.c,h boincdiag.cpp,h (deleted) + +David Feb 6 2004 + - changed default min/max work buffers from (1,3) to (.1, 1) + + html/incs/ + prefs.inc + +David Feb 6 2004 + - ask for more work when # of results in progress is less than # CPUs + - when get an APP_VERSION in a scheduler reply that's already in client state, + DON'T update the client state (it can't be any different anyway) + This fixes a garbage-collection crash + - Win client: added check_state.C to the project. + You can call check_all() to verify the integrity of client data. + This is commented out but useful for debugging. + - FILE_XFER_SET::insert() adds item to list, even if the underlying + HTTP_OP::insert() fails (because can't connect, e.g.) + This is necessary to make sure that the FILE_XFER remains in the + FILE_XFER_SET even in case of error, so that check_all() works. + + NOTE: the semantics of insert() should be reexamined through the whole + FSM stack. Does it initialize? Is it guaranteed to insert? + Need consistency. + + client/ + check_state.C + client_state.C,h + cs_scheduler.C + file_xfer.C + win_build/ + boinc_cli.vcproj + boinc_gui.vcproj + diff --git a/client/check_state.C b/client/check_state.C index f02d3602d6..575c25e8dc 100644 --- a/client/check_state.C +++ b/client/check_state.C @@ -102,7 +102,8 @@ void CLIENT_STATE::check_app_version(APP_VERSION& p) { check_app_pointer(p.app); check_project_pointer(p.project); for (i=0; iproject = p; @@ -487,7 +486,7 @@ int CLIENT_STATE::link_app_version(PROJECT* p, APP_VERSION* avp) { if (lookup_app_version(app, avp->version_num)) return ERR_NOT_UNIQUE; for (i=0; iapp_files.size(); i++) { - file_ref = avp->app_files[i]; + FILE_REF& file_ref = avp->app_files[i]; fip = lookup_file_info(p, file_ref.file_name); if (!fip) { msg_printf(0, MSG_ERROR, @@ -502,7 +501,7 @@ int CLIENT_STATE::link_app_version(PROJECT* p, APP_VERSION* avp) { if (fip->executable) { fip->signature_required = true; } - avp->app_files[i].file_info = fip; + file_ref.file_info = fip; } return 0; } diff --git a/client/client_state.h b/client/client_state.h index e2bea14064..7ea2b412df 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -246,7 +246,7 @@ private: void compute_resource_debts(); PROJECT* find_project_with_overdue_results(); - double current_work_buf_days(); + void current_work_buf_days(double& work_buf, int& nactive_results); void update_avg_cpu(PROJECT*); PROJECT* next_project_sched_rpc_pending(); bool some_project_rpc_ok(); diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 2696a720b4..f297291902 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -54,11 +54,12 @@ const int SECONDS_BEFORE_REPORT_DEADLINE_TO_REPORT = 60*60*6; // estimate the days of work remaining // -double CLIENT_STATE::current_work_buf_days() { +void CLIENT_STATE::current_work_buf_days(double& work_buf, int& nactive_results) { unsigned int i; RESULT* rp; double seconds_remaining=0, x; + nactive_results = 0; for (i=0; istate >= RESULT_COMPUTE_DONE) continue; if (rp->ready_to_report) continue; + nactive_results++; + // TODO: subtract time already finished for WUs in progress seconds_remaining += estimate_cpu_time(*rp->wup) * (1.0-get_percent_done(rp)); @@ -74,13 +77,16 @@ double CLIENT_STATE::current_work_buf_days() { x = seconds_remaining / SECONDS_PER_DAY; x /= host_info.p_ncpus; x /= time_stats.active_frac; - return x; + work_buf = x; } // seconds of CPU work needed to come up to the max buffer level // double CLIENT_STATE::work_needed_secs() { - double x = current_work_buf_days(); + double x; + int n; + + current_work_buf_days(x, n); if (x > global_prefs.work_buf_max_days) return 0; // TODO: take into account preference # CPUS @@ -417,7 +423,8 @@ bool CLIENT_STATE::some_project_rpc_ok() { // initiate scheduler RPC activity if needed and possible // bool CLIENT_STATE::scheduler_rpc_poll() { - double work_secs; + double work_secs, work_buf_days; + int nactive_results; PROJECT* p; bool action=false, below_work_buf_min, should_get_work; @@ -432,7 +439,8 @@ bool CLIENT_STATE::scheduler_rpc_poll() { // work_buf_min concept // //below_work_buf_min = (current_work_buf_days() <= global_prefs.work_buf_min_days); - below_work_buf_min = (current_work_buf_days() == 0); + current_work_buf_days(work_buf_days, nactive_results); + below_work_buf_min = nactive_results < host_info.p_ncpus; should_get_work = below_work_buf_min && some_project_rpc_ok(); } if (should_get_work) { @@ -624,13 +632,6 @@ int CLIENT_STATE::handle_scheduler_reply( *avp = sr.app_versions[i]; retval = link_app_version(project, avp); if (!retval) app_versions.push_back(avp); - } else { - // The list of file references may have changed. - // Copy the list from the reply message, - // and link to the FILE_INFOs - // - avp->app_files = sr.app_versions[i].app_files; - link_app_version(project, avp); } } for (i=0; iinsert(fxp); if (retval) return retval; - file_xfers.push_back(fxp); return 0; } @@ -206,8 +206,6 @@ bool FILE_XFER_SET::poll() { printf("ERROR: file upload returned %d\n", fxp->file_xfer_retval); fxp->fip->upload_offset = -1; } else { - remove(fxp); - i--; // if the server's file size is bigger than ours, // something bad has happened (like a result @@ -223,6 +221,8 @@ bool FILE_XFER_SET::poll() { fxp->file_xfer_retval = fxp->init_upload(*fxp->fip); if (!fxp->file_xfer_retval) { + remove(fxp); + i--; fxp->file_xfer_retval = insert(fxp); if (!fxp->file_xfer_retval) { fxp->file_xfer_done = false; diff --git a/win_build/boinc_cli.vcproj b/win_build/boinc_cli.vcproj index 1aad99b4e8..bbf31a6ea6 100644 --- a/win_build/boinc_cli.vcproj +++ b/win_build/boinc_cli.vcproj @@ -197,6 +197,9 @@ CompileAs="2"/> + + + + + + + + + + + + - - - - - - - -