From 0483da30f4f6023c2823d81530e3fbd02337b51a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 26 Aug 2012 21:24:18 +0000 Subject: [PATCH] - server: compile fix - server: add nfiles_on_host(), a support function for "locality scheduling lite". svn path=/trunk/boinc/; revision=26061 --- checkin_notes | 13 ++++++++++++ client/client_state.cpp | 5 +++-- sched/sched_send.cpp | 47 ++++++++++++++++++++++++++++++----------- vda/sched_vda.cpp | 1 + vda/vda_lib.h | 2 ++ 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/checkin_notes b/checkin_notes index 01b5b79f1f..5c2aa50305 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5748,3 +5748,16 @@ David 24 Aug 2012 html/ops/ db_update.php manage_apps.php + +David 26 Aug 2012 + - server: compile fix + - server: add nfiles_on_host(), + a support function for "locality scheduling lite". + + vda/ + vda_lib.h + sched_vda.cpp + client/ + client_state.cpp + sched/ + sched_send.cpp diff --git a/client/client_state.cpp b/client/client_state.cpp index ad38a4e3c3..1f8d916359 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -564,12 +564,13 @@ int CLIENT_STATE::init() { // set_client_state_dirty("init"); - // initialize GUI RPC data structures before we start accepting - // GUI RPC's. + // check for initialization files // acct_mgr_info.init(); project_init.init(); + // set up for handling GUI RPCs + // if (!no_gui_rpc) { // When we're running at boot time, // it may be a few seconds before we can socket/bind/listen. diff --git a/sched/sched_send.cpp b/sched/sched_send.cpp index 47c066e481..6d663b4e10 100644 --- a/sched/sched_send.cpp +++ b/sched/sched_send.cpp @@ -37,19 +37,20 @@ #include "synch.h" #include "credit.h" -#include "sched_types.h" -#include "sched_shmem.h" -#include "sched_config.h" -#include "sched_util.h" -#include "sched_main.h" -#include "sched_array.h" -#include "sched_msgs.h" -#include "sched_hr.h" #include "hr.h" -#include "sched_locality.h" -#include "sched_timezone.h" +#include "sched_array.h" #include "sched_assign.h" +#include "sched_config.h" #include "sched_customize.h" +#include "sched_hr.h" +#include "sched_locality.h" +#include "sched_main.h" +#include "sched_msgs.h" +#include "sched_shmem.h" +#include "sched_score.h" +#include "sched_timezone.h" +#include "sched_types.h" +#include "sched_util.h" #include "sched_version.h" #include "sched_send.h" @@ -62,10 +63,32 @@ // const double DEFAULT_RAM_SIZE = 64000000; -void send_work_matchmaker(); - int preferred_app_message_index=0; +// return the number of sticky files present on host, used by job +// +int nfiles_on_host(WORKUNIT& wu) { + MIOFILE mf; + mf.init_buf_read(wu.xml_doc); + XML_PARSER xp(&mf); + int n=0; + while (!xp.get_tag()) { + if (xp.match_tag("file_info")) { + FILE_INFO fi; + int retval = fi.parse(xp); + if (retval) continue; + for (unsigned i=0; ifile_infos.size(); i++) { + FILE_INFO& fi2 = g_request->file_infos[i]; + if (!strstr(fi.name, fi2.name)) { + n++; + break; + } + } + } + } + return n; +} + const char* infeasible_string(int code) { switch (code) { case INFEASIBLE_MEM: return "Not enough memory"; diff --git a/vda/sched_vda.cpp b/vda/sched_vda.cpp index 4a62b72917..0aaad3c922 100644 --- a/vda/sched_vda.cpp +++ b/vda/sched_vda.cpp @@ -26,6 +26,7 @@ #include #include +#include #include "filesys.h" diff --git a/vda/vda_lib.h b/vda/vda_lib.h index c1faa789b0..565293da47 100644 --- a/vda/vda_lib.h +++ b/vda/vda_lib.h @@ -22,6 +22,8 @@ #include #include +#include +#include #include "boinc_db.h"