mirror of https://github.com/BOINC/boinc.git
- Scheduler: changed the <homogeneous_redundancy> option
from a bool to an int: 0 = no HR 1 = HR with fine-grained classification (from MF Somers) 2 = HR with coarse-grained classification (from WCG) Note: numerical equivalence depends on your application and how it's compiled. Some apps may need classifications other than these two. Contact me if so. sched/ sched_hr.C sched_config.C,h svn path=/trunk/boinc/; revision=12934
This commit is contained in:
parent
bdb04c4e72
commit
981eef6b14
|
@ -6246,3 +6246,18 @@ David 13 June 2007
|
|||
project.xml
|
||||
html/ops/
|
||||
sample_server_status.php
|
||||
|
||||
David 14 June 2007
|
||||
- Scheduler: changed the <homogeneous_redundancy> option
|
||||
from a bool to an int:
|
||||
0 = no HR
|
||||
1 = HR with fine-grained classification (from MF Somers)
|
||||
2 = HR with coarse-grained classification (from WCG)
|
||||
|
||||
Note: numerical equivalence depends on your application
|
||||
and how it's compiled. Some apps may need classifications
|
||||
other than these two. Contact me if so.
|
||||
|
||||
sched/
|
||||
sched_hr.C
|
||||
sched_config.C,h
|
||||
|
|
|
@ -82,7 +82,7 @@ int SCHED_CONFIG::parse(FILE* f) {
|
|||
else if (xp.parse_bool(tag, "one_result_per_host_per_wu", one_result_per_host_per_wu)) continue;
|
||||
else if (xp.parse_bool(tag, "non_cpu_intensive", non_cpu_intensive)) continue;
|
||||
else if (xp.parse_bool(tag, "verify_files_on_app_start", verify_files_on_app_start)) continue;
|
||||
else if (xp.parse_bool(tag, "homogeneous_redundancy", homogeneous_redundancy)) continue;
|
||||
else if (xp.parse_int(tag, "homogeneous_redundancy", homogeneous_redundancy)) continue;
|
||||
else if (xp.parse_bool(tag, "locality_scheduling", locality_scheduling)) continue;
|
||||
else if (xp.parse_bool(tag, "locality_scheduling_sorted_order", locality_scheduling_sorted_order)) continue;
|
||||
else if (xp.parse_bool(tag, "msg_to_host", msg_to_host)) continue;
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
int max_wus_in_progress;
|
||||
bool non_cpu_intensive;
|
||||
bool verify_files_on_app_start;
|
||||
bool homogeneous_redundancy;
|
||||
int homogeneous_redundancy;
|
||||
bool locality_scheduling;
|
||||
bool locality_scheduling_sorted_order;
|
||||
bool ignore_upload_certificates;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#include "server_types.h"
|
||||
#include "sched_config.h"
|
||||
#include "sched_msgs.h"
|
||||
#include "main.h"
|
||||
#include "sched_hr.h"
|
||||
|
||||
|
||||
|
@ -67,7 +68,7 @@ const int Windows = 384;
|
|||
const int Darwin = 512;
|
||||
const int freebsd = 640;
|
||||
|
||||
inline int OS(HOST& host){
|
||||
inline int os(HOST& host){
|
||||
if (strcasestr(host.os_name, "Linux")) return Linux;
|
||||
else if (strcasestr(host.os_name, "Windows")) return Windows;
|
||||
else if (strcasestr(host.os_name, "Darwin")) return Darwin;
|
||||
|
@ -75,7 +76,14 @@ inline int OS(HOST& host){
|
|||
else return noos;
|
||||
};
|
||||
|
||||
inline int CPU(HOST& host){
|
||||
inline int cpu_coarse(HOST& host){
|
||||
if (strcasestr(host.p_vendor, "Intel")) return Intel;
|
||||
if (strcasestr(host.p_vendor, "AMD")) return AMD;
|
||||
if (strcasestr(host.p_vendor, "Macintosh")) return Macintosh;
|
||||
return nocpu;
|
||||
}
|
||||
|
||||
inline int cpu_fine(HOST& host){
|
||||
if (strcasestr(host.p_vendor, "Intel")) {
|
||||
if (strcasestr(host.p_model, "Xeon")) return IntelXeon;
|
||||
if (strcasestr(host.p_model, "Celeron")) {
|
||||
|
@ -109,7 +117,8 @@ inline int CPU(HOST& host){
|
|||
if (strcasestr(host.p_model, "Family 6 Model 5")) return IntelPentiumII;
|
||||
}
|
||||
return Intel;
|
||||
} else if(strcasestr(host.p_vendor, "AMD")) {
|
||||
}
|
||||
if (strcasestr(host.p_vendor, "AMD")) {
|
||||
if (strcasestr(host.p_model, "Duron")) return AMDDuron;
|
||||
if (strcasestr(host.p_model, "Opteron")) return AMDOpteron;
|
||||
if (strcasestr(host.p_model, "Sempron")) return AMDSempron;
|
||||
|
@ -122,22 +131,45 @@ inline int CPU(HOST& host){
|
|||
}
|
||||
return AMD;
|
||||
}
|
||||
else if (strcasestr(host.p_vendor, "Macintosh")) return Macintosh;
|
||||
else return nocpu;
|
||||
if (strcasestr(host.p_vendor, "Macintosh")) return Macintosh;
|
||||
return nocpu;
|
||||
};
|
||||
|
||||
inline int HR_CLASS(HOST& host) {
|
||||
return OS(host) + CPU(host);
|
||||
}
|
||||
|
||||
int hr_class(HOST& host) {
|
||||
return HR_CLASS(host);
|
||||
switch (config.homogeneous_redundancy) {
|
||||
case 1:
|
||||
return os(host) + cpu_fine(host);
|
||||
case 2:
|
||||
switch (os(host)) {
|
||||
case Windows:
|
||||
case Linux:
|
||||
return os(host);
|
||||
case Darwin:
|
||||
return os(host) + cpu_coarse(host);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool hr_unknown_platform(HOST& host) {
|
||||
if (OS(host) == noos) return true;
|
||||
if (CPU(host) == nocpu) return true;
|
||||
return false;
|
||||
switch (config.homogeneous_redundancy) {
|
||||
case 1:
|
||||
if (os(host) == noos) return true;
|
||||
if (cpu_fine(host) == nocpu) return true;
|
||||
return false;
|
||||
case 2:
|
||||
switch (os(host)) {
|
||||
case Windows:
|
||||
case Linux:
|
||||
case Darwin:
|
||||
switch(cpu_coarse(host)) {
|
||||
case Intel:
|
||||
case Macintosh:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// quick check for platform compatibility
|
||||
|
@ -145,11 +177,8 @@ bool hr_unknown_platform(HOST& host) {
|
|||
bool already_sent_to_different_platform_quick(
|
||||
SCHEDULER_REQUEST& sreq, WORKUNIT& wu
|
||||
) {
|
||||
int host_hr_class = HR_CLASS(sreq.host);
|
||||
if (wu.hr_class) {
|
||||
if (host_hr_class != wu.hr_class) {
|
||||
return true;
|
||||
}
|
||||
if (wu.hr_class && (hr_class(sreq.host) != wu.hr_class)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -181,7 +210,7 @@ bool already_sent_to_different_platform_careful(
|
|||
return true;
|
||||
}
|
||||
wreq.hr_reject_temp = false;
|
||||
int host_hr_class = HR_CLASS(sreq.host);
|
||||
int host_hr_class = hr_class(sreq.host);
|
||||
if (wu_hr_class) {
|
||||
if (host_hr_class != wu_hr_class) {
|
||||
wreq.hr_reject_temp = true;
|
||||
|
|
Loading…
Reference in New Issue