2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-08-04 03:50:04 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2005-08-04 03:50:04 +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.
|
2005-08-04 03:50:04 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-08-04 03:50:04 +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.
|
|
|
|
//
|
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-08-04 03:50:04 +00:00
|
|
|
|
2006-08-16 03:44:47 +00:00
|
|
|
// scheduler code related to homogeneous redundancy
|
2005-08-04 03:50:04 +00:00
|
|
|
|
2005-11-21 18:34:44 +00:00
|
|
|
#include "config.h"
|
2005-08-04 03:50:04 +00:00
|
|
|
#include <ctime>
|
|
|
|
#include <cstdio>
|
|
|
|
#include <stdlib.h>
|
2008-02-27 23:26:38 +00:00
|
|
|
#include <cstring>
|
|
|
|
#include <string>
|
2005-08-04 03:50:04 +00:00
|
|
|
|
|
|
|
#include "error_numbers.h"
|
|
|
|
|
2009-08-10 04:49:02 +00:00
|
|
|
#include "sched_types.h"
|
2005-08-04 03:50:04 +00:00
|
|
|
#include "sched_config.h"
|
|
|
|
#include "sched_msgs.h"
|
2009-08-10 04:49:02 +00:00
|
|
|
#include "sched_main.h"
|
2007-06-20 22:34:06 +00:00
|
|
|
#include "hr.h"
|
2005-08-04 03:58:00 +00:00
|
|
|
#include "sched_hr.h"
|
2005-08-04 03:50:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef _USING_FCGI_
|
2008-09-09 19:10:42 +00:00
|
|
|
#include "boinc_fcgi.h"
|
2005-08-04 03:50:04 +00:00
|
|
|
#endif
|
|
|
|
|
2007-06-14 18:02:00 +00:00
|
|
|
// return true if HR rules out sending any work to this host
|
|
|
|
//
|
|
|
|
bool hr_unknown_platform(HOST& host) {
|
|
|
|
for (int i=0; i<ssp->napps; i++) {
|
|
|
|
APP& app = ssp->apps[i];
|
2010-04-05 18:59:16 +00:00
|
|
|
if (!hr_unknown_class(host, app_hr_type(app))) return false;
|
2007-06-14 18:02:00 +00:00
|
|
|
}
|
|
|
|
return true;
|
2007-05-29 23:41:31 +00:00
|
|
|
}
|
|
|
|
|
2011-10-26 07:15:22 +00:00
|
|
|
// check for HR compatibility
|
2007-05-29 23:41:31 +00:00
|
|
|
//
|
2011-10-26 07:15:22 +00:00
|
|
|
bool already_sent_to_different_hr_class(WORKUNIT& wu, APP& app) {
|
2008-12-19 18:14:02 +00:00
|
|
|
g_wreq->hr_reject_temp = false;
|
|
|
|
int host_hr_class = hr_class(g_request->host, app_hr_type(app));
|
2011-10-26 07:15:22 +00:00
|
|
|
if (wu.hr_class && (host_hr_class != wu.hr_class)) {
|
|
|
|
g_wreq->hr_reject_temp = true;
|
|
|
|
return true;
|
2005-08-04 03:50:04 +00:00
|
|
|
}
|
2011-10-26 07:15:22 +00:00
|
|
|
return false;
|
2005-08-04 03:50:04 +00:00
|
|
|
}
|
|
|
|
|
2005-09-13 09:01:56 +00:00
|
|
|
const char *BOINC_RCSID_4196d9a5b4="$Id$";
|