diff --git a/aclocal.m4 b/aclocal.m4
index a18d8797e0..d6b8c21696 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1106,7 +1106,7 @@ AC_DEFUN([SAH_HEADER_STDCXX],[
#
# Revision Log:
# $Log$
-# Revision 1.144 2004/09/04 23:42:25 davea
+# Revision 1.145 2004/09/10 21:02:04 davea
# *** empty log message ***
#
# Revision 1.1 2003/12/11 18:38:24 korpela
diff --git a/checkin_notes b/checkin_notes
index 4cd8907a78..7432d4b7c5 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -17270,3 +17270,17 @@ David 10 Sept 2004
sched/
validator.C
+
+David 10 Sept 2004
+ - more changes for locality scheduling
+
+ client/
+ client_state.C
+ client_types.C
+ cs_scheduler.C
+ sched/
+ Makefile.am
+ sched_config.C,h
+ sched_locality.h (new)
+ sched_send.C
+ server_types.C,h
diff --git a/client/client_state.C b/client/client_state.C
index ad1397737d..98c87ff241 100644
--- a/client/client_state.C
+++ b/client/client_state.C
@@ -776,7 +776,7 @@ bool CLIENT_STATE::garbage_collect() {
*rp, 0, "WU download error: %s", error_msgs.c_str()
);
} else if (wup->avp && wup->avp->had_failure(failnum)) {
- avp->get_file_errors(error_msgs);
+ wup->avp->get_file_errors(error_msgs);
report_result_error(
*rp, 0, "app_version download error: %s", error_msgs.c_str()
);
diff --git a/client/client_types.C b/client/client_types.C
index e3bdeb6124..1adb888c40 100644
--- a/client/client_types.C
+++ b/client/client_types.C
@@ -481,12 +481,12 @@ char* PROJECT::get_project_name() {
}
}
+#if 0
// comment? what does this do?
// Does it do a lot of disk access to do it??
//
bool PROJECT::associate_file(FILE_INFO* fip) {
return 0;
-#if 0
double space_made = 0;
if (gstate.get_more_disk_space(this, fip->nbytes)) {
size += fip->nbytes;
@@ -501,8 +501,8 @@ bool PROJECT::associate_file(FILE_INFO* fip) {
} else {
return false;
}
-#endif
}
+#endif
int APP::parse(MIOFILE& in) {
char buf[256];
@@ -541,6 +541,7 @@ FILE_INFO::FILE_INFO() {
uploaded = false;
upload_when_present = false;
sticky = false;
+ report_on_rpc = false;
signature_required = false;
is_user_file = false;
pers_file_xfer = NULL;
@@ -667,6 +668,7 @@ int FILE_INFO::parse(MIOFILE& in, bool from_server) {
else if (match_tag(buf, "")) uploaded = true;
else if (match_tag(buf, "")) upload_when_present = true;
else if (match_tag(buf, "")) sticky = true;
+ else if (match_tag(buf, "")) report_on_rpc = true;
else if (match_tag(buf, "")) signature_required = true;
#if 0
else if (parse_int(buf, "", (int&)time_last_used)) continue;
@@ -729,6 +731,7 @@ int FILE_INFO::write(MIOFILE& out, bool to_server) {
if (uploaded) out.printf(" \n");
if (upload_when_present) out.printf(" \n");
if (sticky) out.printf(" \n");
+ if (report_on_rpc) out.printf(" \n");
if (signature_required) out.printf(" \n");
if (strlen(file_signature)) out.printf(" \n%s\n", file_signature);
#if 0
diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C
index 8cff504c0d..6a867ec148 100644
--- a/client/cs_scheduler.C
+++ b/client/cs_scheduler.C
@@ -288,6 +288,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p, double work_req) {
fprintf(f,
" \n"
" %s\n"
+ " \n"
" \n",
fip->name
);
diff --git a/doc/validate.php b/doc/validate.php
index 6fd6ee2c1b..0885c9e3a8 100644
--- a/doc/validate.php
+++ b/doc/validate.php
@@ -28,7 +28,8 @@ be granted for correct results for this workunit.
If, when an output file for a result has a nonrecoverable error
(i.e. the directory is there but the file isn't),
-then it must set the result's outcome to VALIDATE_ERROR and update the result.
+then it must set the result's outcome (in memory, not database)
+to VALIDATE_ERROR.
Note: the function try_fopen() (in lib/util.C) can be used
to detect recoverable/nonrecoverable errors.
@@ -61,7 +62,8 @@ In the absence of errors,
it sets the new result's validate_state to either VALID or INVALID.
If it has a nonrecoverable error reading an output file of either result,
-it must set the new result's outcome to VALIDATE_ERROR and update it.
+it must set the new result's outcome (in memory, not database)
+to VALIDATE_ERROR.
If it has a recoverable error while reading an output file of either result,
it returns retry=true,
diff --git a/sched/Makefile.am b/sched/Makefile.am
index b8d5cd2172..71919a6cd3 100644
--- a/sched/Makefile.am
+++ b/sched/Makefile.am
@@ -57,6 +57,7 @@ cgi_SOURCES = \
handle_request.C \
main.C \
sched_send.C \
+ sched_locality.C \
server_types.C \
../lib/synch.C
diff --git a/sched/Makefile.in b/sched/Makefile.in
index 4361adf277..49b1f1856b 100644
--- a/sched/Makefile.in
+++ b/sched/Makefile.in
@@ -232,6 +232,7 @@ cgi_SOURCES = \
handle_request.C \
main.C \
sched_send.C \
+ sched_locality.C \
server_types.C \
../lib/synch.C
@@ -358,7 +359,8 @@ noinst_PROGRAMS = cgi$(EXEEXT) feeder$(EXEEXT) db_dump$(EXEEXT) \
PROGRAMS = $(noinst_PROGRAMS)
am_cgi_OBJECTS = handle_request.$(OBJEXT) main.$(OBJEXT) \
- sched_send.$(OBJEXT) server_types.$(OBJEXT) synch.$(OBJEXT)
+ sched_send.$(OBJEXT) sched_locality.$(OBJEXT) \
+ server_types.$(OBJEXT) synch.$(OBJEXT)
cgi_OBJECTS = $(am_cgi_OBJECTS)
cgi_LDADD = $(LDADD)
cgi_LDFLAGS =
@@ -486,6 +488,7 @@ am__depfiles_maybe = depfiles
@AMDEP_TRUE@ ./$(DEPDIR)/sample_dummy_assimilator.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/sample_trivial_validator.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/sched_config.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/sched_locality.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/sched_msgs.Po ./$(DEPDIR)/sched_send.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/sched_shmem.Po \
@AMDEP_TRUE@ ./$(DEPDIR)/sched_util.Po ./$(DEPDIR)/send_file.Po \
@@ -710,6 +713,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample_dummy_assimilator.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample_trivial_validator.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_config.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_locality.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_msgs.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_send.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_shmem.Po@am__quote@
diff --git a/sched/sched_config.C b/sched/sched_config.C
index 8ba7967703..4bd0c60925 100644
--- a/sched/sched_config.C
+++ b/sched/sched_config.C
@@ -61,6 +61,9 @@ int SCHED_CONFIG::parse(char* buf) {
if (match_tag(buf, "")) {
homogeneous_redundancy = true;
}
+ if (match_tag(buf, "")) {
+ locality_scheduling = true;
+ }
if (match_tag(buf, "")) {
msg_to_host = true;
}
diff --git a/sched/sched_config.h b/sched/sched_config.h
index a80327c401..5b120fea8b 100644
--- a/sched/sched_config.h
+++ b/sched/sched_config.h
@@ -44,6 +44,7 @@ public:
int max_wus_to_send;
bool non_cpu_intensive;
bool homogeneous_redundancy;
+ bool locality_scheduling;
bool ignore_upload_certificates;
bool enforce_delay_bound;
bool deletion_policy_priority;
diff --git a/sched/sched_locality.h b/sched/sched_locality.h
new file mode 100644
index 0000000000..3361cc26d9
--- /dev/null
+++ b/sched/sched_locality.h
@@ -0,0 +1,4 @@
+extern void send_work_locality(
+ SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
+ WORK_REQ& wreq, SCHED_SHMEM& ss
+);
diff --git a/sched/sched_send.C b/sched/sched_send.C
index 6afa57dd39..4adb534536 100644
--- a/sched/sched_send.C
+++ b/sched/sched_send.C
@@ -33,6 +33,7 @@ using namespace std;
#include "main.h"
#include "sched_msgs.h"
#include "sched_send.h"
+#include "sched_locality.h"
#ifdef _USING_FCGI_
#include "fcgi_stdio.h"
@@ -741,13 +742,18 @@ int send_work(
wreq.seconds_to_fill = MIN_SECONDS_TO_SEND;
}
- // give priority to results that were infeasible for some other host
- //
- wreq.infeasible_only = true;
- scan_work_array(wreq, sreq, reply, platform, ss);
+ if (config.locality_scheduling) {
+ wreq.infeasible_only = false;
+ send_work_locality(sreq, reply, platform, wreq, ss);
+ } else {
+ // give priority to results that were infeasible for some other host
+ //
+ wreq.infeasible_only = true;
+ scan_work_array(wreq, sreq, reply, platform, ss);
- wreq.infeasible_only = false;
- scan_work_array(wreq, sreq, reply, platform, ss);
+ wreq.infeasible_only = false;
+ scan_work_array(wreq, sreq, reply, platform, ss);
+ }
#if 0
// huh???
diff --git a/sched/server_types.C b/sched/server_types.C
index c92efe57fa..94f8f2385e 100644
--- a/sched/server_types.C
+++ b/sched/server_types.C
@@ -45,6 +45,20 @@ int CLIENT_APP_VERSION::parse(FILE* f) {
return ERR_XML_PARSE;
}
+int FILE_INFO::parse(FILE* f) {
+ char buf[256];
+
+ memset(this, 0, sizeof(FILE_INFO));
+ while (fgets(buf, 256, f)) {
+ if (match_tag(buf, "")) {
+ if (!strlen(name)) return ERR_XML_PARSE;
+ return 0;
+ }
+ if (parse_str(buf, "", name, 256)) continue;
+ }
+ return ERR_XML_PARSE;
+}
+
SCHEDULER_REQUEST::SCHEDULER_REQUEST() {
}
@@ -149,6 +163,13 @@ int SCHEDULER_REQUEST::parse(FILE* fin) {
if (!retval) {
msgs_from_host.push_back(md);
}
+ }
+ else if (match_tag(buf, "")) {
+ FILE_INFO fi;
+ retval = fi.parse(fin);
+ if (!retval) {
+ file_infos.push_back(fi);
+ }
} else {
log_messages.printf(SCHED_MSG_LOG::NORMAL, "SCHEDULER_REQUEST::parse(): unrecognized: %s\n", buf);
}
@@ -342,6 +363,13 @@ int SCHEDULER_REPLY::write(FILE* fout) {
if (config.non_cpu_intensive) {
fprintf(fout, "\n");
}
+
+ for (i=0; i%s\n",
+ file_deletes[i].name
+ );
+ }
end:
fprintf(fout,
"\n"
diff --git a/sched/server_types.h b/sched/server_types.h
index 2a807b03ac..6848ab2436 100644
--- a/sched/server_types.h
+++ b/sched/server_types.h
@@ -55,6 +55,8 @@ struct WORK_REQ {
//
struct FILE_INFO {
char name[256];
+
+ int parse(FILE*);
};
struct MSG_FROM_HOST_DESC {