mirror of https://github.com/BOINC/boinc.git
- client: add cpu_sched debug messages for anti-domino-effect
and anti-thrasing mechanisms - wrapper: to kill an app, use SIGTERM instead of SIGKILL svn path=/trunk/boinc/; revision=23082
This commit is contained in:
parent
412395a8c9
commit
01a1ec33c3
|
@ -982,3 +982,14 @@ Charlie 21 Feb 2011
|
||||||
|
|
||||||
client/
|
client/
|
||||||
cs_notice.cpp
|
cs_notice.cpp
|
||||||
|
|
||||||
|
David 21 Feb 2011
|
||||||
|
- client: add cpu_sched debug messages for anti-domino-effect
|
||||||
|
and anti-thrasing mechanisms
|
||||||
|
- wrapper: to kill an app, use SIGTERM instead of SIGKILL
|
||||||
|
client/
|
||||||
|
acct_mgr.cpp
|
||||||
|
cpu_sched.cpp
|
||||||
|
samples/wrapper/
|
||||||
|
wrapper.cpp
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ int ACCT_MGR_OP::do_rpc(
|
||||||
gstate.host_info.write(mf, !config.suppress_net_info, true);
|
gstate.host_info.write(mf, !config.suppress_net_info, true);
|
||||||
if (strlen(gstate.acct_mgr_info.opaque)) {
|
if (strlen(gstate.acct_mgr_info.opaque)) {
|
||||||
fprintf(f,
|
fprintf(f,
|
||||||
" <opaque>\n%s\n"
|
" <opaque>\n<![CDATA[\n%s\n]]>\n"
|
||||||
" </opaque>\n",
|
" </opaque>\n",
|
||||||
gstate.acct_mgr_info.opaque
|
gstate.acct_mgr_info.opaque
|
||||||
);
|
);
|
||||||
|
|
|
@ -366,31 +366,31 @@ RESULT* CLIENT_STATE::largest_debt_project_best_result() {
|
||||||
PROJECT* p = projects[i];
|
PROJECT* p = projects[i];
|
||||||
if (!p->next_runnable_result) continue;
|
if (!p->next_runnable_result) continue;
|
||||||
if (p->non_cpu_intensive) continue;
|
if (p->non_cpu_intensive) continue;
|
||||||
if (use_rec) {
|
if (use_rec) {
|
||||||
if (first || project_priority(p)> best_debt) {
|
if (first || project_priority(p)> best_debt) {
|
||||||
first = false;
|
first = false;
|
||||||
best_project = p;
|
best_project = p;
|
||||||
best_debt = project_priority(p);
|
best_debt = project_priority(p);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (first || p->cpu_pwf.anticipated_debt > best_debt) {
|
||||||
|
first = false;
|
||||||
|
best_project = p;
|
||||||
|
best_debt = p->cpu_pwf.anticipated_debt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (first || p->cpu_pwf.anticipated_debt > best_debt) {
|
|
||||||
first = false;
|
|
||||||
best_project = p;
|
|
||||||
best_debt = p->cpu_pwf.anticipated_debt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!best_project) return NULL;
|
if (!best_project) return NULL;
|
||||||
|
|
||||||
if (!use_rec) {
|
if (!use_rec) {
|
||||||
if (log_flags.cpu_sched_debug) {
|
if (log_flags.cpu_sched_debug) {
|
||||||
msg_printf(best_project, MSG_INFO,
|
msg_printf(best_project, MSG_INFO,
|
||||||
"[cpu_sched] highest debt: %f %s",
|
"[cpu_sched] highest debt: %f %s",
|
||||||
best_project->cpu_pwf.anticipated_debt,
|
best_project->cpu_pwf.anticipated_debt,
|
||||||
best_project->next_runnable_result->name
|
best_project->next_runnable_result->name
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
RESULT* rp = best_project->next_runnable_result;
|
RESULT* rp = best_project->next_runnable_result;
|
||||||
best_project->next_runnable_result = 0;
|
best_project->next_runnable_result = 0;
|
||||||
return rp;
|
return rp;
|
||||||
|
@ -418,11 +418,11 @@ RESULT* first_coproc_result(int rsc_type) {
|
||||||
if (!rp->runnable()) continue;
|
if (!rp->runnable()) continue;
|
||||||
if (rp->project->non_cpu_intensive) continue;
|
if (rp->project->non_cpu_intensive) continue;
|
||||||
if (rp->already_selected) continue;
|
if (rp->already_selected) continue;
|
||||||
if (use_rec) {
|
if (use_rec) {
|
||||||
std = project_priority(rp->project);
|
std = project_priority(rp->project);
|
||||||
} else {
|
} else {
|
||||||
std = rp->project->anticipated_debt(rsc_type);
|
std = rp->project->anticipated_debt(rsc_type);
|
||||||
}
|
}
|
||||||
if (!best) {
|
if (!best) {
|
||||||
best = rp;
|
best = rp;
|
||||||
best_std = std;
|
best_std = std;
|
||||||
|
@ -706,20 +706,20 @@ void CLIENT_STATE::adjust_debts() {
|
||||||
work_fetch.accumulate_inst_sec(atp, elapsed_time);
|
work_fetch.accumulate_inst_sec(atp, elapsed_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_rec) {
|
if (use_rec) {
|
||||||
update_rec();
|
update_rec();
|
||||||
} else {
|
} else {
|
||||||
cpu_work_fetch.update_long_term_debts();
|
cpu_work_fetch.update_long_term_debts();
|
||||||
cpu_work_fetch.update_short_term_debts();
|
cpu_work_fetch.update_short_term_debts();
|
||||||
if (host_info.have_cuda()) {
|
if (host_info.have_cuda()) {
|
||||||
cuda_work_fetch.update_long_term_debts();
|
cuda_work_fetch.update_long_term_debts();
|
||||||
cuda_work_fetch.update_short_term_debts();
|
cuda_work_fetch.update_short_term_debts();
|
||||||
|
}
|
||||||
|
if (host_info.have_ati()) {
|
||||||
|
ati_work_fetch.update_long_term_debts();
|
||||||
|
ati_work_fetch.update_short_term_debts();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (host_info.have_ati()) {
|
|
||||||
ati_work_fetch.update_long_term_debts();
|
|
||||||
ati_work_fetch.update_short_term_debts();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reset_debt_accounting();
|
reset_debt_accounting();
|
||||||
}
|
}
|
||||||
|
@ -792,16 +792,16 @@ static bool schedule_if_possible(
|
||||||
}
|
}
|
||||||
proc_rsc.schedule(rp, atp);
|
proc_rsc.schedule(rp, atp);
|
||||||
|
|
||||||
if (use_rec) {
|
if (use_rec) {
|
||||||
adjust_rec_temp(rp);
|
adjust_rec_temp(rp);
|
||||||
} else {
|
} else {
|
||||||
// project STD at end of time slice
|
// project STD at end of time slice
|
||||||
//
|
//
|
||||||
double dt = gstate.global_prefs.cpu_scheduling_period();
|
double dt = gstate.global_prefs.cpu_scheduling_period();
|
||||||
rp->project->cpu_pwf.anticipated_debt -= dt*rp->avp->avg_ncpus/cpu_work_fetch.ninstances;
|
rp->project->cpu_pwf.anticipated_debt -= dt*rp->avp->avg_ncpus/cpu_work_fetch.ninstances;
|
||||||
rp->project->cuda_pwf.anticipated_debt -= dt*rp->avp->ncudas/cuda_work_fetch.ninstances;
|
rp->project->cuda_pwf.anticipated_debt -= dt*rp->avp->ncudas/cuda_work_fetch.ninstances;
|
||||||
rp->project->ati_pwf.anticipated_debt -= dt*rp->avp->natis/ati_work_fetch.ninstances;
|
rp->project->ati_pwf.anticipated_debt -= dt*rp->avp->natis/ati_work_fetch.ninstances;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,16 +819,32 @@ static void promote_once_ran_edf() {
|
||||||
RESULT* rp = atp->result;
|
RESULT* rp = atp->result;
|
||||||
PROJECT* p = rp->project;
|
PROJECT* p = rp->project;
|
||||||
if (p->deadlines_missed(rp->avp->rsc_type())) {
|
if (p->deadlines_missed(rp->avp->rsc_type())) {
|
||||||
|
if (log_flags.cpu_sched) {
|
||||||
|
msg_printf(p, MSG_INFO,
|
||||||
|
"[cpu_sched] domino prevention: mark %s as deadline miss",
|
||||||
|
rp->name
|
||||||
|
);
|
||||||
|
}
|
||||||
rp->rr_sim_misses_deadline = true;
|
rp->rr_sim_misses_deadline = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (gstate.now - atp->last_deadline_miss_time < gstate.global_prefs.cpu_scheduling_period()) {
|
if (gstate.now - atp->last_deadline_miss_time < gstate.global_prefs.cpu_scheduling_period()) {
|
||||||
|
if (log_flags.cpu_sched) {
|
||||||
|
RESULT* rp = atp->result;
|
||||||
|
PROJECT* p = rp->project;
|
||||||
|
msg_printf(p, MSG_INFO,
|
||||||
|
"[cpu_sched] trashing prevention: mark %s as deadline miss",
|
||||||
|
rp->name
|
||||||
|
);
|
||||||
|
}
|
||||||
atp->result->rr_sim_misses_deadline = true;
|
atp->result->rr_sim_misses_deadline = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void add_coproc_jobs(vector<RESULT*>& run_list, int rsc_type, PROC_RESOURCES& proc_rsc) {
|
void add_coproc_jobs(
|
||||||
|
vector<RESULT*>& run_list, int rsc_type, PROC_RESOURCES& proc_rsc
|
||||||
|
) {
|
||||||
ACTIVE_TASK* atp;
|
ACTIVE_TASK* atp;
|
||||||
RESULT* rp;
|
RESULT* rp;
|
||||||
bool can_run;
|
bool can_run;
|
||||||
|
@ -909,9 +925,9 @@ void CLIENT_STATE::make_run_list(vector<RESULT*>& run_list) {
|
||||||
|
|
||||||
// set temporary variables
|
// set temporary variables
|
||||||
//
|
//
|
||||||
if (use_rec) {
|
if (use_rec) {
|
||||||
project_priority_init();
|
project_priority_init();
|
||||||
}
|
}
|
||||||
for (i=0; i<results.size(); i++) {
|
for (i=0; i<results.size(); i++) {
|
||||||
rp = results[i];
|
rp = results[i];
|
||||||
rp->already_selected = false;
|
rp->already_selected = false;
|
||||||
|
@ -920,11 +936,11 @@ if (use_rec) {
|
||||||
for (i=0; i<projects.size(); i++) {
|
for (i=0; i<projects.size(); i++) {
|
||||||
p = projects[i];
|
p = projects[i];
|
||||||
p->next_runnable_result = NULL;
|
p->next_runnable_result = NULL;
|
||||||
if (!use_rec) {
|
if (!use_rec) {
|
||||||
p->cpu_pwf.anticipated_debt = p->cpu_pwf.short_term_debt;
|
p->cpu_pwf.anticipated_debt = p->cpu_pwf.short_term_debt;
|
||||||
p->cuda_pwf.anticipated_debt = p->cuda_pwf.short_term_debt;
|
p->cuda_pwf.anticipated_debt = p->cuda_pwf.short_term_debt;
|
||||||
p->ati_pwf.anticipated_debt = p->ati_pwf.short_term_debt;
|
p->ati_pwf.anticipated_debt = p->ati_pwf.short_term_debt;
|
||||||
}
|
}
|
||||||
p->cpu_pwf.deadlines_missed_copy = p->cpu_pwf.deadlines_missed;
|
p->cpu_pwf.deadlines_missed_copy = p->cpu_pwf.deadlines_missed;
|
||||||
p->cuda_pwf.deadlines_missed_copy = p->cuda_pwf.deadlines_missed;
|
p->cuda_pwf.deadlines_missed_copy = p->cuda_pwf.deadlines_missed;
|
||||||
p->ati_pwf.deadlines_missed_copy = p->ati_pwf.deadlines_missed;
|
p->ati_pwf.deadlines_missed_copy = p->ati_pwf.deadlines_missed;
|
||||||
|
|
|
@ -512,7 +512,7 @@ void TASK::kill() {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
TerminateProcess(pid_handle, -1);
|
TerminateProcess(pid_handle, -1);
|
||||||
#else
|
#else
|
||||||
::kill(pid, SIGKILL);
|
::kill(pid, SIGTERM);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue