From 2829e7f368a219aeb7aeb765c2985548143f0b91 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 31 Oct 2014 15:02:13 -0700 Subject: [PATCH] sched_customize.cpp: add another example, and remove S@h-specific code --- sched/sched_customize.cpp | 67 ++++----------------------------------- 1 file changed, 6 insertions(+), 61 deletions(-) diff --git a/sched/sched_customize.cpp b/sched/sched_customize.cpp index 621b1401a0..36487b8ca2 100644 --- a/sched/sched_customize.cpp +++ b/sched/sched_customize.cpp @@ -96,7 +96,7 @@ GPU_REQUIREMENTS gpu_requirements[NPROC_TYPES]; bool wu_is_infeasible_custom(WORKUNIT& wu, APP& app, BEST_APP_VERSION& bav) { #if 0 - // example: if WU name contains "_v1", don't use GPU apps. + // example 1: if WU name contains "_v1", don't use GPU apps. // Note: this is slightly suboptimal. // If the host is able to accept both GPU and CPU jobs, // we'll skip this job rather than send it for the CPU. @@ -107,7 +107,7 @@ bool wu_is_infeasible_custom(WORKUNIT& wu, APP& app, BEST_APP_VERSION& bav) { } #endif #if 0 - // example: for NVIDIA GPU app, + // example 2: for NVIDIA GPU app, // wu.batch is the minimum number of GPU processors. // Don't send if #procs is less than this. // @@ -118,67 +118,12 @@ bool wu_is_infeasible_custom(WORKUNIT& wu, APP& app, BEST_APP_VERSION& bav) { } } #endif -#if defined(SETIATHOME) - bool infeasible=false; - static bool send_vlar_to_gpu=false; - static bool sah_config_checked=false; - - // check the projects app config whether to send vlar wus to gpus - if (!sah_config_checked) { - MIOFILE mf; - XML_PARSER xp(&mf); -#ifndef _USING_FCGI_ - FILE *f=fopen(config.project_path("sah_config.xml"),"r"); -#else - FCGI_FILE *f=FCGI::fopen(config.project_path("sah_config.xml"),"r"); -#endif - if (f) { - mf.init_file(f); - if (xp.parse_start("sah") && xp.parse_start("config")) { - while (!xp.get_tag()) { - if (!xp.is_tag) continue; - if (xp.parse_bool("send_vlar_to_gpu",send_vlar_to_gpu)) continue; - if (xp.match_tag("/config")) break; - xp.skip_unexpected(false, "wu_is_infeasible_custom"); - } - } - fclose(f); - } - sah_config_checked=true; - } - // example: if CUDA app and WU name contains ".vlar", don't send - // to NVIDIA, INTEL or older ATI cards +#if 0 + // example 3: require that wu.opaque = user.donated // - if (bav.host_usage.uses_gpu() && strstr(wu.name, ".vlar")) { - if (send_vlar_to_gpu) { - if (bav.host_usage.proc_type == PROC_TYPE_AMD_GPU) { - // ATI GPUs older than HD7870 - COPROC_ATI &cp = g_request->coprocs.ati; - if (cp.count && (cp.attribs.target < 15)) { - infeasible=true; - } - } else if (bav.host_usage.proc_type == PROC_TYPE_NVIDIA_GPU) { - COPROC_NVIDIA &cp = g_request->coprocs.nvidia; - if (cp.count) { - int v = (cp.prop.major)*100 + cp.prop.minor; - if (v < 300) { - infeasible=true; - } - } - } else { - // all other GPUS - infeasible=true; - } - } else { - infeasible=true; - } + if (wu.opaque && wu.opaque != g_reply->user.donated) { + return true; } - if (infeasible && config.debug_version_select) { - log_messages.printf(MSG_NORMAL, - "[version] [setiathome] VLAR workunit is infeasible on this GPU\n" - ); - } - return infeasible; #endif return false; }