mirror of https://github.com/BOINC/boinc.git
- client: rename MODE to RUN_MODE, and rename vars accordingly
svn path=/trunk/boinc/; revision=23974
This commit is contained in:
parent
34d4385c23
commit
cceea7f6d4
|
@ -4771,4 +4771,8 @@ Charlie 8 Aug 2011
|
|||
|
||||
client/
|
||||
coproc_detect.cpp
|
||||
|
||||
|
||||
David 9 Aug 2011
|
||||
- client: rename MODE to RUN_MODE, and rename vars accordingly
|
||||
|
||||
client/various
|
||||
|
|
|
@ -107,7 +107,7 @@ int ACCT_MGR_OP::do_rpc(
|
|||
gstate.core_client_version.major,
|
||||
gstate.core_client_version.minor,
|
||||
gstate.core_client_version.release,
|
||||
run_mode_name[gstate.run_mode.get_perm()]
|
||||
run_mode_name[gstate.cpu_run_mode.get_perm()]
|
||||
);
|
||||
if (strlen(gstate.acct_mgr_info.previous_host_cpid)) {
|
||||
fprintf(f,
|
||||
|
|
|
@ -102,9 +102,9 @@ CLIENT_STATE::CLIENT_STATE()
|
|||
strcpy(main_host_venue, "");
|
||||
strcpy(attach_project_url, "");
|
||||
strcpy(attach_project_auth, "");
|
||||
run_mode.set(RUN_MODE_AUTO, 0);
|
||||
gpu_mode.set(RUN_MODE_AUTO, 0);
|
||||
network_mode.set(RUN_MODE_AUTO, 0);
|
||||
cpu_run_mode.set(RUN_MODE_AUTO, 0);
|
||||
gpu_run_mode.set(RUN_MODE_AUTO, 0);
|
||||
network_run_mode.set(RUN_MODE_AUTO, 0);
|
||||
started_by_screensaver = false;
|
||||
requested_exit = false;
|
||||
os_requested_suspend = false;
|
||||
|
@ -842,7 +842,7 @@ bool CLIENT_STATE::poll_slow_events() {
|
|||
//
|
||||
if (
|
||||
old_network_suspend_reason == SUSPEND_REASON_NETWORK_QUOTA_EXCEEDED
|
||||
&& network_mode.get_current() == RUN_MODE_AUTO
|
||||
&& network_run_mode.get_current() == RUN_MODE_AUTO
|
||||
) {
|
||||
pers_file_xfers->add_random_delay(3600);
|
||||
}
|
||||
|
@ -1944,9 +1944,9 @@ void CLIENT_STATE::clear_absolute_times() {
|
|||
new_version_check_time = now;
|
||||
all_projects_list_check_time = now;
|
||||
retry_shmem_time = 0;
|
||||
run_mode.temp_timeout = 0;
|
||||
gpu_mode.temp_timeout = 0;
|
||||
network_mode.temp_timeout = 0;
|
||||
cpu_run_mode.temp_timeout = 0;
|
||||
gpu_run_mode.temp_timeout = 0;
|
||||
network_run_mode.temp_timeout = 0;
|
||||
time_stats.last_update = now;
|
||||
|
||||
unsigned int i;
|
||||
|
|
|
@ -101,9 +101,9 @@ struct CLIENT_STATE {
|
|||
VERSION_INFO core_client_version;
|
||||
string statefile_platform_name;
|
||||
int file_xfer_giveup_period;
|
||||
MODE run_mode;
|
||||
MODE gpu_mode;
|
||||
MODE network_mode;
|
||||
RUN_MODE cpu_run_mode;
|
||||
RUN_MODE gpu_run_mode;
|
||||
RUN_MODE network_run_mode;
|
||||
bool started_by_screensaver;
|
||||
bool exit_before_start;
|
||||
bool check_all_logins;
|
||||
|
|
|
@ -2120,13 +2120,13 @@ void RESULT::abort_inactive(int status) {
|
|||
exit_status = status;
|
||||
}
|
||||
|
||||
MODE::MODE() {
|
||||
RUN_MODE::RUN_MODE() {
|
||||
perm_mode = 0;
|
||||
temp_mode = 0;
|
||||
temp_timeout = 0;
|
||||
}
|
||||
|
||||
void MODE::set(int mode, double duration) {
|
||||
void RUN_MODE::set(int mode, double duration) {
|
||||
if (mode == RUN_MODE_RESTORE) {
|
||||
temp_timeout = 0;
|
||||
temp_mode = perm_mode;
|
||||
|
@ -2143,11 +2143,11 @@ void MODE::set(int mode, double duration) {
|
|||
}
|
||||
}
|
||||
|
||||
int MODE::get_perm() {
|
||||
int RUN_MODE::get_perm() {
|
||||
return perm_mode;
|
||||
}
|
||||
|
||||
int MODE::get_current() {
|
||||
int RUN_MODE::get_current() {
|
||||
if (temp_timeout > gstate.now) {
|
||||
return temp_mode;
|
||||
} else {
|
||||
|
@ -2155,7 +2155,7 @@ int MODE::get_current() {
|
|||
}
|
||||
}
|
||||
|
||||
double MODE::delay() {
|
||||
double RUN_MODE::delay() {
|
||||
if (temp_timeout > gstate.now) {
|
||||
return temp_timeout - gstate.now;
|
||||
} else {
|
||||
|
|
|
@ -778,11 +778,11 @@ struct RESULT {
|
|||
|
||||
// represents an always/auto/never value, possibly temporarily overridden
|
||||
|
||||
struct MODE {
|
||||
struct RUN_MODE {
|
||||
int perm_mode;
|
||||
int temp_mode;
|
||||
double temp_timeout;
|
||||
MODE();
|
||||
RUN_MODE();
|
||||
void set(int mode, double duration);
|
||||
int get_perm();
|
||||
int get_current();
|
||||
|
|
|
@ -105,7 +105,7 @@ int CLIENT_STATE::check_suspend_processing() {
|
|||
return SUSPEND_REASON_OS;
|
||||
}
|
||||
|
||||
switch (run_mode.get_current()) {
|
||||
switch (cpu_run_mode.get_current()) {
|
||||
case RUN_MODE_ALWAYS: break;
|
||||
case RUN_MODE_NEVER:
|
||||
return SUSPEND_REASON_USER_REQ;
|
||||
|
@ -156,7 +156,7 @@ int CLIENT_STATE::check_suspend_processing() {
|
|||
if (!coprocs.none()) {
|
||||
int old_gpu_suspend_reason = gpu_suspend_reason;
|
||||
gpu_suspend_reason = 0;
|
||||
switch (gpu_mode.get_current()) {
|
||||
switch (gpu_run_mode.get_current()) {
|
||||
case RUN_MODE_ALWAYS:
|
||||
break;
|
||||
case RUN_MODE_NEVER:
|
||||
|
@ -249,7 +249,7 @@ void CLIENT_STATE::check_suspend_network() {
|
|||
ALLOW_NETWORK_IF_RECENT_RPC_PERIOD
|
||||
);
|
||||
|
||||
switch(network_mode.get_current()) {
|
||||
switch(network_run_mode.get_current()) {
|
||||
case RUN_MODE_ALWAYS:
|
||||
return;
|
||||
case RUN_MODE_NEVER:
|
||||
|
|
|
@ -441,15 +441,15 @@ int CLIENT_STATE::parse_state_file_aux(const char* fname) {
|
|||
continue;
|
||||
}
|
||||
if (parse_int(buf, "<user_run_request>", retval)) {
|
||||
run_mode.set(retval, 0);
|
||||
cpu_run_mode.set(retval, 0);
|
||||
continue;
|
||||
}
|
||||
if (parse_int(buf, "<user_gpu_request>", retval)) {
|
||||
gpu_mode.set(retval, 0);
|
||||
gpu_run_mode.set(retval, 0);
|
||||
continue;
|
||||
}
|
||||
if (parse_int(buf, "<user_network_request>", retval)) {
|
||||
network_mode.set(retval, 0);
|
||||
network_run_mode.set(retval, 0);
|
||||
continue;
|
||||
}
|
||||
if (parse_int(buf, "<core_client_major_version>", old_major_version)) {
|
||||
|
@ -727,9 +727,9 @@ int CLIENT_STATE::write_state(MIOFILE& f) {
|
|||
core_client_version.major,
|
||||
core_client_version.minor,
|
||||
core_client_version.release,
|
||||
run_mode.get_perm(),
|
||||
gpu_mode.get_perm(),
|
||||
network_mode.get_perm(),
|
||||
cpu_run_mode.get_perm(),
|
||||
gpu_run_mode.get_perm(),
|
||||
network_run_mode.get_perm(),
|
||||
cpu_benchmarks_pending?"<cpu_benchmarks_pending/>\n":"",
|
||||
new_version_check_time,
|
||||
all_projects_list_check_time
|
||||
|
|
|
@ -311,7 +311,7 @@ static void handle_set_run_mode(char* buf, MIOFILE& fout) {
|
|||
fout.printf("<error>Missing mode</error>\n");
|
||||
return;
|
||||
}
|
||||
gstate.run_mode.set(mode, duration);
|
||||
gstate.cpu_run_mode.set(mode, duration);
|
||||
fout.printf("<success/>\n");
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ static void handle_set_gpu_mode(char* buf, MIOFILE& fout) {
|
|||
fout.printf("<error>Missing mode</error>\n");
|
||||
return;
|
||||
}
|
||||
gstate.gpu_mode.set(mode, duration);
|
||||
gstate.gpu_run_mode.set(mode, duration);
|
||||
gstate.request_schedule_cpus("GPU mode changed");
|
||||
fout.printf("<success/>\n");
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ static void handle_set_network_mode(char* buf, MIOFILE& fout) {
|
|||
//
|
||||
gstate.gui_rpcs.time_of_last_rpc_needing_network = 0;
|
||||
|
||||
gstate.network_mode.set(mode, duration);
|
||||
gstate.network_run_mode.set(mode, duration);
|
||||
fout.printf("<success/>\n");
|
||||
}
|
||||
|
||||
|
@ -573,17 +573,17 @@ static void handle_get_cc_status(GUI_RPC_CONN* gr, MIOFILE& fout) {
|
|||
net_status.network_status(),
|
||||
gstate.acct_mgr_info.password_error?1:0,
|
||||
gstate.suspend_reason,
|
||||
gstate.run_mode.get_current(),
|
||||
gstate.run_mode.get_perm(),
|
||||
gstate.run_mode.delay(),
|
||||
gstate.cpu_run_mode.get_current(),
|
||||
gstate.cpu_run_mode.get_perm(),
|
||||
gstate.cpu_run_mode.delay(),
|
||||
gpu_suspend_reason,
|
||||
gstate.gpu_mode.get_current(),
|
||||
gstate.gpu_mode.get_perm(),
|
||||
gstate.gpu_mode.delay(),
|
||||
gstate.gpu_run_mode.get_current(),
|
||||
gstate.gpu_run_mode.get_perm(),
|
||||
gstate.gpu_run_mode.delay(),
|
||||
gstate.network_suspend_reason,
|
||||
gstate.network_mode.get_current(),
|
||||
gstate.network_mode.get_perm(),
|
||||
gstate.network_mode.delay(),
|
||||
gstate.network_run_mode.get_current(),
|
||||
gstate.network_run_mode.get_perm(),
|
||||
gstate.network_run_mode.delay(),
|
||||
config.disallow_attach?1:0,
|
||||
config.simple_gui_only?1:0
|
||||
);
|
||||
|
|
|
@ -1060,8 +1060,7 @@ static void write_inputs() {
|
|||
);
|
||||
if (use_rec) {
|
||||
fprintf(f,
|
||||
"REC half-life: %f\n",
|
||||
rec_half_life
|
||||
"REC half-life: %f\n", config.rec_half_life
|
||||
);
|
||||
}
|
||||
fprintf(f,
|
||||
|
@ -1106,8 +1105,7 @@ void simulate() {
|
|||
);
|
||||
if (use_rec) {
|
||||
fprintf(summary_file,
|
||||
" REC half-life: %f\n",
|
||||
rec_half_life
|
||||
" REC half-life: %f\n", config.rec_half_life
|
||||
);
|
||||
}
|
||||
fprintf(summary_file,
|
||||
|
@ -1446,7 +1444,7 @@ int main(int argc, char** argv) {
|
|||
} else if (!strcmp(opt, "--use_hyst_fetch")) {
|
||||
use_hyst_fetch = true;
|
||||
} else if (!strcmp(opt, "--rec_half_life")) {
|
||||
rec_half_life = atof(argv[i++]);
|
||||
config.rec_half_life = atof(argv[i++]);
|
||||
} else {
|
||||
usage(argv[0]);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
extern bool use_rec;
|
||||
#define USE_REC
|
||||
extern double rec_half_life;
|
||||
|
||||
extern bool use_hyst_fetch;
|
||||
|
||||
|
|
Loading…
Reference in New Issue