mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=369
This commit is contained in:
parent
b0ac995315
commit
9fc8f33c2f
16
client/app.C
16
client/app.C
|
@ -380,7 +380,7 @@ int ACTIVE_TASK_SET::insert(ACTIVE_TASK* atp) {
|
||||||
// Checks if any child processes have exited and records their final CPU time
|
// Checks if any child processes have exited and records their final CPU time
|
||||||
//
|
//
|
||||||
bool ACTIVE_TASK_SET::poll() {
|
bool ACTIVE_TASK_SET::poll() {
|
||||||
ACTIVE_TASK* atp = NULL;
|
ACTIVE_TASK* atp;
|
||||||
char path[256];
|
char path[256];
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
@ -390,10 +390,12 @@ bool ACTIVE_TASK_SET::poll() {
|
||||||
FILETIME creation_time, exit_time, kernel_time, user_time;
|
FILETIME creation_time, exit_time, kernel_time, user_time;
|
||||||
ULARGE_INTEGER tKernel, tUser;
|
ULARGE_INTEGER tKernel, tUser;
|
||||||
LONGLONG totTime;
|
LONGLONG totTime;
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
for (i=0; i<active_tasks.size(); i++) {
|
for (i=0; i<active_tasks.size(); i++) {
|
||||||
atp = active_tasks[i];
|
atp = active_tasks[i];
|
||||||
if (GetExitCodeProcess(atp->pid_handle, &exit_code)) {
|
if (GetExitCodeProcess(atp->pid_handle, &exit_code)) {
|
||||||
|
found = true;
|
||||||
// Get the elapsed CPU time
|
// Get the elapsed CPU time
|
||||||
if (GetProcessTimes(atp->pid_handle, &creation_time, &exit_time, &kernel_time, &user_time)) {
|
if (GetProcessTimes(atp->pid_handle, &creation_time, &exit_time, &kernel_time, &user_time)) {
|
||||||
tKernel.LowPart = kernel_time.dwLowDateTime;
|
tKernel.LowPart = kernel_time.dwLowDateTime;
|
||||||
|
@ -416,14 +418,11 @@ bool ACTIVE_TASK_SET::poll() {
|
||||||
atp->exit_status = exit_code;
|
atp->exit_status = exit_code;
|
||||||
atp->result->exit_status = atp->exit_status;
|
atp->result->exit_status = atp->exit_status;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Not sure what to do here
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( atp == NULL ) {
|
if (log_flags.task_debug && found) printf("ACTIVE_TASK_SET::poll\n");
|
||||||
return false;
|
return found;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SYS_RESOURCE_H
|
#if HAVE_SYS_RESOURCE_H
|
||||||
|
@ -473,6 +472,7 @@ bool ACTIVE_TASK_SET::poll() {
|
||||||
|
|
||||||
clean_out_dir(atp->dirname);
|
clean_out_dir(atp->dirname);
|
||||||
|
|
||||||
|
if (log_flags.task_debug) printf("ACTIVE_TASK_SET::poll\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -639,10 +639,12 @@ bool ACTIVE_TASK_SET::poll_time() {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
|
|
||||||
for(i=0; i<active_tasks.size(); i++) {
|
for (i=0; i<active_tasks.size(); i++) {
|
||||||
atp = active_tasks[i];
|
atp = active_tasks[i];
|
||||||
updated |= atp->check_app_status_files();
|
updated |= atp->check_app_status_files();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (log_flags.task_debug && updated) printf("ACTIVE_TASK_SET::poll_time\n");
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -700,6 +700,7 @@ bool CLIENT_STATE::garbage_collect() {
|
||||||
|
|
||||||
// TODO: delete obsolete APP_VERSIONs
|
// TODO: delete obsolete APP_VERSIONs
|
||||||
|
|
||||||
|
if (log_flags.state_debug && action) printf("garbage_collect\n");
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,6 +751,7 @@ bool CLIENT_STATE::update_results() {
|
||||||
}
|
}
|
||||||
result_iter++;
|
result_iter++;
|
||||||
}
|
}
|
||||||
|
if (log_flags.state_debug && action) printf("update_results\n");
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,7 @@ bool CLIENT_STATE::handle_running_apps() {
|
||||||
action = true;
|
action = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (log_flags.task_debug && action) printf("CS::handle_running_apps\n");
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,5 +127,6 @@ bool CLIENT_STATE::handle_pers_file_xfers() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (log_flags.file_xfer_debug && action) printf("CS::handle_pers_file_xfers\n");
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
|
@ -219,5 +219,8 @@ bool FILE_XFER_SET::poll() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (log_flags.file_xfer_debug) {
|
||||||
|
if (action) printf("FILE_XFER_SET poll true\n");
|
||||||
|
}
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,6 +189,9 @@ int NET_XFER_SET::poll(int max_bytes, int& bytes_transferred) {
|
||||||
bytes_transferred += n;
|
bytes_transferred += n;
|
||||||
if (max_bytes < 0) break;
|
if (max_bytes < 0) break;
|
||||||
}
|
}
|
||||||
|
if (log_flags.net_xfer_debug && bytes_transferred) {
|
||||||
|
printf("NET_XFER_SET::poll bytes_transferred %d\n", bytes_transferred);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,9 +344,9 @@ int NET_XFER::do_xfer(int& nbytes_transferred) {
|
||||||
offset = 0;
|
offset = 0;
|
||||||
while (nleft) {
|
while (nleft) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
n = send(socket, buf+offset, nleft, 0);
|
n = send(socket, buf+offset, nleft, 0);
|
||||||
#else
|
#else
|
||||||
n = write(socket, buf+offset, nleft);
|
n = write(socket, buf+offset, nleft);
|
||||||
#endif
|
#endif
|
||||||
if (log_flags.net_xfer_debug) {
|
if (log_flags.net_xfer_debug) {
|
||||||
printf("wrote %d bytes to socket %d\n", n, socket);
|
printf("wrote %d bytes to socket %d\n", n, socket);
|
||||||
|
|
|
@ -260,6 +260,7 @@ bool PERS_FILE_XFER_SET::poll() {
|
||||||
|
|
||||||
if (action) gstate.set_client_state_dirty("pers_file_xfer_set poll");
|
if (action) gstate.set_client_state_dirty("pers_file_xfer_set poll");
|
||||||
|
|
||||||
|
if (log_flags.file_xfer_debug && action) printf("PERS_FILE_XFER_SET::poll\n");
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,11 +35,11 @@ PREFS::PREFS() {
|
||||||
dont_run_on_batteries = false;
|
dont_run_on_batteries = false;
|
||||||
dont_run_if_user_active = false;
|
dont_run_if_user_active = false;
|
||||||
confirm_before_connecting = false;
|
confirm_before_connecting = false;
|
||||||
high_water_days = false;
|
high_water_days = 3;
|
||||||
low_water_days = false;
|
low_water_days = 1;
|
||||||
disk_max_used_gb = 0;
|
disk_max_used_gb = 1;
|
||||||
disk_max_used_pct = 0;
|
disk_max_used_pct = 0.5;
|
||||||
disk_min_free_gb = 0;
|
disk_min_free_gb = 0.1;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parse XML based prefs, usually from prefs.xml
|
// Parse XML based prefs, usually from prefs.xml
|
||||||
|
|
|
@ -203,16 +203,18 @@ bool SCHEDULER_OP::update_urls(PROJECT& project, vector<STRING256> &urls) {
|
||||||
|
|
||||||
// poll routine. If an operation is in progress, check for completion
|
// poll routine. If an operation is in progress, check for completion
|
||||||
//
|
//
|
||||||
int SCHEDULER_OP::poll() {
|
bool SCHEDULER_OP::poll() {
|
||||||
int retval;
|
int retval;
|
||||||
vector<STRING256> urls;
|
vector<STRING256> urls;
|
||||||
bool changed, scheduler_op_done;
|
bool changed, scheduler_op_done;
|
||||||
|
bool action = false;
|
||||||
|
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case SCHEDULER_OP_STATE_GET_MASTER:
|
case SCHEDULER_OP_STATE_GET_MASTER:
|
||||||
// here we're fetching the master file for a project
|
// here we're fetching the master file for a project
|
||||||
//
|
//
|
||||||
if (http_op.http_op_state == HTTP_STATE_DONE) {
|
if (http_op.http_op_state == HTTP_STATE_DONE) {
|
||||||
|
action = true;
|
||||||
project->master_url_fetch_pending = false;
|
project->master_url_fetch_pending = false;
|
||||||
http_ops->remove(&http_op);
|
http_ops->remove(&http_op);
|
||||||
if (http_op.http_op_retval == 0) {
|
if (http_op.http_op_retval == 0) {
|
||||||
|
@ -263,6 +265,7 @@ int SCHEDULER_OP::poll() {
|
||||||
//
|
//
|
||||||
scheduler_op_done = false;
|
scheduler_op_done = false;
|
||||||
if (http_op.http_op_state == HTTP_STATE_DONE) {
|
if (http_op.http_op_state == HTTP_STATE_DONE) {
|
||||||
|
action = true;
|
||||||
http_ops->remove(&http_op);
|
http_ops->remove(&http_op);
|
||||||
if (http_op.http_op_retval) {
|
if (http_op.http_op_retval) {
|
||||||
if (log_flags.sched_op_debug) {
|
if (log_flags.sched_op_debug) {
|
||||||
|
@ -330,7 +333,8 @@ int SCHEDULER_OP::poll() {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
if (log_flags.sched_op_debug && action) printf("SCHEDULER_OP::poll\n);
|
||||||
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCHEDULER_REPLY::SCHEDULER_REPLY() {
|
SCHEDULER_REPLY::SCHEDULER_REPLY() {
|
||||||
|
|
|
@ -58,7 +58,7 @@ struct SCHEDULER_OP {
|
||||||
unsigned int url_index; // index within project's URL list
|
unsigned int url_index; // index within project's URL list
|
||||||
|
|
||||||
SCHEDULER_OP(HTTP_OP_SET*);
|
SCHEDULER_OP(HTTP_OP_SET*);
|
||||||
int poll();
|
bool poll();
|
||||||
int init_get_work();
|
int init_get_work();
|
||||||
int init_return_results(PROJECT*, double nsecs);
|
int init_return_results(PROJECT*, double nsecs);
|
||||||
int init_op_project(double ns);
|
int init_op_project(double ns);
|
||||||
|
|
Loading…
Reference in New Issue