From d9465a813846a681266b8ccd010e1e14e87208a3 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 28 Oct 2006 18:25:35 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=11387 --- checkin_notes | 9 ++++++ doc/backend_util.php | 41 +++------------------------ doc/beta.php | 55 +++++++++++++++++++++++++++++++++++++ doc/contact.php | 1 + doc/create_project.php | 1 + doc/download_all.php | 2 +- doc/hier_dir.php | 4 +-- doc/multiple_projects.php | 18 ++++-------- doc/project_options.php | 5 ++-- lib/common_defs.h | 2 +- sched/validate_util.C | 58 ++++++++++++++++++++++++++++++++++++++- sched/validate_util.h | 1 + 12 files changed, 140 insertions(+), 57 deletions(-) create mode 100644 doc/beta.php diff --git a/checkin_notes b/checkin_notes index d07c8e0f87..3a02751d67 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11688,3 +11688,12 @@ Charlie 28 Oct 2006 mac_installer/ PostInstall.cpp release_GridRepublic.sh + +David 28 Oct 2006 + - back end: add function get_output_file_paths() + for getting the paths of multiple output files. + + lib/ + common_defs.h + sched/ + validate_util.C,h diff --git a/doc/backend_util.php b/doc/backend_util.php index 8487137c29..3fe5c10aad 100644 --- a/doc/backend_util.php +++ b/doc/backend_util.php @@ -12,10 +12,11 @@ Returns the path of a result's output file (parses result.xml_doc_out and computes the file's position in the hierarchical directory structure). +".html_text(" +int get_output_file_paths(RESULT const&, vector&); +"),"

-Note: this function doesn't handle multiple output files -(if there are multiple files, it returns the path of the first one). -If your application has multiple output files, see below. +Same, for multiple output files.


