*** empty log message ***

svn path=/trunk/boinc/; revision=12280
This commit is contained in:
David Anderson 2007-03-29 16:40:43 +00:00
parent 6b6881c49d
commit 6ebb7207aa
10 changed files with 154 additions and 35 deletions

View File

@ -2909,3 +2909,16 @@ David 28 Mar 2007
html/inc/
prefs.inc
David 29 Mar 2007
- core client: fix some debug messages
- more code-shuffling for client simulator
client/
cpu_sched.C
file_xfer.h
log_flags.C,h
sim.C,h
win_build/
boincmgr_curl.vcproj
sim.vcproj

View File

@ -1229,7 +1229,7 @@ void CLIENT_STATE::rr_simulation() {
}
}
msg_printf(NULL, MSG_INFO,
"rr_simulation: end; total shortfall %f\n",
"[rr_sim] done; total shortfall %f\n",
cpu_shortfall
);
}

View File

@ -28,10 +28,6 @@
#include "client_types.h"
#include "http_curl.h"
#define MAX_FILE_XFERS_PER_PROJECT 2
#define MAX_FILE_XFERS 8
// kind of arbitrary
#define MIN_DOWNLOAD_INCREMENT 5000
class FILE_XFER : public HTTP_OP {

View File

@ -33,7 +33,6 @@
#include "common_defs.h"
#include "file_names.h"
#include "client_msgs.h"
#include "file_xfer.h"
#include "parse.h"
#include "filesys.h"

View File

@ -30,6 +30,10 @@
#include <stdio.h>
#endif
#define MAX_FILE_XFERS_PER_PROJECT 2
#define MAX_FILE_XFERS 8
// kind of arbitrary
class XML_PARSER;
struct LOG_FLAGS {

View File

@ -69,6 +69,92 @@ HOST_INFO::HOST_INFO() {}
//////////////// FUNCTIONS COPIED /////////////
void PROJECT::init() {
strcpy(master_url, "");
strcpy(authenticator, "");
project_specific_prefs = "";
gui_urls = "";
resource_share = 100;
strcpy(host_venue, "");
using_venue_specific_prefs = false;
scheduler_urls.clear();
strcpy(project_name, "");
strcpy(symstore, "");
strcpy(user_name, "");
strcpy(team_name, "");
strcpy(email_hash, "");
strcpy(cross_project_id, "");
user_total_credit = 0;
user_expavg_credit = 0;
user_create_time = 0;
ams_resource_share = 0;
rpc_seqno = 0;
hostid = 0;
host_total_credit = 0;
host_expavg_credit = 0;
host_create_time = 0;
nrpc_failures = 0;
master_fetch_failures = 0;
min_rpc_time = 0;
possibly_backed_off = true;
master_url_fetch_pending = false;
sched_rpc_pending = 0;
next_rpc_time = 0;
last_rpc_time = 0;
trickle_up_pending = false;
tentative = false;
anonymous_platform = false;
non_cpu_intensive = false;
verify_files_on_app_start = false;
short_term_debt = 0;
long_term_debt = 0;
send_file_list = false;
suspended_via_gui = false;
dont_request_more_work = false;
detach_when_done = false;
attached_via_acct_mgr = false;
strcpy(code_sign_key, "");
user_files.clear();
project_files.clear();
anticipated_debt = 0;
wall_cpu_time_this_debt_interval = 0;
next_runnable_result = NULL;
work_request = 0;
work_request_urgency = WORK_FETCH_DONT_NEED;
duration_correction_factor = 1;
project_files_downloaded_time = 0;
// Initialize scratch variables.
rrsim_proc_rate = 0.0;
cpu_shortfall = 0.0;
rr_sim_deadlines_missed = 0;
deadlines_missed = 0;
}
void RESULT::clear() {
strcpy(name, "");
strcpy(wu_name, "");
report_deadline = 0;
output_files.clear();
_state = RESULT_NEW;
ready_to_report = false;
completed_time = 0;
got_server_ack = false;
final_cpu_time = 0;
exit_status = 0;
stderr_out = "";
suspended_via_gui = false;
rr_sim_misses_deadline = false;
last_rr_sim_missed_deadline = false;
fpops_per_cpu_sec = 0;
fpops_cumulative = 0;
intops_per_cpu_sec = 0;
intops_cumulative = 0;
app = NULL;
wup = NULL;
project = NULL;
}
static const char* task_state_name(int val) {
switch (val) {
case PROCESS_UNINITIALIZED: return "UNINITIALIZED";
@ -151,17 +237,32 @@ RESULT* CLIENT_STATE::lookup_result(PROJECT* p, const char* name) {
}
void CLIENT_STATE::simulate_rpc(PROJECT* p) {
static int i=0;
RESULT* rp = new RESULT;
WORKUNIT* wup = new WORKUNIT;
rp->project = p;
rp->wup = wup;
sprintf(rp->name, "result_%d", i++);
rp->set_state(RESULT_FILES_DOWNLOADED, "simulate_rpc");
wup->project = p;
wup->rsc_fpops_est = 10000000;
wup->rsc_fpops_bound = 10000000;
results.push_back(rp);
unsigned int i;
double net_fpops = host_info.p_fpops;
while (1) {
// pick a random app
SIM_APP* ap;
double x = drand();
for (i=0; i<apps.size();i++) {
ap = (SIM_APP*)&apps[i];
if (ap->project != p) continue;
x -= ap->weight;
if (x <= 0) break;
}
RESULT* rp = new RESULT;
WORKUNIT* wup = new WORKUNIT;
rp->clear();
rp->project = p;
rp->wup = wup;
sprintf(rp->name, "result_%d", i++);
rp->set_state(RESULT_FILES_DOWNLOADED, "simulate_rpc");
wup->project = p;
wup->rsc_fpops_est = ap->fpops.sample();
results.push_back(rp);
double est_cpu = ap->fpops_est/net_fpops;
p->work_request -= est_cpu;
if (p->work_request <= 0) break;
}
request_schedule_cpus("simulate_rpc");
}
@ -238,13 +339,18 @@ int ACTIVE_TASK::init(RESULT* rp) {
max_disk_usage = rp->wup->rsc_disk_bound;
max_mem_usage = rp->wup->rsc_memory_bound;
cpu_time_left = 100;
_task_state = PROCESS_UNINITIALIZED;
scheduler_state = CPU_SCHED_UNINITIALIZED;
return 0;
}
//////////////// OTHER
PROJECT::PROJECT() {
duration_correction_factor = 1;
}
double NORMAL_DIST::sample() {
return 1;
}
int NORMAL_DIST::parse(XML_PARSER& xp, char* end_tag) {
@ -295,7 +401,9 @@ int SIM_APP::parse(XML_PARSER& xp) {
if (!is_tag) return ERR_XML_PARSE;
if (!strcmp(tag, "/app")) {
return 0;
} else if (xp.parse_double(tag, "latency_bound", latency_bound)) continue;
}
else if (xp.parse_double(tag, "latency_bound", latency_bound)) continue;
else if (xp.parse_double(tag, "fpops_est", fpops_est)) continue;
else if (!strcmp(tag, "fpops")) {
retval = fpops.parse(xp, "/fpops");
if (retval) return retval;
@ -370,6 +478,7 @@ int CLIENT_STATE::parse_projects(char* name) {
if (!is_tag) return ERR_XML_PARSE;
if (!strcmp(tag, "project")) {
SIM_PROJECT *p = new SIM_PROJECT;
p->init();
retval = p->parse(xp);
if (retval) return retval;
projects.push_back(p);
@ -418,11 +527,11 @@ int main(int argc, char** argv) {
char projects[256], host[256], prefs[256];
double duration = 100;
bool flag;
int retval;
int retval;
strcpy(projects, "projects.xml");
strcpy(host, "host.xml");
strcpy(prefs, "prefs.xml");
strcpy(projects, "sim_projects.xml");
strcpy(host, "sim_host.xml");
strcpy(prefs, "sim_prefs.xml");
read_config_file();

View File

@ -46,9 +46,11 @@ public:
class SIM_APP: public APP {
public:
double latency_bound;
double fpops_est;
NORMAL_DIST fpops;
NORMAL_DIST checkpoint_period;
double working_set;
double weight;
int parse(XML_PARSER&);
};

View File

@ -57,6 +57,7 @@ bool detect_setup_authenticator_firefox(
return false;
}
#ifdef _WIN32
//
// Detect the 'Setup' cookie in Internet Explorer by using the InternetGetCookie API.
@ -65,6 +66,7 @@ bool detect_setup_authenticator_firefox(
//
bool detect_setup_authenticator_ie(std::string& project_url, std::string& authenticator)
{
#if 0
bool bReturnValue = FALSE;
BOOL bValidates = TRUE;
char szCookieBuffer[2048];
@ -125,5 +127,7 @@ bool detect_setup_authenticator_ie(std::string& project_url, std::string& authen
}
return bReturnValue;
#endif
return false;
}
#endif

View File

@ -664,14 +664,6 @@
RelativePath="..\lib\browser.h"
>
</File>
<File
RelativePath="..\lib\browser_firefox.C"
>
</File>
<File
RelativePath="..\lib\browser_ie.C"
>
</File>
<File
RelativePath="..\lib\diagnostics.C"
>

View File

@ -48,7 +48,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../curl/include;../lib/;../api/;../client/win/;../client;.."
AdditionalIncludeDirectories="../lib/;..;../curl/include/"
PreprocessorDefinitions="WIN32;_DEBUG;_MT;_DLL;_WINDOWS;_CONSOLE;SIM"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -57,9 +57,9 @@
UsePrecompiledHeader="0"
PrecompiledHeaderThrough="boinc_win.h"
PrecompiledHeaderFile="$(IntDir)/boinc_win.pch"
AssemblerListingLocation=".\Build\Debug\boinc_guirpctest\obj/"
ObjectFile=".\Build\Debug\boinc_guirpctest\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_guirpctest\obj/vc70.pdb"
AssemblerListingLocation=".\Build\Debug\sim\obj/"
ObjectFile=".\Build\Debug\sim\obj/"
ProgramDataBaseFileName=".\Build\Debug\sim\obj/vc70.pdb"
BrowseInformation="1"
WarningLevel="4"
SuppressStartupBanner="true"