diff --git a/checkin_notes b/checkin_notes index 242fb40631..e793c99153 100755 --- a/checkin_notes +++ b/checkin_notes @@ -25206,3 +25206,13 @@ David 22 Feb 2005 forum_post.php forum_reply.php sample_index.php + +David 22 Feb 2005 + - core client: scheduling: cap project debt at 1 day + + client/ + cs_apps.C + http.C + scheduler_op.C + sched/ + sched_send.C diff --git a/client/cs_apps.C b/client/cs_apps.C index c3af149994..e2b3ba6845 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -44,6 +44,8 @@ using std::vector; +#define MAX_DEBT (86400) + // maximum project debt // Quit running applications, quit benchmarks, // write the client_state.xml file @@ -462,6 +464,9 @@ bool CLIENT_STATE::schedule_cpus(double now) { if (p->non_cpu_intensive) continue; if (p->next_runnable_result) { p->debt -= min_debt; + if (p->debt > MAX_DEBT) { + p->debt = MAX_DEBT; + } p->anticipated_debt = p->debt; //msg_printf(p, MSG_INFO, "debt %f", p->debt); p->next_runnable_result = NULL; diff --git a/client/http.C b/client/http.C index b64b4818cf..0d3fb0be83 100644 --- a/client/http.C +++ b/client/http.C @@ -56,17 +56,24 @@ using std::istringstream; using std::vector; using std::getline; -// Breaks a HTTP url down into its server and file path components +// Breaks a HTTP URL down into its server, port and file components +// format of url: +// [http://]host.dom.dom[:port][/dir/file] // void parse_url(const char* url, char* host, int &port, char* file) { char* p; char buf[256]; + // strip off http:// if present + // if (strncmp(url, "http://", 7) == 0) { safe_strcpy(buf, url+7); } else { safe_strcpy(buf, url); } + + // parse and strip off file part if present + // p = strchr(buf, '/'); if (p) { strcpy(file, p+1); @@ -74,13 +81,19 @@ void parse_url(const char* url, char* host, int &port, char* file) { } else { strcpy(file, ""); } - p=strchr(buf,':'); + + // parse and strip off port if present + // + p = strchr(buf,':'); if (p) { port = atol(p+1); *p = 0; } else { port=80; } + + // what remains is the host + // strcpy(host, buf); } diff --git a/client/scheduler_op.C b/client/scheduler_op.C index 6e69a675a4..94e2c40f6d 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -660,7 +660,10 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { &code_sign_key ); if (retval) { - msg_printf(project, MSG_ERROR, "SCHEDULER_REPLY.parse(): xml parsing error\n"); + msg_printf(project, MSG_ERROR, + "Can't parse code sign key in scheduler reply: %d", + retval + ); return ERR_XML_PARSE; } } else if (match_tag(buf, "")) { @@ -674,7 +677,9 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { APP app; retval = app.parse(mf); if (retval) { - msg_printf(project, MSG_ERROR, "Can't parse app in scheduler reply"); + msg_printf(project, MSG_ERROR, + "Can't parse app in scheduler reply: %d", retval + ); } else { apps.push_back(app); } @@ -682,7 +687,9 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { FILE_INFO file_info; retval = file_info.parse(mf, true); if (retval) { - msg_printf(project, MSG_ERROR, "Can't parse file info in scheduler reply"); + msg_printf(project, MSG_ERROR, + "Can't parse file info in scheduler reply: %d", retval + ); } else { file_infos.push_back(file_info); } @@ -690,7 +697,9 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { APP_VERSION av; retval = av.parse(mf); if (retval) { - msg_printf(project, MSG_ERROR, "Can't parse app version in scheduler reply"); + msg_printf(project, MSG_ERROR, + "Can't parse app version in scheduler reply: %d", retval + ); } else { app_versions.push_back(av); } @@ -698,7 +707,9 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { WORKUNIT wu; retval = wu.parse(mf); if (retval) { - msg_printf(project, MSG_ERROR, "Can't parse work unit in scheduler reply"); + msg_printf(project, MSG_ERROR, + "Can't parse work unit in scheduler reply: %d", retval + ); } else { workunits.push_back(wu); } @@ -707,7 +718,9 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { // gets called each time retval = result.parse_server(mf); if (retval) { - msg_printf(project, MSG_ERROR, "Can't parse result in scheduler reply"); + msg_printf(project, MSG_ERROR, + "Can't parse result in scheduler reply: %d", retval + ); } else { results.push_back(result); } @@ -715,7 +728,9 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { RESULT result; retval = result.parse_ack(in); if (retval) { - msg_printf(project, MSG_ERROR, "Can't parse result ack in scheduler reply"); + msg_printf(project, MSG_ERROR, + "Can't parse result ack in scheduler reply: %d", retval + ); } else { result_acks.push_back(result); } @@ -739,7 +754,9 @@ int SCHEDULER_REPLY::parse(FILE* in, PROJECT* project) { } else if (match_tag(buf, "")) { retval = gstate.handle_trickle_down(project, in); if (retval) { - msg_printf(project, MSG_ERROR, "handle_trickle_down failed: %d\n", retval); + msg_printf(project, MSG_ERROR, + "handle_trickle_down failed: %d\n", retval + ); } continue; } else if (match_tag(buf, "")) { diff --git a/doc/community.php b/doc/community.php index 6aee26f37d..0b918e33f0 100644 --- a/doc/community.php +++ b/doc/community.php @@ -59,6 +59,13 @@ echo "
  • Compile BOINC software +

    Translating

    +If you speak a non-English language, you can help by + +

    News feeds

    RSS-based news feeds are available from BOINC diff --git a/doc/create_project.php b/doc/create_project.php index 207926c627..d4b473301d 100644 --- a/doc/create_project.php +++ b/doc/create_project.php @@ -19,7 +19,7 @@ BOINC's abstractions of data and computation.

  • Workunits
  • Results
  • Redundancy and errors -
  • Homogeneous redundancy +
  • Numerical discrepancies
  • Work distribution
  • Locality scheduling
  • Trickle messages @@ -129,6 +129,7 @@ Communicating with participants via the web Miscellaneous diff --git a/doc/fortran_numerics.txt b/doc/fortran_numerics.txt new file mode 100644 index 0000000000..71f0d566f7 --- /dev/null +++ b/doc/fortran_numerics.txt @@ -0,0 +1,76 @@ +[ Notes from Eric McIntosh at CERN on how to + eliminate numerical discrepancies between platforms. ] + +First I found a problem with data input on Windows using +an "old" Compaq Visual Fortran compiler. Approximately +1000 out of 16 million magnet errors were one bit too big +on the Windows system. This problem is apparently fixed with +"more modern" compilers, and my colleague Flrent Denichin +from Lyon says we could also have specified a larger number of +decimal digits to avoid this........ + +However I found that the Lahey Fortran compilers +produce identical results on Linux and Windows. +The company claims it strives for this but does +not guarantee it. I use compatible releases +of their compiler e.g. 5.7 on Windows and 6.1 on Linux +but am now in production with 7.1.1 on Windows and 6.2 on Linux. +The data input problem was thus resolved. + +It is very important to note that the compiler disables +extended precision on Intel boxes and has an option to +generate compatible code for any Pentium. Lahey do NOT use +extended 80-bit precision, SSE, or Multiply/ADD in one +instruction, with the appropriate compiler switch settings, +and I make a statically linked executable. I also compile at +the same optimisation level of course to avoid +differences due to different optimisation. + +Given all this I was delighted, until I started finding +small numerical difference in a small percentage of runs. +This was relatively easy to spot, as even a difference of +1 in the least significant bit of the mantissa of an IEEE +floating-point number, will be magnified as the SixTrack +particles pass through ~10,000 computational steps of +each of up to one million turns. + +To cut a long story short; I finally found that the culprits +were the exp and log functions. Certain parameters to these +functions produce a result which is 1 least significant bit different +between an IA-32 and an ATHLON AMD64. A WEB search uncovered the +crlibm, a library of Elementary functions developed at the +Ecole Normale Sperieur in Lyon (just a couple of hours +drive from Geneva!). I downloaded and tested this library, +and developed a Fortran interface and converted it for +Windows as well. (It had been developed using C on Linux.) +The library provides, sin, cos, sinh, cosh, tan, atan, log, log10 and +exp that I use. It offers rounding to nearest, or rounding up +or down. It is also optimised in the sense that it computes a +sufficient but minimum number of binary digits to produce +a correctly rounded result. + +I also implemented some missing elementary functions in terms of +the others they provide; namely acos_rn, asin_rn, atan2_rn in +terms of atan_rn, where _rn implies round to nearest. + +This library GUARANTEES to deliver the correctly rounded double +precision result on virtually any computer, and certainly on the +IEEE IA-32, AMD64 machines I am using. The results are also proven +theoretically to be correct. This is a tremendous piece of work and to +me represents an enormous step forward in the history of computing. +The greatest advance since the invention of IEEE arithmetic itself. +(I have not yet verified on the Intel IA-64 due to the pressure of +work, but I will do, as soon as possible, and Lyon have certainly +tested it.) + +My colleague Florent de Dinechen of ENS Lyon, whom we invited to CERN +afterwards to lecture on floating-point arithmetic, points you to +http://lipforge.ens-lyon.fr/projects/crlibm/ +where their work is described. + +We shall make a joint presentation (I hope) at the +19th International Symposium on Distributed Computing +DISC 2005 +Krakow, Poland, September 25-29, 2005. + +and also at CHEP 06 in Mumbai. diff --git a/doc/homogeneous_redundancy.php b/doc/homogeneous_redundancy.php index 5d7537f402..3cccafdf67 100644 --- a/doc/homogeneous_redundancy.php +++ b/doc/homogeneous_redundancy.php @@ -1,18 +1,33 @@ +Other applications are 'divergent' in the sense that small +numerical differences lead to unpredictably large differences +in the final output. +For such applications it may be difficult to distinguish between results that are correct but differ because -of numerical variation, -and results that are erroneous. +of numerical discrepancies, and results that are erroneous. +The 'fuzzy comparison' approach does not work for such applications. +

    Eliminating discrepancies

    +

    +One approach is to eliminate numerical discrepancies. +Some notes on how to do this for Fortran programs +are here + +

    Homogeneous redundancy

    BOINC provides a feature called homogeneous redundancy -for such applications. +to handle divergent applications. You can enable it for a project by including the line

     <homogeneous_redundancy/>
    diff --git a/doc/intro.php b/doc/intro.php
    index de637d858b..f4e9809382 100644
    --- a/doc/intro.php
    +++ b/doc/intro.php
    @@ -27,9 +27,8 @@ The BOINC's features fall into several areas:
     Many different projects can use BOINC.
     Projects are independent; each one operates its own servers and databases.
     However, projects can share resources in the following sense:
    -Participants install a core client program
    -which in turn downloads and executes project-specific application programs.
    -Participants control which projects they participate in,
    +Participants can participate in multiple projects;
    +they control which projects they participate in,
     and how their resources are divided among these projects.
     When a project is down or has no work,
     the resources of its participants are divided among
    @@ -72,16 +71,9 @@ This simplifies the task of diagnosing performance problems.
     
  • Source code availability
    -BOINC is distributed under a -public license -that allows it to be used freely for public or private distributed -computing projects, -with the restriction that it cannot be used as the basis for -commercial products. -BOINC applications need not be open source. -Each project must provide and maintain its own server systems; -these systems can be set up easily using -open-source components (MySQL, PHP, Apache). +BOINC is distributed under the +Lesser GNU Public License. +However, BOINC applications need not be open source.
  • Support for large data
    diff --git a/doc/language.php b/doc/language.php index 52cae43a91..e1108165b3 100644 --- a/doc/language.php +++ b/doc/language.php @@ -15,15 +15,13 @@ you can help by making a translation for your non-English language. Notes:
    • -You can use a tool called poEdit to modify the 'po' file. -It can be found here:
      -http://sourceforge.net/projects/poedit/ +You can use a tool called poEdit +to modify the 'po' file.
    • You might want to subscribe to the -boinc_loc@ssl.berkeley.edu -email list, which is devoted to discussion of -BOINC-related translation. +boinc_loc at ssl.berkeley.edu +email list, which is devoted to discussion of BOINC-related translation.
    • To submit a new language file, please email it to Rom Walton (rwalton at ssl.berkeley.edu). diff --git a/doc/links.php b/doc/links.php index 1ae3e231c6..12f30f90fe 100644 --- a/doc/links.php +++ b/doc/links.php @@ -45,7 +45,7 @@ language("Danish", array( site("http://www.setihome.dk", "www.setihome.dk") )); language("Dutch", array( - site("http://www.seti.nl/content.php?c=boinc_berkeley_main", + site("http://www.seti.nl/content.php?c=boincmain", "SETI@Netherlands" ) )); @@ -69,6 +69,7 @@ language("French", array( site("http://boinc-quebec.org", "boinc-quebec.org") )); language("German", array( + site("http://home.arcor.de/tim222/", "Team Science and Research Hessen"), site("http://www.boinc.de/", "www.boinc.de"), site( "http://www.boinc-lubeca.de/", "BOINC - LUBECA (Lübeck, Germany)"), site( "http://www.boinc-forum.de/", "www.boinc-forum.de"), diff --git a/doc/validate.php b/doc/validate.php index ff5ef93f20..1058916b50 100644 --- a/doc/validate.php +++ b/doc/validate.php @@ -12,7 +12,8 @@ A validator is a back-end program that does validation and credit-granting. You must supply a validator for each application in your project. BOINC supplies a framework program validator.C. -This program must be linked with two application-specific functions: +To make a validator program, you must link validator.C +with two application-specific functions:
      ",
       htmlspecialchars("
       int check_set(vector results, DB_WORKUNIT& wu, int& canonicalid, double& credit, bool& retry);
      @@ -100,6 +101,18 @@ exceeds a given minimum.
       A placeholder, validator_placeholder.C is also provided.  You can replace
       this file with your own code and 'make' will correctly build and link it.
       
      +

      Command-line arguments

      +A validator has the following command-line arguments: "; +list_start(); +list_item("-app appname", "Name of the application"); +list_item("[ -one_pass_N_WU N ]", "Validate at most N WUs, then exit"); +list_item("[ -one_pass ]", "Make one pass through WU table, then exit"); +list_item("[ -mod n i ]", + "Process only WUs with (id mod n) == i. + This option lets you run multiple instances of the validator + for increased performance." +); +list_end(); page_tail(); ?> diff --git a/sched/sched_send.C b/sched/sched_send.C index 858cac9e41..45242deb05 100644 --- a/sched/sched_send.C +++ b/sched/sched_send.C @@ -534,10 +534,12 @@ bool SCHEDULER_REPLY::work_needed(bool locality_sched) { } if (wreq.nresults >= config.max_wus_to_send) return false; if (config.daily_result_quota) { + // scale daily quota by #CPUs, up to a limit of 4 + // if (host.p_ncpus<4) { - wreq.daily_result_quota=host.p_ncpus*config.daily_result_quota; + wreq.daily_result_quota = host.p_ncpus*config.daily_result_quota; } else { - wreq.daily_result_quota=4*config.daily_result_quota; + wreq.daily_result_quota = 4*config.daily_result_quota; } if (host.nresults_today >= wreq.daily_result_quota) { wreq.daily_result_quota_exceeded = true;