".html_text(" int try_fopen(char* path, FILE*& f, char* mode); @@ -37,40 +38,6 @@ Given a vector of N correct results, computes a canonical credit as follows:
  • if N>2, toss out high and low claimed credit, and return the average of the rest. -
    -

    Multiple output files

    -If your application has multiple output files -you'll need to generalize get_output_file_path(). -To do this you'll need to know the following: - -

    -The database field 'result.xml_doc_out' -describes a result's output files. -It has the form -".html_text(" -... -[ ... ] - - foobar - blah - blah - ... - [ ... ] - -")," -The components are: -

      -
    • The <name> element is the result name. -
    • The <wu_name> element is the workunit name. -
    • Each <file_ref> element is an association to an output file, -described by a corresponding <file_info> element. -
    -

    -The XML document describing the sizes and checksums of the output -files is a list of <file_info> elements, -with the nbytes and md5_cksum fields present. -The project back end -must parse this field to find the locations and checksums of output files. "; page_tail(); ?> diff --git a/doc/beta.php b/doc/beta.php new file mode 100644 index 0000000000..68fb2dc1f4 --- /dev/null +++ b/doc/beta.php @@ -0,0 +1,55 @@ + +One way to implement this is to create a separate test project. +This has two disadvantages: +

      +
    • There is overhead in creating and maintaining a separate project. +
    • The credit accrued by testers goes to a different project. +
    +BOINC provides a way to do beta testing in the context +of your existing project. +You can let users volunteer to run test applications, +warning them in advance that these applications are more likely to crash. +These users will get a mixture of regular and test results, +and they'll get credit for both. +Here's how to do it: +
      +
    • Upgrade to the BOINC server software of Oct 25 2006 or later. +
    • Create a new application +using xadd. +Include <beta>1</beta> in the <app> element to +designate it as a beta-test application. +
    • Add a validator and assimilator for the test application. +
    • Include the line +
      +\$project_has_beta = true;
      +
      +in your html/project/project_specific_prefs.inc file. +This will add a 'Run test applications?' option to your +project-specific preferences. +
    • Publicize this on your web site and wait for +some users to set their preferences to allow test apps. +(Note: this flag is stored in XML in the project_prefs +field of the user table; scan for +<allow_beta_work>1</allow_beta_work>). +
    • Create application versions for the test application. +
    • Create work (as needed for testing) for the test application. +To prevent test work from dominating regular work, +either use the -allapps feeder option +(and give the test app a small weight) +or make a work generator for the test app that maintains +only a small number of unsent results. + +
    + +"; +page_tail(); +?> diff --git a/doc/contact.php b/doc/contact.php index 2abd12ec95..b465969139 100644 --- a/doc/contact.php +++ b/doc/contact.php @@ -116,6 +116,7 @@ show_name("David Anderson"); show_name("Noaa Avital"); show_name("Don Bashford"); show_name("Lars Bausch"); +show_name("Christian Beer"); show_name("Frederic Bor"); show_name("Brian Boshes"); show_name("Jens Breitbart"); diff --git a/doc/create_project.php b/doc/create_project.php index fe718b6830..07aa0b3d0c 100644 --- a/doc/create_project.php +++ b/doc/create_project.php @@ -91,6 +91,7 @@ Creating a BOINC project
  • Upgrading a project's server software
  • Multiple server hosts +
  • Beta-test applications diff --git a/doc/download_all.php b/doc/download_all.php index 4df576c8b4..67a8b1e901 100755 --- a/doc/download_all.php +++ b/doc/download_all.php @@ -14,7 +14,7 @@ require_once("docutil.php"); $xml = $_GET["xml"]; $dev = $_GET["dev"]; -$dev=1; +if (!$xml) $dev=1; $pname = $_GET["platform"]; $min_version = $_GET["min_version"]; $max_version = $_GET["max_version"]; diff --git a/doc/hier_dir.php b/doc/hier_dir.php index de0347bbcf..748c380075 100644 --- a/doc/hier_dir.php +++ b/doc/hier_dir.php @@ -57,10 +57,10 @@ to accomodate a particular file. Secondly, your validator and assimilator should call ".html_text(" int get_output_file_path(RESULT const& result, string& path); +or +int get_output_file_paths(RESULT const& result, vector& ); ")." to get the paths of output files in the hierarchy. -If your application has multiple output files, -you'll need to generalize this function.

    A couple of utility programs are available: diff --git a/doc/multiple_projects.php b/doc/multiple_projects.php index 375cf21373..adec082ef1 100644 --- a/doc/multiple_projects.php +++ b/doc/multiple_projects.php @@ -4,24 +4,16 @@ page_head("Participating in multiple projects"); echo "

    -You can join a second and subsequent projects as follows. -

      -
    1. Visit the second project's web site and create an account. +You can join a second and subsequent projects as follows: +Run the BOINC client, and select the Attach to Project command. +Enter the project's URL and your email address and password. You don't have to use the same email address, but if you do so the accounts will be 'coupled' in terms of preferences and statistics. -
    2. Receive an email containing an account key. -
    3. Paste the account key into the project's web site -to complete the account creation. -
    4. Run the BOINC client, and select the Attach to Project command. -Enter the project's URL and your account key. - -

    General preferences

    -Each BOINC project has its own database and servers. -Each account has its own copy of your +Each BOINC project has its own copy of your general preferences. When you edit your general preferences on a particular project, initially it changes only that one account. @@ -36,7 +28,7 @@ and have at least one computer attached to both accounts). This propagation is 'piggybacked' onto the -scheduler requests between your computers and project servers. +regular communication between your computers and project servers. You can accelerate the propagation by using the Update command in the BOINC Manager. diff --git a/doc/project_options.php b/doc/project_options.php index 15920c9084..33cb9f1697 100644 --- a/doc/project_options.php +++ b/doc/project_options.php @@ -351,8 +351,9 @@ list_item("reliable_time
    reliable_min_avg_credit

    This mechanism is used when the age of a workunit exceeds reliable_time (typically 2-3X the delay bound). - The results are sent to hosts with at least - reliable_min_avg_credit and at most + The results are sent to hosts for which + expavg_credit/ncpus is at least reliable_min_avg_credit + and whose average turnaround is at most reliable_max_avg_turnaround. The delay bound is multiplied by reliable_reduced_delay_bound (typically 0.5 or so). diff --git a/lib/common_defs.h b/lib/common_defs.h index 99c3110f43..10a2e7b500 100644 --- a/lib/common_defs.h +++ b/lib/common_defs.h @@ -92,7 +92,7 @@ enum SUSPEND_REASON { SUSPEND_REASON_TIME_OF_DAY = 8, SUSPEND_REASON_BENCHMARKS = 16, SUSPEND_REASON_DISK_SIZE = 32, - SUSPEND_REASON_CPU_USAGE_LIMIT = 64, + SUSPEND_REASON_CPU_USAGE_LIMIT = 64 }; // States of a result on a client. diff --git a/sched/validate_util.C b/sched/validate_util.C index 9171dc18a4..593cc7b7fb 100644 --- a/sched/validate_util.C +++ b/sched/validate_util.C @@ -38,10 +38,11 @@ using std::vector; using std::string; +#if 0 // get the name of a result's (first) output file // int get_output_file_path(RESULT const& result, string& path_str) { - char buf[256], path[256]; + char buf[256], path[1024]; if (!parse_str(result.xml_doc_out, "", buf, sizeof(buf))) { return ERR_XML_PARSE; @@ -50,7 +51,62 @@ int get_output_file_path(RESULT const& result, string& path_str) { path_str = path; return 0; } +#endif +static int parse_filename(XML_PARSER& xp, string& name) { + char tag[256]; + bool is_tag, found=false; + while (!xp.get(tag, sizeof(tag), is_tag)) { + if (!is_tag) continue; + if (!strcmp(tag, "/file")) { + return found?0:ERR_XML_PARSE; + } + if (xp.parse_string(tag, "name", name)) { + found = true; + } + } + return ERR_XML_PARSE; +} + +int get_output_file_path(RESULT const& result, string& path_str) { + char tag[256], path[1024]; + bool is_tag; + string name; + MIOFILE mf; + mf.init_buf((char*)(result.xml_doc_out)); + XML_PARSER xp(&mf); + while (!xp.get(tag, sizeof(tag), is_tag)) { + if (!is_tag) continue; + if (!strcmp(tag, "file")) { + int retval = parse_filename(xp, name); + if (retval) return retval; + dir_hier_path(name.c_str(), config.upload_dir, config.uldl_dir_fanout, path); + path_str = path; + return 0; + } + } + return ERR_XML_PARSE; +} + +int get_output_file_paths(RESULT const& result, vector& paths) { + char tag[256], path[1024]; + bool is_tag; + MIOFILE mf; + string name; + mf.init_buf((char*)(result.xml_doc_out)); + XML_PARSER xp(&mf); + paths.clear(); + while (!xp.get(tag, sizeof(tag), is_tag)) { + if (!is_tag) continue; + if (!strcmp(tag, "file")) { + int retval = parse_filename(xp, name); + if (retval) return retval; + dir_hier_path(name.c_str(), config.upload_dir, config.uldl_dir_fanout, path); + paths.push_back(path); + } + } + return 0; +} #define CREDIT_EPSILON .001 diff --git a/sched/validate_util.h b/sched/validate_util.h index 15540569d8..14f5cefc9e 100644 --- a/sched/validate_util.h +++ b/sched/validate_util.h @@ -26,6 +26,7 @@ #include "boinc_db.h" extern int get_output_file_path(RESULT const& result, std::string& path); +extern int get_output_file_paths(RESULT const& result, std::vector&); extern double median_mean_credit(std::vector& results); #endif