- API: get rid of BOINC_OPTIONS::backwards_compatible_graphics.

Not necessary.
- wrapper: add optional <append_cmdline_args/> element to
    task descriptor.
    If set, pass the wrapper's cmdline args to that task.
    NOTE: previously they were always passed.
    If you want this behavior, you now must set this.


svn path=/trunk/boinc/; revision=23232
This commit is contained in:
David Anderson 2011-03-14 17:28:52 +00:00
parent 73dfafde79
commit c168971770
4 changed files with 43 additions and 28 deletions

View File

@ -527,9 +527,7 @@ void boinc_exit(int status) {
int retval;
char buf[256];
if (options.backwards_compatible_graphics) {
graphics_cleanup();
}
graphics_cleanup();
if (options.main_program && file_lock.locked) {
retval = file_lock.unlock(LOCKFILE);
@ -985,9 +983,7 @@ static void timer_handler() {
if (in_critical_section==0 && options.handle_process_control) {
handle_process_control_msg();
}
if (options.backwards_compatible_graphics) {
handle_graphics_messages();
}
handle_graphics_messages();
}
if (interrupt_count % TIMERS_PER_SEC) return;

View File

@ -32,28 +32,32 @@
#ifdef __cplusplus
extern "C" {
#endif
// parameters passed to the BOINC runtime system
//
typedef struct BOINC_OPTIONS {
// the following are booleans, implemented as ints for portability
int backwards_compatible_graphics;
// V6 apps should set this so that "Show Graphics" will work
// with pre-V6 clients
int normal_thread_priority;
// run app at normal thread priority on Win.
// run worker thread at normal thread priority on Win.
// (default is idle priority)
int main_program;
// this is the main program, so
// - lock a lock file in the slot directory
// - write finish file on successful boinc_finish()
int check_heartbeat;
// check for timeout of heartbeats from the client;
// action is determined by direct_process_action (see below)
int handle_trickle_ups;
// this process is allowed to call boinc_send_trickle_up()
// periodically check for trickle-up msgs from the app
// must set this to use boinc_send_trickle_up()
int handle_trickle_downs;
// this process is allowed to call boinc_receive_trickle_down()
int handle_process_control;
// whether runtime system should read suspend/resume/quit/abort
// msgs from client.
// action is determined by direct_process_action (see below)
int send_status_msgs;
// send CPU time / fraction done msgs
// whether runtime system should send CPU time / fraction done msgs
int direct_process_action;
// if heartbeat fail, or get process control msg, take
// direction action (exit, suspend, resume).
@ -148,7 +152,6 @@ inline void boinc_options_defaults(BOINC_OPTIONS& b) {
b.handle_process_control = 1;
b.send_status_msgs = 1;
b.direct_process_action = 1;
b.backwards_compatible_graphics = 1;
b.normal_thread_priority = 0;
}

View File

@ -1613,3 +1613,17 @@ David 13 Mar 2011
cpu_sched.cpp
sched/
validator.cpp
David 14 Mar 2011
- API: get rid of BOINC_OPTIONS::backwards_compatible_graphics.
Not necessary.
- wrapper: add optional <append_cmdline_args/> element to
task descriptor.
If set, pass the wrapper's cmdline args to that task.
NOTE: previously they were always passed.
If you want this behavior, you now must set this.
samples/wrapper/
wrapper.cpp
api/
boinc_api.cpp,h

View File

@ -75,6 +75,7 @@ struct TASK {
double weight;
// contribution of this task to overall fraction done
bool is_daemon;
bool append_cmdline_args;
// dynamic stuff follows
double final_cpu_time;
@ -169,7 +170,6 @@ struct TASK {
vector<TASK> tasks;
vector<TASK> daemons;
APP_INIT_DATA aid;
bool graphics = false;
// macro replacement in wrapper strings from job.xml
// for example PROJECT_DIR can be replaced in exec_dir and environment variables
@ -199,6 +199,7 @@ int TASK::parse(XML_PARSER& xp) {
stat_first = true;
pid = 0;
is_daemon = false;
append_cmdline_args = false;
while (!xp.get(tag, sizeof(tag), is_tag)) {
if (!is_tag) {
@ -233,6 +234,7 @@ int TASK::parse(XML_PARSER& xp) {
else if (xp.parse_string(tag, "fraction_done_filename", fraction_done_filename)) continue;
else if (xp.parse_double(tag, "weight", weight)) continue;
else if (xp.parse_bool(tag, "daemon", is_daemon)) continue;
else if (xp.parse_bool(tag, "append_cmdline_args", append_cmdline_args)) continue;
}
return ERR_XML_PARSE;
}
@ -258,7 +260,7 @@ int parse_job_file() {
while (!xp.get(tag, sizeof(tag), is_tag)) {
if (!is_tag) {
fprintf(stderr,
"%s SCHED_CONFIG::parse(): unexpected text %s\n",
"%s unexpected text in job.xml: %s\n",
boinc_msg_prefix(buf2, sizeof(buf2)), tag
);
continue;
@ -277,6 +279,12 @@ int parse_job_file() {
tasks.push_back(task);
}
}
continue;
} else {
fprintf(stderr,
"%s unexpected tag in job.xml: %s\n",
boinc_msg_prefix(buf2, sizeof(buf2)), tag
);
}
}
fclose(f);
@ -376,11 +384,14 @@ int TASK::run(int argct, char** argvt) {
boinc_resolve_filename(buf, app_path, sizeof(app_path));
}
// Append wrapper's command-line arguments to those in the job file.
// Optionally append wrapper's command-line arguments
// to those in the job file.
//
for (int i=1; i<argct; i++){
command_line += string(" ");
command_line += argvt[i];
if (append_cmdline_args) {
for (int i=1; i<argct; i++){
command_line += string(" ");
command_line += argvt[i];
}
}
fprintf(stderr, "%s wrapper: running %s (%s)\n",
@ -675,19 +686,10 @@ int main(int argc, char** argv) {
double checkpoint_cpu_time;
// overall CPU time at last checkpoint
for (i=1; i<(unsigned int)argc; i++) {
if (!strcmp(argv[i], "--graphics")) {
graphics = true;
}
}
memset(&options, 0, sizeof(options));
options.main_program = true;
options.check_heartbeat = true;
options.handle_process_control = true;
if (graphics) {
options.backwards_compatible_graphics = true;
}
boinc_init_options(&options);
fprintf(stderr, "wrapper: starting\n");