- create_work function and script:

check for valid ordering among max_success_results,
    max_total_results, max_error_results, and target_nresults

svn path=/trunk/boinc/; revision=19054
This commit is contained in:
David Anderson 2009-09-16 03:10:22 +00:00
parent 0f9cda3ea3
commit 381a15c724
5 changed files with 32 additions and 5 deletions

View File

@ -7695,7 +7695,7 @@ David 14 Sept 2009
login_form.php (new)
logout.php (new)
David 14 Sept 2009
David 15 Sept 2009
- admin web: finished the above.
Got rid of auth_ops_cmdline() (not needed).
auth_ops() is now called in util_ops.inc;
@ -7714,3 +7714,16 @@ David 14 Sept 2009
project.inc
ops/
(most).php
David 15 Sept 2009
- create_work function and script:
check for valid ordering among max_success_results,
max_total_results, max_error_results, and target_nresults
db/
boinc_db.h
sched/
validator.cpp
tools/
backend_lib.cpp
create_work.cpp

View File

@ -384,9 +384,9 @@ struct WORKUNIT {
// (in terms of numerics, performance, or both)
double opaque; // project-specific; usually external ID
int min_quorum; // minimum quorum size
int target_nresults; // try to get this many successful results
// may be > min_quorum to get consensus
// quicker or reflect loss rate
int target_nresults;
// try to get this many successful results
// may be > min_quorum to get consensus quicker or reflect loss rate
int max_error_results; // WU error if < #error results
int max_total_results; // WU error if < #total results
// (need this in case results are never returned)

View File

@ -493,7 +493,7 @@ int handle_wu(
transition_time = IMMEDIATE;
}
// if #success results == than target_nresults,
// if #success results >= target_nresults,
// we need more results, so bump target_nresults
// NOTE: nsuccess_results should never be > target_nresults,
// but accommodate that if it should happen

View File

@ -612,6 +612,18 @@ int create_work(
fprintf(stderr, "no max_success_results given; can't create job\n");
return ERR_NO_OPTION;
}
if (wu.max_success_results > wu.max_total_results) {
fprintf(stderr, "max_success_results > max_total_results; can't create job\n");
return ERR_INVALID_PARAM;
}
if (wu.max_error_results > wu.max_total_results) {
fprintf(stderr, "max_error_results > max_total_results; can't create job\n");
return ERR_INVALID_PARAM;
}
if (wu.target_nresults > wu.max_success_results) {
fprintf(stderr, "target_nresults > max_success_results; can't create job\n");
return ERR_INVALID_PARAM;
}
if (strstr(wu.name, ASSIGNED_WU_STR)) {
wu.transition_time = INT_MAX;
} else {

View File

@ -46,6 +46,8 @@
// [ --assign_user_all ID ]
// [ --assign_team_one ID ]
// [ --assign_team_all ID ]
// [ --wu_id N ] Pass this if you've already created the workunit record
// (used by boinc_submit)
// infile1 infile2 ...
#include "config.h"