From 6b81e2ffc36fef9b27e66dcf193ef467bfef44bb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 6 Sep 2012 23:44:03 +0000 Subject: [PATCH] - scheduler: fix sending of NCI jobs. We were failing to mark the cache entries as free. - API: initialize GPU device # to -1; If client doesn't give us a device number, something is wrong and it's better to not start computing. svn path=/trunk/boinc/; revision=26079 --- checkin_notes | 13 +++++++++++++ lib/app_ipc.cpp | 2 +- sched/sched_array.cpp | 12 +++++++++--- sched/sched_send.cpp | 2 +- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/checkin_notes b/checkin_notes index e62d39fbc9..2ccc85400f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5884,3 +5884,16 @@ David 6 Sept 2012 sched/ sched_version.cpp file_deleter.cpp + +David 6 Sept 2012 + - scheduler: fix sending of NCI jobs. + We were failing to mark the cache entries as free. + - API: initialize GPU device # to -1; + If client doesn't give us a device number, something is wrong + and it's better to not start computing. + + sched/ + sched_array.cpp + sched_send.cpp + lib/ + app_ipc.cpp diff --git a/lib/app_ipc.cpp b/lib/app_ipc.cpp index a6e2ff55fb..c7f0a7280d 100644 --- a/lib/app_ipc.cpp +++ b/lib/app_ipc.cpp @@ -285,7 +285,7 @@ void APP_INIT_DATA::clear() { fraction_done_end = 0; checkpoint_period = 0; strcpy(gpu_type, ""); - gpu_device_num = 0; + gpu_device_num = -1; // -1 means an older version without gpu_opencl_dev_index field gpu_opencl_dev_index = -1; ncpus = 0; diff --git a/sched/sched_array.cpp b/sched/sched_array.cpp index 150d0bd06f..5bfd9e27dc 100644 --- a/sched/sched_array.cpp +++ b/sched/sched_array.cpp @@ -576,6 +576,7 @@ int send_job_for_app(APP& app) { wu_result.state = g_pid; unlock_sema(); result.id = wu_result.resultid; + wu_result.state = WR_STATE_EMPTY; if (result_still_sendable(result, wu)) { if (config.debug_send) { log_messages.printf(MSG_NORMAL, @@ -583,12 +584,12 @@ int send_job_for_app(APP& app) { ); } add_result_to_reply(result, wu, bavp, false); - break; + return 0; } lock_sema(); } unlock_sema(); - return 0; + return 1; } // try to send jobs for non-CPU-intensive (NCI) apps @@ -629,7 +630,12 @@ int send_nci() { for (unsigned int i=0; i