2012-05-08 12:31:37 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2012 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
// configurable app plan functions.
|
|
|
|
// see http://boinc.berkeley.edu/trac/wiki/AppPlanConfig
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <regex.h>
|
|
|
|
|
2015-01-06 00:32:30 +00:00
|
|
|
// if you add anything here, initialize if in the constructor
|
|
|
|
//
|
2012-05-08 12:31:37 +00:00
|
|
|
struct PLAN_CLASS_SPEC {
|
2012-05-14 06:54:38 +00:00
|
|
|
char name[256];
|
|
|
|
char gpu_type[256];
|
|
|
|
bool cuda;
|
|
|
|
bool cal;
|
|
|
|
bool opencl;
|
|
|
|
bool virtualbox;
|
|
|
|
bool is64bit;
|
|
|
|
std::vector<std::string> cpu_features;
|
2012-06-06 04:45:12 +00:00
|
|
|
double min_ncpus;
|
2012-05-14 06:54:38 +00:00
|
|
|
int max_threads;
|
2014-10-07 11:03:35 +00:00
|
|
|
bool nthreads_cmdline;
|
2012-05-14 06:54:38 +00:00
|
|
|
double projected_flops_scale;
|
|
|
|
bool have_os_regex;
|
|
|
|
regex_t os_regex;
|
2014-10-27 17:36:32 +00:00
|
|
|
bool have_cpu_vendor_regex;
|
|
|
|
regex_t cpu_vendor_regex;
|
2014-05-27 09:27:30 +00:00
|
|
|
double min_os_version;
|
2015-01-06 00:32:30 +00:00
|
|
|
// Win versions can be 9 digits; may as well be safe
|
2014-05-27 09:27:30 +00:00
|
|
|
double max_os_version;
|
2015-01-06 00:32:30 +00:00
|
|
|
int min_android_version;
|
|
|
|
int max_android_version;
|
2012-05-14 06:54:38 +00:00
|
|
|
char project_prefs_tag[256];
|
|
|
|
bool have_project_prefs_regex;
|
|
|
|
regex_t project_prefs_regex;
|
2014-05-27 07:38:40 +00:00
|
|
|
bool project_prefs_default_true;
|
2012-05-14 06:54:38 +00:00
|
|
|
double avg_ncpus;
|
2013-01-28 23:22:02 +00:00
|
|
|
int min_core_client_version;
|
|
|
|
int max_core_client_version;
|
2012-05-14 06:54:38 +00:00
|
|
|
// for non-compute-intensive, or override for GPU apps
|
2013-04-15 19:00:14 +00:00
|
|
|
bool have_host_summary_regex;
|
|
|
|
regex_t host_summary_regex;
|
2012-05-08 12:31:37 +00:00
|
|
|
|
2012-05-14 06:54:38 +00:00
|
|
|
// GPU apps
|
|
|
|
//
|
2012-05-14 19:49:12 +00:00
|
|
|
double cpu_frac;
|
2012-05-08 12:31:37 +00:00
|
|
|
double min_gpu_ram_mb;
|
2012-05-14 06:54:38 +00:00
|
|
|
// for older clients that don't report available RAM
|
2012-05-08 12:31:37 +00:00
|
|
|
double gpu_ram_used_mb;
|
2012-05-14 06:54:38 +00:00
|
|
|
double gpu_peak_flops_scale;
|
|
|
|
double ngpus;
|
|
|
|
int min_driver_version;
|
|
|
|
int max_driver_version;
|
|
|
|
char gpu_utilization_tag[256];
|
|
|
|
// the project prefs tag for user-supplied gpu_utilization factor
|
2012-05-08 12:31:37 +00:00
|
|
|
|
2012-06-07 03:39:37 +00:00
|
|
|
// AMD/ATI apps
|
|
|
|
//
|
|
|
|
bool need_ati_libs;
|
2013-06-26 02:17:46 +00:00
|
|
|
bool need_amd_libs;
|
|
|
|
// need DLLs w/ ATI or AMD name (default: neither)
|
2012-06-07 21:08:47 +00:00
|
|
|
int min_cal_target;
|
|
|
|
int max_cal_target;
|
2013-04-25 20:28:41 +00:00
|
|
|
bool without_opencl; // restrict to CAL only GPUs
|
2012-06-07 03:39:37 +00:00
|
|
|
|
2012-05-14 06:54:38 +00:00
|
|
|
// NVIDIA apps
|
|
|
|
//
|
|
|
|
int min_nvidia_compcap;
|
|
|
|
int max_nvidia_compcap;
|
2012-05-08 12:31:37 +00:00
|
|
|
|
2012-05-14 06:54:38 +00:00
|
|
|
// CUDA apps
|
|
|
|
//
|
|
|
|
int min_cuda_version;
|
|
|
|
int max_cuda_version;
|
2012-05-08 12:31:37 +00:00
|
|
|
|
2012-05-14 06:54:38 +00:00
|
|
|
// OpenCL apps
|
|
|
|
//
|
|
|
|
int min_opencl_version;
|
|
|
|
int max_opencl_version;
|
2013-04-11 01:20:22 +00:00
|
|
|
int min_opencl_driver_revision;
|
|
|
|
int max_opencl_driver_revision;
|
2014-06-26 14:11:15 +00:00
|
|
|
bool double_precision_fp;
|
2012-05-14 06:54:38 +00:00
|
|
|
|
|
|
|
// VirtualBox apps
|
|
|
|
//
|
|
|
|
int min_vbox_version;
|
|
|
|
int max_vbox_version;
|
2014-09-23 17:58:29 +00:00
|
|
|
vector<int> exclude_vbox_version;
|
2013-12-03 23:54:56 +00:00
|
|
|
bool vm_accel_required;
|
2012-05-08 12:31:37 +00:00
|
|
|
|
2012-05-14 06:54:38 +00:00
|
|
|
int parse(XML_PARSER&);
|
2014-06-05 06:39:10 +00:00
|
|
|
bool opencl_check(OPENCL_DEVICE_PROP&);
|
2012-05-08 12:31:37 +00:00
|
|
|
bool check(SCHEDULER_REQUEST& sreq, HOST_USAGE& hu);
|
|
|
|
PLAN_CLASS_SPEC();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct PLAN_CLASS_SPECS {
|
|
|
|
std::vector<PLAN_CLASS_SPEC> classes;
|
2012-06-06 03:47:13 +00:00
|
|
|
int parse_file(const char*);
|
2012-05-08 12:31:37 +00:00
|
|
|
int parse_specs(FILE*);
|
|
|
|
bool check(SCHEDULER_REQUEST& sreq, char* plan_class, HOST_USAGE& hu);
|
|
|
|
PLAN_CLASS_SPECS(){};
|
|
|
|
};
|