*** empty log message ***

svn path=/trunk/boinc/; revision=11492
This commit is contained in:
David Anderson 2006-11-07 17:40:55 +00:00
parent dd27ab74ea
commit 7767ca1eb8
14 changed files with 60 additions and 49 deletions

View File

@ -12362,3 +12362,24 @@ Rom 6 Nov 2006
clientgui/
sg_DlgPreferences.cpp
David 7 Nov 2006
- validate_util.C: fix tag ("file_info", not "file")
- MIOFILE: when we're reading from a buffer,
make it a const char* instead of char*.
Doing this requires limiting ungetc() to push only
the character that was previously read (which is OK).
- scheduler: removed SCHED_SHMEM& arg from wu_is_infeasible()
- fix compile warnings
lib/
gui_rpc_client_ops.C
miofile.C,h
parse.C,h
sched/
handle_request.C
sched_array.C
sched_locality.C
sched_send.C,h
server_types.C,h
validate_util.C

View File

@ -2113,7 +2113,7 @@ int RPC_CLIENT::get_global_prefs_override_struct(GLOBAL_PREFS& prefs) {
retval = get_global_prefs_override(s);
if (retval) return retval;
mf.init_buf_read((char*)s.c_str());
mf.init_buf_read(s.c_str());
XML_PARSER xp(&mf);
prefs.parse(xp, "", found_venue);
return 0;

View File

@ -50,7 +50,7 @@ void MIOFILE::init_file(FILE* _f) {
f = _f;
}
void MIOFILE::init_buf_read(char* _buf) {
void MIOFILE::init_buf_read(const char* _buf) {
buf = _buf;
}
@ -99,9 +99,12 @@ int MIOFILE::_ungetc(int c) {
#else
return ungetc(c, f);
#endif
} else {
buf--;
// NOTE: we assume that the char being pushed
// is what's already there
//*buf = c;
}
buf--;
*buf = c;
return c;
}

View File

@ -49,13 +49,13 @@ class MIOFILE {
MFILE* mf;
FILE* f;
char* wbuf;
char* buf;
const char* buf;
public:
MIOFILE();
~MIOFILE();
void init_mfile(MFILE*);
void init_file(FILE*);
void init_buf_read(char*);
void init_buf_read(const char*);
void init_buf_write(char*);
int printf(const char* format, ...);
char* fgets(char*, int);

View File

@ -275,17 +275,22 @@ bool str_replace(char* str, const char* substr, const char* replacement) {
// then return the contents of that element.
// Otherwise strip out all <venue> elements
//
void extract_venue(char* in, char* venue_name, char* out) {
char* p, *q;
void extract_venue(const char* in, const char* venue_name, char* out) {
const char* p, *q;
char* wp;
char buf[256];
sprintf(buf, "<venue name=\"%s\">", venue_name);
p = strstr(in, buf);
if (p) {
// prefs contain the specified venue
//
p += strlen(buf);
strcpy(out, p);
q = strstr(out, "</venue");
if (q) *q = 0;
wp = strstr(out, "</venue");
if (wp) *wp = 0;
} else {
// prefs don't contain the specified venue
//
q = in;
strcpy(out, "");
while (1) {

View File

@ -116,7 +116,7 @@ extern bool str_replace(char* str, const char* old, const char* neww);
extern char* sgets(char* buf, int len, char* &in);
extern void xml_escape(const char*, char*);
extern void xml_unescape(const char*, char*);
extern void extract_venue(char*, char*, char*);
extern void extract_venue(const char*, const char*, char*);
extern int skip_unrecognized(char* buf, FILE*);
#endif

View File

@ -501,12 +501,12 @@ int handle_global_prefs(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
bool same_account = !strcmp(
sreq.global_prefs_source_email_hash, reply.email_hash
);
unsigned master_mod_time=0, db_mod_time=0;
int master_mod_time=0, db_mod_time=0;
if (have_master_prefs) {
parse_int(sreq.global_prefs_xml, "<mod_time>", (int&)master_mod_time);
parse_int(sreq.global_prefs_xml, "<mod_time>", master_mod_time);
}
if (have_db_prefs) {
parse_int(reply.user.global_prefs, "<mod_time>", (int&)db_mod_time);
parse_int(reply.user.global_prefs, "<mod_time>", db_mod_time);
}
// decide which prefs to use for sched decisions

View File

@ -82,15 +82,15 @@ void scan_work_array(
// If we are looking for beta results and result is not a beta result
// then move on
//
APP* app = ss.lookup_app(wu_result.workunit.appid);
app = ss.lookup_app(wu_result.workunit.appid);
if (app == NULL) continue; // this should never happen
if (reply.wreq.beta_only) {
if (!app->beta) {
continue;
}
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG,
"[HOST#%d] beta work found. Result id %d \n",
reply.host.id
"[HOST#%d] beta work found. [RESULT#%d]\n",
reply.host.id, wu_result.resultid
);
} else {
if (app->beta) {
@ -128,7 +128,7 @@ void scan_work_array(
// don't send if host can't handle it
//
wu = wu_result.workunit;
if (wu_is_infeasible(wu, sreq, reply, ss)) {
if (wu_is_infeasible(wu, sreq, reply)) {
log_messages.printf(
SCHED_MSG_LOG::MSG_DEBUG, "[HOST#%d] [WU#%d %s] WU is infeasible\n",
reply.host.id, wu.id, wu.name

View File

@ -287,7 +287,7 @@ static int possibly_send_result(
// 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, ss)) {
if (wu_is_infeasible(wu, sreq, reply)) {
return ERR_INSUFFICIENT_RESOURCE;
}

View File

@ -237,14 +237,11 @@ static double estimate_wallclock_duration(
if (reply.host.cpu_efficiency) {
ewd /= reply.host.cpu_efficiency;
}
#ifdef EINSTEIN_AT_HOME
log_messages.printf(
SCHED_MSG_LOG::MSG_DEBUG,
"est cpu dur %f; running_frac %f; rsf %f; est %f\n",
ecd, running_frac, request.resource_share_fraction, ewd
);
#endif
return ewd;
}
@ -309,9 +306,10 @@ static int get_host_info(SCHEDULER_REPLY& reply) {
int find_preferred_app_index(SCHEDULER_REPLY& reply, int appid) {
int result = -1;
for (int i=0; i<reply.wreq.host_info.preferred_apps.size(); i++) {
unsigned int i;
for (i=0; i<reply.wreq.host_info.preferred_apps.size(); i++) {
if (reply.wreq.host_info.preferred_apps[i].appid == appid ) {
result = i;
result = (int)i;
break;
}
}
@ -330,8 +328,7 @@ int find_preferred_app_index(SCHEDULER_REPLY& reply, int appid) {
// In particular it doesn't enforce the one-result-per-user-per-wu rule
//
int wu_is_infeasible(
WORKUNIT& wu, SCHEDULER_REQUEST& request, SCHEDULER_REPLY& reply,
SCHED_SHMEM& ss
WORKUNIT& wu, SCHEDULER_REQUEST& request, SCHEDULER_REPLY& reply
) {
int reason = 0;
unsigned int i;

View File

@ -49,7 +49,7 @@ extern bool app_core_compatible(WORK_REQ& wreq, APP_VERSION& av);
#define INFEASIBLE_WORK_BUF 8
#define INFEASIBLE_APP_SETTING 16
extern int wu_is_infeasible(WORKUNIT&, SCHEDULER_REQUEST&, SCHEDULER_REPLY&, SCHED_SHMEM&);
extern int wu_is_infeasible(WORKUNIT&, SCHEDULER_REQUEST&, SCHEDULER_REPLY&);
extern double max_allowable_disk(SCHEDULER_REQUEST&, SCHEDULER_REPLY&);

View File

@ -866,7 +866,7 @@ int HOST::parse_disk_usage(FILE* fin) {
return ERR_XML_PARSE;
}
void GLOBAL_PREFS::parse(char* buf, char* venue) {
void GLOBAL_PREFS::parse(const char* buf, const char* venue) {
char buf2[LARGE_BLOB_SIZE];
double dtemp;

View File

@ -104,7 +104,7 @@ struct GLOBAL_PREFS {
double ram_max_used_busy_frac;
double ram_max_used_idle_frac;
void parse(char* buf, char* venue);
void parse(const char* buf, const char* venue);
void defaults();
};

View File

@ -38,27 +38,12 @@
using std::vector;
using std::string;
#if 0
// get the name of a result's (first) output file
//
int get_output_file_path(RESULT const& result, string& path_str) {
char buf[256], path[1024];
if (!parse_str(result.xml_doc_out, "<name>", buf, sizeof(buf))) {
return ERR_XML_PARSE;
}
dir_hier_path(buf, config.upload_dir, config.uldl_dir_fanout, path);
path_str = path;
return 0;
}
#endif
static int parse_filename(XML_PARSER& xp, string& name) {
char tag[256];
bool is_tag, found=false;
while (!xp.get(tag, sizeof(tag), is_tag)) {
if (!is_tag) continue;
if (!strcmp(tag, "/file")) {
if (!strcmp(tag, "/file_info")) {
return found?0:ERR_XML_PARSE;
}
if (xp.parse_string(tag, "name", name)) {
@ -73,11 +58,11 @@ int get_output_file_path(RESULT const& result, string& path_str) {
bool is_tag;
string name;
MIOFILE mf;
mf.init_buf_read((char*)(result.xml_doc_out));
mf.init_buf_read(result.xml_doc_out);
XML_PARSER xp(&mf);
while (!xp.get(tag, sizeof(tag), is_tag)) {
if (!is_tag) continue;
if (!strcmp(tag, "file")) {
if (!strcmp(tag, "file_info")) {
int retval = parse_filename(xp, name);
if (retval) return retval;
dir_hier_path(name.c_str(), config.upload_dir, config.uldl_dir_fanout, path);
@ -93,12 +78,12 @@ int get_output_file_paths(RESULT const& result, vector<string>& paths) {
bool is_tag;
MIOFILE mf;
string name;
mf.init_buf_read((char*)(result.xml_doc_out));
mf.init_buf_read(result.xml_doc_out);
XML_PARSER xp(&mf);
paths.clear();
while (!xp.get(tag, sizeof(tag), is_tag)) {
if (!is_tag) continue;
if (!strcmp(tag, "file")) {
if (!strcmp(tag, "file_info")) {
int retval = parse_filename(xp, name);
if (retval) return retval;
dir_hier_path(name.c_str(), config.upload_dir, config.uldl_dir_fanout, path);