diff --git a/checkin_notes b/checkin_notes index 979c5ebf42..f32eda8e79 100644 --- a/checkin_notes +++ b/checkin_notes @@ -180,3 +180,17 @@ David 12 Jan 2009 lib/ coproc.cpp + +David 12 Jan 2009 + - scheduler: if we're not sending work because of the user's "no GPUs" pref, + tell them so. + - scheduler: fix bug that caused no CUDA jobs to be sent + + lib/ + coproc.cpp,h + common_defs.h + sched/ + handle_request.cpp + sched_send.cpp + sched_plan.cpp + server_types.h diff --git a/lib/common_defs.h b/lib/common_defs.h index 2f045a1362..3e9989a3d9 100644 --- a/lib/common_defs.h +++ b/lib/common_defs.h @@ -81,7 +81,7 @@ #define MODE_QUIT 6 #define NGRAPHICS_MSGS 7 -// message priorities +// priorities for client messages // #define MSG_INFO 1 // write to stdout diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 2d81a729db..23f6c8f64c 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -116,7 +116,7 @@ int COPROCS::parse(FILE* fin) { return ERR_XML_PARSE; } -COPROC* COPROCS::lookup(char* type) { +COPROC* COPROCS::lookup(const char* type) { for (unsigned int i=0; itype)) return cp; diff --git a/lib/coproc.h b/lib/coproc.h index 2a60c0a417..a496ab759c 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -77,7 +77,7 @@ struct COPROCS { std::vector get(); int parse(FILE*); void summary_string(char*, int); - COPROC* lookup(char*); + COPROC* lookup(const char*); bool sufficient_coprocs(COPROCS&, bool log_flag, const char* prefix); void reserve_coprocs(COPROCS&, void*, bool log_flag, const char* prefix); void free_coprocs(COPROCS&, void*, bool log_flag, const char* prefix); diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index ca1b7d4f9c..c767852ede 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -1151,7 +1151,7 @@ bool bad_install_type() { if (config.no_vista_sandbox) { if (!strcmp(g_request->host.os_name, "Microsoft Windows Vista")) { if (g_request->sandbox == 1) { - log_messages.printf(MSG_INFO, + log_messages.printf(MSG_NORMAL, "Vista secure install - not sending work\n" ); USER_MESSAGE um( @@ -1169,7 +1169,10 @@ bool bad_install_type() { } static inline bool requesting_work() { - return (g_request->work_req_seconds > 0); + if (g_request->work_req_seconds > 0) return true; + if (g_request->cpu_req_secs > 0) return true; + if (coproc_cuda && coproc_cuda->req_secs) return true; + return false; } void process_request(char* code_sign_key) { @@ -1480,7 +1483,7 @@ void handle_request(FILE* fin, FILE* fout, char* code_sign_key) { } sreply.write(fout, sreq); - log_messages.printf(MSG_INFO, "Scheduler ran %f seconds\n", dtime()-start_time); + log_messages.printf(MSG_NORMAL, "Scheduler ran %f seconds\n", dtime()-start_time); if (strlen(config.sched_lockfile_dir)) { diff --git a/sched/sched_plan.cpp b/sched/sched_plan.cpp index 0a11649287..91229b5929 100644 --- a/sched/sched_plan.cpp +++ b/sched/sched_plan.cpp @@ -75,6 +75,7 @@ bool app_plan(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu) { log_messages.printf(MSG_DEBUG, "Skipping CUDA version - user prefs say no GPUS\n" ); + g_wreq->no_gpus_prefs = true; } return false; } diff --git a/sched/sched_send.cpp b/sched/sched_send.cpp index b75dab38bd..952c89e618 100644 --- a/sched/sched_send.cpp +++ b/sched/sched_send.cpp @@ -256,12 +256,14 @@ BEST_APP_VERSION* get_app_version(WORKUNIT& wu) { app->id, g_request->platforms.list[0]->id, app->min_version ); } - sprintf(message, - "%s is not available for your type of computer.", - app->user_friendly_name - ); - USER_MESSAGE um(message, "high"); - g_wreq->insert_no_work_message(um); + if (!g_wreq->no_gpus_prefs) { + sprintf(message, + "%s is not available for your type of computer.", + app->user_friendly_name + ); + USER_MESSAGE um(message, "high"); + g_wreq->insert_no_work_message(um); + } g_wreq->no_app_version = true; return NULL; } @@ -1286,6 +1288,13 @@ static void explain_to_user() { ); g_reply->insert_message(um); } + if (g_wreq->no_gpus_prefs) { + USER_MESSAGE um( + "CUDA (GPU) jobs are available, but your preferences are set to not accept them", + "low" + ); + g_reply->insert_message(um); + } if (g_wreq->daily_result_quota_exceeded) { struct tm *rpc_time_tm; int delay_time; @@ -1430,7 +1439,7 @@ void send_work() { g_wreq->disk_available = max_allowable_disk(); if (all_apps_use_hr && hr_unknown_platform(g_request->host)) { - log_messages.printf(MSG_INFO, + log_messages.printf(MSG_NORMAL, "Not sending work because unknown HR class\n" ); g_wreq->hr_reject_perm = true; diff --git a/sched/server_types.h b/sched/server_types.h index c2e2556d94..77076a1599 100644 --- a/sched/server_types.h +++ b/sched/server_types.h @@ -186,6 +186,7 @@ struct WORK_REQ { bool hr_reject_perm; bool outdated_core; bool gpu_too_slow; + bool no_gpus_prefs; bool daily_result_quota_exceeded; int daily_result_quota; // for this machine: number of cpus * daily_quota/cpu bool cache_size_exceeded;