- scheduler: move HR check to wu_is_infeasible()

In principle, a project can now use both
    locality scheduling and homogeneous redundancy.
- scheduler: do HR check before deadline check,
    since the latter is slower.
- scheduler: wu_is_infeasible() doesn't return a bitmap.
    Change its return values to sequential numbers.
- scheduler: ignore <accelerator> and <p_capabilities> tags

sched/
    sched_send.C,h
    sched_array.C
    sched_locality.C
    server_types.C

svn path=/trunk/boinc/; revision=12791
This commit is contained in:
David Anderson 2007-05-31 18:14:45 +00:00
parent 030ee981b6
commit 2fa5db2775
7 changed files with 76 additions and 45 deletions

View File

@ -5634,3 +5634,19 @@ Rom 31 May 2007
AccountManagerPropertiesPage.cpp
BOINCDialupManager.cpp
ProjectPropertiesPage.cpp
David 31 May 2007
- scheduler: move HR check to wu_is_infeasible()
In principle, a project can now use both
locality scheduling and homogeneous redundancy.
- scheduler: do HR check before deadline check,
since the latter is slower.
- scheduler: wu_is_infeasible() doesn't return a bitmap.
Change its return values to sequential numbers.
- scheduler: ignore <accelerator> and <p_capabilities> tags
sched/
sched_send.C,h
sched_array.C
sched_locality.C
server_types.C

View File

