2005-01-20 23:22:22 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
2003-08-15 22:39:56 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This 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 2.1 of the License, or (at your option) any later version.
|
2003-08-15 22:39:56 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This software 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.
|
2002-04-30 22:22:54 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
2007-10-09 11:35:47 +00:00
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2002-04-30 22:22:54 +00:00
|
|
|
|
|
|
|
#ifndef _SERVER_TYPES_
|
|
|
|
#define _SERVER_TYPES_
|
|
|
|
|
2004-07-13 13:54:09 +00:00
|
|
|
#include <cstdio>
|
2002-04-30 22:22:54 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2003-04-07 19:06:00 +00:00
|
|
|
#include "boinc_db.h"
|
2006-09-01 21:06:30 +00:00
|
|
|
#include "common_defs.h"
|
2004-05-03 02:18:35 +00:00
|
|
|
#include "md5_file.h"
|
2008-03-10 21:59:27 +00:00
|
|
|
#include "coproc.h"
|
2002-12-09 23:06:17 +00:00
|
|
|
|
2007-05-10 16:23:10 +00:00
|
|
|
#include "edf_sim.h"
|
|
|
|
|
2007-05-09 17:45:18 +00:00
|
|
|
// for projects that support work filtering by app,
|
|
|
|
// this records an app for which the user will accept work
|
|
|
|
//
|
2006-10-22 01:46:33 +00:00
|
|
|
struct APP_INFO {
|
2006-10-22 00:42:44 +00:00
|
|
|
int appid;
|
2008-03-07 21:13:01 +00:00
|
|
|
int work_available;
|
2006-10-22 00:42:44 +00:00
|
|
|
};
|
|
|
|
|
2007-05-09 17:45:18 +00:00
|
|
|
// Details concerning a host
|
2006-10-22 00:42:44 +00:00
|
|
|
//
|
2006-10-22 01:46:33 +00:00
|
|
|
struct HOST_INFO {
|
2008-03-07 21:13:01 +00:00
|
|
|
int allow_non_preferred_apps;
|
2006-10-22 00:42:44 +00:00
|
|
|
int allow_beta_work;
|
|
|
|
bool reliable;
|
2006-10-22 01:46:33 +00:00
|
|
|
std::vector<APP_INFO> preferred_apps;
|
2006-10-22 00:42:44 +00:00
|
|
|
};
|
|
|
|
|
2007-08-16 17:33:41 +00:00
|
|
|
// represents a resource (disk etc.) that the client may not have enough of
|
|
|
|
//
|
|
|
|
struct RESOURCE {
|
|
|
|
bool insufficient;
|
|
|
|
double needed; // the min extra amount needed
|
|
|
|
|
|
|
|
inline void set_insufficient(double x) {
|
|
|
|
insufficient = true;
|
|
|
|
if (needed) {
|
|
|
|
if (x < needed) needed = x;
|
|
|
|
} else {
|
|
|
|
needed = x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-03-07 21:13:01 +00:00
|
|
|
// message intended for human eyes
|
|
|
|
//
|
|
|
|
struct USER_MESSAGE {
|
|
|
|
std::string message;
|
|
|
|
std::string priority;
|
|
|
|
USER_MESSAGE(const char* m, const char*p);
|
|
|
|
};
|
|
|
|
|
2005-01-31 23:20:49 +00:00
|
|
|
// summary of a client's request for work, and our response to it
|
2004-09-10 00:41:48 +00:00
|
|
|
//
|
|
|
|
struct WORK_REQ {
|
|
|
|
bool infeasible_only;
|
2006-07-11 21:49:20 +00:00
|
|
|
bool reliable_only;
|
2008-03-07 21:13:01 +00:00
|
|
|
bool user_apps_only;
|
2006-10-22 00:42:44 +00:00
|
|
|
bool beta_only;
|
2006-10-22 01:46:33 +00:00
|
|
|
HOST_INFO host_info;
|
2004-09-10 00:41:48 +00:00
|
|
|
double seconds_to_fill;
|
2007-08-16 17:33:41 +00:00
|
|
|
// in "normalized CPU seconds"; see
|
|
|
|
// http://boinc.berkeley.edu/trac/wiki/ClientSched#NormalizedCPUTime
|
2004-09-10 00:41:48 +00:00
|
|
|
double disk_available;
|
|
|
|
int nresults;
|
|
|
|
int core_client_version;
|
2007-08-16 17:33:41 +00:00
|
|
|
|
|
|
|
RESOURCE disk;
|
|
|
|
RESOURCE mem;
|
|
|
|
RESOURCE speed;
|
2008-03-07 21:13:01 +00:00
|
|
|
RESOURCE bandwidth;
|
|
|
|
|
|
|
|
std::vector<USER_MESSAGE> no_work_messages;
|
2007-08-16 17:33:41 +00:00
|
|
|
|
2006-05-02 22:17:09 +00:00
|
|
|
bool no_allowed_apps_available;
|
2005-04-18 18:42:29 +00:00
|
|
|
bool excessive_work_buf;
|
2004-09-10 00:41:48 +00:00
|
|
|
bool no_app_version;
|
2005-11-30 22:52:23 +00:00
|
|
|
bool hr_reject_temp;
|
|
|
|
bool hr_reject_perm;
|
2004-09-10 00:41:48 +00:00
|
|
|
bool outdated_core;
|
|
|
|
bool daily_result_quota_exceeded;
|
2005-02-22 17:53:17 +00:00
|
|
|
int daily_result_quota; // for this machine: number of cpus * daily_quota/cpu
|
2007-05-14 15:21:38 +00:00
|
|
|
bool cache_size_exceeded;
|
|
|
|
int nresults_on_host;
|
2007-07-05 04:18:48 +00:00
|
|
|
// How many results from this project are (or should be) on the host.
|
|
|
|
// Initially this is the number of "other_results"
|
|
|
|
// reported in the request message.
|
|
|
|
// If the resend_lost_results option is used,
|
|
|
|
// it's set to the number of outstanding results taken from the DB
|
|
|
|
// (those that were lost are resent).
|
|
|
|
// As new results are sent, it's incremented.
|
2004-09-10 00:41:48 +00:00
|
|
|
void update_for_result(double seconds_filled);
|
2008-03-07 21:13:01 +00:00
|
|
|
void insert_no_work_message(USER_MESSAGE&);
|
2004-09-10 00:41:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// a description of a sticky file on host.
|
|
|
|
//
|
|
|
|
struct FILE_INFO {
|
|
|
|
char name[256];
|
2008-03-07 21:13:01 +00:00
|
|
|
|
2004-09-10 21:02:11 +00:00
|
|
|
int parse(FILE*);
|
2004-09-10 00:41:48 +00:00
|
|
|
};
|
|
|
|
|
2004-06-24 21:00:13 +00:00
|
|
|
struct MSG_FROM_HOST_DESC {
|
2004-07-06 04:10:51 +00:00
|
|
|
char variety[256];
|
2004-09-10 00:41:48 +00:00
|
|
|
std::string msg_text;
|
2004-01-08 00:27:59 +00:00
|
|
|
int parse(FILE*);
|
|
|
|
};
|
|
|
|
|
2004-01-26 19:29:39 +00:00
|
|
|
// an app version from an anonymous-platform client
|
|
|
|
//
|
|
|
|
struct CLIENT_APP_VERSION {
|
|
|
|
char app_name[256];
|
|
|
|
int version_num;
|
|
|
|
|
|
|
|
int parse(FILE*);
|
|
|
|
};
|
|
|
|
|
2004-03-23 03:59:32 +00:00
|
|
|
// subset of global prefs used by scheduler
|
|
|
|
//
|
|
|
|
struct GLOBAL_PREFS {
|
2008-02-03 21:46:30 +00:00
|
|
|
double mod_time;
|
2004-03-23 03:59:32 +00:00
|
|
|
double disk_max_used_gb;
|
|
|
|
double disk_max_used_pct;
|
|
|
|
double disk_min_free_gb;
|
2005-04-18 18:42:29 +00:00
|
|
|
double work_buf_min_days;
|
2006-10-04 17:01:36 +00:00
|
|
|
double ram_max_used_busy_frac;
|
|
|
|
double ram_max_used_idle_frac;
|
2004-03-23 03:59:32 +00:00
|
|
|
|
2006-11-07 17:40:55 +00:00
|
|
|
void parse(const char* buf, const char* venue);
|
2006-10-06 18:52:50 +00:00
|
|
|
void defaults();
|
- scheduler: add <workload_sim> config option.
If set, the scheduler will use EDF simulation,
together with the in-progress workload reported by the client,
to avoid sending results that
1) will miss their deadline, or
2) will cause an in-progress result to miss its deadline, or
3) will make an in-progress result miss its deadline
by more than is already predicted.
If this option is not set, or if the client request doesn't
include a workload description (i.e. the client is old)
use the existing approach, which assumes there's no workload.
NOTE: this is experimental. Production projects should not use it.
- EDF sim: write debug stuff to stderr instead of stdout
- Account manager:
- if an account is detach_when_done, set dont_request_more_work
- check done_request_more_work even for first-time projects
- update_uotd: generate a file for use by Google gadget
- user_links(): use full URLs (so can use in Google gadget)
client/
acct_mgr.C
work_fetch.C
html/
inc/
uotd.inc
util.inc
user/
uotd_gadget.php (new)
sched/
Makefile.am
edf_sim.C
sched_config.C,h
sched_resend.C
sched_send.C,h
server_types.C,h
svn path=/trunk/boinc/; revision=12639
2007-05-10 21:50:52 +00:00
|
|
|
inline double work_buf_min() {return work_buf_min_days*86400;}
|
2004-03-23 03:59:32 +00:00
|
|
|
};
|
|
|
|
|
2004-09-13 18:05:54 +00:00
|
|
|
struct GUI_URLS {
|
|
|
|
char* text;
|
|
|
|
void init();
|
2004-09-27 19:44:40 +00:00
|
|
|
void get_gui_urls(USER& user, HOST& host, TEAM& team, char*);
|
2004-09-13 18:05:54 +00:00
|
|
|
};
|
|
|
|
|
2006-06-26 22:58:24 +00:00
|
|
|
struct PROJECT_FILES {
|
|
|
|
char* text;
|
|
|
|
void init();
|
|
|
|
};
|
|
|
|
|
2007-04-30 23:35:39 +00:00
|
|
|
// Represents a result from this project that the client has.
|
|
|
|
// The request message has a list of these.
|
|
|
|
// The reply message may include a list of those to be aborted
|
|
|
|
// or aborted if not started
|
|
|
|
//
|
2005-07-28 09:00:19 +00:00
|
|
|
struct OTHER_RESULT {
|
|
|
|
std::string name;
|
2007-04-05 17:02:01 +00:00
|
|
|
bool abort;
|
|
|
|
bool abort_if_not_started;
|
2008-02-26 17:24:29 +00:00
|
|
|
int reason; // see codes below
|
2005-07-28 09:00:19 +00:00
|
|
|
|
|
|
|
int parse(FILE*);
|
|
|
|
};
|
|
|
|
|
2008-02-26 17:24:29 +00:00
|
|
|
#define ABORT_REASON_NOT_FOUND 1
|
|
|
|
#define ABORT_REASON_WU_CANCELLED 2
|
|
|
|
#define ABORT_REASON_ASSIMILATED 3
|
|
|
|
#define ABORT_REASON_TIMED_OUT 4
|
|
|
|
|
2007-04-19 22:45:57 +00:00
|
|
|
struct CLIENT_PLATFORM {
|
|
|
|
char name[256];
|
|
|
|
int parse(FILE*);
|
|
|
|
};
|
|
|
|
|
2007-04-30 21:19:24 +00:00
|
|
|
struct PLATFORM_LIST {
|
|
|
|
std::vector<PLATFORM*> list;
|
|
|
|
};
|
|
|
|
|
2002-04-30 22:22:54 +00:00
|
|
|
struct SCHEDULER_REQUEST {
|
|
|
|
char authenticator[256];
|
2007-04-19 22:45:57 +00:00
|
|
|
CLIENT_PLATFORM platform;
|
|
|
|
std::vector<CLIENT_PLATFORM> alt_platforms;
|
2008-02-21 00:47:50 +00:00
|
|
|
PLATFORM_LIST platforms;
|
2004-04-30 18:26:20 +00:00
|
|
|
char cross_project_id[256];
|
2002-04-30 22:22:54 +00:00
|
|
|
int hostid; // zero if first RPC
|
2002-12-02 04:29:40 +00:00
|
|
|
int core_client_major_version;
|
|
|
|
int core_client_minor_version;
|
2005-08-31 00:18:36 +00:00
|
|
|
int core_client_release;
|
2002-04-30 22:22:54 +00:00
|
|
|
int rpc_seqno;
|
2004-12-06 22:41:19 +00:00
|
|
|
double work_req_seconds;
|
2005-02-06 21:26:21 +00:00
|
|
|
// in "normalized CPU seconds" (see work_req.php)
|
2004-07-06 21:51:49 +00:00
|
|
|
double resource_share_fraction;
|
2005-10-04 21:44:58 +00:00
|
|
|
// this project's fraction of total resource share
|
|
|
|
double rrs_fraction;
|
|
|
|
// ... of runnable resource share
|
|
|
|
double prrs_fraction;
|
|
|
|
// ... of potentially runnable resource share
|
2004-07-22 18:56:54 +00:00
|
|
|
double estimated_delay;
|
2005-02-14 04:39:07 +00:00
|
|
|
// how many wall-clock seconds will elapse before
|
|
|
|
// host will begin any new work for this project
|
2005-06-29 04:17:28 +00:00
|
|
|
double duration_correction_factor;
|
2003-12-07 18:58:08 +00:00
|
|
|
char global_prefs_xml[LARGE_BLOB_SIZE];
|
2006-10-06 18:52:50 +00:00
|
|
|
char working_global_prefs_xml[LARGE_BLOB_SIZE];
|
2004-05-13 18:18:22 +00:00
|
|
|
char code_sign_key[4096];
|
2004-08-14 00:37:38 +00:00
|
|
|
|
2004-01-26 19:29:39 +00:00
|
|
|
bool anonymous_platform;
|
2004-09-10 00:41:48 +00:00
|
|
|
std::vector<CLIENT_APP_VERSION> client_app_versions;
|
2004-03-23 03:59:32 +00:00
|
|
|
GLOBAL_PREFS global_prefs;
|
2004-05-03 02:18:35 +00:00
|
|
|
char global_prefs_source_email_hash[MD5_LEN];
|
2002-04-30 22:22:54 +00:00
|
|
|
|
2004-05-13 04:48:19 +00:00
|
|
|
HOST host; // request message is parsed into here.
|
|
|
|
// does NOT contain the full host record.
|
2008-03-10 21:59:27 +00:00
|
|
|
COPROCS coprocs;
|
2004-09-10 00:41:48 +00:00
|
|
|
std::vector<RESULT> results;
|
2007-07-05 04:18:48 +00:00
|
|
|
// completed results being reported
|
2004-09-10 00:41:48 +00:00
|
|
|
std::vector<MSG_FROM_HOST_DESC> msgs_from_host;
|
2007-07-06 16:37:00 +00:00
|
|
|
std::vector<FILE_INFO> file_infos;
|
|
|
|
// sticky files reported by host for locality scheduling
|
|
|
|
std::vector<FILE_INFO> file_delete_candidates;
|
|
|
|
// sticky files reported by host, deletion candidates
|
|
|
|
std::vector<FILE_INFO> files_not_needed;
|
|
|
|
// sticky files reported by host, no longer needed
|
2005-07-28 09:00:19 +00:00
|
|
|
std::vector<OTHER_RESULT> other_results;
|
2007-07-05 04:18:48 +00:00
|
|
|
// in-progress results from this project
|
2005-07-28 09:00:19 +00:00
|
|
|
std::vector<IP_RESULT> ip_results;
|
2007-07-05 04:18:48 +00:00
|
|
|
// in-progress results from all projects
|
2005-07-28 10:13:30 +00:00
|
|
|
bool have_other_results_list;
|
|
|
|
bool have_ip_results_list;
|
2008-01-13 00:12:14 +00:00
|
|
|
bool have_time_stats_log;
|
2002-04-30 22:22:54 +00:00
|
|
|
|
|
|
|
SCHEDULER_REQUEST();
|
|
|
|
~SCHEDULER_REQUEST();
|
|
|
|
int parse(FILE*);
|
2004-01-26 19:29:39 +00:00
|
|
|
bool has_version(APP& app);
|
2005-01-31 16:10:49 +00:00
|
|
|
int write(FILE*); // write request info to file: not complete
|
2002-04-30 22:22:54 +00:00
|
|
|
};
|
|
|
|
|
2005-04-18 17:54:03 +00:00
|
|
|
// keep track of bottleneck disk preference
|
|
|
|
//
|
|
|
|
struct DISK_LIMITS {
|
|
|
|
double max_used;
|
|
|
|
double max_frac;
|
|
|
|
double min_free;
|
|
|
|
};
|
|
|
|
|
2002-09-22 23:27:14 +00:00
|
|
|
// NOTE: if any field requires initialization,
|
|
|
|
// you must do it in the constructor. Nothing is zeroed by default.
|
|
|
|
//
|
2002-04-30 22:22:54 +00:00
|
|
|
struct SCHEDULER_REPLY {
|
2005-01-31 23:20:49 +00:00
|
|
|
WORK_REQ wreq;
|
2005-04-18 17:54:03 +00:00
|
|
|
DISK_LIMITS disk_limits;
|
2005-02-16 23:17:43 +00:00
|
|
|
double request_delay; // don't request again until this time elapses
|
2005-01-31 22:19:03 +00:00
|
|
|
std::vector<USER_MESSAGE> messages;
|
2004-10-01 22:00:39 +00:00
|
|
|
int hostid;
|
|
|
|
// nonzero only if a new host record was created.
|
|
|
|
// this tells client to reset rpc_seqno
|
2005-05-17 05:55:24 +00:00
|
|
|
int lockfile_fd; // file descriptor of lockfile, or -1 if no lock.
|
2006-10-06 18:52:50 +00:00
|
|
|
bool send_global_prefs;
|
2002-12-02 04:29:40 +00:00
|
|
|
bool nucleus_only; // send only message
|
2003-08-15 22:39:56 +00:00
|
|
|
bool probable_user_browser;
|
2002-05-29 23:25:21 +00:00
|
|
|
USER user;
|
2004-05-03 02:18:35 +00:00
|
|
|
char email_hash[MD5_LEN];
|
2004-05-13 04:48:19 +00:00
|
|
|
HOST host; // after validation, contains full host rec
|
2003-02-24 21:31:36 +00:00
|
|
|
TEAM team;
|
2004-09-10 00:41:48 +00:00
|
|
|
std::vector<APP> apps;
|
|
|
|
std::vector<APP_VERSION> app_versions;
|
|
|
|
std::vector<WORKUNIT>wus;
|
|
|
|
std::vector<RESULT>results;
|
2005-06-22 06:02:59 +00:00
|
|
|
std::vector<std::string>result_acks;
|
2007-04-05 17:02:01 +00:00
|
|
|
std::vector<std::string>result_aborts;
|
|
|
|
std::vector<std::string>result_abort_if_not_starteds;
|
2004-09-10 00:41:48 +00:00
|
|
|
std::vector<MSG_TO_HOST>msgs_to_host;
|
|
|
|
std::vector<FILE_INFO>file_deletes;
|
2004-05-13 18:18:22 +00:00
|
|
|
char code_sign_key[4096];
|
|
|
|
char code_sign_key_signature[4096];
|
2004-06-24 21:00:13 +00:00
|
|
|
bool send_msg_ack;
|
2002-04-30 22:22:54 +00:00
|
|
|
|
|
|
|
SCHEDULER_REPLY();
|
|
|
|
~SCHEDULER_REPLY();
|
|
|
|
int write(FILE*);
|
|
|
|
void insert_app_unique(APP&);
|
|
|
|
void insert_app_version_unique(APP_VERSION&);
|
|
|
|
void insert_workunit_unique(WORKUNIT&);
|
|
|
|
void insert_result(RESULT&);
|
2005-01-31 22:19:03 +00:00
|
|
|
void insert_message(USER_MESSAGE&);
|
2005-02-09 20:06:15 +00:00
|
|
|
bool work_needed(bool locality_sched=false);
|
2005-02-16 23:17:43 +00:00
|
|
|
void set_delay(double);
|
2005-02-26 00:24:37 +00:00
|
|
|
void got_good_result(); // adjust max_results_day
|
|
|
|
void got_bad_result(); // adjust max_results_day
|
2002-04-30 22:22:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|