From 5a8142a23c3294eaf4a1fe36511bb4b148476597 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 18 May 2010 16:45:55 +0000 Subject: [PATCH] - client: don't promote multithread jobs ahead of EDF jobs svn path=/trunk/boinc/; revision=21563 --- checkin_notes | 8 +++++++- client/app_start.cpp | 16 ++++++++++++++-- client/cpu_sched.cpp | 2 ++ lib/coproc.h | 3 +++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 52a6237461..3951bbaf24 100644 --- a/checkin_notes +++ b/checkin_notes @@ -3690,8 +3690,14 @@ Rytis 17 May 2010 prefs_util.inc Bernd 18 May 2010 - fix query in send_old_work() + - scheduler: fix query in send_old_work() from Oliver Bock sched/ sched_locality.cpp + +David 18 May 2010 + - client: don't promote multithread jobs ahead of EDF jobs + + client/ + cpu_sched.cpp diff --git a/client/app_start.cpp b/client/app_start.cpp index 85471063dd..ed1e65bbc2 100644 --- a/client/app_start.cpp +++ b/client/app_start.cpp @@ -167,10 +167,22 @@ int ACTIVE_TASK::get_shmem_seg_name() { // if (!boinc_file_exists(init_data_path)) { FILE* f = boinc_fopen(init_data_path, "w"); - if (f) fclose(f); + if (f) { + fclose(f); + } else { + msg_printf(wup->project, MSG_INTERNAL_ERROR, + "error: can't open file for shmem seg name" + ); + } } shmem_seg_name = ftok(init_data_path, 1); - if (shmem_seg_name == -1) return ERR_SHMEM_NAME; + if (shmem_seg_name == -1) { + msg_printf(wup->project, MSG_INTERNAL_ERROR, + "error: can't open file for shmem seg name: %d", errno + ); + perror("ftok"); + return ERR_SHMEM_NAME; + } #endif return 0; } diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index dd79de6b7a..f5b03f3bf2 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -822,6 +822,7 @@ static inline bool in_ordered_scheduled_results(ACTIVE_TASK* atp) { // scan the runnable list, keeping track of CPU usage X. // if find a MT job J, and X < ncpus, move J before all non-MT jobs +// But don't promote a MT job ahead of a job in EDF // static void promote_multi_thread_jobs(vector& runnable_jobs) { double cpus_used = 0; @@ -831,6 +832,7 @@ static void promote_multi_thread_jobs(vector& runnable_jobs) { if (cur == runnable_jobs.end()) break; if (cpus_used >= gstate.ncpus) break; RESULT* rp = *cur; + if (rp->rr_sim_misses_deadline) break; double nc = rp->avp->avg_ncpus; if (nc > 1) { if (first_non_mt != runnable_jobs.end()) { diff --git a/lib/coproc.h b/lib/coproc.h index b9d9470561..e0e964a829 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -139,6 +139,9 @@ struct COPROC { for (int i=0; i