- scheduler: send <dont_use_dcf> only if client is 7.0.28 or later.

svn path=/trunk/boinc/; revision=25759
This commit is contained in:
David Anderson 2012-06-14 17:14:52 +00:00
parent 7add13f1af
commit e9362c80ff
9 changed files with 82 additions and 39 deletions

View File

@ -4317,3 +4317,15 @@ Charlie 13 June 2012
client/
coproc_detect.cpp
David 14 June 2012
- scheduler: send <dont_use_dcf> only if client is 7.0.28 or later.
sched/
sched_types.cpp
vda/
ssim.cpp
vdad.cpp
des.h
stats.cpp,h
vda_lib.cpp,h

View File

@ -620,11 +620,12 @@ int SCHEDULER_REPLY::write(FILE* fout, SCHEDULER_REQUEST& sreq) {
fprintf(fout,
"Content-type: text/xml\n\n"
"<scheduler_reply>\n"
"<scheduler_version>%d</scheduler_version>\n"
//"<dont_use_dcf/>\n"
,
"<scheduler_version>%d</scheduler_version>\n",
BOINC_MAJOR_VERSION*100+BOINC_MINOR_VERSION
);
if (sreq.core_client_version >= 70028) {
fprintf(fout, "<dont_use_dcf/>\n");
}
if (strlen(config.master_url)) {
fprintf(fout,
"<master_url>%s</master_url>\n",

View File

@ -18,6 +18,9 @@
// The world's smallest discrete event simulator.
// Uses the STL "heap" data structure for efficient event storage.
#ifndef _DES_
#define _DES_
#include <vector>
#include <algorithm>
@ -32,7 +35,7 @@ struct EVENT {
virtual void handle(){}
};
bool compare(EVENT* e1, EVENT* e2) {
inline bool compare(EVENT* e1, EVENT* e2) {
return (e1->t > e2->t);
}
@ -77,3 +80,7 @@ struct SIMULATOR {
}
}
};
extern SIMULATOR sim;
#endif

View File

@ -38,6 +38,7 @@
#include <limits.h>
#include "des.h"
#include "stats.h"
#include "vda_lib.h"
using std::set;
@ -119,6 +120,10 @@ char* now_str() {
return time_str(sim.now);
}
void show_msg(char* msg) {
printf("%s: %s", time_str(sim.now), msg);
}
struct CHUNK;
struct CHUNK_ON_HOST;
struct META_CHUNK;
@ -204,8 +209,8 @@ struct SIM_FILE : VDA_FILE_AUX, EVENT {
} else {
meta_chunk = new META_CHUNK(this, NULL, size, 0, id);
#ifdef EVENT_DEBUG
printf("created file %d: size %f encoded size %f\n",
id, size, disk_usage.value
printf("created file %d: size %f GB encoded size %f GB\n",
id, size/1e9, disk_usage.value/1e9
);
t = sim.now + 500.*86400;
sim.insert(this);
@ -451,10 +456,12 @@ void CHUNK::download_complete() {
}
int META_CHUNK::encode() {
printf("%s: encoding metachunk %s\n", now_str(), name);
return 0;
}
int META_CHUNK::decode() {
printf("%s: decoding metachunk %s\n", now_str(), name);
return 0;
}

View File

@ -19,23 +19,9 @@
#include <stdio.h>
#include <limits.h>
#include "vda_lib.h"
#include "stats.h"
//#define SAMPLE_DEBUG
char* time_str(double t) {
static char buf[256];
int n = (int)t;
int nsec = n % 60;
n /= 60;
int nmin = n % 60;
n /= 60;
int nhour = n % 24;
n /= 24;
sprintf(buf, "%4d days %02d:%02d:%02d", n, nhour, nmin, nsec);
return buf;
}
void STATS_ITEM::init(const char* n, const char* filename, STATS_KIND k) {
f = fopen(filename, "w");
strcpy(name, n);
@ -56,19 +42,23 @@ void STATS_ITEM::init(const char* n, const char* filename, STATS_KIND k) {
}
void STATS_ITEM::sample(double v, bool collecting_stats, double now) {
#ifdef SAMPLE_DEBUG
switch (kind) {
case DISK:
printf("%s: %s: %f GB -> %f GB\n", now_str(), name, value/1e9, v/1e9);
break;
case NETWORK:
printf("%s: %s: %f Mbps -> %f Mbps\n", now_str(), name, value/1e6, v/1e6);
break;
case FAULT_TOLERANCE:
printf("%s: %s: %.0f -> %.0f\n", now_str(), name, value, v);
break;
char buf[256];
if (value != v) {
switch (kind) {
case DISK:
sprintf(buf, "%s: %f GB -> %f GB\n", name, value/1e9, v/1e9);
show_msg(buf);
break;
case NETWORK:
sprintf(buf, "%s: %f Mbps -> %f Mbps\n", name, value/1e6, v/1e6);
show_msg(buf);
break;
case FAULT_TOLERANCE:
sprintf(buf, "%s: %.0f -> %.0f\n", name, value, v);
show_msg(buf);
break;
}
}
#endif
double old_val = value;
value = v;
if (!collecting_stats) return;

View File

@ -19,6 +19,11 @@
// (server disk usage, up/download rate, fault tolerance level)
//
#ifndef _STATS_
#define _STATS_
#include <stdio.h>
typedef enum {DISK, NETWORK, FAULT_TOLERANCE} STATS_KIND;
struct STATS_ITEM {
@ -40,4 +45,4 @@ struct STATS_ITEM {
void print_summary(FILE* f, double now);
};
extern char* time_str(double);
#endif

View File

@ -258,10 +258,10 @@ int META_CHUNK::recovery_action(double now) {
//
for (i=0; i<j; i++) {
DATA_UNIT* c = recoverable[i];
printf(" Min failures of %s: %d\n", c->name, c->min_failures);
//printf(" Min failures of %s: %d\n", c->name, c->min_failures);
min_failures += c->min_failures;
}
printf(" our min failures: %d\n", min_failures);
//printf(" our min failures: %d\n", min_failures);
}
return 0;
}
@ -277,6 +277,8 @@ bool CHUNK::download_in_progress() {
int CHUNK::recovery_action(double now) {
int retval;
char buf[256];
VDA_FILE_AUX* fp = parent->dfile;
if (data_now_present) {
present_on_server = true;
@ -309,9 +311,8 @@ int CHUNK::recovery_action(double now) {
present_on_server = false;
status = RECOVERABLE;
min_failures = fp->policy.replication;
#ifdef EVENT_DEBUG
printf("%s: %s replicated, removing from server\n", now_str(), name);
#endif
sprintf(buf, "%s replicated, removing from server\n", name);
show_msg(buf);
parent->dfile->disk_usage.sample_inc(
-size,
fp->collecting_stats(),
@ -471,3 +472,16 @@ int META_CHUNK::expand() {
}
return 0;
}
char* time_str(double t) {
static char buf[256];
int n = (int)t;
int nsec = n % 60;
n /= 60;
int nmin = n % 60;
n /= 60;
int nhour = n % 24;
n /= 24;
sprintf(buf, "%4d days %02d:%02d:%02d", n, nhour, nmin, nsec);
return buf;
}

View File

@ -33,6 +33,9 @@
//
#define VDA_HOST_TIMEOUT (86400*4)
extern void show_msg(char*);
extern char* time_str(double);
struct META_CHUNK;
struct VDA_FILE_AUX : VDA_FILE {

View File

@ -42,6 +42,10 @@ using std::set;
#include "vda_lib.h"
void show_msg(char* msg) {
printf("%s", msg);
}
// return the name of a file created by Jerasure's encoder
//
// encoder creates files with names of the form