no trickles while net comm suspended

svn path=/trunk/boinc/; revision=7329
This commit is contained in:
David Anderson 2005-08-15 05:08:42 +00:00
parent 7bedf36a68
commit 262dc55a25
11 changed files with 81 additions and 28 deletions

View File

@ -10570,4 +10570,19 @@ Bruce 13 Aug 2005
BOINCGUIApp.h
ViewWork.cpp
David 14 Aug 2005
- Don't do scheduler RPC to send trickle-up message
if network comm is suspended.
(previously we were setting sched_rpc_pending
when have trickle up, same as user "update" command,
which overrides comm suspended).
Add new flag PROJECT::trickle_up_pending
(suggested by Glenn Dill)
client/
app_control.C
client_state.h
client_types.C,h
cs_scheduler.C
scheduler_op.h

View File

@ -833,7 +833,7 @@ bool ACTIVE_TASK::get_trickle_up_msg() {
if (match_tag(msg_buf, "<have_new_trickle_up/>")) {
retval = move_trickle_file();
if (!retval) {
wup->project->sched_rpc_pending = true;
wup->project->trickle_up_pending = true;
}
}
if (match_tag(msg_buf, "<have_new_upload_file/>")) {

View File

@ -325,6 +325,7 @@ private:
PROJECT* find_project_with_overdue_results();
PROJECT* next_project_sched_rpc_pending();
PROJECT* next_project_trickle_up_pending();
//bool some_project_rpc_ok();
bool scheduler_rpc_poll();
double time_until_work_done(PROJECT*, int, double);

View File

@ -80,6 +80,7 @@ void PROJECT::init() {
min_report_min_rpc_time = 0;
master_url_fetch_pending = false;
sched_rpc_pending = false;
trickle_up_pending = false;
tentative = false;
anonymous_platform = false;
non_cpu_intensive = false;
@ -98,11 +99,6 @@ void PROJECT::init() {
duration_correction_factor = 1;
}
PROJECT::~PROJECT() {
}
// parse project fields from client_state.xml
//
int PROJECT::parse_state(MIOFILE& in) {
@ -163,6 +159,7 @@ int PROJECT::parse_state(MIOFILE& in) {
}
else if (match_tag(buf, "<master_url_fetch_pending/>")) master_url_fetch_pending = true;
else if (match_tag(buf, "<sched_rpc_pending/>")) sched_rpc_pending = true;
else if (match_tag(buf, "<trickle_up_pending/>")) trickle_up_pending = true;
else if (match_tag(buf, "<send_file_list/>")) send_file_list = true;
else if (match_tag(buf, "<non_cpu_intensive/>")) non_cpu_intensive = true;
else if (match_tag(buf, "<suspended_via_gui/>")) suspended_via_gui = true;
@ -248,6 +245,7 @@ int PROJECT::write_state(MIOFILE& out, bool gui_rpc) {
duration_correction_factor,
master_url_fetch_pending?" <master_url_fetch_pending/>\n":"",
sched_rpc_pending?" <sched_rpc_pending/>\n":"",
trickle_up_pending?" <trickle_up_pending/>\n":"",
send_file_list?" <send_file_list/>\n":"",
non_cpu_intensive?" <non_cpu_intensive/>\n":"",
suspended_via_gui?" <suspended_via_gui/>\n":"",
@ -307,7 +305,7 @@ void PROJECT::copy_state_fields(PROJECT& p) {
master_fetch_failures = p.master_fetch_failures;
min_rpc_time = p.min_rpc_time;
master_url_fetch_pending = p.master_url_fetch_pending;
sched_rpc_pending = p.sched_rpc_pending;
trickle_up_pending = p.trickle_up_pending;
safe_strcpy(code_sign_key, p.code_sign_key);
short_term_debt = p.short_term_debt;
long_term_debt = p.long_term_debt;

View File

@ -208,6 +208,7 @@ public:
bool master_url_fetch_pending;
// need to fetch and parse the master URL
bool sched_rpc_pending; // contact scheduling server for preferences
bool trickle_up_pending; // have trickle up to send
bool tentative; // master URL and account ID not confirmed
bool anonymous_platform; // app_versions.xml file found in project dir;
// use those apps rather then getting from server
@ -291,7 +292,7 @@ public:
#endif
PROJECT();
~PROJECT();
~PROJECT(){}
void init();
void copy_state_fields(PROJECT&);
char *get_project_name();

View File

@ -140,6 +140,21 @@ PROJECT* CLIENT_STATE::next_project_sched_rpc_pending() {
return 0;
}
PROJECT* CLIENT_STATE::next_project_trickle_up_pending() {
unsigned int i;
PROJECT* p;
for (i=0; i<projects.size(); i++) {
p = projects[i];
if (p->waiting_until_min_rpc_time()) continue;
if (p->suspended_via_gui) continue;
if (p->trickle_up_pending) {
return p;
}
}
return 0;
}
// Return the best project to fetch work from, NULL if none
//
// Basically, pick the one with largest long term debt - amount of current work
@ -530,17 +545,22 @@ int CLIENT_STATE::compute_work_requests() {
p->work_request_urgency = WORK_FETCH_DONT_NEED;
if (!p->contactable()) continue;
// if the projects have been running in round robin without resort to EDF, then
// all projects will have a LT debt greater than
// if system has been running in round robin,
// then all projects will have a LT debt greater than
// -global_prefs.cpu_scheduling_period_minutes * 60
// Therefore any project that has a LT debt greater than this
// is a candidate for more work.
// Also if the global need is immediate, we need to get work from
// someplace - anyplace that can be contacted, even if the LT debt
// is extremely negative.
if ((p->long_term_debt < -global_prefs.cpu_scheduling_period_minutes * 60) && (overall_work_fetch_urgency != WORK_FETCH_NEED_IMMEDIATELY)) continue;
// any contactable project, even if its LT debt is extremely negative.
//
if ((p->long_term_debt < -global_prefs.cpu_scheduling_period_minutes*60)
&& (overall_work_fetch_urgency != WORK_FETCH_NEED_IMMEDIATELY)
) {
continue;
}
// if it is non cpu intensive and we have work, we don't need any more.
//
if (p->non_cpu_intensive && p->runnable()) continue;
int min_results = proj_min_results(p, prrs);
@ -623,6 +643,12 @@ bool CLIENT_STATE::scheduler_rpc_poll() {
break;
}
if (network_suspended || activities_suspended) break;
p = next_project_trickle_up_pending();
if (p) {
scheduler_op->init_op_project(p, REASON_TRICKLE_UP);
action = true;
break;
}
// report overdue results
//
@ -967,6 +993,7 @@ int CLIENT_STATE::handle_scheduler_reply(
project->send_file_list = true;
}
project->sched_rpc_pending = false;
project->trickle_up_pending = false;
// handle delay request
//
@ -991,7 +1018,9 @@ bool CLIENT_STATE::should_get_work() {
for (unsigned int i = 0; i < results.size();++i) {
tot_cpu_time_remaining += results[i]->estimated_cpu_time_remaining();
}
if (tot_cpu_time_remaining < global_prefs.work_buf_min_days * SECONDS_PER_DAY) return true;
if (tot_cpu_time_remaining < global_prefs.work_buf_min_days*SECONDS_PER_DAY) {
return true;
}
// if the CPU started this time period overloaded,
// let it process for a while to get out of the CPU overload state.
@ -999,9 +1028,8 @@ bool CLIENT_STATE::should_get_work() {
if (!work_fetch_no_new_work) {
set_scheduler_modes();
}
bool ret = !work_fetch_no_new_work;
return ret;
return !work_fetch_no_new_work;
}
void PROJECT::set_rrsim_proc_rate(double per_cpu_proc_rate, double rrs) {

View File

@ -227,6 +227,7 @@ int SCHEDULER_OP::start_rpc(PROJECT* p) {
case REASON_USER_REQ: why = "Requested by user"; break;
case REASON_NEED_WORK: why = "To fetch work"; break;
case REASON_RESULTS_DUE: why = "To report results"; break;
case REASON_TRICKLE_UP: why = "To send trickle-up message"; break;
default: why = "Unknown";
}
msg_printf(p, MSG_INFO, "Reason: %s", why);

View File

@ -45,7 +45,8 @@
typedef enum {
REASON_USER_REQ,
REASON_RESULTS_DUE,
REASON_NEED_WORK
REASON_NEED_WORK,
REASON_TRICKLE_UP
} SCHEDULER_OP_REASON ;
// default constants related to scheduler RPC policy

View File

@ -28,22 +28,15 @@ Also, read:
The following medium-to-large development projects are available:
<ul>
<li> Core client: use the
<a href=http://curl.haxx.se/libcurl/>libcurl</a> library
or some other open-source HTTP library,
replacing the HTTP_OP and PROXY classes.
This would let the core client use HTTPS.
(Carl C. is working on this).
<li> BOINC Manager:
Change the Statistics tab to use a single graph
with different colors for different projects.
<li> BOINC Manager:
add progress bars for file transfers and in-progress results.
Use progress bars for file transfers and in-progress results.
<li> BOINC Manager:
add pie charts for disk usage
Use pie charts for disk usage
<li> Disk space management: prevent disk space usage from
exceeding user preferences,
@ -106,7 +99,7 @@ Various implementation notes:
<li> <a href=trickle_impl.php>Trickle messages</a>
<li> <a href=version_diff.txt>How to see what has changed
between two versions of an executable</a>.
<li> <a href=acct_mgt.php>Account management systems</a>
<li> <a href=acct_mgt_new.php>Account management systems</a>
<li> <a href=spec.txt>Spec info for RPMs</a>
<li> <a href=stats_summary.php>Statistics summaries</a>
</ul>

View File

@ -2,6 +2,13 @@
$project_news = array(
array("August 14, 2005",
"We are <a href=new_setup.php>redesigning BOINC</a> to use
a user-supplied identifier and password
instead of a system-supplied random key
for identifying an account.
Comments on the design are welcome."
),
array("August 9, 2005",
"BOINC is transitioning to use <a href=http://curl.haxx.se/>libcurl</a>
for HTTP operations.

View File

@ -24,7 +24,15 @@ for command-line apps it's written to your terminal).
This is verbose but extremely useful for tracking down
database-level problems.
<h2>Scheduler single-stepping</h2>
<h2>Getting core dumps from the scheduler</h2>
<p>
In sched/main.C put:
<pre>
#define DUMP_CORE_ON_SEGV 1
</pre>
and recompile.
<h2>Running the scheduler under a debugger</h2>
The scheduler is a CGI program.
It reads from stdin and writes to stdout,
so you can also run it with a command-line debugger like gdb: