diff --git a/checkin_notes b/checkin_notes index 6702343181..ce3145bbe8 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2498,3 +2498,11 @@ David 2 Mar 2009 handle_request.cpp sched_config.cpp,h sched_send.cpp + +David 2 Mar 2009 + - scheduler: add + and options + From Bernd M. + sched/ + sched_config.cpp,h + sched_locality.cpp diff --git a/sched/sched_config.cpp b/sched/sched_config.cpp index abf2b02584..1b8725d4a6 100644 --- a/sched/sched_config.cpp +++ b/sched/sched_config.cpp @@ -54,6 +54,8 @@ int SCHED_CONFIG::parse(FILE* f) { memset(this, 0, sizeof(*this)); ban_os = new vector; ban_cpu = new vector; + locality_scheduling_workunit_file = new vector; + locality_scheduling_sticky_file = new vector; max_wus_to_send = 10; default_disk_max_used_gb = 100.; default_disk_max_used_pct = 50.; @@ -108,6 +110,24 @@ int SCHED_CONFIG::parse(FILE* f) { if (xp.parse_int(tag, "uldl_dir_fanout", uldl_dir_fanout)) continue; if (xp.parse_int(tag, "locality_scheduling_wait_period", locality_scheduling_wait_period)) continue; if (xp.parse_int(tag, "locality_scheduling_send_timeout", locality_scheduling_send_timeout)) continue; + if (xp.parse_str(tag, "locality_scheduling_workunit_file", buf, sizeof(buf))) { + retval = regcomp(&re, buf, REG_EXTENDED|REG_NOSUB); + if (retval) { + log_messages.printf(MSG_CRITICAL, "BAD REGEXP: %s\n", buf); + } else { + locality_scheduling_workunit_file->push_back(re); + } + continue; + } + if (xp.parse_str(tag, "locality_scheduling_sticky_file", buf, sizeof(buf))) { + retval = regcomp(&re, buf, REG_EXTENDED|REG_NOSUB); + if (retval) { + log_messages.printf(MSG_CRITICAL, "BAD REGEXP: %s\n", buf); + } else { + locality_scheduling_sticky_file->push_back(re); + } + continue; + } if (xp.parse_double(tag, "locality_scheduler_fraction", locality_scheduler_fraction)) continue; if (xp.parse_int(tag, "min_core_client_version", min_core_client_version)) continue; if (xp.parse_int(tag, "min_core_client_version_announced", min_core_client_version_announced)) continue; diff --git a/sched/sched_config.h b/sched/sched_config.h index 010d9ea31c..5181bda0ba 100644 --- a/sched/sched_config.h +++ b/sched/sched_config.h @@ -64,6 +64,8 @@ public: int uldl_dir_levels; int locality_scheduling_wait_period; int locality_scheduling_send_timeout; + vector *locality_scheduling_workunit_file; + vector *locality_scheduling_sticky_file; double locality_scheduler_fraction; int min_core_client_version; int min_core_client_version_announced; diff --git a/sched/sched_locality.cpp b/sched/sched_locality.cpp index daffdf5e6a..ce9435969f 100644 --- a/sched/sched_locality.cpp +++ b/sched/sched_locality.cpp @@ -997,6 +997,25 @@ bool file_info_order(const FILE_INFO& fi1, const FILE_INFO& fi2) { return false; } +bool is_sticky_file(char*fname) { + for (unsigned int i=0; isize(); i++) { + if (!regexec(&((*config.locality_scheduling_sticky_file)[i]), fname, 0, NULL, 0)) { + return true; + } + } + return false; +} + + +bool is_workunit_file(char*fname) { + for (unsigned int i=0; isize(); i++) { + if (!regexec(&((*config.locality_scheduling_workunit_file)[i]), fname, 0, NULL, 0)) { + return true; + } + } + return false; +} + void send_work_locality() { int i, nsent, nfiles, j; @@ -1024,16 +1043,22 @@ void send_work_locality() { strncmp("l1_", fname, 3) && strncmp("L1_", fname, 3) ); - +#if 0 // here, put a list of patterns of ALL files that are still needed to be // sticky, but are not 'data' files for locality scheduling purposes, eg they // do not have associated WU with names FILENAME__* // - bool data_files = strncmp("grid_", fname, 5) && strncmp("skygrid_", fname, 8) && strncmp("Config_", fname, 7); - if (strlen(fname)==15 && !strncmp("l1_", fname, 3)) data_files = false; + bool data_files = + strncmp("grid_", fname, 5) + && strncmp("skygrid_", fname, 8) + && strncmp("Config_", fname, 7); + if (strlen(fname)==15 && !strncmp("l1_", fname, 3)) { + data_files = false; + } +#endif - if (!useful) { + if (is_workunit_file(fname)) { // these files WILL be deleted from the host // g_request->files_not_needed.push_back(eah_copy[i]); @@ -1043,7 +1068,7 @@ void send_work_locality() { g_reply->host.id, fname ); } - } else if (!data_files) { + } else if (is_sticky_file(fname)) { // these files MIGHT be deleted from host if we need to make // disk space there //