From f17a80080774de4197dc1b46722c2ef5ee249108 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 22 Sep 2008 20:33:59 +0000 Subject: [PATCH] - API: in boinc_exit(), release the lockfile only if we're the main program (otherwise we didn't lock it in the first place, and a crash results). From Artyom Sharov. - scheduler: add support for the GCL simulator, which uses special versions of backend programs that use virtual time, and that wait for signals instead of sleep()ing. To compile: make clean configure CXXFLAGS="-DGCL_SIMULATOR" make svn path=/trunk/boinc/; revision=16038 --- api/boinc_api.C | 7 +++++-- checkin_notes | 31 +++++++++++++++++++++++++++++++ db/boinc_db.C | 7 ++++--- db/boinc_db.h | 2 +- doc/boinc_news.php | 5 +++++ doc/projects.inc | 24 ++++++++++++++++-------- lib/util.C | 8 ++++++++ lib/util.h | 6 ++++++ tools/backend_lib.C | 1 + 9 files changed, 77 insertions(+), 14 deletions(-) diff --git a/api/boinc_api.C b/api/boinc_api.C index 5eb4a3ce92..c14ee53cae 100644 --- a/api/boinc_api.C +++ b/api/boinc_api.C @@ -444,12 +444,15 @@ int boinc_finish(int status) { // Win: called from the worker or timer thread. // // make static eventually +// void boinc_exit(int status) { if (options.backwards_compatible_graphics) { graphics_cleanup(); } - file_lock.unlock(LOCKFILE); + if (options.main_program) { + file_lock.unlock(LOCKFILE); + } fflush(NULL); @@ -461,7 +464,7 @@ void boinc_exit(int status) { // BOINCINFO("Exit Status: %d", status); #if defined(_WIN32) - // Halts all the threads and then cleans up. + // Halt all the threads and cleans up. TerminateProcess(GetCurrentProcess(), status); #elif defined(__APPLE_CC__) // stops endless exit()/atexit() loops. diff --git a/checkin_notes b/checkin_notes index 96a7d7b1f1..f92ab8a7c6 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7638,3 +7638,34 @@ David 22 Sept 2008 update_profile_pages.php user/ language_select.php + +David 22 Sept 2008 + - API: in boinc_exit(), release the lockfile only if + we're the main program (otherwise we didn't lock it in + the first place, and a crash results). From Artyom Sharov. + - scheduler: add support for the GCL simulator, + which uses special versions of backend programs + that use virtual time, + and that wait for signals instead of sleep()ing. + + To compile: + make clean + configure CXXFLAGS="-DGCL_SIMULATOR" + make + + api/ + boinc_api.C + db/ + boinc_db.C,h + lib/ + util.C,h + sched/ + feeder.C + hr_info.C + pymw_assimilator.C + sched_util.C,h + transitioner.C + trickle_handler.C + validator.C + tools/ + backend_lib.C diff --git a/db/boinc_db.C b/db/boinc_db.C index 32f42f1549..9da647be86 100644 --- a/db/boinc_db.C +++ b/db/boinc_db.C @@ -29,6 +29,7 @@ #endif #include "str_util.h" +#include "util.h" #include "error_numbers.h" #include "boinc_db.h" @@ -921,7 +922,7 @@ void DB_CREDIT_MULTIPLIER::db_print(char* buf) { "time=%d, " "multiplier=%f ", appid, - time, + _time, multiplier ); } @@ -931,7 +932,7 @@ void DB_CREDIT_MULTIPLIER::db_parse(MYSQL_ROW& r) { clear(); id = atoi(r[i++]); appid = atoi(r[i++]); - time = atoi(r[i++]); + _time = atoi(r[i++]); multiplier = atof(r[i++]); } @@ -943,7 +944,7 @@ void DB_CREDIT_MULTIPLIER::get_nearest(int _appid, int t) { // set default values. clear(); multiplier = 1; - time = ::time(NULL); + _time = time(0); appid = _appid; snprintf(query,MAX_QUERY_LEN, diff --git a/db/boinc_db.h b/db/boinc_db.h index 33092be2a3..444cbb737a 100644 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -566,7 +566,7 @@ struct TRANSITIONER_ITEM { struct CREDIT_MULTIPLIER { int id; int appid; - int time; + int _time; double multiplier; void clear(); diff --git a/doc/boinc_news.php b/doc/boinc_news.php index 7be6499cc7..a6541358df 100644 --- a/doc/boinc_news.php +++ b/doc/boinc_news.php @@ -1,6 +1,11 @@ Docking@Home, + a project at the University of Delaware that studies + protein-ligand interactions (and BOINC itself)." +), array("September 15, 2008", "OGM (Organizational Grid Manager) has been released by the University of Extremadura. diff --git a/doc/projects.inc b/doc/projects.inc index 8d27193eda..1122f49603 100644 --- a/doc/projects.inc +++ b/doc/projects.inc @@ -3,6 +3,14 @@ $biomed = array( "Biology and Medicine", array( + array( + "Docking@Home", + "http://docking.cis.udel.edu/", + "University of Delaware", + "Study of protein - ligand interactions", + "Docking@Home has both bioscience and computer science goals. The project aims to further knowledge of the atomic details of protein-ligand interactions and, by doing so, will search for insights into the discovery of novel pharmaceuticals.", + "docking.png" + ), array( "GPU Grid - PS3 Grid", "http://www.ps3grid.net/", @@ -194,14 +202,14 @@ $math = array( "Find all the generalized binary number systems (in which bases are matrices and digits are vectors) up to dimension 11.", "szdg1_small.jpg" ), - array( - "Riesel Sieve", - "http://boinc.rieselsieve.com/", - "Riesel Sieve community", - "Mathematics", - "Find prime numbers of the form k*2n-1", - "" - ), +// array( +// "Riesel Sieve", +// "http://boinc.rieselsieve.com/", +// "Riesel Sieve community", +// "Mathematics", +// "Find prime numbers of the form k*2n-1", +// "" +// ), array( "Rectilinear Crossing Number", "http://dist.ist.tugraz.at/cape5/", diff --git a/lib/util.C b/lib/util.C index a34f97c33a..09eb4a7ef6 100644 --- a/lib/util.C +++ b/lib/util.C @@ -62,9 +62,16 @@ using std::vector; #define EPOCHFILETIME_SEC (11644473600.) #define TEN_MILLION 10000000. +#ifdef GCL_SIMULATOR +double simtime; +#endif + // return time of day (seconds since 1970) as a double // double dtime() { +#ifdef GCL_SIMULATOR + return simtime; +#else #ifdef _WIN32 LARGE_INTEGER time; FILETIME sysTime; @@ -81,6 +88,7 @@ double dtime() { gettimeofday(&tv, 0); return tv.tv_sec + (tv.tv_usec/1.e6); #endif +#endif } // return time today 0:00 in seconds since 1970 as a double diff --git a/lib/util.h b/lib/util.h index 83c1e32b3c..2b52c4a1dd 100644 --- a/lib/util.h +++ b/lib/util.h @@ -93,4 +93,10 @@ extern bool process_exists(int); #endif extern int wait_client_mutex(const char* dir, double timeout); + +#ifdef GCL_SIMULATOR +extern double simtime; +#define time(x) ((int)simtime) +#endif + #endif diff --git a/tools/backend_lib.C b/tools/backend_lib.C index 512d87dddc..e7652a8d16 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -35,6 +35,7 @@ #include "common_defs.h" #include "filesys.h" #include "sched_util.h" +#include "util.h" #include "backend_lib.h"