From 4f9dd9b18b394f3da194f34f65ed5e1f8c051401 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 12 Aug 2003 20:58:24 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=2064 --- db/boinc_db.C | 28 ++++++++++++++-------------- doc/index.html | 4 ++++ sched/assimilate_handler.C | 8 +++++--- sched/assimilator.C | 4 +++- sched/handle_request.C | 3 ++- sched/sched_util.C | 20 +++++++++++++------- sched/sched_util.h | 16 +++++++++------- sched/update_stats.C | 9 +++++---- 8 files changed, 55 insertions(+), 37 deletions(-) diff --git a/db/boinc_db.C b/db/boinc_db.C index e14c04f66a..f34ec2ac7d 100644 --- a/db/boinc_db.C +++ b/db/boinc_db.C @@ -374,7 +374,7 @@ void DB_USER::db_print(char* buf){ "id=%d, create_time=%d, email_addr='%s', name='%s', " "authenticator='%s', " "country='%s', postal_code='%s', " - "total_credit=%e, expavg_credit=%e, expavg_time=%e, " + "total_credit=%.15e, expavg_credit=%.15e, expavg_time=%.15e, " "global_prefs='%s', project_prefs='%s', " "teamid=%d, venue='%s', url='%s', send_email=%d, show_hosts=%d", id, @@ -436,7 +436,7 @@ void DB_TEAM::db_print(char* buf){ "id=%d, create_time=%d, userid=%d, name='%s', " "name_lc='%s', url='%s', " "type=%d, name_html='%s', description='%s', nusers=%d, " - "country='%s', total_credit=%e, expavg_credit=%e", + "country='%s', total_credit=%.15e, expavg_credit=%.15e", id, create_time, userid, @@ -487,18 +487,18 @@ void DB_HOST::db_print(char* buf){ sprintf(buf, "id=%d, create_time=%d, userid=%d, " "rpc_seqno=%d, rpc_time=%d, " - "total_credit=%.12e, expavg_credit=%.12e, expavg_time=%e, " + "total_credit=%.12e, expavg_credit=%.12e, expavg_time=%.15e, " "timezone=%d, domain_name='%s', serialnum='%s', " "last_ip_addr='%s', nsame_ip_addr=%d, " - "on_frac=%e, connected_frac=%e, active_frac=%e, " + "on_frac=%.15e, connected_frac=%.15e, active_frac=%.15e, " "p_ncpus=%d, p_vendor='%s', p_model='%s', " - "p_fpops=%e, p_iops=%e, p_membw=%e, " + "p_fpops=%.15e, p_iops=%.15e, p_membw=%.15e, " "os_name='%s', os_version='%s', " - "m_nbytes=%e, m_cache=%e, m_swap=%e, " - "d_total=%e, d_free=%e, " - "d_boinc_used_total=%e, d_boinc_used_project=%e, d_boinc_max=%e, " - "n_bwup=%e, n_bwdown=%e, " - "credit_per_cpu_sec=%e, " + "m_nbytes=%.15e, m_cache=%.15e, m_swap=%.15e, " + "d_total=%.15e, d_free=%.15e, " + "d_boinc_used_total=%.15e, d_boinc_used_project=%.15e, d_boinc_max=%.15e, " + "n_bwup=%.15e, n_bwdown=%.15e, " + "credit_per_cpu_sec=%.15e, " "venue='%s', projects='%s'", id, create_time, userid, rpc_seqno, rpc_time, @@ -571,9 +571,9 @@ void DB_WORKUNIT::db_print(char* buf){ sprintf(buf, "id=%d, create_time=%d, appid=%d, " "name='%s', xml_doc='%s', batch=%d, " - "rsc_fpops=%e, rsc_iops=%e, rsc_memory=%e, rsc_disk=%e, " + "rsc_fpops=%.15e, rsc_iops=%.15e, rsc_memory=%.15e, rsc_disk=%.15e, " "need_validate=%d, " - "canonical_resultid=%d, canonical_credit=%e, " + "canonical_resultid=%d, canonical_credit=%.15e, " "timeout_check_time=%d, delay_bound=%d, " "error_mask=%d, file_delete_state=%d, assimilate_state=%d, " "workseq_next=%d, opaque=%d", @@ -621,10 +621,10 @@ void DB_RESULT::db_print(char* 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, " - "name='%s', cpu_time=%e, " + "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, " - "claimed_credit=%e, granted_credit=%e, opaque=%d, random=%d, " + "claimed_credit=%.15e, granted_credit=%.15e, opaque=%d, random=%d, " "client_version_num=%d", id, create_time, workunitid, server_state, outcome, client_state, diff --git a/doc/index.html b/doc/index.html index a5335a5486..a66e34ead6 100644 --- a/doc/index.html +++ b/doc/index.html @@ -69,6 +69,10 @@ Help debug and enhance the BOINC software.

Status and news

+August 1, 2003 +
+We fixed various bugs and added some new interface features. The BOINC core client is at version 1.09. +

July 25, 2003
We've added two new web-site features for BOINC projects: diff --git a/sched/assimilate_handler.C b/sched/assimilate_handler.C index 7daf440d21..b2283ac6d8 100644 --- a/sched/assimilate_handler.C +++ b/sched/assimilate_handler.C @@ -6,13 +6,15 @@ void assimilate_handler( WORKUNIT& wu, vector& results, RESULT& canonical_result - ) -{ +) { ScopeMessages scope_messages(log_messages, SchedMessages::NORMAL); scope_messages.printf("[%s] Assimilating\n", wu.name); if (wu.canonical_resultid) { scope_messages.printf("[%s] Found canonical result\n", wu.name); - log_messages.printf_multiline(SchedMessages::DEBUG, canonical_result.xml_doc_out, "[%s] canonical result", wu.name); + log_messages.printf_multiline( + SchedMessages::DEBUG, canonical_result.xml_doc_out, + "[%s] canonical result", wu.name + ); } else { scope_messages.printf("[%s] No canonical result\n", wu.name); } diff --git a/sched/assimilator.C b/sched/assimilator.C index b60613e5ff..267e174626 100644 --- a/sched/assimilator.C +++ b/sched/assimilator.C @@ -52,7 +52,9 @@ bool do_pass(APP& app) { while (!wu.enumerate(buf)) { did_something = true; - log_messages.printf(SchedMessages::DEBUG, "[%s] assimilating; state=%d\n", wu.name, wu.assimilate_state); + log_messages.printf(SchedMessages::DEBUG, + "[%s] assimilating; state=%d\n", wu.name, wu.assimilate_state + ); sprintf(buf, "where workunitid=%d", wu.id); while (!result.enumerate(buf)) { diff --git a/sched/handle_request.C b/sched/handle_request.C index 61d5bc5d4a..a0f1aaab2d 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -95,7 +95,8 @@ bool wu_is_feasible(WORKUNIT& wu, HOST& host) { if (host_remaining_time + wu_wallclock_time > wu.delay_bound) { log_messages.printf( SchedMessages::DEBUG, "[WU#%d %s] needs requires %d seconds on [HOST#%d]; delay_bound is %d\n", - wu.id, wu.name, (int)wu_wallclock_time, host.id, wu.delay_bound); + wu.id, wu.name, (int)wu_wallclock_time, host.id, wu.delay_bound + ); return false; } diff --git a/sched/sched_util.C b/sched/sched_util.C index 0a74c1a71f..0f17cfb01e 100644 --- a/sched/sched_util.C +++ b/sched/sched_util.C @@ -38,7 +38,7 @@ void write_pid_file(const char* filename) { log_messages.printf(SchedMessages::NORMAL, "Couldn't write pid\n"); return; } - fprintf(fpid, "%d\n", getpid()); + fprintf(fpid, "%d\n", (int)getpid()); fclose(fpid); } @@ -67,10 +67,15 @@ void check_stop_trigger() { } -// update an exponential average of credit per second. +// decay an exponential average of credit per day, +// and possibly add an increment for new credit // void update_average( - double credit_assigned_time, double credit, double& avg, double& avg_time + double credit_assigned_time, // when work was started for new credit + // (or zero if no new credit) + double credit, // amount of new credit + double& avg, // average credit per day (in and out) + double& avg_time // when average was last computed ) { time_t now = time(0); @@ -79,13 +84,14 @@ void update_average( // if (avg_time) { double deltat = now - avg_time; - avg *= exp(-deltat*ALPHA); + avg *= exp(-deltat*LOG2/AVG_HALF_LIFE); } if (credit_assigned_time) { double deltat = now - credit_assigned_time; - // Add (credit)/(number of days to return result) to credit, which - // is the average number of cobblestones per day - avg += credit/(deltat/86400); + // Add (credit)/(number of days to return result) to credit, + // which is the average number of cobblestones per day + // + avg += credit/(deltat/SECONDS_IN_DAY); } avg_time = now; } diff --git a/sched/sched_util.h b/sched/sched_util.h index 0afaf7717e..4bb5230e7a 100644 --- a/sched/sched_util.h +++ b/sched/sched_util.h @@ -25,18 +25,20 @@ // "average credit" uses an exponential decay so that recent // activity is weighted more heavily. -// H is the "half-life" period: the average goes down by 1/2 -// if idle for this period. -// Specifically, the weighting function W(t) is -// W(t) = exp(t/(H*log(2))*H*log(2). -// The average credit is the sum of X*W(t(X)) -// over units of credit X that were granted t(X) time ago. +// AVG_HALF_LIFE is the "half-life" period: +// the average decreases by 1/2 if idle for this period. +// +// After a period of T, average credit is multiplied by +// exp(-T*log(2)/AHL) +// +// When new credit is granted, the average credit is incremented +// by the new credit's average rate, +// i.e. the amount divided by the time since it was started #define LOG2 M_LN2 // log(2) #define SECONDS_IN_DAY (3600*24) #define AVG_HALF_LIFE (SECONDS_IN_DAY*7) -#define ALPHA (LOG2/AVG_HALF_LIFE) extern void write_pid_file(const char* filename); extern void set_debug_level(int); diff --git a/sched/update_stats.C b/sched/update_stats.C index 0934fe871c..f7a0d3cf1a 100644 --- a/sched/update_stats.C +++ b/sched/update_stats.C @@ -17,8 +17,9 @@ // Contributor(s): // -// update_stats: update exponential average credit for users and hosts, -// and calculate total users/credit for teams +// update_stats +// update average credit for users and hosts, +// and calculate total users/credit for teams // // usage: update_stats [-update_teams] [-update_users] [-update_hosts] [-asynch] @@ -68,13 +69,14 @@ int get_team_credit(TEAM& team) { DB_USER user; char buf[256]; - // count the number of users on a team + // count the number of users on the team // sprintf(buf, "where teamid=%d", team.id); retval = user.count(nusers, buf); if (retval) return retval; // get the summed credit values for a team + // sprintf(buf, "where teamid=%d", team.id); retval = user.sum(expavg_credit, "expavg_credit", buf); if (retval) return retval; @@ -108,7 +110,6 @@ int update_teams() { continue; } - // update the team record retval = team.update(); if (retval) return retval; }