2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-01-20 23:22:22 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2003-07-03 00:48:43 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// 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.
|
2003-07-03 00:48:43 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-01-20 23:22:22 +00:00
|
|
|
// 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.
|
2002-04-30 22:22:54 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2002-04-30 22:22:54 +00:00
|
|
|
|
|
|
|
// If you change anything, make sure you also change:
|
2004-07-14 20:55:26 +00:00
|
|
|
// client_types.C (to write and parse it)
|
2002-04-30 22:22:54 +00:00
|
|
|
// client_state.C (to cross-link objects)
|
|
|
|
//
|
|
|
|
|
2017-04-08 06:54:49 +00:00
|
|
|
#ifndef BOINC_CLIENT_TYPES_H
|
|
|
|
#define BOINC_CLIENT_TYPES_H
|
2002-08-22 20:23:24 +00:00
|
|
|
|
2003-10-16 19:03:49 +00:00
|
|
|
#include "cpp.h"
|
2002-04-30 22:22:54 +00:00
|
|
|
|
2005-12-16 03:45:01 +00:00
|
|
|
#if !defined(_WIN32) || defined(__CYGWIN32__)
|
2009-02-26 00:23:23 +00:00
|
|
|
#include <cstdio>
|
2003-07-03 05:01:29 +00:00
|
|
|
#include <sys/time.h>
|
2012-05-09 16:11:50 +00:00
|
|
|
#include <sys/param.h>
|
2003-07-03 05:01:29 +00:00
|
|
|
#endif
|
|
|
|
|
2012-11-12 21:29:26 +00:00
|
|
|
#include "cc_config.h"
|
2016-02-16 02:53:07 +00:00
|
|
|
#include "str_replace.h"
|
2012-11-12 21:29:26 +00:00
|
|
|
#include "common_defs.h"
|
|
|
|
#include "coproc.h"
|
2008-09-04 12:50:54 +00:00
|
|
|
#include "cert_sig.h"
|
2012-11-12 21:29:26 +00:00
|
|
|
#include "filesys.h"
|
2002-04-30 22:22:54 +00:00
|
|
|
#include "hostinfo.h"
|
2017-07-29 21:51:39 +00:00
|
|
|
#include "keyword.h"
|
2012-11-12 21:29:26 +00:00
|
|
|
#include "md5_file.h"
|
2004-06-12 04:45:36 +00:00
|
|
|
#include "miofile.h"
|
2009-02-26 17:12:55 +00:00
|
|
|
|
2009-12-21 17:49:28 +00:00
|
|
|
#include "cs_notice.h"
|
2011-09-20 18:49:38 +00:00
|
|
|
#include "cs_trickle.h"
|
2012-04-30 21:00:28 +00:00
|
|
|
#include "rr_sim.h"
|
|
|
|
#include "work_fetch.h"
|
2002-04-30 22:22:54 +00:00
|
|
|
|
2010-09-24 20:02:42 +00:00
|
|
|
#ifdef SIM
|
|
|
|
#include "sim.h"
|
|
|
|
#endif
|
|
|
|
|
2005-10-03 18:05:58 +00:00
|
|
|
#define MAX_FILE_INFO_LEN 4096
|
|
|
|
#define MAX_SIGNATURE_LEN 4096
|
|
|
|
#define MAX_KEY_LEN 4096
|
|
|
|
|
2009-09-22 21:02:06 +00:00
|
|
|
#define MAX_COPROCS_PER_JOB 8
|
2011-03-25 03:44:09 +00:00
|
|
|
// max # of instances of a GPU that a job can use
|
|
|
|
|
|
|
|
extern int rsc_index(const char*);
|
|
|
|
extern const char* rsc_name(int);
|
2014-02-25 04:54:42 +00:00
|
|
|
extern const char* rsc_name_long(int);
|
2011-03-25 03:44:09 +00:00
|
|
|
extern COPROCS coprocs;
|
2009-09-22 21:02:06 +00:00
|
|
|
|
2011-07-20 19:12:10 +00:00
|
|
|
struct FILE_INFO;
|
2012-02-06 06:06:44 +00:00
|
|
|
struct ASYNC_VERIFY;
|
2011-07-20 19:12:10 +00:00
|
|
|
|
|
|
|
// represents a list of URLs (e.g. to download a file)
|
|
|
|
// and a current position in that list
|
|
|
|
//
|
|
|
|
struct URL_LIST {
|
|
|
|
std::vector<std::string> urls;
|
|
|
|
int start_index;
|
|
|
|
int current_index;
|
|
|
|
|
2015-10-18 18:56:48 +00:00
|
|
|
URL_LIST() {
|
|
|
|
clear();
|
|
|
|
}
|
2011-07-20 19:12:10 +00:00
|
|
|
|
|
|
|
void clear() {
|
|
|
|
urls.clear();
|
|
|
|
start_index = -1;
|
|
|
|
current_index = -1;
|
|
|
|
}
|
|
|
|
bool empty() {return urls.empty();}
|
|
|
|
const char* get_init_url();
|
|
|
|
const char* get_next_url();
|
|
|
|
const char* get_current_url(FILE_INFO&);
|
|
|
|
inline void add(std::string url) {
|
|
|
|
urls.push_back(url);
|
|
|
|
}
|
|
|
|
void replace(URL_LIST& ul) {
|
|
|
|
clear();
|
|
|
|
for (unsigned int i=0; i<ul.urls.size(); i++) {
|
|
|
|
add(ul.urls[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-12-21 19:20:28 +00:00
|
|
|
struct FILE_INFO {
|
2003-11-02 22:51:49 +00:00
|
|
|
char name[256];
|
2013-03-30 05:36:53 +00:00
|
|
|
char md5_cksum[MD5_LEN];
|
2003-11-02 22:51:49 +00:00
|
|
|
double max_nbytes;
|
|
|
|
double nbytes;
|
2012-01-26 08:39:51 +00:00
|
|
|
double gzipped_nbytes; // defined if download_gzipped is true
|
2003-11-02 22:51:49 +00:00
|
|
|
double upload_offset;
|
2011-10-11 17:41:10 +00:00
|
|
|
int status; // see above
|
2003-11-02 22:51:49 +00:00
|
|
|
bool executable; // change file protections to make executable
|
|
|
|
bool uploaded; // file has been uploaded
|
|
|
|
bool sticky; // don't delete unless instructed to do so
|
2014-09-23 19:39:09 +00:00
|
|
|
double sticky_lifetime;
|
|
|
|
// how long file should stay sticky.
|
|
|
|
// passed from the server;
|
|
|
|
// used by client to calculate sticky_expire_time.
|
|
|
|
double sticky_expire_time;
|
|
|
|
// if nonzero, when sticky status expires
|
2003-11-02 22:51:49 +00:00
|
|
|
bool signature_required; // true iff associated with app version
|
|
|
|
bool is_user_file;
|
2006-06-26 22:58:24 +00:00
|
|
|
bool is_project_file;
|
2013-04-03 00:23:37 +00:00
|
|
|
bool is_auto_update_file;
|
2011-07-20 19:12:10 +00:00
|
|
|
bool anonymous_platform_file;
|
2006-06-20 22:03:15 +00:00
|
|
|
bool gzip_when_done;
|
2010-04-01 05:54:29 +00:00
|
|
|
// for output files: gzip file when done, and append .gz to its name
|
2006-11-26 02:06:30 +00:00
|
|
|
class PERS_FILE_XFER* pers_file_xfer;
|
2010-04-01 05:54:29 +00:00
|
|
|
// nonzero if in the process of being up/downloaded
|
2009-12-21 19:20:28 +00:00
|
|
|
PROJECT* project;
|
2003-11-02 22:51:49 +00:00
|
|
|
int ref_cnt;
|
2011-07-20 19:12:10 +00:00
|
|
|
URL_LIST download_urls;
|
|
|
|
URL_LIST upload_urls;
|
- client: add a mechanism for restartable download of compressed files.
(It turns out that the compression schemes supported by
Apache and libcurl, suprisingly, aren't restartable.)
if a <file_info> from the server contains <gzipped_url> tags,
use those instead of the <url> tags,
and flag the file as "download_gzipped".
If this is the case, download NAME.gz and save it as NAME.gzt.
When the download is complete, rename NAME.gzt to NAME.gz,
and uncompress it to NAME.
(this ensures that if NAME.gz is present, it's complete).
Also do the uncompression, if needed, in verify_file().
This ensures that the uncompression will eventually get done
even if the client quits are crashes in the middle.
- update_versions: if <gzip> is present in a <file_info>,
add a gzipped copy in the download directory
and add a <gzipped_url> elements to the app version's xml_doc.
svn path=/trunk/boinc/; revision=25112
2012-01-20 23:34:15 +00:00
|
|
|
bool download_gzipped;
|
|
|
|
// if set, download NAME.gz and gunzip it to NAME
|
2005-10-03 18:05:58 +00:00
|
|
|
char xml_signature[MAX_SIGNATURE_LEN];
|
2011-07-20 20:08:05 +00:00
|
|
|
// the upload signature
|
2005-10-03 18:05:58 +00:00
|
|
|
char file_signature[MAX_SIGNATURE_LEN];
|
2010-04-01 05:54:29 +00:00
|
|
|
// if the file itself is signed (for executable files)
|
|
|
|
// this is the signature
|
2008-10-04 23:44:24 +00:00
|
|
|
std::string error_msg;
|
2010-04-01 05:54:29 +00:00
|
|
|
// if permanent error occurs during file xfer, it's recorded here
|
2008-09-04 12:50:54 +00:00
|
|
|
CERT_SIGS* cert_sigs;
|
2012-02-06 06:06:44 +00:00
|
|
|
ASYNC_VERIFY* async_verify;
|
2003-11-02 22:51:49 +00:00
|
|
|
|
|
|
|
FILE_INFO();
|
2012-02-06 23:33:23 +00:00
|
|
|
~FILE_INFO();
|
2004-09-02 16:23:21 +00:00
|
|
|
void reset();
|
2012-03-21 18:36:00 +00:00
|
|
|
int set_permissions(const char* path=0);
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-06-12 04:45:36 +00:00
|
|
|
int write(MIOFILE&, bool to_server);
|
2004-07-13 23:51:09 +00:00
|
|
|
int write_gui(MIOFILE&);
|
2008-10-04 23:44:24 +00:00
|
|
|
int delete_file();
|
2010-04-01 05:54:29 +00:00
|
|
|
// attempt to delete the underlying file
|
2006-03-30 22:21:18 +00:00
|
|
|
bool had_failure(int& failnum);
|
|
|
|
void failure_message(std::string&);
|
2004-07-06 18:31:56 +00:00
|
|
|
int merge_info(FILE_INFO&);
|
2012-02-08 19:30:57 +00:00
|
|
|
int verify_file(bool, bool, bool);
|
2008-09-04 12:17:58 +00:00
|
|
|
bool verify_file_certs();
|
2008-10-04 23:44:24 +00:00
|
|
|
int gzip();
|
2010-04-01 05:54:29 +00:00
|
|
|
// gzip file and add .gz to name
|
2012-01-26 23:13:00 +00:00
|
|
|
int gunzip(char*);
|
|
|
|
// unzip file and remove .gz from filename.
|
|
|
|
// optionally compute MD5 also
|
2011-07-20 19:12:10 +00:00
|
|
|
inline bool uploadable() {
|
|
|
|
return !upload_urls.empty();
|
|
|
|
}
|
|
|
|
inline bool downloadable() {
|
|
|
|
return !download_urls.empty();
|
|
|
|
}
|
|
|
|
inline URL_LIST& get_url_list(bool is_upload) {
|
|
|
|
return is_upload?upload_urls:download_urls;
|
|
|
|
}
|
2003-11-02 22:51:49 +00:00
|
|
|
};
|
|
|
|
|
2011-02-10 22:45:39 +00:00
|
|
|
// Describes a connection between a file and a workunit, result, or app version
|
|
|
|
//
|
2003-11-02 22:51:49 +00:00
|
|
|
struct FILE_REF {
|
2008-10-04 23:44:24 +00:00
|
|
|
char file_name[256];
|
2010-04-01 05:54:29 +00:00
|
|
|
// physical name
|
2008-10-04 23:44:24 +00:00
|
|
|
char open_name[256];
|
2010-04-01 05:54:29 +00:00
|
|
|
// logical name
|
2003-11-02 22:51:49 +00:00
|
|
|
bool main_program;
|
|
|
|
FILE_INFO* file_info;
|
2007-04-13 22:55:18 +00:00
|
|
|
bool copy_file;
|
2010-04-01 05:54:29 +00:00
|
|
|
// if true, core client will copy the file instead of linking
|
2013-04-03 00:23:37 +00:00
|
|
|
bool optional;
|
|
|
|
// for output files: app may not generate file;
|
|
|
|
// don't treat as error if file is missing.
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-06-12 04:45:36 +00:00
|
|
|
int write(MIOFILE&);
|
2003-11-02 22:51:49 +00:00
|
|
|
};
|
|
|
|
|
2009-07-16 16:35:57 +00:00
|
|
|
// file xfer backoff state for a project and direction (up/down)
|
|
|
|
// if file_xfer_failures exceeds FILE_XFER_FAILURE_LIMIT,
|
|
|
|
// we switch from a per-file to a project-wide backoff policy
|
|
|
|
// (separately for the up/down directions)
|
|
|
|
// NOTE: this refers to transient failures, not permanent.
|
|
|
|
//
|
|
|
|
#define FILE_XFER_FAILURE_LIMIT 3
|
|
|
|
struct FILE_XFER_BACKOFF {
|
|
|
|
int file_xfer_failures;
|
|
|
|
// count of consecutive failures
|
|
|
|
double next_xfer_time;
|
|
|
|
// when to start trying again
|
|
|
|
bool ok_to_transfer();
|
|
|
|
void file_xfer_failed(PROJECT*);
|
|
|
|
void file_xfer_succeeded();
|
|
|
|
|
|
|
|
FILE_XFER_BACKOFF() {
|
|
|
|
file_xfer_failures = 0;
|
|
|
|
next_xfer_time = 0;
|
|
|
|
}
|
2011-11-20 09:18:12 +00:00
|
|
|
|
|
|
|
// clear backoff but maintain failure count;
|
|
|
|
// called when network becomes available
|
|
|
|
//
|
|
|
|
void clear_temporary() {
|
|
|
|
next_xfer_time = 0;
|
|
|
|
}
|
2009-07-16 16:35:57 +00:00
|
|
|
};
|
|
|
|
|
2010-04-01 05:54:29 +00:00
|
|
|
// statistics at a specific day
|
2008-10-04 23:44:24 +00:00
|
|
|
|
2005-08-11 04:45:16 +00:00
|
|
|
struct DAILY_STATS {
|
2005-04-04 06:02:36 +00:00
|
|
|
double user_total_credit;
|
|
|
|
double user_expavg_credit;
|
|
|
|
double host_total_credit;
|
|
|
|
double host_expavg_credit;
|
|
|
|
double day;
|
2005-08-11 04:45:16 +00:00
|
|
|
|
2019-11-05 08:16:02 +00:00
|
|
|
DAILY_STATS(int){}
|
|
|
|
void clear() {
|
|
|
|
static const DAILY_STATS x(0);
|
|
|
|
*this = x;
|
|
|
|
}
|
|
|
|
DAILY_STATS() {
|
|
|
|
clear();
|
|
|
|
}
|
2005-08-11 04:45:16 +00:00
|
|
|
int parse(FILE*);
|
2005-04-04 06:02:36 +00:00
|
|
|
};
|
2007-01-11 00:20:58 +00:00
|
|
|
bool operator < (const DAILY_STATS&, const DAILY_STATS&);
|
2009-07-16 16:35:57 +00:00
|
|
|
|
2010-09-08 18:06:56 +00:00
|
|
|
// base class for PROJECT and ACCT_MGR_INFO
|
|
|
|
//
|
|
|
|
struct PROJ_AM {
|
|
|
|
char master_url[256];
|
|
|
|
char project_name[256];
|
|
|
|
// descriptive. not unique
|
|
|
|
std::vector<RSS_FEED> proj_feeds;
|
|
|
|
inline char *get_project_name() {
|
|
|
|
if (strlen(project_name)) {
|
|
|
|
return project_name;
|
|
|
|
} else {
|
|
|
|
return master_url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2002-04-30 22:22:54 +00:00
|
|
|
struct APP {
|
|
|
|
char name[256];
|
2006-06-26 19:08:00 +00:00
|
|
|
char user_friendly_name[256];
|
2011-05-25 21:16:45 +00:00
|
|
|
bool non_cpu_intensive;
|
2014-05-04 07:02:32 +00:00
|
|
|
bool fraction_done_exact;
|
2002-04-30 22:22:54 +00:00
|
|
|
PROJECT* project;
|
2017-03-07 00:04:44 +00:00
|
|
|
bool report_results_immediately;
|
2012-11-28 20:26:49 +00:00
|
|
|
int max_concurrent;
|
|
|
|
// Limit on # of concurrent jobs of this app; 0 if none
|
|
|
|
// Specified in app_config.xml
|
2013-04-04 17:25:56 +00:00
|
|
|
// Can also specify in client_state.xml (for client emulator)
|
2018-12-21 08:54:00 +00:00
|
|
|
int app_n_concurrent;
|
2012-11-28 20:26:49 +00:00
|
|
|
// temp during job scheduling, to enforce max_concurrent
|
2014-11-24 08:14:23 +00:00
|
|
|
COPROC_INSTANCE_BITMAP non_excluded_instances[MAX_RSC];
|
2013-06-21 04:47:34 +00:00
|
|
|
// for each resource type, bitmap of the non-excluded instances
|
2010-09-24 20:02:42 +00:00
|
|
|
#ifdef SIM
|
|
|
|
double latency_bound;
|
|
|
|
double fpops_est;
|
|
|
|
NORMAL_DIST fpops;
|
|
|
|
NORMAL_DIST checkpoint_period;
|
|
|
|
double working_set;
|
|
|
|
double weight;
|
2010-10-22 18:35:06 +00:00
|
|
|
bool ignore;
|
2010-09-24 20:02:42 +00:00
|
|
|
#endif
|
2002-04-30 22:22:54 +00:00
|
|
|
|
2019-11-05 08:16:02 +00:00
|
|
|
APP(int){}
|
|
|
|
void clear() {
|
|
|
|
static const APP x(0);
|
|
|
|
*this = x;
|
|
|
|
}
|
|
|
|
APP(){
|
|
|
|
clear();
|
|
|
|
}
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2004-06-12 04:45:36 +00:00
|
|
|
int write(MIOFILE&);
|
2002-04-30 22:22:54 +00:00
|
|
|
};
|
|
|
|
|
2011-03-25 03:44:09 +00:00
|
|
|
struct GPU_USAGE {
|
2014-11-07 08:57:39 +00:00
|
|
|
int rsc_type; // index into COPROCS array
|
2011-03-25 03:44:09 +00:00
|
|
|
double usage;
|
|
|
|
};
|
|
|
|
|
2021-01-08 07:50:31 +00:00
|
|
|
// if you add anything, initialize it in init()
|
|
|
|
//
|
2002-05-17 22:33:57 +00:00
|
|
|
struct APP_VERSION {
|
|
|
|
char app_name[256];
|
|
|
|
int version_num;
|
2007-05-03 17:14:30 +00:00
|
|
|
char platform[256];
|
2008-03-27 18:25:29 +00:00
|
|
|
char plan_class[64];
|
2007-09-21 18:10:54 +00:00
|
|
|
char api_version[16];
|
2008-03-28 18:00:27 +00:00
|
|
|
double avg_ncpus;
|
2014-07-30 20:16:42 +00:00
|
|
|
GPU_USAGE gpu_usage; // can only use 1 GPU type
|
2009-12-11 22:45:59 +00:00
|
|
|
double gpu_ram;
|
2008-03-28 18:00:27 +00:00
|
|
|
double flops;
|
2008-10-04 23:44:24 +00:00
|
|
|
char cmdline[256];
|
2010-04-01 05:54:29 +00:00
|
|
|
// additional cmdline args
|
2011-08-03 18:14:45 +00:00
|
|
|
char file_prefix[256];
|
|
|
|
// prepend this to input/output file logical names
|
|
|
|
// (e.g. "share" for VM apps)
|
2011-12-26 04:56:36 +00:00
|
|
|
bool needs_network;
|
2008-03-28 18:00:27 +00:00
|
|
|
|
2002-05-17 22:33:57 +00:00
|
|
|
APP* app;
|
|
|
|
PROJECT* project;
|
2004-06-30 18:17:21 +00:00
|
|
|
std::vector<FILE_REF> app_files;
|
2003-03-02 19:24:09 +00:00
|
|
|
int ref_cnt;
|
2021-01-08 07:50:31 +00:00
|
|
|
|
|
|
|
// graphics app, if any
|
|
|
|
// the strings are filled in after exec is downloaded and verified
|
|
|
|
//
|
|
|
|
FILE_INFO *graphics_exec_fip;
|
2012-05-09 16:11:50 +00:00
|
|
|
char graphics_exec_path[MAXPATHLEN];
|
2010-04-07 05:54:20 +00:00
|
|
|
char graphics_exec_file[256];
|
2021-01-08 07:50:31 +00:00
|
|
|
|
2009-04-09 16:46:03 +00:00
|
|
|
double max_working_set_size;
|
|
|
|
// max working set of tasks using this app version.
|
2010-12-11 19:03:57 +00:00
|
|
|
// unstarted jobs using this app version are assumed
|
|
|
|
// to use this much RAM,
|
|
|
|
// so that we don't run a long sequence of jobs,
|
|
|
|
// each of which turns out not to fit in available RAM
|
2011-03-25 03:44:09 +00:00
|
|
|
bool missing_coproc;
|
2011-04-20 23:32:14 +00:00
|
|
|
double missing_coproc_usage;
|
2011-03-25 03:44:09 +00:00
|
|
|
char missing_coproc_name[256];
|
2011-06-17 19:16:07 +00:00
|
|
|
bool dont_throttle;
|
2015-01-05 20:58:40 +00:00
|
|
|
// jobs of this app version are exempt from CPU throttling
|
|
|
|
// Set for coprocessor apps
|
2013-10-23 05:21:13 +00:00
|
|
|
bool is_vm_app;
|
2013-11-07 18:27:17 +00:00
|
|
|
// currently this set if plan class includes "vbox" (kludge)
|
|
|
|
bool is_wrapper;
|
|
|
|
// the main program is a wrapper; run it above idle priority
|
2010-05-13 20:18:27 +00:00
|
|
|
|
|
|
|
int index; // temp var for make_scheduler_request()
|
2010-11-01 16:53:41 +00:00
|
|
|
#ifdef SIM
|
|
|
|
bool dont_use;
|
|
|
|
#endif
|
2002-05-17 22:33:57 +00:00
|
|
|
|
2015-10-18 18:56:48 +00:00
|
|
|
APP_VERSION() {
|
|
|
|
init();
|
|
|
|
}
|
2007-05-10 16:23:10 +00:00
|
|
|
~APP_VERSION(){}
|
2013-07-04 23:00:10 +00:00
|
|
|
void init();
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2009-03-05 17:45:36 +00:00
|
|
|
int write(MIOFILE&, bool write_file_info = true);
|
2004-10-07 19:18:37 +00:00
|
|
|
bool had_download_failure(int& failnum);
|
2004-09-02 16:23:21 +00:00
|
|
|
void get_file_errors(std::string&);
|
|
|
|
void clear_errors();
|
2014-07-30 20:16:42 +00:00
|
|
|
bool api_version_at_least(int major, int minor);
|
2011-06-12 20:58:43 +00:00
|
|
|
inline bool uses_coproc(int rt) {
|
|
|
|
return (gpu_usage.rsc_type == rt);
|
2009-08-19 18:41:47 +00:00
|
|
|
}
|
2010-03-05 21:13:53 +00:00
|
|
|
inline int rsc_type() {
|
2011-03-25 03:44:09 +00:00
|
|
|
return gpu_usage.rsc_type;
|
2010-03-05 21:13:53 +00:00
|
|
|
}
|
2014-05-02 19:04:05 +00:00
|
|
|
inline bool is_opencl() {
|
|
|
|
return (strstr(plan_class, "opencl") != NULL);
|
|
|
|
}
|
2021-01-08 07:50:31 +00:00
|
|
|
void check_graphics_exec();
|
2002-05-17 22:33:57 +00:00
|
|
|
};
|
|
|
|
|
2002-04-30 22:22:54 +00:00
|
|
|
struct WORKUNIT {
|
|
|
|
char name[256];
|
|
|
|
char app_name[256];
|
|
|
|
int version_num;
|
2010-04-01 05:54:29 +00:00
|
|
|
// Deprecated, but need to keep around to let people revert
|
|
|
|
// to versions before multi-platform support
|
2004-12-26 02:55:31 +00:00
|
|
|
std::string command_line;
|
2004-06-30 18:17:21 +00:00
|
|
|
std::vector<FILE_REF> input_files;
|
2002-04-30 22:22:54 +00:00
|
|
|
PROJECT* project;
|
|
|
|
APP* app;
|
|
|
|
int ref_cnt;
|
2003-09-04 00:41:51 +00:00
|
|
|
double rsc_fpops_est;
|
|
|
|
double rsc_fpops_bound;
|
|
|
|
double rsc_memory_bound;
|
|
|
|
double rsc_disk_bound;
|
2017-07-30 20:12:16 +00:00
|
|
|
JOB_KEYWORD_IDS job_keyword_ids;
|
2002-04-30 22:22:54 +00:00
|
|
|
|
2015-10-18 18:56:48 +00:00
|
|
|
WORKUNIT(){
|
2017-07-29 21:51:39 +00:00
|
|
|
safe_strcpy(name, "");
|
|
|
|
safe_strcpy(app_name, "");
|
|
|
|
version_num = 0;
|
2020-05-07 11:43:14 +00:00
|
|
|
command_line.clear();
|
2017-07-29 21:51:39 +00:00
|
|
|
input_files.clear();
|
2017-07-30 20:12:16 +00:00
|
|
|
job_keyword_ids.clear();
|
2017-07-29 21:51:39 +00:00
|
|
|
project = NULL;
|
|
|
|
app = NULL;
|
|
|
|
ref_cnt = 0;
|
|
|
|
rsc_fpops_est = 0.0;
|
|
|
|
rsc_fpops_bound = 0.0;
|
|
|
|
rsc_memory_bound = 0.0;
|
|
|
|
rsc_disk_bound = 0.0;
|
|
|
|
}
|
2007-05-10 16:23:10 +00:00
|
|
|
~WORKUNIT(){}
|
2011-08-09 21:44:14 +00:00
|
|
|
int parse(XML_PARSER&);
|
2017-07-29 21:51:39 +00:00
|
|
|
int write(MIOFILE&, bool gui);
|
2004-10-07 19:18:37 +00:00
|
|
|
bool had_download_failure(int& failnum);
|
2004-06-30 18:17:21 +00:00
|
|
|
void get_file_errors(std::string&);
|
2005-01-13 18:57:27 +00:00
|
|
|
void clear_errors();
|
2002-04-30 22:22:54 +00:00
|
|
|
};
|
|
|
|
|
2010-04-01 05:54:29 +00:00
|
|
|
// represents an always/auto/never value, possibly temporarily overridden
|
2008-10-04 23:44:24 +00:00
|
|
|
|
2011-08-09 20:41:15 +00:00
|
|
|
struct RUN_MODE {
|
2006-11-10 17:55:22 +00:00
|
|
|
int perm_mode;
|
|
|
|
int temp_mode;
|
2012-01-27 13:02:35 +00:00
|
|
|
int prev_mode;
|
2006-11-10 17:55:22 +00:00
|
|
|
double temp_timeout;
|
2011-08-09 20:41:15 +00:00
|
|
|
RUN_MODE();
|
2006-11-10 17:55:22 +00:00
|
|
|
void set(int mode, double duration);
|
2012-01-27 13:02:35 +00:00
|
|
|
void set_prev(int mode);
|
2006-11-10 17:55:22 +00:00
|
|
|
int get_perm();
|
2012-01-27 13:02:35 +00:00
|
|
|
int get_prev();
|
2006-11-10 17:55:22 +00:00
|
|
|
int get_current();
|
2013-04-03 00:23:37 +00:00
|
|
|
double delay();
|
2006-11-10 17:55:22 +00:00
|
|
|
};
|
|
|
|
|
2010-04-01 05:54:29 +00:00
|
|
|
// a platform supported by the client.
|
2008-10-04 23:44:24 +00:00
|
|
|
|
2012-02-03 18:33:39 +00:00
|
|
|
struct PLATFORM {
|
2007-05-02 17:53:35 +00:00
|
|
|
std::string name;
|
|
|
|
};
|
|
|
|
|
2012-04-25 05:51:26 +00:00
|
|
|
extern int parse_project_files(XML_PARSER&, std::vector<FILE_REF>&);
|
|
|
|
|
2002-04-30 22:22:54 +00:00
|
|
|
#endif
|