diff --git a/checkin_notes b/checkin_notes index 3ce505bcfd..070181ad0b 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6494,12 +6494,31 @@ David 20 June 2007 updater.C Janus 21 June 2007 - - Added the scraping mechanism for Bittorrent support (not all Bittorrent clients - actually support this, but those that do get an increased performance boost and - don't have to contact the more expensive announce.php nearly as often as those - that do not support it. Since it hasn't yet been decided which BT library we - will be using I just added scraping anyways. + - Added the scraping mechanism for Bittorrent support + (not all Bittorrent clients actually support this, + but those that do get an increased performance boost and + don't have to contact the more expensive announce.php + nearly as often as those that do not support it. + Since it hasn't yet been decided which BT library we + will be using I just added scraping anyways. html/bt/ scrape.php (new) +David 21 June 2007 + - user web: fixed bug in private-message code + - back end: moved HR_INFO to a separate file; + did some debugging in HR code + + html/ + inc/ + forum_user.inc + util.inc + user/ + forum_pm.php + sched/ + Makefile.am + census.C + feeder.C + hr.C,h + hr_info.C,h (new) diff --git a/doc/help_vol.php b/doc/help_vol.php index 04d5bd5e84..02170b456e 100644 --- a/doc/help_vol.php +++ b/doc/help_vol.php @@ -118,7 +118,7 @@ if ($send_email) { $volid = $_GET['volid']; $subject = stripslashes($_GET['subject']); $vol = vol_lookup($volid); - if (!$vol) { + if (!$vol || $vol->hide) { error_page("No such volunteer $volid"); } $msg = stripslashes($_GET['message']); diff --git a/doc/index.php b/doc/index.php index dab452e24d..36aee1a272 100644 --- a/doc/index.php +++ b/doc/index.php @@ -141,6 +141,10 @@ function show_nsf() { } html_tag(); +if (defined("CHARSET")) { + header("Content-type: text/html; charset=".tr(CHARSET)); +} + echo "
diff --git a/html/inc/forum_user.inc b/html/inc/forum_user.inc index 94bd336b1b..5690f49dd4 100644 --- a/html/inc/forum_user.inc +++ b/html/inc/forum_user.inc @@ -34,8 +34,13 @@ class User { } else { $this->dbObj = $this->dbhandler->getUser($id); } - if ($optional_prefobj) {$this->fprefObj = $optional_prefobj; $this->prefs_loaded=true;}; - if (!$this->dbObj) error_page("User with id $id created but nothing returned from DB layer"); + if ($optional_prefobj) { + $this->fprefObj = $optional_prefobj; + $this->prefs_loaded=true; + }; + if (!$this->dbObj) { + error_page("User with id $id created but nothing returned from DB layer"); + } } /** diff --git a/html/inc/util.inc b/html/inc/util.inc index da7e867925..7ccc8fe4ef 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -101,11 +101,11 @@ function show_login($user) { } } -/** - * Page_head() is overridable so that projects that want to integrate BOINC with an existing web framework - * can more easily do so. To take advantage of this simply define the function page_head() somewhere - * in the project include file. - */ +// Page_head() is overridable so that projects that want to integrate BOINC +// with an existing web framework can more easily do so. +// To take advantage of this simply define the function page_head() +// somewhere in the project include file. +// if (!function_exists("page_head")){ function page_head($title, $java_onload=null, $title_plain=null, $prefix="") { $styleSheet = URL_BASE . STYLESHEET; diff --git a/html/user/forum_pm.php b/html/user/forum_pm.php index 387b308bda..e4ccce76fd 100644 --- a/html/user/forum_pm.php +++ b/html/user/forum_pm.php @@ -73,7 +73,7 @@ if ($action == "inbox") { } } elseif ($action == "new") { - check_banished(new User($logged_in_user)); + check_banished(new User($logged_in_user->id)); pm_create_new(); } elseif ($action == "delete") { $id = get_int("id", true); @@ -106,7 +106,7 @@ if ($action == "inbox") { } } } elseif ($action == "send") { - check_banished(new User($logged_in_user)); + check_banished(new User($logged_in_user->id)); check_tokens($logged_in_user->authenticator); $to = stripslashes(post_str("to", true)); diff --git a/sched/Makefile.am b/sched/Makefile.am index b0452e5103..31b3f7e75f 100644 --- a/sched/Makefile.am +++ b/sched/Makefile.am @@ -66,6 +66,7 @@ cgi_SOURCES = \ edf_sim.C \ handle_request.C \ hr.C \ + hr_info.C \ main.C \ sched_array.C \ sched_hr.C \ @@ -78,7 +79,8 @@ cgi_SOURCES = \ census_SOURCES = \ census.C \ - hr.C + hr.C \ + hr_info.C ## install header-files with prefix-subdir BOINC/ to avoid name-conflicts includedir = ${prefix}/include/BOINC/ @@ -96,6 +98,8 @@ cgi_DEPENDENCIES = $(LIB_SCHED) feeder_SOURCES = \ feeder.C \ + hr.C \ + hr_info.C \ ../lib/synch.C feeder_DEPENDENCIES = $(LIB_SCHED) @@ -167,6 +171,8 @@ delete_file_LDADD = $(LDADD) $(RSA_LIBS) fcgi_SOURCES = \ handle_request.C \ + hr.C \ + hr_info.C \ main.C \ sched_send.C \ sched_resend.C \ diff --git a/sched/census.C b/sched/census.C index 5a07674a7b..983ee4045a 100644 --- a/sched/census.C +++ b/sched/census.C @@ -29,7 +29,7 @@ #include "sched_config.h" #include "sched_util.h" #include "sched_msgs.h" -#include "hr.h" +#include "hr_info.h" int main() { HR_INFO hri; @@ -52,6 +52,7 @@ int main() { exit(1); } boinc_db.set_isolation_level(READ_UNCOMMITTED); + hri.init(); hri.scan_db(); - hri.write_file("foobar"); + hri.write_file(); } diff --git a/sched/feeder.C b/sched/feeder.C index 1dd695baff..852e1ffa84 100644 --- a/sched/feeder.C +++ b/sched/feeder.C @@ -17,9 +17,10 @@ // or write to the Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// ------------------------------- +// Feeder: create a shared memory segment containing DB info, +// including an array of work items (results/workunits to send). // -// feeder +// Usage: feeder [ options ] // [ -d x ] debug level x // [ -random_order ] order by "random" field of result // [ -priority_order ] order by decreasing "priority" field of result @@ -32,9 +33,6 @@ // that have been there for longer then x minutes // but haven't been assigned // -// Creates a shared memory segment containing DB info, -// including an array of work items (results/workunits to send). -// // The feeder tries to keep the work array filled. // It maintains a DB enumerator (DB_WORK_ITEM). // scan_work_array() scans the work array. @@ -62,6 +60,20 @@ // app_count[] is the number of slots per app // (approximately proportional to its weight) +// Homogeneous redundancy (HR): +// If HR is used, jobs can either be "uncommitted" +// (can send to any HR class) +// or "committed" (can send only to one HR class). +// The feeder tries to maintain a ratio of committed to uncommitted +// (generally 50/50) and, of committed jobs, ratios between HR classes +// (proportional to the total RAC of hosts in that class). +// This is to maximize the likelihood of having work for an average host. +// +// If you use different HR types between apps, you must use -allapps. +// Otherwise we wouldn't know how many slots to reserve for each HR type. +// +// It's OK to use HR for some apps and not others. + // Trigger files: // The feeder program periodically checks for two trigger files: // @@ -98,6 +110,7 @@ using std::vector; #include "sched_shmem.h" #include "sched_util.h" #include "sched_msgs.h" +#include "hr_info.h" #define DEFAULT_SLEEP_INTERVAL 5 @@ -125,6 +138,9 @@ int *app_indices; int napps; // if -allapps, the number of apps // otherwise one +HR_INFO hr_info; +bool using_hr; + // true iff any app is using HR void cleanup_shmem() { ssp->ready = false; @@ -153,6 +169,38 @@ int check_reread_trigger() { return 0; } +// Count the # of slots used by HR classes. +// This is done at the start of each array scan, +// and doesn't reflect slots that have been emptied out by the scheduler +// +void hr_count_slots() { + int i, j; + + for (i=1; i