propagate batch to result

svn path=/trunk/boinc/; revision=9318
This commit is contained in:
David Anderson 2006-01-26 00:19:05 +00:00
parent d99d85baab
commit f471b89bf9
4 changed files with 20 additions and 4 deletions

View File

@ -1021,3 +1021,17 @@ David 25 Jan 2006
client/
acct_mgr.C
David 25 Jan 2006
- Initialize result.batch to workunit.batch
This required adding a batch field to TRANSITIONER_ITEM.
(for Rosetta@home)
Note: if you're using the batch field for anything,
you should add indices on it to workunit and/or result
db/
boinc_db.C,h
tools/
backend_lib.C

View File

@ -851,6 +851,7 @@ void TRANSITIONER_ITEM::parse(MYSQL_ROW& r) {
target_nresults = atoi(r[i++]);
strcpy2(result_template_file, r[i++]);
priority = atoi(r[i++]);
batch = atoi(r[i++]);
// use safe_atoi() from here on cuz they might not be there
//
@ -908,6 +909,7 @@ int DB_TRANSITIONER_ITEM_SET::enumerate(
" wu.target_nresults, "
" wu.result_template_file, "
" wu.priority, "
" wu.batch, "
" res.id, "
" res.name, "
" res.report_deadline, "

View File

@ -482,6 +482,7 @@ struct TRANSITIONER_ITEM {
int target_nresults;
char result_template_file[64];
int priority;
int batch;
int res_id;
char res_name[256];
int res_report_deadline;

View File

@ -322,11 +322,9 @@ static int process_wu_template(
return 0;
}
// Set the time-varying fields of a result to their initial state.
// This is used to create clones of existing results,
// so set only the time-varying fields
// initialize an about-to-be-created result, given its WU
//
void initialize_result(DB_RESULT& result, TRANSITIONER_ITEM& wu) {
static void initialize_result(DB_RESULT& result, TRANSITIONER_ITEM& wu) {
result.id = 0;
result.create_time = time(0);
result.workunitid = wu.id;
@ -346,6 +344,7 @@ void initialize_result(DB_RESULT& result, TRANSITIONER_ITEM& wu) {
result.granted_credit = 0;
result.appid = wu.appid;
result.priority = wu.priority;
result.batch = wu.batch;
}
// Create a new result for the given WU.