diff --git a/api/boinc_api.C b/api/boinc_api.C index 7e7132ed6e..9d03a4cc45 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -179,7 +179,12 @@ static int setup_shared_mem() { // static int boinc_worker_thread_cpu_time(double& cpu) { #ifdef _WIN32 - if (boinc_thread_cpu_time(worker_thread_handle, cpu)) { + if (options.all_threads_cpu_time) { + retval = boinc_process_cpu_time(cpu); + } else { + retval = boinc_thread_cpu_time(worker_thread_handle, cpu); + } + if (retval) { cpu = nrunning_ticks * TIMER_PERIOD; // for Win9x } #else @@ -851,7 +856,7 @@ int boinc_time_to_checkpoint() { int boinc_checkpoint_completed() { double cur_cpu; - boinc_calling_thread_cpu_time(cur_cpu); + boinc_worker_thread_cpu_time(cur_cpu); last_wu_cpu_time = cur_cpu + aid.wu_cpu_time; last_checkpoint_cpu_time = last_wu_cpu_time; update_app_progress(last_checkpoint_cpu_time, last_checkpoint_cpu_time); diff --git a/api/boinc_api.h b/api/boinc_api.h index 7288e0e4a6..6f42ac1897 100755 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -49,6 +49,9 @@ typedef struct BOINC_OPTIONS { // if heartbeat fail, or get process control msg, take // direction action (exit, suspend, resume). // Otherwise just set flag in BOINC status + int all_threads_cpu_time; + // count the CPU time of all threads + // (for apps that have multiple worker threads) } BOINC_OPTIONS; typedef struct BOINC_STATUS { diff --git a/checkin_notes b/checkin_notes index 4ab2fee8e2..55e82ce2d7 100755 --- a/checkin_notes +++ b/checkin_notes @@ -4297,3 +4297,16 @@ Rom 28 Apr 2006 (by Frank S. Thomas) configure.ac clientgui/ BOINCGUIApp.cpp + +David 30 Apr 2006 + - API: add all_threads_cpu_time flag to BOINC_OPTIONS + for applications that have more than one CPU-intensive thread. + Measure the CPU time of whole process, not just worker thread. + - Less insistent messages when client has worng URL for project + + api/ + boinc_api.C,h + client/ + cs_scheduler.C + lib/ + util.C,h diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 4119e9529d..f54756d884 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -751,16 +751,22 @@ int CLIENT_STATE::handle_scheduler_reply( } p2 = gstate.lookup_project(sr.master_url); if (p2) { - msg_printf(project, MSG_ERROR, - "Duplicate attachment detected - detach all projects named %s", + msg_printf(project, MSG_INFO, + "You seem to be attached to this project twice" + ); + msg_printf(project, MSG_INFO, + "We suggest that you detach projects named %s,", project->project_name ); - msg_printf(project, MSG_ERROR, - "Then reattach to %s", sr.master_url + msg_printf(project, MSG_INFO, + "then reattach to %s", sr.master_url ); } else { - msg_printf(project, MSG_ERROR, - "Detach this project, then reattach to %s", + msg_printf(project, MSG_INFO, + "Using the wrong URL can cause problems in some cases." + ); + msg_printf(project, MSG_INFO, + "When convenient, detach this project, then reattach to %s", sr.master_url ); } diff --git a/doc/boinc_news.inc b/doc/boinc_news.inc index e1c8c89d75..153de54e8e 100644 --- a/doc/boinc_news.inc +++ b/doc/boinc_news.inc @@ -1,9 +1,16 @@ The latest German BOINCcast + discusses ClimatePrediction.net; + earlier BOINCcasts cover SIMAP, LHC@home, and uFluids. +
+ " +), array("April 14, 2006", "The CERN Courier's Computer Newsletter features an article on - BOINC activities at CERN. + BOINC activities at CERN. "), array("April 13, 2006", "According to various statistics sites, diff --git a/doc/compound_app.php b/doc/compound_app.php index f15508c36c..71e40695bb 100644 --- a/doc/compound_app.php +++ b/doc/compound_app.php @@ -71,6 +71,11 @@ list_item("direct_process_action", the BOINC_STATUS structure, which can be polled using boinc_get_status()." ); +list_item("all_threads_cpu_time", + "If set, the CPU of all threads (not just the worker thread) + will be counted. + For apps that do computation in more than one thread." +); list_end(); echo "

@@ -103,6 +108,7 @@ Typical worker program logic is: BOINC_OPTIONS options; options.main_program = false; +options.send_status_msgs = true; ... boinc_init_options(&options); ... diff --git a/doc/logo.php b/doc/logo.php index 4dd8046d90..a1136e7b47 100644 --- a/doc/logo.php +++ b/doc/logo.php @@ -13,6 +13,9 @@ Hi-res versions of the logo:

  • The BOINC logo uses the Planet Benson font from Larabie Fonts. +
  • +An icon for BOINC-related Podcasts, from Christian Beer: + We welcome alternative ideas. diff --git a/doc/work.php b/doc/work.php index e1477bbd32..ad384c7608 100644 --- a/doc/work.php +++ b/doc/work.php @@ -30,7 +30,14 @@ list_item( list_item( "input files", "A list of the input files: their names, - and the names by which the application refers to them." + and the names by which the application refers to them. + Typically these file are downloaded from a data server. + However, if the <generate_locally/> element is present, + the file is generated on the client + (typically by an earlier instance of the same application). + Applications should use file locking to prevent + two jobs from generating the file at the same time. + " ); list_item( "priority", diff --git a/lib/util.C b/lib/util.C index 9e69eae869..928ca41320 100755 --- a/lib/util.C +++ b/lib/util.C @@ -767,6 +767,29 @@ int boinc_thread_cpu_time(HANDLE thread_handle, double& cpu) { return 0; } +int boinc_process_cpu_time(double& cpu) { + FILETIME creationTime, exitTime, kernelTime, userTime; + + if (GetProcessTimes( + GetCurrentProcess(), &creationTime, &exitTime, &kernelTime, &userTime) + ) { + ULARGE_INTEGER tKernel, tUser; + LONGLONG totTime; + + tKernel.LowPart = kernelTime.dwLowDateTime; + tKernel.HighPart = kernelTime.dwHighDateTime; + tUser.LowPart = userTime.dwLowDateTime; + tUser.HighPart = userTime.dwHighDateTime; + totTime = tKernel.QuadPart + tUser.QuadPart; + + // Runtimes in 100-nanosecond units + cpu = totTime / 1.e7; + } else { + return -1; + } + return 0; +} + static void get_elapsed_time(double& cpu) { static bool first = true; static DWORD first_count = 0; diff --git a/lib/util.h b/lib/util.h index 07f2c70e68..397ab52cab 100755 --- a/lib/util.h +++ b/lib/util.h @@ -101,6 +101,7 @@ extern char* windows_format_error_string( unsigned long dwError, char* pszBuf, int iSize ); extern int boinc_thread_cpu_time(HANDLE thread_handle, double& cpu); +extern int boinc_process_cpu_time(double& cpu); #endif