@ -1,6 +1,14 @@
<?
$project_news = array(
array("May 31, 2007",
"Sony Playstation 3 owners: researchers at the Barcelona
Biomedical Research Park have launched
<a href=http://www.ps3grid.net/>PS3GRID</a>,
a BOINC-based project whose application
(molecular dynamics simulations) runs on the
PS3's Cell processor, on Linux."
),
array("May 29, 2007",
"Check out <a href=http://www.youtube.com/watch?v=UNDcMAePKYY&eurl=http%3A%2F%2Fcb%2Dtools%2Epytalhost%2Ede%2Fblog%2F>a video promoting BOINC</a> on YouTube.</a>"
),

View File

@ -120,7 +120,7 @@ void scan_work_array(
// don't send if host can't handle it
//
wu = wu_result.workunit;
retval = wu_is_infeasible(wu, sreq, reply);
retval = wu_is_infeasible(wu, sreq, reply, app);
if (retval) {
log_messages.printf(
SCHED_MSG_LOG::MSG_DEBUG, "[HOST#%d] [WU#%d %s] WU is infeasible: %d\n",
@ -129,19 +129,6 @@ void scan_work_array(
continue;
}
// homogeneous redundancy, quick check
//
if (config.homogeneous_redundancy || app->homogeneous_redundancy) {
if (already_sent_to_different_platform_quick(sreq, wu)) {
log_messages.printf(
SCHED_MSG_LOG::MSG_DEBUG,
"[HOST#%d] [WU#%d %s] failed quick HR check: WU is class %d, host is class %d\n",
wu.hr_class, hr_class(sreq.host)
);
continue;
}
}
// Find the app and app_version for the client's platform.
// If none, treat the WU as infeasible
//

View File

@ -288,21 +288,6 @@ static int possibly_send_result(
retval = wu.lookup_id(result.workunitid);
if (retval) return ERR_DB_NOT_FOUND;
// wu_is_infeasible() returns a bitmask of potential reasons
// why the WU is not feasible. These are defined in sched_send.h.
// INFEASIBLE_MEM, INFEASIBLE_DISK, INFEASIBLE_CPU.
//
if (wu_is_infeasible(wu, sreq, reply)) {
return ERR_INSUFFICIENT_RESOURCE;
}
if (config.one_result_per_user_per_wu) {
sprintf(buf, "where userid=%d and workunitid=%d", reply.user.id, wu.id);
retval = result2.count(count, buf);
if (retval) return ERR_DB_NOT_FOUND;
if (count > 0) return ERR_WU_USER_RULE;
}
retval = get_app_version(
wu, app, avp, sreq, reply, platforms, ss
);
@ -317,6 +302,21 @@ static int possibly_send_result(
if (retval) return ERR_NO_APP_VERSION;
// wu_is_infeasible() returns the reason why the WU is not feasible;
// INFEASIBLE_MEM, INFEASIBLE_DISK, INFEASIBLE_CPU.
// see sched_send.h.
//
if (wu_is_infeasible(wu, sreq, reply, app)) {
return ERR_INSUFFICIENT_RESOURCE;
}
if (config.one_result_per_user_per_wu) {
sprintf(buf, "where userid=%d and workunitid=%d", reply.user.id, wu.id);
retval = result2.count(count, buf);
if (retval) return ERR_DB_NOT_FOUND;
if (count > 0) return ERR_WU_USER_RULE;
}
return add_result_to_reply(result, wu, sreq, reply, platforms, app, avp);
}

View File

@ -43,10 +43,11 @@ using namespace std;
#include "main.h"
#include "sched_array.h"
#include "sched_msgs.h"
#include "sched_send.h"
#include "sched_hr.h"
#include "sched_locality.h"
#include "sched_timezone.h"
#include "sched_send.h"
#ifdef _USING_FCGI_
#include "fcgi_stdio.h"
@ -422,10 +423,30 @@ static inline int check_deadline(
// Should move a few other checks from sched_array.C
//
int wu_is_infeasible(
WORKUNIT& wu, SCHEDULER_REQUEST& request, SCHEDULER_REPLY& reply
WORKUNIT& wu, SCHEDULER_REQUEST& request, SCHEDULER_REPLY& reply,
APP* app
) {
int retval;
// homogeneous redundancy, quick check
//
if (config.homogeneous_redundancy || app->homogeneous_redundancy) {
if (already_sent_to_different_platform_quick(request, wu)) {
log_messages.printf(
SCHED_MSG_LOG::MSG_DEBUG,
"[HOST#%d] [WU#%d %s] failed quick HR check: WU is class %d, host is class %d\n",
reply.host.id, wu.id, wu.name, wu.hr_class, hr_class(request.host)
);
return INFEASIBLE_HR;
}
}
if (config.one_result_per_user_per_wu || config.one_result_per_host_per_wu) {
if (wu_already_in_reply(wu, reply)) {
return INFEASIBLE_DUP;
}
}
retval = check_app_filter(wu, request, reply);
if (retval) return retval;
retval = check_memory(wu, request, reply);
@ -433,6 +454,8 @@ int wu_is_infeasible(
retval = check_disk(wu, request, reply);
if (retval) return retval;
// do this last because EDF sim uses some CPU
//
if (config.workload_sim && request.have_other_results_list) {
double est_cpu = estimate_cpu_duration(wu, reply);
IP_RESULT candidate("", wu.delay_bound, est_cpu);
@ -447,16 +470,9 @@ int wu_is_infeasible(
}
} else {
retval = check_deadline(wu, request, reply);
if (retval) return retval;
if (retval) return INFEASIBLE_WORKLOAD;
}
if (config.one_result_per_user_per_wu || config.one_result_per_host_per_wu) {
if (wu_already_in_reply(wu, reply)) {
return -1;
}
}
return 0;
}

View File

@ -45,12 +45,16 @@ extern bool app_core_compatible(WORK_REQ& wreq, APP_VERSION& av);
//
#define INFEASIBLE_MEM 1
#define INFEASIBLE_DISK 2
#define INFEASIBLE_CPU 4
#define INFEASIBLE_WORK_BUF 8
#define INFEASIBLE_APP_SETTING 16
#define INFEASIBLE_WORKLOAD 32
#define INFEASIBLE_CPU 3
#define INFEASIBLE_WORK_BUF 4
#define INFEASIBLE_APP_SETTING 5
#define INFEASIBLE_WORKLOAD 6
#define INFEASIBLE_DUP 7
#define INFEASIBLE_HR 8
extern int wu_is_infeasible(WORKUNIT&, SCHEDULER_REQUEST&, SCHEDULER_REPLY&);
extern int wu_is_infeasible(
WORKUNIT&, SCHEDULER_REQUEST&, SCHEDULER_REPLY&, APP*
);
extern double max_allowable_disk(SCHEDULER_REQUEST&, SCHEDULER_REPLY&);

View File

@ -882,10 +882,10 @@ int HOST::parse(FILE* fin) {
// fields reported by 5.5+ clients, not currently used
//
else if (match_tag(buf, "<p_features>")) continue;
#if 0
else if (match_tag(buf, "<p_capabilities>")) continue;
else if (match_tag(buf, "<accelerators>")) continue;
#if 0
// not sure where thees fields belong in the above
// categories
//