- validator: in "credit_from_wu" case, record what the new credit

system would have assigned in result.claimed_credit.

svn path=/trunk/boinc/; revision=24088
This commit is contained in:
David Anderson 2011-08-30 22:28:52 +00:00
parent 8b409fffa2
commit 9b89168c49
2 changed files with 16 additions and 1 deletions

View File

@ -5320,3 +5320,10 @@ David 30 Aug 2011
samples/vboxwrapper/
vboxwrapper.cpp
David 30 Aug 2011
- validator: in "credit_from_wu" case, record what the new credit
system would have assigned in result.claimed_credit.
sched/
validator.cpp

View File

@ -149,7 +149,7 @@ int handle_wu(
bool update_result, retry;
TRANSITION_TIME transition_time = NO_CHANGE;
int retval = 0, canonicalid = 0, x;
double credit = 0;
double credit = 0, credit_new = 0;
unsigned int i;
WORKUNIT& wu = items[0].wu;
@ -360,6 +360,7 @@ int handle_wu(
wu, results, app, app_versions, host_app_versions,
max_granted_credit, credit
);
retval = get_credit_from_wu(wu, results, credit);
if (retval) {
log_messages.printf(MSG_CRITICAL,
@ -437,6 +438,13 @@ int handle_wu(
);
}
result.granted_credit = credit;
if (credit_from_wu) {
DB_RESULT r;
r = result;
char buf[256];
sprintf(buf, "claimed_credit=%f", credit_new);
r.update_field(buf);
}
grant_credit(host, result.sent_time, credit);
log_messages.printf(MSG_NORMAL,
"[RESULT#%d %s] Valid; granted %f credit [HOST#%d]\n",