2003-10-18 19:35:58 +00:00
|
|
|
// The contents of this file are subject to the BOINC Public License
|
|
|
|
// Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
// compliance with the License. You may obtain a copy of the License at
|
|
|
|
// http://boinc.berkeley.edu/license_1.0.txt
|
2004-07-13 13:54:09 +00:00
|
|
|
//
|
2003-10-18 19:35:58 +00:00
|
|
|
// Software distributed under the License is distributed on an "AS IS"
|
|
|
|
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing rights and limitations
|
2004-07-13 13:54:09 +00:00
|
|
|
// under the License.
|
|
|
|
//
|
|
|
|
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
|
|
|
|
//
|
2003-10-18 19:35:58 +00:00
|
|
|
// The Initial Developer of the Original Code is the SETI@home project.
|
|
|
|
// Portions created by the SETI@home project are Copyright (C) 2002
|
2004-07-13 13:54:09 +00:00
|
|
|
// University of California at Berkeley. All Rights Reserved.
|
|
|
|
//
|
2003-10-18 19:35:58 +00:00
|
|
|
// Contributor(s):
|
|
|
|
//
|
|
|
|
|
2004-05-21 22:40:54 +00:00
|
|
|
// Manage a (perhaps multi-processor) benchmark.
|
|
|
|
// Because of hyperthreaded CPUs we can't just benchmark 1 CPU;
|
|
|
|
// we have to run parallel benchmarks,
|
|
|
|
// and we have to ensure that they run more or less concurrently.
|
|
|
|
// Here's our scheme:
|
|
|
|
// - the main program forks N benchmarks threads or processes
|
|
|
|
// - after FP_START seconds it creates a file "do_fp"
|
|
|
|
// - after FP_END seconds it deletes do_fp
|
|
|
|
// - after INT_START seconds it creates do_int
|
|
|
|
// - after INT_END seconds it deletes do_int and starts waiting for processes
|
|
|
|
// Each thread/process checks for the relevant file before
|
|
|
|
// starting or stopping each benchmark
|
2003-10-18 19:35:58 +00:00
|
|
|
|
|
|
|
#include "cpp.h"
|
|
|
|
|
2004-03-04 11:41:43 +00:00
|
|
|
#ifdef _WIN32
|
2004-06-16 23:16:08 +00:00
|
|
|
#include "boinc_win.h"
|
2004-03-04 11:41:43 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _WIN32
|
2003-10-18 19:35:58 +00:00
|
|
|
#if HAVE_SYS_TYPES_H
|
|
|
|
#include <sys/types.h>
|
|
|
|
#endif
|
|
|
|
#if HAVE_SYS_WAIT_H
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#endif
|
2004-07-13 13:54:09 +00:00
|
|
|
#include <csignal>
|
2003-10-18 19:35:58 +00:00
|
|
|
#if HAVE_SYS_SIGNAL_H
|
|
|
|
#include <sys/signal.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2004-07-13 13:54:09 +00:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <ctime>
|
2004-03-04 11:41:43 +00:00
|
|
|
#endif
|
2003-10-18 19:35:58 +00:00
|
|
|
|
|
|
|
#include "error_numbers.h"
|
|
|
|
#include "file_names.h"
|
|
|
|
#include "filesys.h"
|
2004-04-07 06:51:42 +00:00
|
|
|
#include "util.h"
|
2003-10-19 19:03:49 +00:00
|
|
|
#include "cpu_benchmark.h"
|
2004-04-08 08:15:23 +00:00
|
|
|
#include "client_msgs.h"
|
2003-10-18 19:35:58 +00:00
|
|
|
#include "client_state.h"
|
|
|
|
|
2003-11-02 22:51:49 +00:00
|
|
|
// defaults in case benchmarks fail or time out.
|
|
|
|
// better to err on the low side so hosts don't get too much work
|
|
|
|
|
|
|
|
#define DEFAULT_FPOPS 1e7
|
|
|
|
#define DEFAULT_IOPS 1e7
|
|
|
|
#define DEFAULT_MEMBW 1e8
|
|
|
|
#define DEFAULT_CACHE 1e6
|
|
|
|
|
2004-05-22 01:36:36 +00:00
|
|
|
#define FP_START 2
|
2004-06-19 21:18:07 +00:00
|
|
|
#define FP_END 22
|
|
|
|
#define INT_START 37
|
|
|
|
#define INT_END 57
|
2004-05-21 22:40:54 +00:00
|
|
|
|
2004-05-22 01:36:36 +00:00
|
|
|
#define BM_FP_INIT 0
|
2004-05-21 22:40:54 +00:00
|
|
|
#define BM_FP 1
|
2004-05-22 01:36:36 +00:00
|
|
|
#define BM_INT_INIT 2
|
2004-05-21 22:40:54 +00:00
|
|
|
#define BM_INT 3
|
2004-05-22 01:36:36 +00:00
|
|
|
#define BM_SLEEP 4
|
|
|
|
#define BM_DONE 5
|
2004-05-21 22:40:54 +00:00
|
|
|
static int bm_state;
|
|
|
|
|
2004-06-01 22:12:41 +00:00
|
|
|
#define BENCHMARK_PERIOD (SECONDS_PER_DAY*5)
|
2003-10-18 19:35:58 +00:00
|
|
|
// rerun CPU benchmarks this often (hardware may have been upgraded)
|
|
|
|
|
2004-03-21 00:10:15 +00:00
|
|
|
extern void guiOnBenchmarksBegin();
|
|
|
|
extern void guiOnBenchmarksEnd();
|
2003-10-18 19:35:58 +00:00
|
|
|
|
2004-03-21 00:10:15 +00:00
|
|
|
// represents a benchmark thread/process, in progress or completed
|
2003-10-18 19:35:58 +00:00
|
|
|
//
|
2004-03-21 00:10:15 +00:00
|
|
|
struct BENCHMARK_DESC {
|
|
|
|
int ordinal;
|
|
|
|
HOST_INFO host_info;
|
|
|
|
bool done;
|
|
|
|
bool error;
|
2003-10-18 19:35:58 +00:00
|
|
|
#ifdef _WIN32
|
2004-03-21 00:10:15 +00:00
|
|
|
HANDLE handle;
|
|
|
|
DWORD pid;
|
|
|
|
#else
|
|
|
|
char filename[256];
|
|
|
|
PROCESS_ID pid;
|
2003-10-18 19:35:58 +00:00
|
|
|
#endif
|
2004-03-21 00:10:15 +00:00
|
|
|
};
|
2003-10-18 19:35:58 +00:00
|
|
|
|
2004-03-21 02:19:37 +00:00
|
|
|
static BENCHMARK_DESC* benchmark_descs=0;
|
2004-03-21 00:10:15 +00:00
|
|
|
static bool benchmarks_running=false; // at least 1 benchmark thread running
|
|
|
|
static double cpu_benchmarks_start;
|
|
|
|
|
2004-05-21 22:40:54 +00:00
|
|
|
char *file_names[2] = {"do_fp", "do_int"};
|
|
|
|
|
|
|
|
static void remove_benchmark_file(int which) {
|
|
|
|
boinc_delete_file(file_names[which]);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void make_benchmark_file(int which) {
|
|
|
|
FILE* f = boinc_fopen(file_names[which], "w");
|
|
|
|
fclose(f);
|
|
|
|
}
|
|
|
|
|
|
|
|
void benchmark_wait_to_start(int which) {
|
|
|
|
while (1) {
|
|
|
|
if (boinc_file_exists(file_names[which])) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
boinc_sleep(0.1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool benchmark_time_to_stop(int which) {
|
|
|
|
if (boinc_file_exists(file_names[which])) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2004-03-21 02:19:37 +00:00
|
|
|
// benchmark a single CPU
|
2004-06-19 21:18:07 +00:00
|
|
|
// This takes 60-120 seconds,
|
2003-10-18 19:35:58 +00:00
|
|
|
//
|
2004-03-21 00:10:15 +00:00
|
|
|
int cpu_benchmarks(BENCHMARK_DESC* bdp) {
|
2003-10-18 19:35:58 +00:00
|
|
|
HOST_INFO host_info;
|
2004-05-19 19:49:46 +00:00
|
|
|
double x, y;
|
2003-10-18 19:35:58 +00:00
|
|
|
|
2004-03-31 19:43:15 +00:00
|
|
|
host_info.clear_host_info();
|
2004-05-19 22:10:08 +00:00
|
|
|
whetstone(host_info.p_fpops);
|
|
|
|
dhrystone(x, y);
|
2004-05-19 19:49:46 +00:00
|
|
|
host_info.p_iops = y*1e6;
|
|
|
|
host_info.p_membw = 1e9;
|
2004-03-21 02:19:37 +00:00
|
|
|
host_info.m_cache = 1e6; // TODO: measure the cache
|
2003-10-18 19:35:58 +00:00
|
|
|
|
2004-03-21 00:10:15 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
bdp->host_info = host_info;
|
|
|
|
#else
|
|
|
|
FILE* finfo;
|
|
|
|
finfo = boinc_fopen(bdp->filename, "w");
|
|
|
|
if (!finfo) return ERR_FOPEN;
|
2003-10-18 19:35:58 +00:00
|
|
|
host_info.write_cpu_benchmarks(finfo);
|
|
|
|
fclose(finfo);
|
2004-03-21 00:10:15 +00:00
|
|
|
#endif
|
2003-10-18 19:35:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-03-21 00:10:15 +00:00
|
|
|
#ifdef _WIN32
|
2004-03-21 00:32:03 +00:00
|
|
|
DWORD WINAPI win_cpu_benchmarks(LPVOID p) {
|
2004-03-21 00:10:15 +00:00
|
|
|
return cpu_benchmarks((BENCHMARK_DESC*)p);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void CLIENT_STATE::start_cpu_benchmarks() {
|
|
|
|
int i;
|
|
|
|
|
2004-04-08 08:15:23 +00:00
|
|
|
SCOPE_MSG_LOG scope_messages(log_messages, CLIENT_MSG_LOG::DEBUG_MEASUREMENT);
|
2004-08-10 20:27:51 +00:00
|
|
|
|
2004-03-21 00:10:15 +00:00
|
|
|
if (skip_cpu_benchmarks) {
|
|
|
|
scope_messages.printf("CLIENT_STATE::cpu_benchmarks(): Skipping CPU benchmarks.\n");
|
|
|
|
host_info.p_fpops = DEFAULT_FPOPS;
|
|
|
|
host_info.p_iops = DEFAULT_IOPS;
|
|
|
|
host_info.p_membw = DEFAULT_MEMBW;
|
|
|
|
host_info.m_cache = DEFAULT_CACHE;
|
|
|
|
return;
|
|
|
|
}
|
2003-10-18 19:35:58 +00:00
|
|
|
|
2004-05-22 01:36:36 +00:00
|
|
|
bm_state = BM_FP_INIT;
|
2004-05-21 22:40:54 +00:00
|
|
|
remove_benchmark_file(BM_TYPE_FP);
|
|
|
|
remove_benchmark_file(BM_TYPE_INT);
|
2004-05-22 01:36:36 +00:00
|
|
|
cpu_benchmarks_start = dtime();
|
2004-05-21 22:40:54 +00:00
|
|
|
|
2004-03-21 00:10:15 +00:00
|
|
|
msg_printf(NULL, MSG_INFO, "Running CPU benchmarks");
|
2004-03-21 02:19:37 +00:00
|
|
|
if (!benchmark_descs) {
|
|
|
|
benchmark_descs = (BENCHMARK_DESC*)calloc(
|
|
|
|
host_info.p_ncpus, sizeof(BENCHMARK_DESC)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
guiOnBenchmarksBegin();
|
2004-03-21 00:10:15 +00:00
|
|
|
benchmarks_running = true;
|
|
|
|
|
|
|
|
for (i=0; i<host_info.p_ncpus; i++) {
|
|
|
|
benchmark_descs[i].ordinal = i;
|
|
|
|
benchmark_descs[i].done = false;
|
|
|
|
benchmark_descs[i].error = false;
|
2003-10-18 19:35:58 +00:00
|
|
|
#ifdef _WIN32
|
2004-03-21 00:10:15 +00:00
|
|
|
benchmark_descs[i].handle = CreateThread(
|
|
|
|
NULL, 0, win_cpu_benchmarks, benchmark_descs+i, 0,
|
|
|
|
&benchmark_descs[i].pid
|
|
|
|
);
|
|
|
|
#else
|
|
|
|
sprintf(benchmark_descs[i].filename, "%s_%d.xml", CPU_BENCHMARKS_FILE_NAME, i);
|
|
|
|
PROCESS_ID pid = fork();
|
|
|
|
if (pid == 0) {
|
|
|
|
_exit(cpu_benchmarks(benchmark_descs+i));
|
|
|
|
} else {
|
|
|
|
benchmark_descs[i].pid = pid;
|
2003-10-18 19:35:58 +00:00
|
|
|
}
|
2004-03-21 00:10:15 +00:00
|
|
|
#endif
|
2004-03-21 00:32:03 +00:00
|
|
|
}
|
2004-03-21 00:10:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Returns true if CPU benchmarks should be run:
|
2004-08-10 20:27:51 +00:00
|
|
|
// flag is set or it's been 5 days since we last ran
|
2004-03-21 00:10:15 +00:00
|
|
|
//
|
|
|
|
bool CLIENT_STATE::should_run_cpu_benchmarks() {
|
|
|
|
// Note: if skip_cpu_benchmarks we still should "run" cpu benchmarks
|
|
|
|
// (we'll just use default values in cpu_benchmarks())
|
2004-11-24 22:00:10 +00:00
|
|
|
//
|
|
|
|
if (activities_suspended) return false;
|
2004-03-21 00:10:15 +00:00
|
|
|
return (
|
2004-11-24 22:00:10 +00:00
|
|
|
(run_cpu_benchmarks ||
|
|
|
|
dtime() - host_info.p_calculated > BENCHMARK_PERIOD)
|
2004-03-21 00:10:15 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// abort a running benchmark thread/process
|
|
|
|
//
|
|
|
|
void abort_benchmark(BENCHMARK_DESC& desc) {
|
|
|
|
if (desc.done) return;
|
|
|
|
#ifdef _WIN32
|
|
|
|
TerminateThread(desc.handle, 0);
|
|
|
|
CloseHandle(desc.handle);
|
2003-10-18 19:35:58 +00:00
|
|
|
#else
|
2004-03-21 00:10:15 +00:00
|
|
|
kill(desc.pid, SIGKILL);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// check a running benchmark thread/process.
|
|
|
|
//
|
|
|
|
void check_benchmark(BENCHMARK_DESC& desc) {
|
|
|
|
#ifdef _WIN32
|
|
|
|
DWORD exit_code = 0;
|
|
|
|
GetExitCodeThread(desc.handle, &exit_code);
|
|
|
|
if (exit_code != STILL_ACTIVE) {
|
|
|
|
CloseHandle(desc.handle);
|
|
|
|
desc.done = true;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
int retval;
|
|
|
|
int exit_code = 0;
|
|
|
|
retval = waitpid(desc.pid, &exit_code, WNOHANG);
|
|
|
|
if (retval) {
|
|
|
|
desc.done = true;
|
|
|
|
FILE* f = fopen(desc.filename, "r");
|
|
|
|
if (!f) {
|
|
|
|
desc.error = true;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
retval = desc.host_info.parse_cpu_benchmarks(f);
|
|
|
|
fclose(f);
|
|
|
|
boinc_delete_file(desc.filename);
|
|
|
|
if (retval) {
|
|
|
|
desc.error = true;
|
2003-10-18 19:35:58 +00:00
|
|
|
}
|
2004-03-21 00:10:15 +00:00
|
|
|
}
|
2003-10-18 19:35:58 +00:00
|
|
|
#endif
|
2004-03-21 00:10:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CLIENT_STATE::abort_cpu_benchmarks() {
|
|
|
|
int i;
|
|
|
|
if (!benchmarks_running) return;
|
|
|
|
for (i=0; i<host_info.p_ncpus; i++) {
|
|
|
|
abort_benchmark(benchmark_descs[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// benchmark poll routine. Called every second
|
|
|
|
//
|
|
|
|
bool CLIENT_STATE::cpu_benchmarks_poll() {
|
|
|
|
int i;
|
|
|
|
if (!benchmarks_running) return false;
|
|
|
|
|
2004-05-21 22:40:54 +00:00
|
|
|
double now = dtime();
|
|
|
|
|
2004-07-21 02:47:07 +00:00
|
|
|
// Send heartbeat to all active tasks so they know we are alive
|
|
|
|
// and well.
|
2004-08-10 20:27:51 +00:00
|
|
|
active_tasks.send_heartbeats();
|
2004-07-21 02:47:07 +00:00
|
|
|
|
2004-05-21 22:40:54 +00:00
|
|
|
// do transitions through benchmark states
|
|
|
|
//
|
|
|
|
switch (bm_state) {
|
2004-05-22 01:36:36 +00:00
|
|
|
case BM_FP_INIT:
|
2004-05-21 22:40:54 +00:00
|
|
|
if (now - cpu_benchmarks_start > FP_START) {
|
|
|
|
make_benchmark_file(BM_TYPE_FP);
|
|
|
|
bm_state = BM_FP;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
case BM_FP:
|
|
|
|
if (now - cpu_benchmarks_start > FP_END) {
|
|
|
|
remove_benchmark_file(BM_TYPE_FP);
|
2004-05-22 01:36:36 +00:00
|
|
|
bm_state = BM_INT_INIT;
|
2004-05-21 22:40:54 +00:00
|
|
|
}
|
|
|
|
return false;
|
2004-05-22 01:36:36 +00:00
|
|
|
case BM_INT_INIT:
|
2004-05-21 22:40:54 +00:00
|
|
|
if (now - cpu_benchmarks_start > INT_START) {
|
|
|
|
make_benchmark_file(BM_TYPE_INT);
|
|
|
|
bm_state = BM_INT;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
case BM_INT:
|
|
|
|
if (now - cpu_benchmarks_start > INT_END) {
|
|
|
|
remove_benchmark_file(BM_TYPE_INT);
|
2004-05-22 01:36:36 +00:00
|
|
|
bm_state = BM_SLEEP;
|
2004-05-21 22:40:54 +00:00
|
|
|
}
|
|
|
|
return false;
|
2004-05-22 01:36:36 +00:00
|
|
|
case BM_SLEEP:
|
|
|
|
boinc_sleep(2.0);
|
|
|
|
bm_state = BM_DONE;
|
|
|
|
return false;
|
2004-05-21 22:40:54 +00:00
|
|
|
}
|
|
|
|
|
2004-03-21 00:10:15 +00:00
|
|
|
// check for timeout
|
|
|
|
//
|
2004-05-21 22:40:54 +00:00
|
|
|
if (now > cpu_benchmarks_start + MAX_CPU_BENCHMARKS_SECONDS) {
|
2004-03-21 00:10:15 +00:00
|
|
|
msg_printf(NULL, MSG_ERROR, "CPU benchmarks timed out, using default values");
|
|
|
|
abort_cpu_benchmarks();
|
|
|
|
host_info.p_fpops = DEFAULT_FPOPS;
|
|
|
|
host_info.p_iops = DEFAULT_IOPS;
|
|
|
|
host_info.p_membw = DEFAULT_MEMBW;
|
|
|
|
host_info.m_cache = DEFAULT_CACHE;
|
|
|
|
guiOnBenchmarksEnd();
|
|
|
|
benchmarks_running = false;
|
|
|
|
set_client_state_dirty("CPU benchmarks");
|
|
|
|
}
|
|
|
|
int ndone = 0;
|
|
|
|
bool had_error = false;
|
|
|
|
for (i=0; i<host_info.p_ncpus; i++) {
|
|
|
|
if (!benchmark_descs[i].done) {
|
|
|
|
check_benchmark(benchmark_descs[i]);
|
|
|
|
}
|
|
|
|
if (benchmark_descs[i].done) {
|
|
|
|
ndone ++;
|
|
|
|
if (benchmark_descs[i].error) had_error = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ndone == host_info.p_ncpus) {
|
|
|
|
if (had_error) {
|
|
|
|
msg_printf(NULL, MSG_ERROR, "CPU benchmarks error");
|
2003-11-02 22:51:49 +00:00
|
|
|
host_info.p_fpops = DEFAULT_FPOPS;
|
|
|
|
host_info.p_iops = DEFAULT_IOPS;
|
|
|
|
host_info.p_membw = DEFAULT_MEMBW;
|
|
|
|
host_info.m_cache = DEFAULT_CACHE;
|
2004-03-21 00:10:15 +00:00
|
|
|
} else {
|
|
|
|
host_info.p_fpops = 0;
|
|
|
|
host_info.p_iops = 0;
|
|
|
|
host_info.p_membw = 0;
|
|
|
|
host_info.m_cache = 0;
|
|
|
|
for (i=0; i<host_info.p_ncpus; i++) {
|
|
|
|
host_info.p_fpops += benchmark_descs[i].host_info.p_fpops;
|
|
|
|
host_info.p_iops += benchmark_descs[i].host_info.p_iops;
|
|
|
|
host_info.p_membw += benchmark_descs[i].host_info.p_membw;
|
|
|
|
host_info.m_cache += benchmark_descs[i].host_info.m_cache;
|
|
|
|
}
|
|
|
|
host_info.p_fpops /= host_info.p_ncpus;
|
|
|
|
host_info.p_iops /= host_info.p_ncpus;
|
|
|
|
host_info.p_membw /= host_info.p_ncpus;
|
|
|
|
host_info.m_cache /= host_info.p_ncpus;
|
2003-10-18 19:35:58 +00:00
|
|
|
}
|
2004-05-20 22:01:07 +00:00
|
|
|
msg_printf(NULL, MSG_INFO, "Benchmark results:");
|
|
|
|
msg_printf(NULL, MSG_INFO, " Number of CPUs: %d", host_info.p_ncpus);
|
2004-03-21 02:19:37 +00:00
|
|
|
msg_printf(
|
2004-05-20 22:01:07 +00:00
|
|
|
NULL, MSG_INFO, " %.0f double precision MIPS (Whetstone) per CPU",
|
|
|
|
host_info.p_fpops/1e6
|
2004-03-21 02:19:37 +00:00
|
|
|
);
|
|
|
|
msg_printf(
|
2004-05-20 22:01:07 +00:00
|
|
|
NULL, MSG_INFO, " %.0f integer MIPS (Dhrystone) per CPU",
|
|
|
|
host_info.p_iops/1e6
|
2004-03-21 02:19:37 +00:00
|
|
|
);
|
2004-05-19 19:49:46 +00:00
|
|
|
#if 0
|
2004-03-21 02:19:37 +00:00
|
|
|
msg_printf(
|
|
|
|
NULL, MSG_INFO, "Benchmark results: %.0f million bytes/sec memory bandwidth%s",
|
|
|
|
host_info.p_membw/1e6, (host_info.p_membw_err?" [ERROR]":"")
|
|
|
|
);
|
2004-05-19 19:49:46 +00:00
|
|
|
#endif
|
2004-03-21 02:19:37 +00:00
|
|
|
|
2004-05-21 22:40:54 +00:00
|
|
|
host_info.p_calculated = now;
|
2004-03-21 00:10:15 +00:00
|
|
|
guiOnBenchmarksEnd();
|
|
|
|
benchmarks_running = false;
|
2004-05-19 21:44:19 +00:00
|
|
|
msg_printf(NULL, MSG_INFO, "Finished CPU benchmarks");
|
2004-03-21 00:10:15 +00:00
|
|
|
set_client_state_dirty("CPU benchmarks");
|
2003-10-18 19:35:58 +00:00
|
|
|
}
|
2004-03-21 00:10:15 +00:00
|
|
|
return false;
|
2003-10-18 19:35:58 +00:00
|
|
|
}
|
|
|
|
|
2004-03-21 00:10:15 +00:00
|
|
|
// return true if any CPU benchmark thread/process is running
|
|
|
|
//
|
|
|
|
bool CLIENT_STATE::are_cpu_benchmarks_running() {
|
|
|
|
return benchmarks_running;
|
|
|
|
}
|
2004-12-08 00:40:19 +00:00
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
static volatile const char __attribute__((unused)) *BOINCrcsid="$Id$";
|
|
|
|
#else
|
|
|
|
static volatile const char *BOINCrcsid="$Id$";
|
|
|
|
#endif
|