From 4c070e3bfb9ec62c6760a4f82a223535e97b2bf3 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 29 Jul 2009 17:29:56 +0000 Subject: [PATCH] - scheduler: Gianni requested a feature where jobs have a "min # of GPU processors" attribute (stored in batch) and are sent only to hosts whose GPUs have at least this #. The logical place for this is in the scoring function, JOB::get_score(). I added a clause (#ifdef'd out) that does this. It rejects the WU if #procs is too small, otherwise it adds min/actual to the score. This favors sending jobs that need lots of procs to GPUs that have them. svn path=/trunk/boinc/; revision=18764 --- checkin_notes | 15 +++++++++++++++ sched/sched_score.cpp | 23 ++++++++++++++++++++++- sched/server_types.h | 2 ++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 1c2150709d..0d2754ac27 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6638,3 +6638,18 @@ Rom 29 July 2009 clientgui/ AccountManagerPropertiesPage.cpp, .h ProjectPropertiesPage.cpp, .h + +David 29 July 2009 + - scheduler: Gianni requested a feature where jobs have a + "min # of GPU processors" attribute (stored in batch) + and are sent only to hosts whose GPUs have at least this #. + + The logical place for this is in the scoring function, JOB::get_score(). + I added a clause (#ifdef'd out) that does this. + It rejects the WU if #procs is too small, + otherwise it adds min/actual to the score. + This favors sending jobs that need lots of procs to GPUs that have them. + + sched/ + sched_score.cpp + server_types.h diff --git a/sched/sched_score.cpp b/sched/sched_score.cpp index 620bb8f52a..085011584e 100644 --- a/sched/sched_score.cpp +++ b/sched/sched_score.cpp @@ -110,7 +110,7 @@ bool JOB::get_score() { score = 0; - // Find the app_version for the client's platform. + // Find the best app version to use. // bavp = get_app_version(wu, true); if (!bavp) return false; @@ -128,6 +128,27 @@ bool JOB::get_score() { score = 1; +#if 0 + // example: for CUDA app, wu.batch is the minimum number of processors. + // Don't send if #procs is less than this. + // Otherwise add min/actual to score + // (this favors sending jobs that need lots of procs to GPUs that have them) + // + if (!strcmp(app->name, "foobar") && bavp->host_usage.ncudas) { + if (!g_request->coproc_cuda) { + log_messages.printf(MSG_CRITICAL, + "[HOST#%d] expected CUDA device\n", g_reply->host.id + ); + return false; + } + int n = g_request->coproc_cuda->prop.multiProcessorCount; + if (n < wu.batch) { + return false; + } + score += ((double)wu.batch)/n; + } +#endif + // check if user has selected apps, // and send beta work to beta users // diff --git a/sched/server_types.h b/sched/server_types.h index 1e55e84acd..39a59d6887 100644 --- a/sched/server_types.h +++ b/sched/server_types.h @@ -257,6 +257,8 @@ struct BEST_APP_VERSION { // populated otherwise: APP_VERSION* avp; + + // populated in either case: HOST_USAGE host_usage; BEST_APP_VERSION() {