From 8168008631a379bf87c6b2217ecf0ec3cf32f611 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 5 Jan 2015 22:53:50 -0500 Subject: [PATCH] WRAPPER: Make creating/writing the graphics status file part of the job file configuration. No need to write it if there is not going to be a running graphics application. --- samples/wrapper/wrapper.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/samples/wrapper/wrapper.cpp b/samples/wrapper/wrapper.cpp index 0eeb56e7a4..7dd3f81e7d 100644 --- a/samples/wrapper/wrapper.cpp +++ b/samples/wrapper/wrapper.cpp @@ -98,6 +98,7 @@ int gpu_device_num = -1; double runtime = 0; // run time this session double trickle_period = 0; +bool enable_graphics_support = false; vector unzip_filenames; string zip_filename; vector zip_patterns; @@ -520,6 +521,7 @@ int parse_job_file() { parse_zip_output(xp); continue; } + if (xp.parse_bool("enable_graphics_support", enable_graphics_support)) continue; fprintf(stderr, "%s unexpected tag in job.xml: %s\n", boinc_msg_prefix(buf2, sizeof(buf2)), xp.parsed_tag @@ -1143,11 +1145,13 @@ int main(int argc, char** argv) { check_trickle_period(); } - boinc_write_graphics_status( - task.starting_cpu + cpu_time, - checkpoint_cpu_time + task.elapsed_time, - frac_done + task.weight/total_weight - ); + if (enable_graphics_support) { + boinc_write_graphics_status( + task.starting_cpu + cpu_time, + checkpoint_cpu_time + task.elapsed_time, + frac_done + task.weight/total_weight + ); + } boinc_sleep(POLL_PERIOD); if (!task.suspended) {