63
68
while (!xp.get(tag, sizeof(tag), is_tag)) {
65
msg_printf(NULL, MSG_USER_ERROR,
66
"Unexpected text %s in %s", tag, CONFIG_FILE
70
msg_printf_notice(NULL, false,
71
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=log_flags",
73
_("Unexpected text in cc_config.xml"),
84
92
if (xp.parse_bool(tag, "debt_debug", debt_debug)) continue;
85
93
if (xp.parse_bool(tag, "std_debug", std_debug)) continue;
86
94
if (xp.parse_bool(tag, "file_xfer_debug", file_xfer_debug)) continue;
87
if (xp.parse_bool(tag, "guirpc_debug", guirpc_debug)) continue;
95
if (xp.parse_bool(tag, "gui_rpc_debug", gui_rpc_debug)) continue;
96
if (xp.parse_bool(tag, "heartbeat_debug", heartbeat_debug)) continue;
88
97
if (xp.parse_bool(tag, "http_debug", http_debug)) continue;
89
98
if (xp.parse_bool(tag, "http_xfer_debug", http_xfer_debug)) continue;
90
99
if (xp.parse_bool(tag, "mem_usage_debug", mem_usage_debug)) continue;
101
110
if (xp.parse_bool(tag, "time_debug", time_debug)) continue;
102
111
if (xp.parse_bool(tag, "unparsed_xml", unparsed_xml)) continue;
103
112
if (xp.parse_bool(tag, "work_fetch_debug", work_fetch_debug)) continue;
113
if (xp.parse_bool(tag, "notice_debug", notice_debug)) continue;
105
msg_printf(NULL, MSG_USER_ERROR, "Unrecognized tag in %s: <%s>\n",
115
msg_printf_notice(NULL, false,
116
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=log_flags",
118
_("Unrecognized tag in cc_config.xml"),
108
121
xp.skip_unexpected(tag, true, "LOG_FLAGS::parse");
143
156
show_flag(buf, dcf_debug, "dcf_debug");
144
157
show_flag(buf, debt_debug, "debt_debug");
145
158
show_flag(buf, file_xfer_debug, "file_xfer_debug");
146
show_flag(buf, guirpc_debug, "guirpc_debug");
159
show_flag(buf, gui_rpc_debug, "gui_rpc_debug");
160
show_flag(buf, heartbeat_debug, "heartbeat_debug");
147
161
show_flag(buf, http_debug, "http_debug");
148
162
show_flag(buf, http_xfer_debug, "http_xfer_debug");
149
163
show_flag(buf, mem_usage_debug, "mem_usage_debug");
161
175
show_flag(buf, time_debug, "time_debug");
162
176
show_flag(buf, unparsed_xml, "unparsed_xml");
163
177
show_flag(buf, work_fetch_debug, "work_fetch_debug");
178
show_flag(buf, notice_debug, "notice_debug");
165
180
if (strlen(buf)) {
166
181
msg_printf(NULL, MSG_INFO, "log flags: %s", buf);
178
193
void CONFIG::show() {
181
msg_printf(NULL, MSG_INFO, "Config: use at most %d CPUs", config.ncpus);
196
msg_printf(NULL, MSG_INFO, "Config: simulate %d CPUs", config.ncpus);
184
199
msg_printf(NULL, MSG_INFO, "Config: don't use coprocessors");
202
msg_printf(NULL, MSG_INFO, "Config: don't fetch project list or client version info");
186
204
if (no_priority_change) {
187
205
msg_printf(NULL, MSG_INFO, "Config: run apps at regular priority");
195
213
if (zero_debts) {
196
214
msg_printf(NULL, MSG_INFO, "Config: zero long-term debts on startup");
216
if (fetch_minimal_work) {
217
msg_printf(NULL, MSG_INFO, "Config: fetch minimal work");
198
219
show_gpu_ignore(ignore_cuda_dev, "NVIDIA");
199
220
show_gpu_ignore(ignore_ati_dev, "ATI");
200
221
for (i=0; i<exclusive_apps.size(); i++) {
258
282
max_file_xfers_per_project = MAX_FILE_XFERS_PER_PROJECT;
259
283
max_stderr_file_size = 0;
260
284
max_stdout_file_size = 0;
285
max_tasks_reported = 0;
262
287
network_test_url = "http://www.google.com/";
263
288
no_alt_platform = false;
290
no_info_fetch = false;
265
291
no_priority_change = false;
266
292
os_random_only = false;
267
293
report_results_immediately = false;
268
294
run_apps_manually = false;
269
295
save_stats_days = 30;
270
296
simple_gui_only = false;
297
skip_cpu_benchmarks = false;
272
299
stderr_head = false;
273
300
suppress_net_info = false;
301
unsigned_apps_ok = false;
274
302
use_all_gpus = false;
275
303
use_certs = false;
276
304
use_certs_only = false;
297
325
while (!xp.get(tag, sizeof(tag), is_tag)) {
299
msg_printf(NULL, MSG_USER_ERROR,
300
"Unexpected text %s in %s", tag, CONFIG_FILE
327
msg_printf_notice(NULL, false,
328
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=config",
330
_("Unexpected text in cc_config.xml"),
330
361
if (xp.parse_bool(tag, "dont_check_file_sizes", dont_check_file_sizes)) continue;
331
362
if (xp.parse_bool(tag, "dont_contact_ref_site", dont_contact_ref_site)) continue;
332
363
if (xp.parse_string(tag, "exclusive_app", s)) {
333
exclusive_apps.push_back(s);
364
if (!strstr(s.c_str(), "boinc")) {
365
exclusive_apps.push_back(s);
336
369
if (xp.parse_string(tag, "exclusive_gpu_app", s)) {
337
exclusive_gpu_apps.push_back(s);
370
if (!strstr(s.c_str(), "boinc")) {
371
exclusive_gpu_apps.push_back(s);
375
if (xp.parse_bool(tag, "exit_after_finish", exit_after_finish)) continue;
376
if (xp.parse_bool(tag, "exit_when_idle", exit_when_idle)) {
377
if (exit_when_idle) {
378
report_results_immediately = true;
382
if (xp.parse_bool(tag, "fetch_minimal_work", fetch_minimal_work)) continue;
340
383
if (xp.parse_string(tag, "force_auth", force_auth)) {
341
384
downcase_string(force_auth);
354
397
if (xp.parse_int(tag, "max_file_xfers_per_project", max_file_xfers_per_project)) continue;
355
398
if (xp.parse_int(tag, "max_stderr_file_size", max_stderr_file_size)) continue;
356
399
if (xp.parse_int(tag, "max_stdout_file_size", max_stdout_file_size)) continue;
400
if (xp.parse_int(tag, "max_tasks_reported", max_tasks_reported)) continue;
357
401
if (xp.parse_int(tag, "ncpus", ncpus)) continue;
358
402
if (xp.parse_string(tag, "network_test_url", network_test_url)) {
359
403
downcase_string(network_test_url);
362
406
if (xp.parse_bool(tag, "no_alt_platform", no_alt_platform)) continue;
363
407
if (xp.parse_bool(tag, "no_gpus", no_gpus)) continue;
408
if (xp.parse_bool(tag, "no_info_fetch", no_info_fetch)) continue;
364
409
if (xp.parse_bool(tag, "no_priority_change", no_priority_change)) continue;
365
410
if (xp.parse_bool(tag, "os_random_only", os_random_only)) continue;
374
419
if (xp.parse_bool(tag, "run_apps_manually", run_apps_manually)) continue;
375
420
if (xp.parse_int(tag, "save_stats_days", save_stats_days)) continue;
376
421
if (xp.parse_bool(tag, "simple_gui_only", simple_gui_only)) continue;
422
if (xp.parse_bool(tag, "skip_cpu_benchmarks", skip_cpu_benchmarks)) continue;
377
423
if (xp.parse_double(tag, "start_delay", start_delay)) continue;
378
424
if (xp.parse_bool(tag, "stderr_head", stderr_head)) continue;
379
425
if (xp.parse_bool(tag, "suppress_net_info", suppress_net_info)) continue;
426
if (xp.parse_bool(tag, "unsigned_apps_ok", unsigned_apps_ok)) continue;
380
427
if (xp.parse_bool(tag, "use_all_gpus", use_all_gpus)) continue;
381
428
if (xp.parse_bool(tag, "use_certs", use_certs)) continue;
382
429
if (xp.parse_bool(tag, "use_certs_only", use_certs_only)) continue;
383
430
if (xp.parse_bool(tag, "zero_debts", zero_debts)) continue;
384
if (xp.parse_bool(tag, "skip_cpu_benchmarks", btemp)) {
385
gstate.skip_cpu_benchmarks = btemp;
388
if (xp.parse_bool(tag, "unsigned_apps_ok", btemp)) {
389
gstate.unsigned_apps_ok = btemp;
392
if (xp.parse_bool(tag, "exit_after_finish", btemp)) {
393
gstate.exit_after_finish = btemp;
397
msg_printf(NULL, MSG_USER_ERROR, "Unrecognized tag in %s: <%s>\n",
432
msg_printf_notice(NULL, false,
433
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=config",
435
_("Unrecognized tag in cc_config.xml"),
400
438
xp.skip_unexpected(tag, true, "CONFIG::parse_options");
412
450
if (!xp.parse_start("cc_config")) {
413
msg_printf(NULL, MSG_USER_ERROR, "Missing start tag in %s", CONFIG_FILE);
451
msg_printf_notice(NULL, false,
452
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=config",
454
_("Missing start tag in cc_config.xml")
414
456
return ERR_XML_PARSE;
416
458
while (!xp.get(tag, sizeof(tag), is_tag)) {
418
msg_printf(NULL, MSG_USER_ERROR,
419
"Unexpected text %s in %s", tag, CONFIG_FILE
460
msg_printf_notice(NULL, false,
461
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=config",
463
_("Unexpected text in cc_config.xml"),
429
474
parse_options(xp);
432
msg_printf(NULL, MSG_USER_ERROR, "Unparsed tag in %s: <%s>\n",
477
if (!strcmp(tag, "options/")) continue;
478
if (!strcmp(tag, "log_flags/")) continue;
479
msg_printf_notice(NULL, false,
480
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=config",
482
_("Unrecognized tag in cc_config.xml"),
435
485
xp.skip_unexpected(tag, true, "CONFIG.parse");
437
msg_printf(NULL, MSG_USER_ERROR, "Missing end tag in %s", CONFIG_FILE);
487
msg_printf_notice(NULL, false,
488
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=config",
490
_("Missing end tag in cc_config.xml")
438
492
return ERR_XML_PARSE;
445
499
msg_printf(NULL, MSG_INFO, "Re-reading cc_config.xml");
448
503
f = boinc_fopen(CONFIG_FILE, "r");
449
504
if (!f) return ERR_FOPEN;
505
int retval = config.parse(f);
507
if (retval) return retval;
509
diagnostics_set_max_file_sizes(
510
config.max_stdout_file_size, config.max_stderr_file_size