diff --git a/client/app.C b/client/app.C index 15ce8bf855..66604c1e65 100644 --- a/client/app.C +++ b/client/app.C @@ -1243,7 +1243,7 @@ int ACTIVE_TASK::suspend() { #ifdef _WIN32 SuspendThread(thread_handle); #else - kill(pid, SIGSTOP); + kill(pid, SIGTSTP); #endif return 0; } diff --git a/client/client_state.h b/client/client_state.h index cdb5b38f93..2986efea06 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -252,14 +252,12 @@ public: PROJECT* next_project(PROJECT*); int make_scheduler_request(PROJECT*, double); int handle_scheduler_reply(PROJECT*, char* scheduler_url, int& nresults); + int compute_work_requests(); private: SCHEDULER_OP* scheduler_op; bool contacted_sched_server; - void compute_resource_debts(); - int compute_work_requests(); PROJECT* find_project_with_overdue_results(); - void current_work_buf_days(double& work_buf, int& nactive_results); PROJECT* next_project_sched_rpc_pending(); bool some_project_rpc_ok(); bool scheduler_rpc_poll(); diff --git a/client/cs_prefs.C b/client/cs_prefs.C index 81bbb4447f..def1acafee 100644 --- a/client/cs_prefs.C +++ b/client/cs_prefs.C @@ -21,6 +21,8 @@ // when to compute, how much disk to use, etc. // +#include "cpp.h" + #ifdef _WIN32 #include "boinc_win.h" #endif diff --git a/client/scheduler_op.C b/client/scheduler_op.C index eea6fe6bb4..7150fd446b 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -80,19 +80,12 @@ bool SCHEDULER_OP::check_master_fetch_start() { int SCHEDULER_OP::init_get_work() { int retval; char err_msg[256]; - double ns = gstate.work_needed_secs(); - - // in some cases we get work to keep all CPUs busy, - // even though we have at least the min buf. - // In this case just ask for 1 sec - // - if (ns == 0) { - ns = 1.0; - } + double ns; must_get_work = true; project = gstate.next_project(0); if (project) { + ns = project->work_request; msg_printf(project, MSG_INFO, "Requesting %.0f seconds of work", ns ); @@ -447,9 +440,12 @@ bool SCHEDULER_OP::poll() { } else { backoff(project, "No schedulers responded"); if (must_get_work) { + int urgency = gstate.compute_work_requests(); project = gstate.next_project(project); - if (project) { - retval = init_op_project(gstate.work_needed_secs()); + if (urgency != DONT_NEED_WORK + && project != 0 + ) { + retval = init_op_project(project->work_request); } else { scheduler_op_done = true; } @@ -504,11 +500,11 @@ bool SCHEDULER_OP::poll() { // ask another project for work // if (must_get_work) { - double x = gstate.work_needed_secs(); - if (x > 0) { + int urgency = gstate.compute_work_requests(); + if (urgency != DONT_NEED_WORK) { project = gstate.next_project(project); if (project) { - retval = init_op_project(x); + retval = init_op_project(project->work_request); } else { scheduler_op_done = true; }