mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=12341
This commit is contained in:
parent
ab42c2fe96
commit
fb47db934a
|
@ -3365,3 +3365,12 @@ Rom 10 Apr 2007
|
||||||
|
|
||||||
clientgui/
|
clientgui/
|
||||||
BOINCGridCtrl.cpp
|
BOINCGridCtrl.cpp
|
||||||
|
|
||||||
|
David 10 Apr 2007
|
||||||
|
- core client: adjustment to anticipated debt is
|
||||||
|
resource_share*expected_payoff, not
|
||||||
|
(1-resource_share)*expected_payoff
|
||||||
|
|
||||||
|
client/
|
||||||
|
cpu_sched.C
|
||||||
|
sim.C,h
|
||||||
|
|
|
@ -507,7 +507,7 @@ void CLIENT_STATE::schedule_cpus() {
|
||||||
ram_left -= atp->procinfo.working_set_size_smoothed;
|
ram_left -= atp->procinfo.working_set_size_smoothed;
|
||||||
}
|
}
|
||||||
|
|
||||||
rp->project->anticipated_debt -= (1 - rp->project->resource_share / rrs) * expected_pay_off;
|
rp->project->anticipated_debt -= (rp->project->resource_share / rrs) * expected_pay_off;
|
||||||
rp->project->deadlines_missed--;
|
rp->project->deadlines_missed--;
|
||||||
rp->edf_scheduled = true;
|
rp->edf_scheduled = true;
|
||||||
if (log_flags.cpu_sched_debug) {
|
if (log_flags.cpu_sched_debug) {
|
||||||
|
@ -541,7 +541,8 @@ void CLIENT_STATE::schedule_cpus() {
|
||||||
}
|
}
|
||||||
ram_left -= atp->procinfo.working_set_size_smoothed;
|
ram_left -= atp->procinfo.working_set_size_smoothed;
|
||||||
}
|
}
|
||||||
rp->project->anticipated_debt -= (1 - rp->project->resource_share / rrs) * expected_pay_off;
|
double xx = (rp->project->resource_share / rrs) * expected_pay_off;
|
||||||
|
rp->project->anticipated_debt -= xx;
|
||||||
if (log_flags.cpu_sched_debug) {
|
if (log_flags.cpu_sched_debug) {
|
||||||
msg_printf(NULL, MSG_INFO, "[cpu_sched_debug] scheduling (regular) %s", rp->name);
|
msg_printf(NULL, MSG_INFO, "[cpu_sched_debug] scheduling (regular) %s", rp->name);
|
||||||
}
|
}
|
||||||
|
|
63
client/sim.C
63
client/sim.C
|
@ -409,6 +409,11 @@ bool ACTIVE_TASK_SET::poll() {
|
||||||
case PROCESS_EXECUTING:
|
case PROCESS_EXECUTING:
|
||||||
atp->cpu_time_left -= diff;
|
atp->cpu_time_left -= diff;
|
||||||
RESULT* rp = atp->result;
|
RESULT* rp = atp->result;
|
||||||
|
|
||||||
|
double cpu_time_used = rp->final_cpu_time - atp->cpu_time_left;
|
||||||
|
atp->fraction_done = cpu_time_used/rp->final_cpu_time;
|
||||||
|
atp->checkpoint_wall_time = gstate.now;
|
||||||
|
|
||||||
if (atp->cpu_time_left <= 0) {
|
if (atp->cpu_time_left <= 0) {
|
||||||
atp->set_task_state(PROCESS_EXITED, "poll");
|
atp->set_task_state(PROCESS_EXITED, "poll");
|
||||||
rp->exit_status = 0;
|
rp->exit_status = 0;
|
||||||
|
@ -435,13 +440,11 @@ bool ACTIVE_TASK_SET::poll() {
|
||||||
if (p->idle) {
|
if (p->idle) {
|
||||||
p->idle_period_duration += diff;
|
p->idle_period_duration += diff;
|
||||||
} else {
|
} else {
|
||||||
if (p->idle_period_duration) {
|
p->idle_period_duration = 0;
|
||||||
double ipd = p->idle_period_duration;
|
|
||||||
p->idle_period_sumsq += ipd*ipd;
|
|
||||||
p->nidle_periods++;
|
|
||||||
p->idle_period_duration = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
double ipd = p->idle_period_duration;
|
||||||
|
p->idle_period_sumsq += ipd*ipd;
|
||||||
|
p->nidle_periods++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
|
@ -681,32 +684,28 @@ double CLIENT_STATE::variety() {
|
||||||
return sqrt(sum/n);
|
return sqrt(sum/n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SIM_RESULTS::compute() {
|
||||||
|
double total = cpu_used + cpu_wasted + cpu_idle;
|
||||||
|
cpu_wasted_frac = cpu_wasted/total;
|
||||||
|
cpu_idle_frac = cpu_idle/total;
|
||||||
|
share_violation = gstate.share_violation();
|
||||||
|
variety = gstate.variety();
|
||||||
|
}
|
||||||
|
|
||||||
// top-level results (for aggregating multiple simulations)
|
// top-level results (for aggregating multiple simulations)
|
||||||
//
|
//
|
||||||
void SIM_RESULTS::print(FILE* f) {
|
void SIM_RESULTS::print(FILE* f, const char* title) {
|
||||||
double total = cpu_used + cpu_wasted + cpu_idle;
|
if (title) {
|
||||||
|
fprintf(f, title);
|
||||||
|
}
|
||||||
fprintf(f, "wasted %f idle %f share_violation %f variety %f\n",
|
fprintf(f, "wasted %f idle %f share_violation %f variety %f\n",
|
||||||
cpu_wasted/total, cpu_idle/total,
|
cpu_wasted_frac, cpu_idle_frac, share_violation, variety
|
||||||
gstate.share_violation(),
|
|
||||||
gstate.variety()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// all results (human-readable)
|
|
||||||
//
|
|
||||||
void SIM_RESULTS::print_pct(const char* title, FILE* f) {
|
|
||||||
double total = cpu_used + cpu_wasted + cpu_idle;
|
|
||||||
fprintf(f, "%s used %.2f%%, wasted %.2f%%, idle %.2f%%\n",
|
|
||||||
title,
|
|
||||||
(cpu_used/total)*100,
|
|
||||||
(cpu_wasted/total)*100,
|
|
||||||
(cpu_idle/total)*100
|
|
||||||
);
|
|
||||||
}
|
|
||||||
void SIM_RESULTS::parse(FILE* f) {
|
void SIM_RESULTS::parse(FILE* f) {
|
||||||
fscanf(f, "used %lf wasted %lf idle %lf met %d missed %d",
|
fscanf(f, "wasted %lf idle %lf share_violation %lf variety %lf",
|
||||||
&cpu_used, &cpu_wasted, &cpu_idle,
|
&cpu_wasted, &cpu_idle, &share_violation, &variety
|
||||||
&nresults_met_deadline, &nresults_missed_deadline
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
void SIM_RESULTS::add(SIM_RESULTS& r) {
|
void SIM_RESULTS::add(SIM_RESULTS& r) {
|
||||||
|
@ -884,8 +883,8 @@ void CLIENT_STATE::html_rec() {
|
||||||
void CLIENT_STATE::html_end() {
|
void CLIENT_STATE::html_end() {
|
||||||
double cpu_total=sim_results.cpu_used + sim_results.cpu_wasted + sim_results.cpu_idle;
|
double cpu_total=sim_results.cpu_used + sim_results.cpu_wasted + sim_results.cpu_idle;
|
||||||
fprintf(html_out, "</table><pre>\n");
|
fprintf(html_out, "</table><pre>\n");
|
||||||
|
sim_results.compute();
|
||||||
sim_results.print(html_out);
|
sim_results.print(html_out);
|
||||||
sim_results.print_pct("Total:", html_out);
|
|
||||||
print_project_results(html_out);
|
print_project_results(html_out);
|
||||||
fprintf(html_out, "</pre>\n");
|
fprintf(html_out, "</pre>\n");
|
||||||
fclose(html_out);
|
fclose(html_out);
|
||||||
|
@ -994,11 +993,11 @@ int main(int argc, char** argv) {
|
||||||
FILE* f = fopen(SUMMARY_FILE, "r");
|
FILE* f = fopen(SUMMARY_FILE, "r");
|
||||||
sim_results.parse(f);
|
sim_results.parse(f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
sim_results.print_pct(dir.c_str(), stdout);
|
sim_results.print(stdout, dir.c_str());
|
||||||
total_results.add(sim_results);
|
total_results.add(sim_results);
|
||||||
chdir("..");
|
chdir("..");
|
||||||
}
|
}
|
||||||
total_results.print_pct("Total", stdout);
|
total_results.print(stdout, "Total");
|
||||||
} else {
|
} else {
|
||||||
read_config_file();
|
read_config_file();
|
||||||
int retval;
|
int retval;
|
||||||
|
@ -1014,7 +1013,13 @@ int main(int argc, char** argv) {
|
||||||
gstate.set_ncpus();
|
gstate.set_ncpus();
|
||||||
gstate.request_work_fetch("init");
|
gstate.request_work_fetch("init");
|
||||||
gstate.simulate();
|
gstate.simulate();
|
||||||
gstate.print_project_results(stdout);
|
|
||||||
|
sim_results.compute();
|
||||||
|
|
||||||
|
// print machine-readable first
|
||||||
sim_results.print(stdout);
|
sim_results.print(stdout);
|
||||||
|
|
||||||
|
// then other
|
||||||
|
gstate.print_project_results(stdout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
13
client/sim.h
13
client/sim.h
|
@ -25,14 +25,13 @@ struct SIM_RESULTS {
|
||||||
double cpu_idle;
|
double cpu_idle;
|
||||||
int nresults_met_deadline;
|
int nresults_met_deadline;
|
||||||
int nresults_missed_deadline;
|
int nresults_missed_deadline;
|
||||||
|
double share_violation;
|
||||||
|
double variety;
|
||||||
|
double cpu_wasted_frac;
|
||||||
|
double cpu_idle_frac;
|
||||||
|
|
||||||
// top-level results (for aggregating multiple simulations)
|
void compute();
|
||||||
//
|
void print(FILE* f, const char* title=0);
|
||||||
void print(FILE* f);
|
|
||||||
|
|
||||||
// all results (human-readable)
|
|
||||||
//
|
|
||||||
void print_pct(const char* title, FILE* f);
|
|
||||||
void parse(FILE* f);
|
void parse(FILE* f);
|
||||||
void add(SIM_RESULTS& r);
|
void add(SIM_RESULTS& r);
|
||||||
SIM_RESULTS();
|
SIM_RESULTS();
|
||||||
|
|
Loading…
Reference in New Issue