From 4774eeda5208ecc815b14293ee1e835a44015c04 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 24 Dec 2011 05:07:20 +0000 Subject: [PATCH] - make_project: don't try to copy nonexistent file; fixes #1166 - scheduler: change Vbox app plan function to accommodate single and multithreaded variants svn path=/trunk/boinc/; revision=24884 --- checkin_notes | 10 ++++++++++ py/Boinc/setup_project.py | 2 +- sched/sched_customize.cpp | 35 +++++++++++++++++++++++++---------- 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/checkin_notes b/checkin_notes index 1021be9205..fcaf9ba1bf 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9378,3 +9378,13 @@ Rom 23 Dec 2011 html/inc/ host.inc + +David 23 Dec 2011 + - make_project: don't try to copy nonexistent file; fixes #1166 + - scheduler: change Vbox app plan function to accommodate + single and multithreaded variants + + py/Boinc/ + setup_project.py + sched/ + sched_customize.cpp diff --git a/py/Boinc/setup_project.py b/py/Boinc/setup_project.py index 4c5b22825c..45e13ddcac 100644 --- a/py/Boinc/setup_project.py +++ b/py/Boinc/setup_project.py @@ -379,7 +379,7 @@ sys.path.insert(0, os.path.join('%s', 'py')) 'single_job_assimilator', 'assimilator.py', 'pymw_assimilator.py', 'update_stats', 'db_dump', 'db_purge', 'show_shmem', 'census', - 'delete_file', 'request_file_list', 'get_file', 'put_file' ]) + 'delete_file', 'get_file', 'put_file' ]) map(lambda (s): install(srcdir('tools',s), dir('bin',s)), [ 'appmgr', 'create_work', 'xadd', 'dbcheck_files_exist', 'run_in_ops', 'update_versions', 'parse_config', 'grep_logs', 'db_query', diff --git a/sched/sched_customize.cpp b/sched/sched_customize.cpp index b79231acf1..c1fb264aa3 100644 --- a/sched/sched_customize.cpp +++ b/sched/sched_customize.cpp @@ -125,6 +125,7 @@ static inline bool app_plan_mt( ) { double ncpus = g_wreq->effective_ncpus; // number of usable CPUs, taking user prefs into account + if (ncpus < 2) return false; int nthreads = (int)ncpus; if (nthreads > 64) nthreads = 64; hu.avg_ncpus = nthreads; @@ -514,7 +515,7 @@ static inline bool app_plan_opencl( } static inline bool app_plan_vbox( - SCHEDULER_REQUEST& sreq, HOST_USAGE& hu, bool is_64bit + SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu ) { // make sure they have VirtualBox // @@ -530,14 +531,30 @@ static inline bool app_plan_vbox( // it will look in the 32-bit half of the registry and fail // PLATFORM* p = g_request->platforms.list[0]; - if (is_64bit != is_64b_platform(p->name)) { + if (strstr(plan_class, "64") && !is_64b_platform(p->name)) { return false; } - hu.avg_ncpus = 1; - hu.max_ncpus = 1; - hu.projected_flops = 1.1*sreq.host.p_fpops; - hu.peak_flops = sreq.host.p_fpops; + if (strstr(plan_class, "mt")) { + double ncpus = g_wreq->effective_ncpus; + // number of usable CPUs, taking user prefs into account + if (ncpus < 2) return false; + int nthreads = (int)ncpus; + if (nthreads > 2) nthreads = 2; + hu.avg_ncpus = nthreads; + sprintf(hu.cmdline, "--nthreads %d", nthreads); + } else { + hu.avg_ncpus = 1; + } + hu.max_ncpus = hu.avg_ncpus; + hu.projected_flops = sreq.host.p_fpops*hu.avg_ncpus; + hu.peak_flops = sreq.host.p_fpops*hu.avg_ncpus; + if (config.debug_version_select) { + log_messages.printf(MSG_NORMAL, + "[version] %s app projected %.2fG\n", + plan_class, hu.projected_flops/1e9 + ); + } return true; } @@ -557,10 +574,8 @@ bool app_plan(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu) { return app_plan_nci(sreq, hu); } else if (!strcmp(plan_class, "sse3")) { return app_plan_sse3(sreq, hu); - } else if (!strcmp(plan_class, "vbox32")) { - return app_plan_vbox(sreq, hu, false); - } else if (!strcmp(plan_class, "vbox64")) { - return app_plan_vbox(sreq, hu, true); + } else if (strstr(plan_class, "vbox")) { + return app_plan_vbox(sreq, plan_class, hu); } log_messages.printf(MSG_CRITICAL, "Unknown plan class: %s\n", plan_class