diff --git a/checkin_notes b/checkin_notes index 878da2ce22..1927dbb1b3 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9552,3 +9552,15 @@ David 27 Nov 2009 client/ cs_scheduler.cpp + +David 27 Nov 2009 + - client: add log flag. + This tells you what's running, not why + - client: add log flag; changes in STD + + The above are to let you log just stuff relevant to debt. + Right now I'm not sure why we need STD at all. + + client/ + cpu_sched.cpp + log_flags.cpp,h diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index 48ab3f04f0..fb8d8ceb07 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -568,6 +568,7 @@ void CLIENT_STATE::adjust_debts() { // rrs = runnable_resource_share(); for (i=0; inon_cpu_intensive) continue; nprojects++; @@ -575,9 +576,16 @@ void CLIENT_STATE::adjust_debts() { if (p->runnable()) { nrprojects++; share_frac = p->resource_share/rrs; - p->short_term_debt += share_frac*cpu_work_fetch.secs_this_debt_interval + delta = share_frac*cpu_work_fetch.secs_this_debt_interval - p->cpu_pwf.secs_this_debt_interval; + p->short_term_debt += delta; total_short_term_debt += p->short_term_debt; + if (log_flags.std_debug) { + msg_printf(p, MSG_INFO, + "[std_debug] std delta %.2f (work done %.2f)", + delta, cpu_work_fetch.secs_this_debt_interval + ); + } } else { p->short_term_debt = 0; p->anticipated_debt = 0; @@ -601,6 +609,11 @@ void CLIENT_STATE::adjust_debts() { p->short_term_debt = -MAX_STD; } } + if (log_flags.std_debug) { + msg_printf(p, MSG_INFO, + "[std_debug] std %.2f", p->short_term_debt + ); + } } } @@ -1489,6 +1502,12 @@ bool CLIENT_STATE::enforce_schedule() { atp->run_interval_start_wall_time = now; app_started = now; } + if (log_flags.cpu_sched_status) { + msg_printf(atp->result->project, MSG_INFO, + "[css] running %s (%s)", + atp->result->name, atp->result->resources + ); + } atp->scheduler_state = CPU_SCHED_SCHEDULED; swap_left -= atp->procinfo.swap_size; } diff --git a/client/log_flags.cpp b/client/log_flags.cpp index 163f15ec26..4328e67eca 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -79,8 +79,10 @@ int LOG_FLAGS::parse(XML_PARSER& xp) { if (xp.parse_bool(tag, "coproc_debug", coproc_debug)) continue; if (xp.parse_bool(tag, "cpu_sched", cpu_sched)) continue; if (xp.parse_bool(tag, "cpu_sched_debug", cpu_sched_debug)) continue; + if (xp.parse_bool(tag, "cpu_sched_status", cpu_sched_status)) continue; if (xp.parse_bool(tag, "dcf_debug", dcf_debug)) continue; if (xp.parse_bool(tag, "debt_debug", debt_debug)) continue; + if (xp.parse_bool(tag, "std_debug", std_debug)) continue; if (xp.parse_bool(tag, "file_xfer_debug", file_xfer_debug)) continue; if (xp.parse_bool(tag, "guirpc_debug", guirpc_debug)) continue; if (xp.parse_bool(tag, "http_debug", http_debug)) continue; @@ -137,6 +139,7 @@ void LOG_FLAGS::show() { show_flag(buf, coproc_debug, "coproc_debug"); show_flag(buf, cpu_sched, "cpu_sched"); show_flag(buf, cpu_sched_debug, "cpu_sched_debug"); + show_flag(buf, cpu_sched_status, "cpu_sched_status"); show_flag(buf, dcf_debug, "dcf_debug"); show_flag(buf, debt_debug, "debt_debug"); show_flag(buf, file_xfer_debug, "file_xfer_debug"); @@ -153,6 +156,7 @@ void LOG_FLAGS::show() { show_flag(buf, slot_debug, "slot_debug"); show_flag(buf, state_debug, "state_debug"); show_flag(buf, statefile_debug, "statefile_debug"); + show_flag(buf, std_debug, "std_debug"); show_flag(buf, task_debug, "task_debug"); show_flag(buf, time_debug, "time_debug"); show_flag(buf, unparsed_xml, "unparsed_xml"); diff --git a/client/log_flags.h b/client/log_flags.h index 01fa021ed2..c7da94866f 100644 --- a/client/log_flags.h +++ b/client/log_flags.h @@ -62,10 +62,14 @@ struct LOG_FLAGS { // preemption and resumption bool cpu_sched_debug; // explain scheduler decisions + bool cpu_sched_status; + // show what's running bool dcf_debug; // show changes to duration correction factors bool debt_debug; - // changes to debt + // changes to long-term debt + bool std_debug; + // changes to short-term debt bool file_xfer_debug; // show completion of FILE_XFER bool guirpc_debug; diff --git a/lib/idlemon.h b/lib/idlemon.h index 7e4eaeb193..b46acce819 100644 --- a/lib/idlemon.h +++ b/lib/idlemon.h @@ -22,7 +22,6 @@ extern bool startup_idle_monitor(); extern bool attach_idle_monitor(); extern void shutdown_idle_monitor(); extern void detach_idle_monitor(); - extern long get_idle_tick_count(); -#endif \ No newline at end of file +#endif