*** empty log message ***

svn path=/trunk/boinc/; revision=5499
This commit is contained in:
David Anderson 2005-02-23 00:11:59 +00:00
parent d517061a45
commit 20656a03df
6 changed files with 35 additions and 14 deletions

View File

@ -25175,3 +25175,15 @@ Rom 22 Feb 2005
MainFrame.cpp
lib/
gui_rpc_client.C, .h
David 22 Feb 2005
- backend processes: centralize avg_turnaround updating,
and write log messages
- backend programs: define CRITICAL/NORMAL/DEBUG as 1/2/3
so that message logging works as advertised
sched/
sched_msgs.h
sched_util.C,h
transitioner.C
validator.C

View File

@ -25,9 +25,9 @@ class SCHED_MSG_LOG : public MSG_LOG {
bool v_message_wanted(int kind) const;
public:
enum Kind {
CRITICAL,
NORMAL,
DEBUG
CRITICAL=1,
NORMAL=2,
DEBUG=3
};
SCHED_MSG_LOG(): MSG_LOG(stderr) {}
void set_debug_level(int new_level) { debug_level = new_level; }

View File

@ -208,4 +208,18 @@ int extract_filename(char* in, char* out) {
return 0;
}
void compute_avg_turnaround(HOST& host, double turnaround) {
double new_avg;
if (host.avg_turnaround == 0) {
new_avg = turnaround;
} else {
new_avg = .7*host.avg_turnaround + .3*turnaround;
}
log_messages.printf(SCHED_MSG_LOG::NORMAL,
"turnaround %f; old %f; new %f\n",
turnaround, host.avg_turnaround, new_avg
);
host.avg_turnaround = new_avg;
}
const char *BOINC_RCSID_affa6ef1e4 = "$Id$";

View File

@ -20,6 +20,8 @@
#ifndef SCHED_UTIL_H
#define SCHED_UTIL_H
#include "boinc_db.h"
// "average credit" uses an exponential decay so that recent
// activity is weighted more heavily.
// CREDIT_HALF_LIFE is the "half-life" period:
@ -54,4 +56,6 @@ extern int dir_hier_url(
//
extern int extract_filename(char* in, char* out);
extern void compute_avg_turnaround(HOST& host, double turnaround);
#endif

View File

@ -69,12 +69,7 @@ int penalize_host(int hostid, double delay_bound) {
char buf[256];
int retval = host.lookup_id(hostid);
if (retval) return retval;
if (host.avg_turnaround == 0) {
host.avg_turnaround = delay_bound;
} else {
host.avg_turnaround = .7*host.avg_turnaround + .3*delay_bound;
}
compute_avg_turnaround(host, delay_bound);
sprintf(buf, "avg_turnaround=%f", host.avg_turnaround);
return host.update_field(buf);
}

View File

@ -112,11 +112,7 @@ int grant_credit(RESULT& result, double credit) {
update_average(result.sent_time, credit, CREDIT_HALF_LIFE, host.expavg_credit, host.expavg_time);
double turnaround = result.received_time - result.sent_time;
if (host.avg_turnaround == 0) {
host.avg_turnaround = turnaround;
} else {
host.avg_turnaround = .7*host.avg_turnaround + .3*turnaround;
}
compute_avg_turnaround(host, turnaround);
sprintf(
buf,