Added a command line option to make single pass with a small number of WU

for testing purposes.

svn path=/trunk/boinc/; revision=4986
This commit is contained in:
Bruce Allen 2005-01-03 17:18:32 +00:00
parent 04b03bc630
commit 07f776dd63
2 changed files with 16 additions and 4 deletions

View File

@ -49,6 +49,8 @@ bool noinsert = false;
#define SLEEP_INTERVAL 10 #define SLEEP_INTERVAL 10
int one_pass_N_WU=0;
// assimilate all WUs that need it // assimilate all WUs that need it
// return nonzero if did anything // return nonzero if did anything
// //
@ -62,7 +64,8 @@ bool do_pass(APP& app) {
check_stop_daemons(); check_stop_daemons();
sprintf(buf, "where appid=%d and assimilate_state=%d limit 1000", app.id, ASSIMILATE_READY); sprintf(buf, "where appid=%d and assimilate_state=%d limit %d", app.id, ASSIMILATE_READY,
one_pass_N_WU ? one_pass_N_WU : 1000);
while (!wu.enumerate(buf)) { while (!wu.enumerate(buf)) {
vector<RESULT> results; // must be inside while()! vector<RESULT> results; // must be inside while()!
@ -133,6 +136,9 @@ int main(int argc, char** argv) {
for (i=1; i<argc; i++) { for (i=1; i<argc; i++) {
if (!strcmp(argv[i], "-asynch")) { if (!strcmp(argv[i], "-asynch")) {
asynch = true; asynch = true;
} else if (!strcmp(argv[i], "-one_pass_N_WU")) {
one_pass_N_WU = atoi(argv[++i]);
one_pass = true;
} else if (!strcmp(argv[i], "-one_pass")) { } else if (!strcmp(argv[i], "-one_pass")) {
one_pass = true; one_pass = true;
} else if (!strcmp(argv[i], "-d")) { } else if (!strcmp(argv[i], "-d")) {

View File

@ -21,8 +21,9 @@
// validator - check and validate new results, and grant credit // validator - check and validate new results, and grant credit
// -app appname // -app appname
// [-d debug_level] // [-d debug_level]
// [-one_pass] // make one pass through WU table, then exit // [-one_pass_N_WU N] // Validate only N WU in one pass, then exit
// [-asynch] // fork, run in separate process // [-one_pass] // make one pass through WU table, then exit
// [-asynch] // fork, run in separate process
// //
// This program must be linked with two project-specific functions: // This program must be linked with two project-specific functions:
// check_set() and check_pair(). // check_set() and check_pair().
@ -465,6 +466,8 @@ void handle_wu(
} }
} }
int one_pass_N_WU=0;
// make one pass through the workunits with need_validate set. // make one pass through the workunits with need_validate set.
// return true if there were any // return true if there were any
// //
@ -475,7 +478,7 @@ bool do_validate_scan(APP& app) {
// loop over entries that need to be checked // loop over entries that need to be checked
// //
while (!validator.enumerate(app.id, SELECT_LIMIT, items)) { while (!validator.enumerate(app.id, one_pass_N_WU?one_pass_N_WU:SELECT_LIMIT, items)) {
handle_wu(validator, items); handle_wu(validator, items);
found = true; found = true;
} }
@ -525,6 +528,9 @@ int main(int argc, char** argv) {
for (i=1; i<argc; i++) { for (i=1; i<argc; i++) {
if (!strcmp(argv[i], "-asynch")) { if (!strcmp(argv[i], "-asynch")) {
asynch = true; asynch = true;
} else if (!strcmp(argv[i], "-one_pass_N_WU")) {
one_pass_N_WU = atoi(argv[++i]);
one_pass = true;
} else if (!strcmp(argv[i], "-one_pass")) { } else if (!strcmp(argv[i], "-one_pass")) {
one_pass = true; one_pass = true;
} else if (!strcmp(argv[i], "-app")) { } else if (!strcmp(argv[i], "-app")) {