From 505d04969a19ec868f3948966533c9f49e8b8a25 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 27 Sep 2007 15:08:40 +0000 Subject: [PATCH] - file upload handler: fix major bug (introducted 12 Sept) that caused it to report "volume full" erroneously - added --help option to some backend programs; gives general info and directs to web page file_upload_handler.C svn path=/trunk/boinc/; revision=13685 --- checkin_notes | 13 ++++++++++++- sched/assimilator.C | 19 ++++++++++++++++--- sched/census.C | 18 +++++++++++++++++- sched/db_dump.C | 13 ++++++++++++- sched/file_upload_handler.C | 6 ++++-- 5 files changed, 61 insertions(+), 8 deletions(-) diff --git a/checkin_notes b/checkin_notes index 34affbd43d..64bb27829c 100755 --- a/checkin_notes +++ b/checkin_notes @@ -8844,4 +8844,15 @@ Charlie 27 Sep 2007 api/ boinc_api.C - \ No newline at end of file + +David 27 Sept 2007 + - file upload handler: fix major bug (introducted 12 Sept) + that caused it to report "volume full" erroneously + - added --help option to some backend programs; + gives general info and directs to web page + + sched/ + assimilator.C + census.C + db_dump.C + file_upload_handler.C diff --git a/sched/assimilator.C b/sched/assimilator.C index 33f94e8262..4cedf23fe9 100644 --- a/sched/assimilator.C +++ b/sched/assimilator.C @@ -72,7 +72,7 @@ bool do_pass(APP& app) { check_stop_daemons(); if (wu_id_modulus) { - sprintf(mod_clause, " and workunit.id %% %d = %d ", + sprintf(mod_clause, " and workunit.id %% %d = %d ", wu_id_modulus, wu_id_remainder ); } else { @@ -144,6 +144,14 @@ bool do_pass(APP& app) { return did_something; } +void show_help() { + fprintf(stderr, + "This program is an 'assimilator'; it handles validated results.\n" + "Normally it is run as a daemon from config.xml.\n" + "For more info: http://boinc.berkeley.edu/trac/wiki/BackendPrograms\n" + ); +} + int main(int argc, char** argv) { int retval; bool one_pass = false; @@ -179,14 +187,19 @@ int main(int argc, char** argv) { } else if (!strcmp(argv[i], "-mod")) { wu_id_modulus = atoi(argv[++i]); wu_id_remainder = atoi(argv[++i]); + } else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) { + show_help(); + exit(0); } else { log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, "Unrecognized arg: %s\n", argv[i]); } } if (wu_id_modulus) { - log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG, "Using mod'ed WU enumeration. modulus = %d remainder = %d\n", - wu_id_modulus, wu_id_remainder); + log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG, + "Using mod'ed WU enumeration. modulus = %d remainder = %d\n", + wu_id_modulus, wu_id_remainder + ); } retval = config.parse_file(".."); diff --git a/sched/census.C b/sched/census.C index 983ee4045a..5227399287 100644 --- a/sched/census.C +++ b/sched/census.C @@ -31,11 +31,27 @@ #include "sched_msgs.h" #include "hr_info.h" -int main() { +void show_help() { + fprintf(stderr, + "This program writes a file '%s' containing the distribution of\n" + "host platforms (needed if you use homogeneous redundancy).\n" + "This should be run ~once/day as a periodic task from config.xml.\n" + "For more info, see http://boinc.berkeley.edu/trac/wiki/HomogeneousRedundancy", + HR_INFO_FILENAME + ); +} + +int main(int argc, char** argv) { HR_INFO hri; int retval; SCHED_CONFIG config; + for (int i=0; i