mirror of https://github.com/BOINC/boinc.git
- client: add <no_info_fetch> config option and --no_info_fetch
cmdline arg. Suppresses the fetch of project list and of current client version #. Use when running on grid nodes. - debugging on client simulator. Not done yet. svn path=/trunk/boinc/; revision=22414
This commit is contained in:
parent
31db3207e4
commit
1c4422985f
|
@ -6828,3 +6828,23 @@ David 24 Sept 2010
|
|||
work_fetch.cpp,h
|
||||
client_state.cpp,h
|
||||
app.cpp
|
||||
|
||||
David 27 Sept 2010
|
||||
- client: add <no_info_fetch> config option and --no_info_fetch
|
||||
cmdline arg.
|
||||
Suppresses the fetch of project list and of current client version #.
|
||||
Use when running on grid nodes.
|
||||
- debugging on client simulator. Not done yet.
|
||||
|
||||
client/
|
||||
work_fetch.cpp,h
|
||||
client_types.cpp,h
|
||||
client_state.cpp
|
||||
sim.cpp
|
||||
work_fetch.cpp
|
||||
sim_util.cpp
|
||||
cs_cmdline.cpp
|
||||
log_flags.cpp,h
|
||||
cs_statefile.cpp
|
||||
scheduler_op.cpp
|
||||
time_stats.cpp
|
||||
|
|
|
@ -483,7 +483,9 @@ int CLIENT_STATE::init() {
|
|||
if (!boinc_file_exists(ALL_PROJECTS_LIST_FILENAME)) {
|
||||
all_projects_list_check_time = 0;
|
||||
}
|
||||
all_projects_list_check();
|
||||
if (!config.no_info_fetch) {
|
||||
all_projects_list_check();
|
||||
}
|
||||
|
||||
auto_update.init();
|
||||
|
||||
|
|
|
@ -836,15 +836,17 @@ int FILE_INFO::parse(MIOFILE& in, bool from_server) {
|
|||
if (parse_bool(buf, "is_project_file", is_project_file)) continue;
|
||||
if (match_tag(buf, "<no_delete")) continue;
|
||||
if (match_tag(buf, "<persistent_file_xfer>")) {
|
||||
#ifndef SIM
|
||||
pfxp = new PERS_FILE_XFER;
|
||||
retval = pfxp->parse(in);
|
||||
#ifdef SIM
|
||||
delete pfxp;
|
||||
continue;
|
||||
#endif
|
||||
if (!retval) {
|
||||
pers_file_xfer = pfxp;
|
||||
} else {
|
||||
delete pfxp;
|
||||
}
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
if (!from_server && match_tag(buf, "<signed_xml>")) {
|
||||
|
|
|
@ -467,6 +467,8 @@ struct APP {
|
|||
NORMAL_DIST checkpoint_period;
|
||||
double working_set;
|
||||
double weight;
|
||||
bool has_version;
|
||||
APP() {memset(this, 0, sizeof(APP));}
|
||||
#endif
|
||||
|
||||
int parse(MIOFILE&);
|
||||
|
|
|
@ -74,6 +74,7 @@ static void print_options(char* prog) {
|
|||
" --master_fetch_period N reload master URL after N RPC failures\n"
|
||||
" --master_fetch_retry_cap N exponential backoff limit\n"
|
||||
" --no_gui_rpc don't allow GUI RPC, don't make socket\n"
|
||||
" --no_info_fetch don't fetch project list or client version info\n"
|
||||
" --no_priority_change run apps at same priority as client\n"
|
||||
" --pers_giveup N giveup time for persistent file xfer\n"
|
||||
" --pers_retry_delay_max N max for file xfer exponential backoff\n"
|
||||
|
@ -189,8 +190,9 @@ void CLIENT_STATE::parse_cmdline(int argc, char** argv) {
|
|||
config.no_gpus = true;
|
||||
} else if (ARG(no_gui_rpc)) {
|
||||
no_gui_rpc = true;
|
||||
} else if (ARG(no_info_fetch)) {
|
||||
config.no_info_fetch = true;
|
||||
} else if (ARG(no_priority_change)) {
|
||||
fprintf(stderr, "NO PRIO CHANGE\n");
|
||||
config.no_priority_change = true;
|
||||
} else if (ARG(pers_giveup)) {
|
||||
if (i == argc-1) show_options = true;
|
||||
|
|
|
@ -129,9 +129,9 @@ int CLIENT_STATE::parse_state_file() {
|
|||
msg_printf(NULL, MSG_INTERNAL_ERROR, "Can't parse project in state file");
|
||||
} else {
|
||||
#ifdef SIM
|
||||
PROJECT* p = new PROJECT;
|
||||
*p = temp_project;
|
||||
projects.push_back(p);
|
||||
project = new PROJECT;
|
||||
*project = temp_project;
|
||||
projects.push_back(project);
|
||||
#else
|
||||
project = lookup_project(temp_project.master_url);
|
||||
if (project) {
|
||||
|
@ -669,6 +669,10 @@ int CLIENT_STATE::write_state(MIOFILE& f) {
|
|||
unsigned int i, j;
|
||||
int retval;
|
||||
|
||||
#ifdef SIM
|
||||
fprintf(stderr, "simulator shouldn't write state file\n");
|
||||
exit(1);
|
||||
#endif
|
||||
f.printf("<client_state>\n");
|
||||
retval = host_info.write(f, true, true);
|
||||
if (retval) return retval;
|
||||
|
|
|
@ -191,6 +191,9 @@ void CONFIG::show() {
|
|||
if (no_gpus) {
|
||||
msg_printf(NULL, MSG_INFO, "Config: don't use coprocessors");
|
||||
}
|
||||
if (no_info_fetch) {
|
||||
msg_printf(NULL, MSG_INFO, "Config: don't fetch project list or client version info");
|
||||
}
|
||||
if (no_priority_change) {
|
||||
msg_printf(NULL, MSG_INFO, "Config: run apps at regular priority");
|
||||
}
|
||||
|
@ -276,6 +279,7 @@ void CONFIG::clear() {
|
|||
network_test_url = "http://www.google.com/";
|
||||
no_alt_platform = false;
|
||||
no_gpus = false;
|
||||
no_info_fetch = false;
|
||||
no_priority_change = false;
|
||||
os_random_only = false;
|
||||
report_results_immediately = false;
|
||||
|
@ -386,6 +390,7 @@ int CONFIG::parse_options(XML_PARSER& xp) {
|
|||
}
|
||||
if (xp.parse_bool(tag, "no_alt_platform", no_alt_platform)) continue;
|
||||
if (xp.parse_bool(tag, "no_gpus", no_gpus)) continue;
|
||||
if (xp.parse_bool(tag, "no_info_fetch", no_info_fetch)) continue;
|
||||
if (xp.parse_bool(tag, "no_priority_change", no_priority_change)) continue;
|
||||
if (xp.parse_bool(tag, "os_random_only", os_random_only)) continue;
|
||||
#ifndef SIM
|
||||
|
|
|
@ -135,6 +135,7 @@ struct CONFIG {
|
|||
std::string network_test_url;
|
||||
bool no_alt_platform;
|
||||
bool no_gpus;
|
||||
bool no_info_fetch;
|
||||
bool no_priority_change;
|
||||
bool os_random_only;
|
||||
bool report_results_immediately;
|
||||
|
|
|
@ -126,8 +126,10 @@ int SCHEDULER_OP::init_op_project(PROJECT* p, int r) {
|
|||
// Now's a good time to check for new BOINC versions
|
||||
// and project list
|
||||
//
|
||||
gstate.new_version_check();
|
||||
gstate.all_projects_list_check();
|
||||
if (!config.no_info_fetch) {
|
||||
gstate.new_version_check();
|
||||
gstate.all_projects_list_check();
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ void PROJECT::update_dcf_stats(RESULT* rp) {
|
|||
return;
|
||||
}
|
||||
|
||||
// generate a job; pick a random app,
|
||||
// generate a job; pick a random app for this project,
|
||||
// and pick a FLOP count from its distribution
|
||||
//
|
||||
void CLIENT_STATE::make_job(PROJECT* p, WORKUNIT* wup, RESULT* rp) {
|
||||
|
@ -107,7 +107,7 @@ void CLIENT_STATE::make_job(PROJECT* p, WORKUNIT* wup, RESULT* rp) {
|
|||
}
|
||||
}
|
||||
if (!ap) {
|
||||
printf("ERROR-NO APP\n");
|
||||
printf("ERROR - NO APP\n");
|
||||
exit(1);
|
||||
}
|
||||
rp->clear();
|
||||
|
@ -185,11 +185,11 @@ void CLIENT_STATE::get_workload(vector<IP_RESULT>& ip_results) {
|
|||
init_ip_results(work_buf_min(), ncpus, ip_results);
|
||||
}
|
||||
|
||||
// simulate trying to do an RPC
|
||||
// return false if we didn't actually do one
|
||||
// simulate trying to do an RPC;
|
||||
// return true if we actually did one
|
||||
//
|
||||
bool CLIENT_STATE::simulate_rpc(PROJECT* p) {
|
||||
char buf[256];
|
||||
char buf[256], buf2[256];
|
||||
static double last_time=-1e9;
|
||||
vector<IP_RESULT> ip_results;
|
||||
int infeasible_count = 0;
|
||||
|
@ -204,9 +204,8 @@ bool CLIENT_STATE::simulate_rpc(PROJECT* p) {
|
|||
}
|
||||
last_time = now;
|
||||
|
||||
sprintf(buf, "RPC to %s; asking for %f/%.2f<br>",
|
||||
p->project_name, cpu_work_fetch.req_secs, cpu_work_fetch.req_instances
|
||||
);
|
||||
work_fetch.request_string(buf);
|
||||
sprintf(buf, "RPC to %s: %s<br>", p->project_name, buf2);
|
||||
html_msg += buf;
|
||||
|
||||
msg_printf(0, MSG_INFO, buf);
|
||||
|
@ -738,6 +737,77 @@ char* next_arg(int argc, char** argv, int& i) {
|
|||
return argv[i++];
|
||||
}
|
||||
|
||||
// get application FLOPS params.
|
||||
// These can be specified manually in the <app>.
|
||||
// If not they are taken from a WU if one exists for the app.
|
||||
// If not they default to 1 GFLOPS/hour
|
||||
//
|
||||
void get_app_params() {
|
||||
unsigned int i, j;
|
||||
for (i=0; i<gstate.apps.size(); i++) {
|
||||
APP* app = gstate.apps[i];
|
||||
if (!app->fpops_est) {
|
||||
for (j=0; j<gstate.workunits.size(); j++) {
|
||||
WORKUNIT* wup = gstate.workunits[j];
|
||||
if (wup->app != app) continue;
|
||||
app->fpops_est = wup->rsc_fpops_est;
|
||||
break;
|
||||
}
|
||||
if (!app->fpops_est) {
|
||||
app->fpops_est = 3600 * 1e9;
|
||||
}
|
||||
}
|
||||
if (!app->fpops.mean) {
|
||||
app->fpops.mean = app->fpops_est;
|
||||
}
|
||||
if (!app->weight) {
|
||||
app->weight = 1;
|
||||
}
|
||||
fprintf(stderr, "app %s: fpops_est %f fpops mean %f\n",
|
||||
app->name, app->fpops_est, app->fpops.mean
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// zero backoffs and debts.
|
||||
//
|
||||
void clear_backoff() {
|
||||
unsigned int i;
|
||||
for (i=0; i<gstate.projects.size(); i++) {
|
||||
PROJECT* p = gstate.projects[i];
|
||||
p->cpu_pwf.reset();
|
||||
p->cuda_pwf.reset();
|
||||
p->ati_pwf.reset();
|
||||
p->min_rpc_time = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// remove apps with no app versions,
|
||||
// then projects with no apps
|
||||
//
|
||||
void cull_projects() {
|
||||
unsigned int i;
|
||||
|
||||
for (i=0; i<gstate.apps.size(); i++) {
|
||||
APP* app = gstate.apps[i];
|
||||
app->has_version = false;
|
||||
}
|
||||
for (i=0; i<gstate.app_versions.size(); i++) {
|
||||
APP_VERSION* avp = gstate.app_versions[i];
|
||||
avp->app->has_version = true;
|
||||
}
|
||||
for (i=0; i<gstate.projects.size(); i++) {
|
||||
PROJECT* p = gstate.projects[i];
|
||||
p->dont_request_more_work = true;
|
||||
}
|
||||
for (i=0; i<gstate.apps.size(); i++) {
|
||||
APP* app = gstate.apps[i];
|
||||
if (app->has_version) {
|
||||
app->project->dont_request_more_work = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define SUMMARY_FILE "sim_summary.txt"
|
||||
#define LOG_FILE "sim_log.txt"
|
||||
|
||||
|
@ -746,8 +816,19 @@ void CLIENT_STATE::do_client_simulation() {
|
|||
read_config_file(true);
|
||||
config.show();
|
||||
|
||||
add_platform("client simulator");
|
||||
parse_state_file();
|
||||
read_global_prefs();
|
||||
for (unsigned int i=0; i<projects.size(); i++) {
|
||||
projects[i]->index = i;
|
||||
}
|
||||
|
||||
gstate.now = 86400;
|
||||
get_app_params();
|
||||
clear_backoff();
|
||||
|
||||
gstate.workunits.clear();
|
||||
gstate.results.clear();
|
||||
|
||||
gstate.set_ncpus();
|
||||
work_fetch.init();
|
||||
|
|
|
@ -99,8 +99,8 @@ int ACTIVE_TASK::request_exit() {
|
|||
int ACTIVE_TASK::resume_or_start(bool first_time) {
|
||||
if (log_flags.task) {
|
||||
msg_printf(result->project, MSG_INFO,
|
||||
"[task] %s task %s",
|
||||
first_time?"Starting":"Resuming", result->name
|
||||
"[task] %s task %s: time left %f",
|
||||
first_time?"Starting":"Resuming", result->name, cpu_time_left
|
||||
);
|
||||
}
|
||||
set_task_state(PROCESS_EXECUTING, "start");
|
||||
|
|
|
@ -292,9 +292,11 @@ int TIME_STATS::parse(MIOFILE& in) {
|
|||
if (match_tag(buf, "</time_stats>")) return 0;
|
||||
else if (parse_double(buf, "<last_update>", x)) {
|
||||
if (x < 0 || x > gstate.now) {
|
||||
#ifndef SIM
|
||||
msg_printf(0, MSG_INTERNAL_ERROR,
|
||||
"bad value %f of time stats last update; ignoring", x
|
||||
);
|
||||
#endif
|
||||
} else {
|
||||
last_update = x;
|
||||
}
|
||||
|
|
|
@ -970,6 +970,27 @@ void WORK_FETCH::compute_shares() {
|
|||
}
|
||||
}
|
||||
|
||||
void WORK_FETCH::request_string(char* buf) {
|
||||
char buf2[256];
|
||||
sprintf(buf,
|
||||
"[work_fetch] request: %.2f sec CPU (%.2f sec, %.2f)",
|
||||
cpu_work_fetch.req_secs,
|
||||
cpu_work_fetch.req_secs, cpu_work_fetch.req_instances
|
||||
);
|
||||
if (gstate.host_info.have_cuda()) {
|
||||
sprintf(buf2, " NVIDIA GPU (%.2f sec, %.2f)",
|
||||
cuda_work_fetch.req_secs, cuda_work_fetch.req_instances
|
||||
);
|
||||
strcat(buf, buf2);
|
||||
}
|
||||
if (gstate.host_info.have_ati()) {
|
||||
sprintf(buf2, " ATI GPU (%.2f sec, %.2f)",
|
||||
ati_work_fetch.req_secs, ati_work_fetch.req_instances
|
||||
);
|
||||
strcat(buf, buf2);
|
||||
}
|
||||
}
|
||||
|
||||
void WORK_FETCH::write_request(FILE* f, PROJECT* p) {
|
||||
double work_req = cpu_work_fetch.req_secs;
|
||||
|
||||
|
@ -1001,24 +1022,8 @@ void WORK_FETCH::write_request(FILE* f, PROJECT* p) {
|
|||
cpu_work_fetch.req_secs?cpu_work_fetch.busy_time_estimator.get_busy_time():0
|
||||
);
|
||||
if (log_flags.work_fetch_debug) {
|
||||
char buf[256], buf2[256];
|
||||
sprintf(buf,
|
||||
"[work_fetch] request: %.2f sec CPU (%.2f sec, %.2f)",
|
||||
work_req,
|
||||
cpu_work_fetch.req_secs, cpu_work_fetch.req_instances
|
||||
);
|
||||
if (gstate.host_info.have_cuda()) {
|
||||
sprintf(buf2, " NVIDIA GPU (%.2f sec, %.2f)",
|
||||
cuda_work_fetch.req_secs, cuda_work_fetch.req_instances
|
||||
);
|
||||
strcat(buf, buf2);
|
||||
}
|
||||
if (gstate.host_info.have_ati()) {
|
||||
sprintf(buf2, " ATI GPU (%.2f sec, %.2f)",
|
||||
ati_work_fetch.req_secs, ati_work_fetch.req_instances
|
||||
);
|
||||
strcat(buf, buf2);
|
||||
}
|
||||
char buf[256];
|
||||
request_string(buf);
|
||||
msg_printf(p, MSG_INFO, buf);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -267,6 +267,7 @@ struct WORK_FETCH {
|
|||
void compute_shares();
|
||||
void zero_debts();
|
||||
void clear_backoffs(APP_VERSION&);
|
||||
void request_string(char*);
|
||||
};
|
||||
|
||||
extern RSC_WORK_FETCH cuda_work_fetch;
|
||||
|
|
|
@ -219,4 +219,11 @@ function show_link($url) {
|
|||
echo "<br><a href=$url>$url</a>";
|
||||
}
|
||||
|
||||
function get_str2($x) {
|
||||
if (array_key_exists($x, $_GET)) {
|
||||
return $_GET[$x];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -91,7 +91,6 @@ function show_download($pname) {
|
|||
.tra("You may run this software on a computer only if you own the computer or have the permission of its owner.").
|
||||
"<p>"
|
||||
;
|
||||
if ($_GET['foo']) $pname = null;
|
||||
if ($pname) {
|
||||
download_link($pname, true);
|
||||
} else {
|
||||
|
@ -134,7 +133,7 @@ function show_download($pname) {
|
|||
";
|
||||
}
|
||||
|
||||
if ($_GET['xml']) {
|
||||
if (get_str2('xml')) {
|
||||
$args = strstr($_SERVER['REQUEST_URI'], '?');
|
||||
Header("Location: download_all.php$args");
|
||||
exit();
|
||||
|
@ -142,7 +141,7 @@ if ($_GET['xml']) {
|
|||
|
||||
page_head(tra("BOINC: compute for science"));
|
||||
|
||||
if ($_GET['all_platforms']) {
|
||||
if (get_str2('all_platforms')) {
|
||||
show_download(null);
|
||||
} else if (strstr($client_info, 'Windows')) {
|
||||
if (strstr($client_info, 'Win64')||strstr($client_info, 'WOW64')) {
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
require_once("docutil.php");
|
||||
require_once("versions.inc");
|
||||
|
||||
$xml = $_GET["xml"];
|
||||
$dev = $_GET["dev"];
|
||||
$pname = $_GET["platform"];
|
||||
$min_version = $_GET["min_version"];
|
||||
$max_version = $_GET["max_version"];
|
||||
$version = $_GET["version"];
|
||||
$type_name = $_GET["type"];
|
||||
$xml = get_str2("xml");
|
||||
$dev = get_str2("dev");
|
||||
$pname = get_str2("platform");
|
||||
$min_version = get_str2("min_version");
|
||||
$max_version = get_str2("max_version");
|
||||
$version = get_str2("version");
|
||||
$type_name = get_str2("type");
|
||||
$client_info = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
if (!$xml) $dev=1;
|
||||
|
|
|
@ -88,7 +88,7 @@ function forum_rss($forumid, $userid, $truncate, $threads_only, $ndays) {
|
|||
// Create channel header and open XML content
|
||||
//
|
||||
$description = PROJECT.": $forum->title";
|
||||
if ($user) {
|
||||
if ($userid) {
|
||||
$description .= " (posts by $user->name)";
|
||||
}
|
||||
$channel_image = URL_BASE . "rss_image.gif";
|
||||
|
|
|
@ -199,7 +199,7 @@ function site_list($sites) {
|
|||
$s = $sites[$i];
|
||||
$url = $s[0];
|
||||
$name = $s[1];
|
||||
$comment = $s[2];
|
||||
$comment = array_key_exists(2, $s)?$s[2]:"";
|
||||
echo "<li><a href=\"$url\">$name</a> $comment\n";
|
||||
}
|
||||
echo "</ul>\n";
|
||||
|
|
Loading…
Reference in New Issue