- client: when exclusive app mechanism is used (CPU or GPU)

wait for 30 secs after excl app exits
    before restarting computation


svn path=/trunk/boinc/; revision=23048
This commit is contained in:
David Anderson 2011-02-16 20:41:19 +00:00
parent 3928100518
commit 28bad727c1
5 changed files with 26 additions and 12 deletions

View File

@ -839,3 +839,13 @@ David 16 Feb 2011
client/
cs_scheduler.cpp
David 16 Feb 2011
- client: when exclusive app mechanism is used (CPU or GPU)
wait for 30 secs after excl app exits
before restarting computation
client/
app.cpp,h
client_state.h
cs_prefs.cpp

View File

@ -71,8 +71,8 @@
using std::max;
using std::min;
bool exclusive_app_running;
bool exclusive_gpu_app_running;
double exclusive_app_running = 0;
double exclusive_gpu_app_running = 0;
int gpu_suspend_reason;
double non_boinc_cpu_usage;
@ -330,22 +330,22 @@ void ACTIVE_TASK_SET::get_memory_usage() {
}
}
exclusive_app_running = false;
bool old_egar = exclusive_gpu_app_running;
exclusive_gpu_app_running = false;
exclusive_app_running = 0;
double old_egar = exclusive_gpu_app_running;
exclusive_gpu_app_running = 0;
for (i=0; i<config.exclusive_apps.size(); i++) {
if (app_running(piv, config.exclusive_apps[i].c_str())) {
exclusive_app_running = true;
exclusive_app_running = gstate.now;
break;
}
}
for (i=0; i<config.exclusive_gpu_apps.size(); i++) {
if (app_running(piv, config.exclusive_gpu_apps[i].c_str())) {
exclusive_gpu_app_running = true;
exclusive_gpu_app_running = gstate.now;
break;
}
}
if (old_egar != exclusive_gpu_app_running) {
if ((old_egar==0) != (exclusive_gpu_app_running==0)) {
gstate.request_schedule_cpus("Exclusive GPU app status changed");
}

View File

@ -280,8 +280,8 @@ public:
int parse(MIOFILE&);
};
extern bool exclusive_app_running;
extern bool exclusive_gpu_app_running;
extern double exclusive_app_running; // last time an exclusive app was running
extern double exclusive_gpu_app_running;
extern int gpu_suspend_reason;
extern double non_boinc_cpu_usage;

View File

@ -557,6 +557,10 @@ extern void print_suspend_tasks_message(int);
//////// MISC
#define EXCLUSIVE_APP_WAIT 30
// if "exclusive app" feature used,
// wait this long after app exits before restarting jobs
#define DAILY_XFER_HISTORY_PERIOD 60
#define MAX_STD (86400)

View File

@ -127,7 +127,7 @@ int CLIENT_STATE::check_suspend_processing() {
return SUSPEND_REASON_NO_RECENT_INPUT;
}
}
if (exclusive_app_running) {
if (now - exclusive_app_running < EXCLUSIVE_APP_WAIT) {
return SUSPEND_REASON_EXCLUSIVE_APP_RUNNING;
}
if (global_prefs.suspend_cpu_usage && non_boinc_cpu_usage*100 > global_prefs.suspend_cpu_usage) {
@ -159,7 +159,7 @@ int CLIENT_STATE::check_suspend_processing() {
gpu_suspend_reason = SUSPEND_REASON_USER_REQ;
break;
default:
if (exclusive_gpu_app_running) {
if (now - exclusive_gpu_app_running < EXCLUSIVE_APP_WAIT) {
gpu_suspend_reason = SUSPEND_REASON_EXCLUSIVE_APP_RUNNING;
break;
}