- client: suspend_reason is not a bitmap; fix code that acted like it is.

This commit is contained in:
David Anderson 2013-02-12 18:21:21 -08:00 committed by Oliver Bock
parent 45120de247
commit 5c7f583e42
7 changed files with 9 additions and 15 deletions

View File

@ -710,7 +710,7 @@ bool ACTIVE_TASK_SET::check_app_exited() {
// if we're running benchmarks, exited process
// is probably a benchmark process; don't show error
//
if (!gstate.are_cpu_benchmarks_running() && log_flags.task_debug) {
if (!gstate.benchmarks_running && log_flags.task_debug) {
msg_printf(NULL, MSG_INTERNAL_ERROR,
"Process %d not found\n", pid
);

View File

@ -131,6 +131,7 @@ CLIENT_STATE::CLIENT_STATE()
redirect_io = false;
disable_graphics = false;
cant_write_state_file = false;
benchmarks_running = false;
debt_interval_start = 0;
retry_shmem_time = 0;
@ -763,7 +764,7 @@ bool CLIENT_STATE::poll_slow_events() {
last_wakeup_time = now;
}
if (should_run_cpu_benchmarks() && !are_cpu_benchmarks_running()) {
if (should_run_cpu_benchmarks() && !benchmarks_running) {
run_cpu_benchmarks = false;
start_cpu_benchmarks();
}
@ -851,7 +852,7 @@ bool CLIENT_STATE::poll_slow_events() {
}
tasks_suspended = (suspend_reason != 0);
if (suspend_reason & SUSPEND_REASON_BENCHMARKS) {
if (benchmarks_running) {
cpu_benchmarks_poll();
}

View File

@ -351,11 +351,12 @@ struct CLIENT_STATE {
ACTIVE_TASK* get_task(RESULT*);
// --------------- cs_benchmark.cpp:
bool benchmarks_running;
bool should_run_cpu_benchmarks();
void start_cpu_benchmarks();
bool cpu_benchmarks_poll();
void abort_cpu_benchmarks();
bool are_cpu_benchmarks_running();
bool cpu_benchmarks_done();
void cpu_benchmarks_set_defaults();
void print_benchmark_results();

View File

@ -117,7 +117,6 @@ struct BENCHMARK_DESC {
};
static BENCHMARK_DESC* benchmark_descs=0;
static bool benchmarks_running=false; // at least 1 benchmark thread running
static double cpu_benchmarks_start;
static int bm_ncpus;
// user might change ncpus during benchmarks.
@ -560,10 +559,3 @@ void CLIENT_STATE::cpu_benchmarks_set_defaults() {
if (!host_info.p_membw) host_info.p_membw = DEFAULT_MEMBW;
if (!host_info.m_cache) host_info.m_cache = DEFAULT_CACHE;
}
// return true if any CPU benchmark thread/process is running
//
bool CLIENT_STATE::are_cpu_benchmarks_running() {
return benchmarks_running;
}

View File

@ -204,7 +204,7 @@ void CLIENT_STATE::get_disk_shares() {
// and if it's zero set gpu_suspend_reason
//
int CLIENT_STATE::check_suspend_processing() {
if (are_cpu_benchmarks_running()) {
if (benchmarks_running) {
return SUSPEND_REASON_BENCHMARKS;
}

View File

@ -155,7 +155,7 @@ void CLIENT_TIME_STATS::get_log_after(double t, MIOFILE& mf) {
void CLIENT_TIME_STATS::update(int suspend_reason, int _gpu_suspend_reason) {
double dt, w1, w2;
bool is_active = !(suspend_reason & ~SUSPEND_REASON_CPU_THROTTLE);
bool is_active = (suspend_reason == 0) || (suspend_reason == SUSPEND_REASON_CPU_THROTTLE);
bool is_gpu_active = is_active && !_gpu_suspend_reason;
if (last_update == 0) {
// this is the first time this client has executed.

View File

@ -258,7 +258,7 @@ language("Finnish", array(
//),
));
language("French", array(
//site("http://boinc.starwars-holonet.com/", "Star Wars [FR]"),
site("http://boinc.starwars-holonet.com/", "Star Wars [FR]"),
//site("http://wwww.boinc-2tf.org", "2TF Asso"),
//site("http://boincfrance.org", "BOINCFRANCE.ORG"),
site("http://www.boinc-af.org", "L'Alliance Francophone"),