2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-01-20 23:22:22 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2003-07-08 21:30:47 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2003-07-08 21:30:47 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-01-20 23:22:22 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
2003-03-08 00:09:40 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2005-01-20 23:22:22 +00:00
|
|
|
|
2004-01-14 20:24:24 +00:00
|
|
|
// update_stats:
|
|
|
|
// Update average credit for idle users, hosts and teams.
|
|
|
|
// These fields are updates as new credit is granted;
|
|
|
|
// the purpose of this program is to decay credit of entities
|
|
|
|
// that are inactive for long periods.
|
2011-05-06 12:33:12 +00:00
|
|
|
// Run it about once a day.
|
2004-01-14 20:24:24 +00:00
|
|
|
//
|
|
|
|
// Also updates the nusers field of teams
|
2003-03-08 00:09:40 +00:00
|
|
|
//
|
2011-05-06 12:33:12 +00:00
|
|
|
// usage: update_stats args
|
|
|
|
// [--update_teams]
|
|
|
|
// [--update_users]
|
|
|
|
// [--update_hosts]
|
|
|
|
// [--min_age nsec] don't update items updated more recently than this
|
|
|
|
|
|
|
|
|
2005-11-21 18:34:44 +00:00
|
|
|
#include "config.h"
|
2004-07-13 13:54:09 +00:00
|
|
|
#include <cstdio>
|
|
|
|
#include <cstring>
|
2008-02-27 23:26:38 +00:00
|
|
|
#include <string>
|
2004-07-13 13:54:09 +00:00
|
|
|
#include <cstdlib>
|
2003-03-08 00:09:40 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
|
2003-04-07 19:06:00 +00:00
|
|
|
#include "boinc_db.h"
|
2003-03-08 00:09:40 +00:00
|
|
|
#include "util.h"
|
2007-05-11 16:30:13 +00:00
|
|
|
#include "str_util.h"
|
2008-10-27 21:23:07 +00:00
|
|
|
#include "error_numbers.h"
|
2009-09-17 17:56:59 +00:00
|
|
|
#include "svn_version.h"
|
2007-05-11 16:30:13 +00:00
|
|
|
|
2003-08-15 00:45:25 +00:00
|
|
|
#include "sched_config.h"
|
2003-03-08 00:09:40 +00:00
|
|
|
#include "sched_util.h"
|
2004-04-08 08:15:23 +00:00
|
|
|
#include "sched_msgs.h"
|
2003-03-08 00:09:40 +00:00
|
|
|
|
2011-05-06 12:33:12 +00:00
|
|
|
// If the item's average credit has been updated more recently than this,
|
|
|
|
// don't update it (optimizes performance).
|
2004-01-14 20:24:24 +00:00
|
|
|
|
2011-05-06 12:33:12 +00:00
|
|
|
#define MIN_AGE 86400
|
|
|
|
|
|
|
|
double max_update_time;
|
2004-01-14 20:24:24 +00:00
|
|
|
|
2003-03-08 00:09:40 +00:00
|
|
|
int update_users() {
|
2003-06-04 17:21:26 +00:00
|
|
|
DB_USER user;
|
2003-03-08 00:09:40 +00:00
|
|
|
int retval;
|
2004-10-04 23:59:51 +00:00
|
|
|
char buf[256];
|
2010-10-29 23:41:34 +00:00
|
|
|
double now = dtime();
|
2003-03-08 00:09:40 +00:00
|
|
|
|
2008-10-27 21:23:07 +00:00
|
|
|
while (1) {
|
2011-05-06 12:33:12 +00:00
|
|
|
sprintf(buf, "where expavg_credit>0.1 and expavg_time < %f", max_update_time);
|
|
|
|
retval = user.enumerate(buf);
|
2008-10-27 21:23:07 +00:00
|
|
|
if (retval) {
|
|
|
|
if (retval != ERR_DB_NOT_FOUND) {
|
|
|
|
log_messages.printf(MSG_CRITICAL, "lost DB conn\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2010-10-29 23:41:34 +00:00
|
|
|
update_average(
|
|
|
|
now, 0, 0, CREDIT_HALF_LIFE, user.expavg_credit, user.expavg_time
|
|
|
|
);
|
2006-06-21 19:48:41 +00:00
|
|
|
sprintf( buf, "expavg_credit=%f, expavg_time=%f",
|
2004-10-04 23:59:51 +00:00
|
|
|
user.expavg_credit, user.expavg_time
|
|
|
|
);
|
|
|
|
retval = user.update_field(buf);
|
2003-12-26 06:03:03 +00:00
|
|
|
if (retval) {
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL, "Can't update user %d\n", user.id);
|
2003-12-26 06:03:03 +00:00
|
|
|
return retval;
|
|
|
|
}
|
2003-03-08 00:09:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int update_hosts() {
|
2003-06-04 17:21:26 +00:00
|
|
|
DB_HOST host;
|
2003-03-08 00:09:40 +00:00
|
|
|
int retval;
|
2004-10-04 23:59:51 +00:00
|
|
|
char buf[256];
|
2010-10-29 23:41:34 +00:00
|
|
|
double now = dtime();
|
2003-03-08 00:09:40 +00:00
|
|
|
|
2008-10-27 21:23:07 +00:00
|
|
|
while (1) {
|
2011-05-06 12:33:12 +00:00
|
|
|
sprintf(buf, "where expavg_credit>0.1 and expavg_time < %f", max_update_time);
|
|
|
|
retval = host.enumerate(buf);
|
2008-10-27 21:23:07 +00:00
|
|
|
if (retval) {
|
|
|
|
if (retval != ERR_DB_NOT_FOUND) {
|
|
|
|
log_messages.printf(MSG_CRITICAL, "lost DB conn\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2010-10-29 23:41:34 +00:00
|
|
|
update_average(
|
|
|
|
now, 0, 0, CREDIT_HALF_LIFE, host.expavg_credit, host.expavg_time
|
|
|
|
);
|
2004-10-04 23:59:51 +00:00
|
|
|
sprintf(
|
|
|
|
buf,"expavg_credit=%f, expavg_time=%f",
|
|
|
|
host.expavg_credit, host.expavg_time
|
|
|
|
);
|
|
|
|
retval = host.update_field(buf);
|
2003-12-26 06:03:03 +00:00
|
|
|
if (retval) {
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL, "Can't update host %d\n", host.id);
|
2003-12-26 06:03:03 +00:00
|
|
|
return retval;
|
|
|
|
}
|
2003-03-08 00:09:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-01-14 20:24:24 +00:00
|
|
|
int get_team_totals(TEAM& team) {
|
2003-03-08 23:50:21 +00:00
|
|
|
int nusers;
|
|
|
|
int retval;
|
2003-06-04 17:21:26 +00:00
|
|
|
DB_USER user;
|
|
|
|
char buf[256];
|
2003-03-08 23:50:21 +00:00
|
|
|
|
2003-08-12 20:58:24 +00:00
|
|
|
// count the number of users on the team
|
2003-06-04 17:21:26 +00:00
|
|
|
//
|
|
|
|
sprintf(buf, "where teamid=%d", team.id);
|
|
|
|
retval = user.count(nusers, buf);
|
2003-03-08 23:50:21 +00:00
|
|
|
if (retval) return retval;
|
|
|
|
|
2006-01-22 16:35:08 +00:00
|
|
|
if (team.nusers != nusers) {
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL,
|
2006-01-22 16:35:08 +00:00
|
|
|
"updating member count for [TEAM#%d]: database has %d users, count shows %d\n",
|
|
|
|
team.id, team.nusers, nusers
|
|
|
|
);
|
|
|
|
}
|
2003-06-04 17:21:26 +00:00
|
|
|
team.nusers = nusers;
|
2003-03-08 23:50:21 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// fill in the nusers, total_credit and expavg_credit fields
|
|
|
|
// of the team table.
|
|
|
|
// This may take a while; don't do it often
|
|
|
|
//
|
|
|
|
int update_teams() {
|
2003-06-04 17:21:26 +00:00
|
|
|
DB_TEAM team;
|
2003-03-08 23:50:21 +00:00
|
|
|
int retval;
|
2004-10-04 23:59:51 +00:00
|
|
|
char buf[256];
|
2010-10-29 23:41:34 +00:00
|
|
|
double now = dtime();
|
2003-03-08 23:50:21 +00:00
|
|
|
|
2008-10-27 21:23:07 +00:00
|
|
|
while (1) {
|
|
|
|
retval = team.enumerate("where expavg_credit>0.1");
|
|
|
|
if (retval) {
|
|
|
|
if (retval != ERR_DB_NOT_FOUND) {
|
|
|
|
log_messages.printf(MSG_CRITICAL, "lost DB conn\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2004-01-14 20:24:24 +00:00
|
|
|
retval = get_team_totals(team);
|
2003-08-08 00:43:20 +00:00
|
|
|
if (retval) {
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL,
|
2003-08-08 00:43:20 +00:00
|
|
|
"update_teams: get_team_credit([TEAM#%d]) failed: %d\n",
|
|
|
|
team.id,
|
2004-01-14 20:24:24 +00:00
|
|
|
retval
|
|
|
|
);
|
2003-08-08 00:57:01 +00:00
|
|
|
continue;
|
2003-08-08 00:43:20 +00:00
|
|
|
}
|
2011-05-06 12:33:12 +00:00
|
|
|
if (team.expavg_time < max_update_time) {
|
2010-10-29 23:41:34 +00:00
|
|
|
update_average(
|
|
|
|
now, 0, 0, CREDIT_HALF_LIFE, team.expavg_credit,
|
|
|
|
team.expavg_time
|
|
|
|
);
|
2004-01-14 20:24:24 +00:00
|
|
|
}
|
2004-10-04 23:59:51 +00:00
|
|
|
sprintf(
|
2006-01-22 16:35:08 +00:00
|
|
|
buf, "expavg_credit=%f, expavg_time=%f, nusers=%d",
|
|
|
|
team.expavg_credit, team.expavg_time, team.nusers
|
2004-10-04 23:59:51 +00:00
|
|
|
);
|
|
|
|
retval = team.update_field(buf);
|
2003-12-26 06:03:03 +00:00
|
|
|
if (retval) {
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL, "Can't update team %d\n", team.id);
|
2003-12-26 06:03:03 +00:00
|
|
|
return retval;
|
|
|
|
}
|
2003-03-08 23:50:21 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-09-17 17:56:59 +00:00
|
|
|
void usage(char *name) {
|
|
|
|
fprintf(stderr,
|
|
|
|
"Update average credit for idle users, hosts and teams.\n"
|
|
|
|
"These fields are updates as new credit is granted;\n"
|
|
|
|
"the purpose of this program is to decay credit of entities\n"
|
|
|
|
"that are inactive for long periods.\n"
|
|
|
|
"Hence it should be run about once a day at most.\n\n"
|
|
|
|
"Also updates the nusers field of teams\n\n"
|
|
|
|
"Usage: %s [OPTION]...\n\n"
|
|
|
|
"Options:\n"
|
- server: change the following from per-host to per-(host, app version):
- daily quota mechanism
- reliable mechanism (accelerated retries)
- "trusted" mechanism (adaptive replication)
- scheduler: enforce host scale probation only for apps with
host_scale_check set.
- validator: do scale probation on invalid results
(need this in addition to error and timeout cases)
- feeder: update app version scales every 10 min, not 10 sec
- back-end apps: support --foo as well as -foo for options
Notes:
- If you have, say, cuda, cuda23 and cuda_fermi plan classes,
a host will have separate quotas for each one.
That means it could error out on 100 jobs for cuda_fermi,
and when its quota goes to zero,
error out on 100 jobs for cuda23, etc.
This is intentional; there may be cases where one version
works but not the others.
- host.error_rate and host.max_results_day are deprecated
TODO:
- the values in the app table for limits on jobs in progress etc.
should override rather than config.xml.
Implementation notes:
scheduler:
process_request():
read all host_app_versions for host at start;
Compute "reliable" and "trusted" for each one.
write modified records at end
get_app_version():
add "reliable_only" arg; if set, use only reliable versions
skip over-quota versions
Multi-pass scheduling: if have at least one reliable version,
do a pass for jobs that need reliable,
and use only reliable versions.
Then clear best_app_versions cache.
Score-based scheduling: for need-reliable jobs,
it will pick the fastest version,
then give a score bonus if that version happens to be reliable.
When get back a successful result from client:
increase daily quota
When get back an error result from client:
impose scale probation
decrease daily quota if not aborted
Validator:
when handling a WU, create a vector of HOST_APP_VERSION
parallel to vector of RESULT.
Pass it to assign_credit_set().
Make copies of originals so we can update only modified ones
update HOST_APP_VERSION error rates
Transitioner:
decrease quota on timeout
svn path=/trunk/boinc/; revision=21181
2010-04-15 03:13:56 +00:00
|
|
|
" [ -d X ] Set debug level to X\n"
|
|
|
|
" [ --update_teams ] Updates teams.\n"
|
|
|
|
" [ --update_users ] Updates users.\n"
|
|
|
|
" [ --update_hosts ] Updates hosts.\n"
|
|
|
|
" [ -h | --help ] Shows this help text\n"
|
|
|
|
" [ -v | --version ] Shows version information\n",
|
2009-09-17 17:56:59 +00:00
|
|
|
name
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2003-03-08 00:09:40 +00:00
|
|
|
int main(int argc, char** argv) {
|
|
|
|
int retval, i;
|
2011-05-06 12:33:12 +00:00
|
|
|
bool do_update_teams = false;
|
|
|
|
bool do_update_users = false;
|
2007-04-18 20:49:58 +00:00
|
|
|
bool do_update_hosts = false;
|
2003-03-08 00:09:40 +00:00
|
|
|
|
2011-05-06 12:33:12 +00:00
|
|
|
max_update_time = time(0) - MIN_AGE;
|
2004-01-14 20:24:24 +00:00
|
|
|
|
2004-05-03 19:30:01 +00:00
|
|
|
check_stop_daemons();
|
2003-03-08 00:09:40 +00:00
|
|
|
|
|
|
|
for (i=1; i<argc; i++) {
|
- server: change the following from per-host to per-(host, app version):
- daily quota mechanism
- reliable mechanism (accelerated retries)
- "trusted" mechanism (adaptive replication)
- scheduler: enforce host scale probation only for apps with
host_scale_check set.
- validator: do scale probation on invalid results
(need this in addition to error and timeout cases)
- feeder: update app version scales every 10 min, not 10 sec
- back-end apps: support --foo as well as -foo for options
Notes:
- If you have, say, cuda, cuda23 and cuda_fermi plan classes,
a host will have separate quotas for each one.
That means it could error out on 100 jobs for cuda_fermi,
and when its quota goes to zero,
error out on 100 jobs for cuda23, etc.
This is intentional; there may be cases where one version
works but not the others.
- host.error_rate and host.max_results_day are deprecated
TODO:
- the values in the app table for limits on jobs in progress etc.
should override rather than config.xml.
Implementation notes:
scheduler:
process_request():
read all host_app_versions for host at start;
Compute "reliable" and "trusted" for each one.
write modified records at end
get_app_version():
add "reliable_only" arg; if set, use only reliable versions
skip over-quota versions
Multi-pass scheduling: if have at least one reliable version,
do a pass for jobs that need reliable,
and use only reliable versions.
Then clear best_app_versions cache.
Score-based scheduling: for need-reliable jobs,
it will pick the fastest version,
then give a score bonus if that version happens to be reliable.
When get back a successful result from client:
increase daily quota
When get back an error result from client:
impose scale probation
decrease daily quota if not aborted
Validator:
when handling a WU, create a vector of HOST_APP_VERSION
parallel to vector of RESULT.
Pass it to assign_credit_set().
Make copies of originals so we can update only modified ones
update HOST_APP_VERSION error rates
Transitioner:
decrease quota on timeout
svn path=/trunk/boinc/; revision=21181
2010-04-15 03:13:56 +00:00
|
|
|
if (is_arg(argv[i], "update_teams")) {
|
2003-03-08 00:09:40 +00:00
|
|
|
do_update_teams = true;
|
- server: change the following from per-host to per-(host, app version):
- daily quota mechanism
- reliable mechanism (accelerated retries)
- "trusted" mechanism (adaptive replication)
- scheduler: enforce host scale probation only for apps with
host_scale_check set.
- validator: do scale probation on invalid results
(need this in addition to error and timeout cases)
- feeder: update app version scales every 10 min, not 10 sec
- back-end apps: support --foo as well as -foo for options
Notes:
- If you have, say, cuda, cuda23 and cuda_fermi plan classes,
a host will have separate quotas for each one.
That means it could error out on 100 jobs for cuda_fermi,
and when its quota goes to zero,
error out on 100 jobs for cuda23, etc.
This is intentional; there may be cases where one version
works but not the others.
- host.error_rate and host.max_results_day are deprecated
TODO:
- the values in the app table for limits on jobs in progress etc.
should override rather than config.xml.
Implementation notes:
scheduler:
process_request():
read all host_app_versions for host at start;
Compute "reliable" and "trusted" for each one.
write modified records at end
get_app_version():
add "reliable_only" arg; if set, use only reliable versions
skip over-quota versions
Multi-pass scheduling: if have at least one reliable version,
do a pass for jobs that need reliable,
and use only reliable versions.
Then clear best_app_versions cache.
Score-based scheduling: for need-reliable jobs,
it will pick the fastest version,
then give a score bonus if that version happens to be reliable.
When get back a successful result from client:
increase daily quota
When get back an error result from client:
impose scale probation
decrease daily quota if not aborted
Validator:
when handling a WU, create a vector of HOST_APP_VERSION
parallel to vector of RESULT.
Pass it to assign_credit_set().
Make copies of originals so we can update only modified ones
update HOST_APP_VERSION error rates
Transitioner:
decrease quota on timeout
svn path=/trunk/boinc/; revision=21181
2010-04-15 03:13:56 +00:00
|
|
|
} else if (is_arg(argv[i], "update_users")) {
|
2003-03-08 00:09:40 +00:00
|
|
|
do_update_users = true;
|
- server: change the following from per-host to per-(host, app version):
- daily quota mechanism
- reliable mechanism (accelerated retries)
- "trusted" mechanism (adaptive replication)
- scheduler: enforce host scale probation only for apps with
host_scale_check set.
- validator: do scale probation on invalid results
(need this in addition to error and timeout cases)
- feeder: update app version scales every 10 min, not 10 sec
- back-end apps: support --foo as well as -foo for options
Notes:
- If you have, say, cuda, cuda23 and cuda_fermi plan classes,
a host will have separate quotas for each one.
That means it could error out on 100 jobs for cuda_fermi,
and when its quota goes to zero,
error out on 100 jobs for cuda23, etc.
This is intentional; there may be cases where one version
works but not the others.
- host.error_rate and host.max_results_day are deprecated
TODO:
- the values in the app table for limits on jobs in progress etc.
should override rather than config.xml.
Implementation notes:
scheduler:
process_request():
read all host_app_versions for host at start;
Compute "reliable" and "trusted" for each one.
write modified records at end
get_app_version():
add "reliable_only" arg; if set, use only reliable versions
skip over-quota versions
Multi-pass scheduling: if have at least one reliable version,
do a pass for jobs that need reliable,
and use only reliable versions.
Then clear best_app_versions cache.
Score-based scheduling: for need-reliable jobs,
it will pick the fastest version,
then give a score bonus if that version happens to be reliable.
When get back a successful result from client:
increase daily quota
When get back an error result from client:
impose scale probation
decrease daily quota if not aborted
Validator:
when handling a WU, create a vector of HOST_APP_VERSION
parallel to vector of RESULT.
Pass it to assign_credit_set().
Make copies of originals so we can update only modified ones
update HOST_APP_VERSION error rates
Transitioner:
decrease quota on timeout
svn path=/trunk/boinc/; revision=21181
2010-04-15 03:13:56 +00:00
|
|
|
} else if (is_arg(argv[i], "update_hosts")) {
|
2003-03-08 00:09:40 +00:00
|
|
|
do_update_hosts = true;
|
2011-05-06 12:33:12 +00:00
|
|
|
} else if (is_arg(argv[i], "min_age")) {
|
|
|
|
double x = atof(argv[++i]);
|
|
|
|
max_update_time = time(0) - x;
|
2003-06-11 23:36:40 +00:00
|
|
|
} else if (!strcmp(argv[i], "-d")) {
|
2009-09-17 17:56:59 +00:00
|
|
|
if (!argv[++i]) {
|
|
|
|
log_messages.printf(MSG_CRITICAL, "%s requires an argument\n\n", argv[--i]);
|
|
|
|
usage(argv[0]);
|
|
|
|
exit(1);
|
|
|
|
}
|
2010-04-05 21:59:33 +00:00
|
|
|
int dl = atoi(argv[i]);
|
|
|
|
log_messages.set_debug_level(dl);
|
|
|
|
if (dl == 4) g_print_queries = true;
|
- server: change the following from per-host to per-(host, app version):
- daily quota mechanism
- reliable mechanism (accelerated retries)
- "trusted" mechanism (adaptive replication)
- scheduler: enforce host scale probation only for apps with
host_scale_check set.
- validator: do scale probation on invalid results
(need this in addition to error and timeout cases)
- feeder: update app version scales every 10 min, not 10 sec
- back-end apps: support --foo as well as -foo for options
Notes:
- If you have, say, cuda, cuda23 and cuda_fermi plan classes,
a host will have separate quotas for each one.
That means it could error out on 100 jobs for cuda_fermi,
and when its quota goes to zero,
error out on 100 jobs for cuda23, etc.
This is intentional; there may be cases where one version
works but not the others.
- host.error_rate and host.max_results_day are deprecated
TODO:
- the values in the app table for limits on jobs in progress etc.
should override rather than config.xml.
Implementation notes:
scheduler:
process_request():
read all host_app_versions for host at start;
Compute "reliable" and "trusted" for each one.
write modified records at end
get_app_version():
add "reliable_only" arg; if set, use only reliable versions
skip over-quota versions
Multi-pass scheduling: if have at least one reliable version,
do a pass for jobs that need reliable,
and use only reliable versions.
Then clear best_app_versions cache.
Score-based scheduling: for need-reliable jobs,
it will pick the fastest version,
then give a score bonus if that version happens to be reliable.
When get back a successful result from client:
increase daily quota
When get back an error result from client:
impose scale probation
decrease daily quota if not aborted
Validator:
when handling a WU, create a vector of HOST_APP_VERSION
parallel to vector of RESULT.
Pass it to assign_credit_set().
Make copies of originals so we can update only modified ones
update HOST_APP_VERSION error rates
Transitioner:
decrease quota on timeout
svn path=/trunk/boinc/; revision=21181
2010-04-15 03:13:56 +00:00
|
|
|
} else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
|
2009-09-17 17:56:59 +00:00
|
|
|
printf("%s\n", SVN_VERSION);
|
|
|
|
exit(0);
|
- server: change the following from per-host to per-(host, app version):
- daily quota mechanism
- reliable mechanism (accelerated retries)
- "trusted" mechanism (adaptive replication)
- scheduler: enforce host scale probation only for apps with
host_scale_check set.
- validator: do scale probation on invalid results
(need this in addition to error and timeout cases)
- feeder: update app version scales every 10 min, not 10 sec
- back-end apps: support --foo as well as -foo for options
Notes:
- If you have, say, cuda, cuda23 and cuda_fermi plan classes,
a host will have separate quotas for each one.
That means it could error out on 100 jobs for cuda_fermi,
and when its quota goes to zero,
error out on 100 jobs for cuda23, etc.
This is intentional; there may be cases where one version
works but not the others.
- host.error_rate and host.max_results_day are deprecated
TODO:
- the values in the app table for limits on jobs in progress etc.
should override rather than config.xml.
Implementation notes:
scheduler:
process_request():
read all host_app_versions for host at start;
Compute "reliable" and "trusted" for each one.
write modified records at end
get_app_version():
add "reliable_only" arg; if set, use only reliable versions
skip over-quota versions
Multi-pass scheduling: if have at least one reliable version,
do a pass for jobs that need reliable,
and use only reliable versions.
Then clear best_app_versions cache.
Score-based scheduling: for need-reliable jobs,
it will pick the fastest version,
then give a score bonus if that version happens to be reliable.
When get back a successful result from client:
increase daily quota
When get back an error result from client:
impose scale probation
decrease daily quota if not aborted
Validator:
when handling a WU, create a vector of HOST_APP_VERSION
parallel to vector of RESULT.
Pass it to assign_credit_set().
Make copies of originals so we can update only modified ones
update HOST_APP_VERSION error rates
Transitioner:
decrease quota on timeout
svn path=/trunk/boinc/; revision=21181
2010-04-15 03:13:56 +00:00
|
|
|
} else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
|
2009-09-17 17:56:59 +00:00
|
|
|
usage(argv[0]);
|
|
|
|
exit(0);
|
2003-03-08 23:50:21 +00:00
|
|
|
} else {
|
2009-09-17 17:56:59 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL, "unknown command line argument: %s\n\n", argv[i]);
|
|
|
|
usage(argv[0]);
|
|
|
|
exit(1);
|
2003-03-08 23:50:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-06 12:33:12 +00:00
|
|
|
// if no do_update flags set, set them all
|
|
|
|
//
|
|
|
|
if (!do_update_teams && !do_update_users && !do_update_hosts) {
|
|
|
|
do_update_teams = true;
|
|
|
|
do_update_users = true;
|
|
|
|
do_update_hosts = true;
|
|
|
|
}
|
|
|
|
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_NORMAL, "Starting\n");
|
2003-07-01 00:39:54 +00:00
|
|
|
|
2009-05-07 13:54:51 +00:00
|
|
|
retval = config.parse_file();
|
2003-03-08 00:09:40 +00:00
|
|
|
if (retval) {
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL,
|
2009-05-07 13:54:51 +00:00
|
|
|
"Can't parse config.xml: %s\n", boincerror(retval)
|
2007-05-11 16:30:13 +00:00
|
|
|
);
|
2003-03-08 00:09:40 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2004-01-15 23:53:13 +00:00
|
|
|
retval = boinc_db.open(config.db_name, config.db_host, config.db_user, config.db_passwd);
|
2003-03-08 00:09:40 +00:00
|
|
|
if (retval) {
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL, "Can't open DB\n");
|
2003-03-08 00:09:40 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
2007-02-13 21:41:07 +00:00
|
|
|
retval = boinc_db.set_isolation_level(READ_UNCOMMITTED);
|
|
|
|
if (retval) {
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL,
|
2010-11-08 17:51:57 +00:00
|
|
|
"boinc_db.set_isolation_level: %s; %s\n",
|
|
|
|
boincerror(retval), boinc_db.error_string()
|
2007-02-13 21:41:07 +00:00
|
|
|
);
|
|
|
|
}
|
2003-03-08 00:09:40 +00:00
|
|
|
|
|
|
|
if (do_update_users) {
|
|
|
|
retval = update_users();
|
|
|
|
if (retval) {
|
2010-11-08 17:51:57 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL,
|
|
|
|
"update_users failed: %s\n", boincerror(retval)
|
|
|
|
);
|
2003-03-08 00:09:40 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (do_update_hosts) {
|
|
|
|
retval = update_hosts();
|
|
|
|
if (retval) {
|
2010-11-08 17:51:57 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL,
|
|
|
|
"update_hosts failed: %s\n", boincerror(retval)
|
|
|
|
);
|
2003-03-08 00:09:40 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-08 23:50:21 +00:00
|
|
|
if (do_update_teams) {
|
|
|
|
retval = update_teams();
|
|
|
|
if (retval) {
|
2010-11-08 17:51:57 +00:00
|
|
|
log_messages.printf(MSG_CRITICAL,
|
|
|
|
"update_teams failed: %s\n", boincerror(retval)
|
|
|
|
);
|
2003-03-08 23:50:21 +00:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-21 21:00:58 +00:00
|
|
|
log_messages.printf(MSG_NORMAL, "Finished\n");
|
2003-03-08 00:09:40 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2004-12-08 00:40:19 +00:00
|
|
|
|
2005-01-02 18:29:53 +00:00
|
|
|
const char *BOINC_RCSID_6b05e9ecce = "$Id$";
|