From cdc65cd283d5fdfd3a82474cf79391e93ee76228 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 25 Jun 2007 19:05:29 +0000 Subject: [PATCH] - Manager: if a job is running EDF, show "high priority" in status - compile fixes for Charlie's next-to-last checkin client/ client_state.h cpu_sched.C sim.h sim_util.C clientgui/ ViewWork.cpp ViewWorkGrid.cpp svn path=/trunk/boinc/; revision=13021 --- checkin_notes | 13 +++++++++++ client/client_state.h | 3 +++ client/cpu_sched.C | 46 +++++++++++++++++++++----------------- client/sim.h | 1 + client/sim_util.C | 1 + clientgui/ViewWork.cpp | 6 ++++- clientgui/ViewWorkGrid.cpp | 6 ++++- 7 files changed, 54 insertions(+), 22 deletions(-) diff --git a/checkin_notes b/checkin_notes index 33bc096f9e..c37aeedb2b 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6695,3 +6695,16 @@ Charlie 25 June 2007 mac_build/ boinc.xcodeproj/ project.pbxproj + +David 25 June 2007 + - Manager: if a job is running EDF, show "high priority" in status + - compile fixes for Charlie's next-to-last checkin + + client/ + client_state.h + cpu_sched.C + sim.h + sim_util.C + clientgui/ + ViewWork.cpp + ViewWorkGrid.cpp diff --git a/client/client_state.h b/client/client_state.h index 2c5671214e..0d397692d4 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -269,6 +269,9 @@ private: void print_deadline_misses(); public: double retry_shmem_time; + // if we fail to start a task due to no shared-mem segments, + // wait until at least this time to try running + // another task that needs a shared-mem seg inline double work_buf_min() { return global_prefs.work_buf_min_days * 86400; } diff --git a/client/cpu_sched.C b/client/cpu_sched.C index 8564b20c33..9fdbceca0d 100644 --- a/client/cpu_sched.C +++ b/client/cpu_sched.C @@ -49,6 +49,7 @@ #include "client_msgs.h" #include "str_util.h" #include "util.h" +#include "error_numbers.h" #include "log_flags.h" using std::vector; @@ -504,16 +505,16 @@ void CLIENT_STATE::schedule_cpus() { } atp->too_large = true; continue; - } else { - atp->too_large = false; - - if (gstate.retry_shmem_time < gstate.now) { - if (atp->app_client_shm.shm == NULL) { - atp->needs_shmem = true; - continue; - } - atp->needs_shmem = false; + } + atp->too_large = false; + + // TODO: merge this chunk of code with its clone + if (gstate.retry_shmem_time < gstate.now) { + if (atp->app_client_shm.shm == NULL) { + atp->needs_shmem = true; + continue; } + atp->needs_shmem = false; } ram_left -= atp->procinfo.working_set_size_smoothed; } @@ -550,16 +551,19 @@ void CLIENT_STATE::schedule_cpus() { } atp->too_large = true; continue; - } else { - atp->too_large = false; - } - if (gstate.retry_shmem_time < gstate.now) { - if (atp->app_client_shm.shm == NULL) { - atp->needs_shmem = true; - continue; - } - atp->needs_shmem = false; + } + atp->too_large = false; + + // don't select if it would need a new shared-mem seg + // and we're out of them + // + if (gstate.retry_shmem_time < gstate.now) { + if (atp->app_client_shm.shm == NULL) { + atp->needs_shmem = true; + continue; } + atp->needs_shmem = false; + } ram_left -= atp->procinfo.working_set_size_smoothed; } double xx = (rp->project->resource_share / rrs) * expected_pay_off; @@ -917,9 +921,11 @@ bool CLIENT_STATE::enforce_schedule() { atp->scheduler_state == CPU_SCHED_UNINITIALIZED ); if ((retval == ERR_SHMGET) || (retval == ERR_SHMAT)) { - // Assume no additional shared memory is available for next 10 seconds + // Assume no additional shared memory segs + // will be available in the next 10 seconds // (run only tasks which are already attached to shared memory). - if (gstate.retry_shmem_time < gstate.now) { // Do this only once + // + if (gstate.retry_shmem_time < gstate.now) { request_schedule_cpus("no more shared memory"); } gstate.retry_shmem_time = gstate.now + 10.0; diff --git a/client/sim.h b/client/sim.h index fd257c7de0..56add2489a 100644 --- a/client/sim.h +++ b/client/sim.h @@ -180,6 +180,7 @@ private: void make_running_task_heap(vector&); void print_deadline_misses(); public: + double retry_shmem_time; inline double work_buf_min() { return global_prefs.work_buf_min_days * 86400; } diff --git a/client/sim_util.C b/client/sim_util.C index 0a93e02266..269de6b39d 100644 --- a/client/sim_util.C +++ b/client/sim_util.C @@ -45,6 +45,7 @@ CLIENT_STATE::CLIENT_STATE() { initialized = false; + retry_shmem_time = 0; } FILE* boinc_fopen(const char* path, const char* mode) { diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index c773daac83..0830f9d7b9 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -796,7 +796,11 @@ wxInt32 CViewWork::FormatStatus(wxInt32 item, wxString& strBuffer) const { } else if (result->needs_shmem) { strBuffer = _("Waiting for shared memory"); } else if (result->scheduler_state == CPU_SCHED_SCHEDULED) { - strBuffer = _("Running"); + if (result->edf_scheduled) { + strBuffer = _("Running, high priority"); + } else { + strBuffer = _("Running"); + } } else if (result->scheduler_state == CPU_SCHED_PREEMPTED) { strBuffer = _("Waiting to run"); } else if (result->scheduler_state == CPU_SCHED_UNINITIALIZED) { diff --git a/clientgui/ViewWorkGrid.cpp b/clientgui/ViewWorkGrid.cpp index 7ca813e776..c04e1e5593 100644 --- a/clientgui/ViewWorkGrid.cpp +++ b/clientgui/ViewWorkGrid.cpp @@ -715,7 +715,11 @@ wxInt32 CViewWorkGrid::FormatStatus(wxInt32 item, wxString& strBuffer) const { } else if (result->needs_shmem) { strBuffer = _("Waiting for shared memory"); } else if (result->scheduler_state == CPU_SCHED_SCHEDULED) { - strBuffer = _("Running"); + if (result->edf_scheduled) { + strBuffer = _("Running, high priority"); + } else { + strBuffer = _("Running"); + } } else if (result->scheduler_state == CPU_SCHED_PREEMPTED) { strBuffer = _("Waiting to run"); } else if (result->scheduler_state == CPU_SCHED_UNINITIALIZED) {