diff --git a/checkin_notes b/checkin_notes
index 3dc006b1e8..6d14b10eb2 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -44,3 +44,9 @@ David 6 Jan 2011
server_status.php
client/
*.cpp
+
+David 6 Jan 2011
+ - simulator work
+ - fix some indentation
+
+ various files
diff --git a/client/sim.cpp b/client/sim.cpp
index e3a93d8106..2919aa9f81 100644
--- a/client/sim.cpp
+++ b/client/sim.cpp
@@ -821,7 +821,7 @@ void html_start() {
exit(1);
}
setbuf(html_out, 0);
- fprintf(index_file, "
Timeline\n", buf);
+ fprintf(index_file, "
Timeline\n", TIMELINE_FNAME);
fprintf(html_out, "
BOINC client simulator
\n");
fprintf(html_out,
"Time | \n", WIDTH1
@@ -940,7 +940,7 @@ void make_graph(const char* title, const char* fname, int field) {
fclose(f);
sprintf(png_fname, "%s%s.png", outfile_prefix, fname);
sprintf(cmd, "gnuplot < %s > %s", gp_fname, png_fname);
- fprintf(index_file, "
Graph of %s\n", png_fname, title);
+ fprintf(index_file, "
Graph of %s\n", fname, title);
system(cmd);
}
@@ -1006,7 +1006,7 @@ void make_graph(const char* title, const char* fname, int field, int nfields) {
fclose(f);
sprintf(png_fname, "%s%s.png", outfile_prefix, fname);
sprintf(cmd, "gnuplot < %s > %s", gp_fname, png_fname);
- fprintf(index_file, "
Graph of %s\n", png_fname, title);
+ fprintf(index_file, "
Graph of %s\n", fname, title);
system(cmd);
}
@@ -1234,10 +1234,14 @@ void cull_projects() {
void do_client_simulation() {
char buf[256], buf2[256];
+ fprintf(index_file,
+ "Input files
\n"
+ );
+
sprintf(buf, "%s%s", infile_prefix, CONFIG_FILE);
read_config_file(true, buf);
fprintf(index_file,
- "
Configuration file (cc_config.xml)\n",
+ "
Configuration file (cc_config.xml)\n",
buf
);
config.show();
@@ -1246,18 +1250,18 @@ void do_client_simulation() {
sprintf(buf, "%s%s", infile_prefix, STATE_FILE_NAME);
gstate.parse_state_file_aux(buf);
fprintf(index_file,
- "
State file (client_state.xml)\n",
+ "
State file (client_state.xml)\n",
buf
);
sprintf(buf, "%s%s", infile_prefix, GLOBAL_PREFS_FILE_NAME);
sprintf(buf2, "%s%s", infile_prefix, GLOBAL_PREFS_OVERRIDE_FILE);
gstate.read_global_prefs(buf, buf2);
fprintf(index_file,
- "
Preferences file (global_prefs.xml)\n"
- "
Preferences override file (global_prefs_override.xml)\n"
+ "
Preferences file (global_prefs.xml)\n"
+ "
Preferences override file (global_prefs_override.xml)\n"
"Output files
\n"
"Log file\n",
- buf, buf2, log_filename
+ buf, buf2, LOG_FNAME
);
get_app_params();
@@ -1351,9 +1355,6 @@ int main(int argc, char** argv) {
sprintf(buf, "%s%s", outfile_prefix, "index.html");
index_file = fopen(buf, "w");
- fprintf(index_file,
- "Input files
\n"
- );
sprintf(log_filename, "%s%s", outfile_prefix, LOG_FNAME);
logfile = fopen(log_filename, "w");
diff --git a/client/sim_control.php b/client/sim_control.php
index 4cc251a851..421e7a10a4 100644
--- a/client/sim_control.php
+++ b/client/sim_control.php
@@ -23,7 +23,7 @@
// show the average results as a function of the parameter.
// Show the figures of merit as line graphs.
-$duration = 86400; // sim duration
+$duration = 864000; // sim duration
// a set of scheduling policies
//
@@ -261,4 +261,11 @@ if (0) {
compare_params(array("s3"), $p, $lo, $hi, $inc, "test2");
}
+if (1) {
+ $p1 = new POLICY();
+ $p2 = new POLICY();
+ $p2->use_hyst_fetch = true;
+ compare_policies(array("scen1"), $p1, $p2, "test3");
+}
+
?>
diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp
index abf787e8a1..2024a0d19d 100644
--- a/client/work_fetch.cpp
+++ b/client/work_fetch.cpp
@@ -34,7 +34,7 @@
using std::vector;
bool use_rec = false;
-bool use_hysteresis = false;
+bool use_hyst_fetch = false;
RSC_WORK_FETCH cuda_work_fetch;
RSC_WORK_FETCH ati_work_fetch;
@@ -975,7 +975,7 @@ if (use_rec) {
bool cuda_usable = gstate.host_info.have_cuda() && gpus_usable;
bool ati_usable = gstate.host_info.have_ati() && gpus_usable;
-if (use_hysteresis) {
+if (use_hyst_fetch) {
if (cuda_usable) {
p = cuda_work_fetch.choose_project_hyst();
}
diff --git a/client/work_fetch.h b/client/work_fetch.h
index c0601d3103..35d4188ec4 100644
--- a/client/work_fetch.h
+++ b/client/work_fetch.h
@@ -28,7 +28,7 @@ extern bool use_rec;
#define REC_HALF_LIFE (10*86400)
//#define REC_HALF_LIFE (1*86400)
-extern bool use_hysteresis;
+extern bool use_hyst_fetch;
#define RSC_TYPE_ANY 0
#define RSC_TYPE_CPU 1
diff --git a/lib/parse.cpp b/lib/parse.cpp
index 9538d781aa..f3364708e5 100644
--- a/lib/parse.cpp
+++ b/lib/parse.cpp
@@ -283,7 +283,7 @@ bool str_replace(char* str, const char* substr, const char* replacement) {
strcat(p, temp);
return true;
}
-
+
// if the given XML has an element of the form
//
// ...
@@ -309,17 +309,17 @@ void extract_venue(const char* in, const char* venue_name, char* out) {
//
q = in;
strcpy(out, "");
- while (1) {
- p = strstr(q, "");
- if (!q) break;
- q += strlen("");
- }
+ strncat(out, q, p-q);
+ q = strstr(p, "");
+ if (!q) break;
+ q += strlen("");
+ }
}
}
@@ -449,7 +449,6 @@ int skip_unrecognized(char* buf, MIOFILE& fin) {
if (strstr(buf2, close_tag.c_str())) {
return 0;
}
-
}
return ERR_XML_PARSE;
}
@@ -608,7 +607,7 @@ bool XML_PARSER::copy_until_tag(char* buf, int len) {
int XML_PARSER::get_aux(char* buf, int len, char* attr_buf, int attr_len) {
bool eof;
int c, retval;
-
+
while (1) {
eof = scan_nonws(c);
if (eof) return XML_PARSE_EOF;
@@ -838,27 +837,27 @@ bool XML_PARSER::parse_start(const char* start_tag) {
// strips whitespace.
//
int XML_PARSER::element_contents(const char* end_tag, char* buf, int buflen) {
- int n=0;
- int retval=0;
+ int n=0;
+ int retval=0;
while (1) {
- if (n == buflen-1) {
- retval = ERR_XML_PARSE;
- break;
- }
+ if (n == buflen-1) {
+ retval = ERR_XML_PARSE;
+ break;
+ }
int c = f->_getc();
- if (c == EOF) {
- retval = ERR_XML_PARSE;
- break;
- }
- buf[n++] = c;
- buf[n] = 0;
- char* p = strstr(buf, end_tag);
- if (p) {
- *p = 0;
- break;
- }
+ if (c == EOF) {
+ retval = ERR_XML_PARSE;
+ break;
+ }
+ buf[n++] = c;
+ buf[n] = 0;
+ char* p = strstr(buf, end_tag);
+ if (p) {
+ *p = 0;
+ break;
+ }
}
- buf[n] = 0;
+ buf[n] = 0;
strip_whitespace(buf);
return retval;
}
diff --git a/lib/url.cpp b/lib/url.cpp
index 013675b256..12f7406fdc 100644
--- a/lib/url.cpp
+++ b/lib/url.cpp
@@ -245,12 +245,12 @@ void escape_url_readable(char *in, char* out) {
void canonicalize_master_url(char* url) {
char buf[1024];
size_t n;
- bool bSSL = false; // keep track if they sent in https://
+ bool bSSL = false; // keep track if they sent in https://
char *p = strstr(url, "://");
if (p) {
- bSSL = (bool) (p == url + 5);
- strcpy(buf, p+3);
+ bSSL = (bool) (p == url + 5);
+ strcpy(buf, p+3);
} else {
strcpy(buf, url);
}
@@ -263,7 +263,7 @@ void canonicalize_master_url(char* url) {
if (buf[n-1] != '/') {
strcat(buf, "/");
}
- sprintf(url, "http%s://%s", (bSSL ? "s" : ""), buf);
+ sprintf(url, "http%s://%s", (bSSL ? "s" : ""), buf);
}
void canonicalize_master_url(string& url) {
@@ -278,19 +278,19 @@ void canonicalize_master_url(string& url) {
bool valid_master_url(char* buf) {
char* p, *q;
size_t n;
- bool bSSL = false;
+ bool bSSL = false;
p = strstr(buf, "http://");
- if (p != buf) {
- // allow https
- p = strstr(buf, "https://");
- if (p == buf) {
- bSSL = true;
- } else {
- return false; // no http or https, it's bad!
- }
- }
- q = p+strlen(bSSL ? "https://" : "http://");
+ if (p != buf) {
+ // allow https
+ p = strstr(buf, "https://");
+ if (p == buf) {
+ bSSL = true;
+ } else {
+ return false; // no http or https, it's bad!
+ }
+ }
+ q = p+strlen(bSSL ? "https://" : "http://");
p = strstr(q, ".");
if (!p) return false;
if (p == q) return false;
diff --git a/lib/util.cpp b/lib/util.cpp
index 4c0f7b5ae4..5ef5bbddb5 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -308,9 +308,9 @@ double linux_cpu_time(int pid) {
void boinc_crash() {
#ifdef _WIN32
- DebugBreak();
+ DebugBreak();
#else
- *(int*)0 = 0;
+ *(int*)0 = 0;
#endif
}
diff --git a/lib/win_util.cpp b/lib/win_util.cpp
index 1fe146bed7..cf1a445f1d 100644
--- a/lib/win_util.cpp
+++ b/lib/win_util.cpp
@@ -29,12 +29,13 @@
* Find out if we are on a Windows 2000 compatible system
**/
BOOL IsWindows2000Compatible() {
- OSVERSIONINFO osvi;
- ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ OSVERSIONINFO osvi;
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
+ if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) ) {
return FALSE;
+ }
return (osvi.dwMajorVersion >= 5);
}
@@ -800,16 +801,16 @@ int suspend_or_resume_threads(
}
void chdir_to_data_dir() {
- LONG lReturnValue;
- HKEY hkSetupHive;
+ LONG lReturnValue;
+ HKEY hkSetupHive;
LPTSTR lpszRegistryValue = NULL;
- DWORD dwSize = 0;
+ DWORD dwSize = 0;
// change the current directory to the boinc data directory if it exists
- lReturnValue = RegOpenKeyEx(
+ lReturnValue = RegOpenKeyEx(
HKEY_LOCAL_MACHINE,
_T("SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Setup"),
- 0,
+ 0,
KEY_READ,
&hkSetupHive
);
@@ -842,7 +843,7 @@ void chdir_to_data_dir() {
}
}
- if (hkSetupHive) RegCloseKey(hkSetupHive);
+ if (hkSetupHive) RegCloseKey(hkSetupHive);
if (lpszRegistryValue) free(lpszRegistryValue);
}
diff --git a/sched/assimilator.cpp b/sched/assimilator.cpp
index d29c8e6360..f505d93147 100644
--- a/sched/assimilator.cpp
+++ b/sched/assimilator.cpp
@@ -168,7 +168,7 @@ bool do_pass(APP& app) {
assimilate_state = ASSIMILATE_INIT;
}
sprintf(
- buf, "assimilate_state=%d, transition_time=%d",
+ buf, "assimilate_state=%d, transition_time=%d",
assimilate_state, (int)time(0)
);
retval = wu.update_field(buf);
@@ -230,7 +230,7 @@ int main(int argc, char** argv) {
// your project.
update_db = false;
} else if (is_arg(argv[i], "noinsert")) {
- // This option is also for testing and is used to
+ // This option is also for testing and is used to
// prevent the inserting of results into the *backend*
// (as opposed to the boinc) DB.
noinsert = true;
@@ -282,11 +282,11 @@ int main(int argc, char** argv) {
}
install_stop_signal_handler();
do {
- if (!do_pass(app)) {
- if (!one_pass) {
- sleep(sleep_interval);
+ if (!do_pass(app)) {
+ if (!one_pass) {
+ sleep(sleep_interval);
+ }
}
- }
} while (!one_pass);
}
diff --git a/sched/edf_sim.cpp b/sched/edf_sim.cpp
index fa7c2cc491..4c51299b4e 100644
--- a/sched/edf_sim.cpp
+++ b/sched/edf_sim.cpp
@@ -108,23 +108,23 @@ void mark_edf_misses (int ncpus, vector& ip_results){
lowest_booked_cpu = j;
}
}
-
+
booked_to[lowest_booked_cpu] += r.cpu_time_remaining;
log_msg(DETAIL, "[edf_detail] running %s on cpu %d; finishes at %.2f\n",
r.name, lowest_booked_cpu, booked_to[lowest_booked_cpu]/3600
);
if (booked_to[lowest_booked_cpu] > r.computation_deadline) {
- r.misses_deadline = true;
- r.estimated_completion_time = booked_to[lowest_booked_cpu];
- log_msg(DETAIL, "[edf_detail] %s misses_deadline; est completion %.2f\n",
+ r.misses_deadline = true;
+ r.estimated_completion_time = booked_to[lowest_booked_cpu];
+ log_msg(DETAIL, "[edf_detail] %s misses_deadline; est completion %.2f\n",
r.name, booked_to[lowest_booked_cpu]/3600
);
} else {
- r.misses_deadline = false;
- log_msg(DETAIL, "[edf_detail] %s makes deadline; est completion %.2f\n",
+ r.misses_deadline = false;
+ log_msg(DETAIL, "[edf_detail] %s makes deadline; est completion %.2f\n",
r.name, booked_to[lowest_booked_cpu]/3600
);
- // if result doesn't miss its deadline,
+ // if result doesn't miss its deadline,
// then the estimated_completion_time is of no use
}
}
@@ -158,24 +158,24 @@ void init_ip_results(
}
#if 0
-// Sort test_results by computation_deadline.
+// Sort test_results by computation_deadline.
// For each test result in ascending order of deadline,
// see whether adding it to the work queue would cause deadline misses
// or deadline miss delays.
// If a test result passes these checks, append it to the work queue
// for further result additions.
-// Return list of new results that can be sent to the client.
+// Return list of new results that can be sent to the client.
//
// NOTE: should we sort by increasing deadline or by increasing slack time?
//
vector REQUEST_HANDLER_WORK_SEND::find_sendable_test_results (
vector test_results,
- int ncpus,
- vector ipp_results,
+ int ncpus,
+ vector ipp_results,
double cpu_pessimism_factor // = 1 by default
) {
//test results to send
- vector sendable_test_results;
+ vector sendable_test_results;
vector::iterator test_results_it;
sort(test_results.begin(), test_results.end(), lessthan_deadline);
@@ -214,7 +214,7 @@ vector REQUEST_HANDLER_WORK_SEND::find_sendable_test_results (
//
bool check_candidate (
IP_RESULT& candidate,
- int ncpus,
+ int ncpus,
vector ip_results // passed by value (copy)
) {
double booked_to[128]; // keeps track of when each cpu is free
@@ -244,7 +244,7 @@ bool check_candidate (
double lowest_booked_time = booked_to[0];
int lowest_booked_cpu = 0;
for (j=1; j r.computation_deadline
&& !r.misses_deadline
) {
- log_msg(SUMMARY,
+ log_msg(SUMMARY,
"[send] cand. fails; %s now misses deadline: %.2f > %.2f\n",
r.name, booked_to[lowest_booked_cpu]/3600,
r.computation_deadline/3600
@@ -270,7 +270,7 @@ bool check_candidate (
// check a late result (i.e., one that would have missed its
// deadline) // would be made even later
//
- if (r.misses_deadline
+ if (r.misses_deadline
&& booked_to[lowest_booked_cpu] > r.estimated_completion_time
){
log_msg(SUMMARY,
diff --git a/sched/sched_locality.cpp b/sched/sched_locality.cpp
index 243d93a252..30ece0faec 100644
--- a/sched/sched_locality.cpp
+++ b/sched/sched_locality.cpp
@@ -362,12 +362,12 @@ static bool retrieve_single_trigger_by_fileset_name(char *fileset_name, DB_SCHED
// (no way to be sure if it succeeded).
//
int make_more_work_for_file(char* filename) {
- int retval = 0;
+ int retval = 0;
DB_SCHED_TRIGGER trigger;
if (!retrieve_single_trigger_by_fileset_name(filename, trigger)) {
- // trigger retrieval failed (message logged by previous method)
+ // trigger retrieval failed (message logged by previous method)
return -1;
}
@@ -514,11 +514,11 @@ static int get_working_set_filename(char *filename, bool slowhost) {
static void flag_for_possible_removal(char* fileset_name) {
- int retval = 0;
+ int retval = 0;
DB_SCHED_TRIGGER trigger;
if (!retrieve_single_trigger_by_fileset_name(fileset_name, trigger)) {
- // trigger retrieval failed (message logged by previous method)
+ // trigger retrieval failed (message logged by previous method)
return;
}
@@ -1198,13 +1198,13 @@ void send_work_locality() {
// generate corresponding l1_XXXX.XX_S5R4 and *_S5R7 patterns and delete it also
//
if (strlen(fi.name)==15 && !strncmp("h1_", fi.name, 3)) {
- FILE_INFO fil4,fil7,fih7;
- fil4=fi;
- fil4.name[0]='l';
- fil7=fil4;
- fil7.name[14]='7';
- fih7=fi;
- fih7.name[14]='7';
+ FILE_INFO fil4,fil7,fih7;
+ fil4=fi;
+ fil4.name[0]='l';
+ fil7=fil4;
+ fil7.name[14]='7';
+ fih7=fi;
+ fih7.name[14]='7';
g_reply->file_deletes.push_back(fil4);
g_reply->file_deletes.push_back(fil7);
g_reply->file_deletes.push_back(fih7);
diff --git a/sched/sched_msgs.cpp b/sched/sched_msgs.cpp
index fedf0feef3..00bd1fe170 100644
--- a/sched/sched_msgs.cpp
+++ b/sched/sched_msgs.cpp
@@ -51,9 +51,9 @@ SCHED_MSG_LOG::~SCHED_MSG_LOG() {
void SCHED_MSG_LOG::close() {
if (output) {
- flush();
- fclose(output);
- output = NULL;
+ flush();
+ fclose(output);
+ output = NULL;
}
}
diff --git a/sched/sched_shmem.h b/sched/sched_shmem.h
index cbbf5ca570..e18ffe4b7a 100644
--- a/sched/sched_shmem.h
+++ b/sched/sched_shmem.h
@@ -55,7 +55,7 @@ struct WU_RESULT {
int state;
// EMPTY, PRESENT, or PID of locking process
int infeasible_count;
- bool need_reliable; // try to send to a reliable host
+ bool need_reliable; // try to send to a reliable host
WORKUNIT workunit;
int resultid;
int time_added_to_shared_memory;
diff --git a/sched/sched_timezone.cpp b/sched/sched_timezone.cpp
index a0c7d44e25..a3651c4064 100644
--- a/sched/sched_timezone.cpp
+++ b/sched/sched_timezone.cpp
@@ -52,9 +52,9 @@ static int hostid=0;
static int compare(const void *x, const void *y) {
const URLTYPE *a=(const URLTYPE *)x;
const URLTYPE *b=(const URLTYPE *)y;
-
+
char longname[512];
-
+
const int twelve_hours = 12*3600;
int diffa = abs(tzone - (a->zone));
@@ -63,7 +63,7 @@ static int compare(const void *x, const void *y) {
if (diffa > twelve_hours) {
diffa = 2*twelve_hours-diffa;
}
-
+
if (diffb > twelve_hours) {
diffb = 2*twelve_hours-diffb;
}
@@ -71,11 +71,11 @@ static int compare(const void *x, const void *y) {
if (diffa < diffb) {
return -1;
}
-
+
if (diffa > diffb) {
return +1;
}
-
+
// In order to ensure uniform distribution, we hash paths that are
// equidistant from the host's timezone in a way that gives a
// unique ordering for each host but which is effectively random
@@ -87,15 +87,15 @@ static int compare(const void *x, const void *y) {
std::string sb = md5_string((const unsigned char *)longname, strlen((const char *)longname));
int xa = strtol(sa.substr(1, 7).c_str(), 0, 16);
int xb = strtol(sb.substr(1, 7).c_str(), 0, 16);
-
+
if (xaxb) {
return 1;
}
-
+
return 0;
}
@@ -105,13 +105,13 @@ static URLTYPE *cached=NULL;
URLTYPE* read_download_list() {
int count=0;
int i;
-
+
if (cached) return cached;
const char *download_servers = config.project_path("download_servers");
#ifndef _USING_FCGI_
FILE *fp=fopen(download_servers, "r");
-#else
+#else
FCGI_FILE *fp=FCGI::fopen(download_servers, "r");
#endif
@@ -142,7 +142,7 @@ URLTYPE* read_download_list() {
}
}
fclose(fp);
-
+
if (!count) {
log_messages.printf(MSG_CRITICAL,
"File %s contained no valid entries!\n"
@@ -153,11 +153,11 @@ URLTYPE* read_download_list() {
free(cached);
return NULL;
}
-
+
// sort URLs by distance from host timezone. See compare() above
// for details.
qsort(cached, count, sizeof(URLTYPE), compare);
-
+
log_messages.printf(MSG_DEBUG,
"Sorted list of URLs follows [host timezone: UTC%+d]\n",
tzone
@@ -180,9 +180,9 @@ int make_download_list(char *buffer, char *path, unsigned int lim, int tz) {
// global variable used in the compare() function
tzone=tz;
URLTYPE *serverlist=read_download_list();
-
+
if (!serverlist) return -1;
-
+
// print list of servers in sorted order.
// Space is to format them nicely
//
@@ -210,7 +210,7 @@ int add_download_servers(char *old_xml, char *new_xml, int tz) {
p = (r = old_xml);
- // search for next URL to do surgery on
+ // search for next URL to do surgery on
while ((q=strstr(p, ""))) {
// p is at current position
// q is at beginning of next "" tag
@@ -218,19 +218,19 @@ int add_download_servers(char *old_xml, char *new_xml, int tz) {
char *s;
char path[1024];
int len = q-p;
-
+
// copy everything from p to q to new_xml
//
strncpy(new_xml, p, len);
new_xml += len;
-
+
// locate next instance of
//
if (!(r = strstr(q, ""))) {
return 1;
}
r += strlen("");
-
+
// r points to the end of the whole "..." tag
// parse out the URL into 'path'
//
@@ -246,8 +246,8 @@ int add_download_servers(char *old_xml, char *new_xml, int tz) {
new_xml += r-q;
p=r;
} else {
- // calculate free space available for URL replaces
- int lim = total_free - (len - (p - old_xml));
+ // calculate free space available for URL replaces
+ int lim = total_free - (len - (p - old_xml));
// find end of the specified replace string,
// i.e. start of the 'path'
@@ -256,10 +256,10 @@ int add_download_servers(char *old_xml, char *new_xml, int tz) {
// insert new download list in place of the original single URL
len = make_download_list(new_xml, s, lim, tz);
if (len == 0) {
- // if the replacement would exceed the maximum XML length,
- // just keep the original URL
- len = r-q;
- strncpy(new_xml, q, len);
+ // if the replacement would exceed the maximum XML length,
+ // just keep the original URL
+ len = r-q;
+ strncpy(new_xml, q, len);
} else if (len < 0) {
return 1;
}
@@ -269,7 +269,7 @@ int add_download_servers(char *old_xml, char *new_xml, int tz) {
p=r;
}
}
-
+
strcpy(new_xml, r);
return 0;
}
@@ -305,7 +305,7 @@ void process_wu_timezone(
tzone = g_reply->host.timezone;
hostid = g_reply->host.id;
-
+
retval = add_download_servers(wu2.xml_doc, wu3.xml_doc, g_reply->host.timezone);
if (retval) {
log_messages.printf(MSG_CRITICAL,
diff --git a/sched/sched_types.h b/sched/sched_types.h
index 6b80337987..4eeaab0a87 100644
--- a/sched/sched_types.h
+++ b/sched/sched_types.h
@@ -32,8 +32,8 @@
// this records an app for which the user will accept work
//
struct APP_INFO {
- int appid;
- int work_available;
+ int appid;
+ int work_available;
};
// represents a resource (disk etc.) that the client may not have enough of
@@ -184,7 +184,7 @@ struct BEST_APP_VERSION {
DB_HOST_APP_VERSION* host_app_version();
// get the HOST_APP_VERSION, if any
-
+
BEST_APP_VERSION() {
present = false;
cavp = NULL;
@@ -264,7 +264,7 @@ struct SCHEDULER_REQUEST {
int core_client_version; // 10000*major + 100*minor + release
int rpc_seqno;
double work_req_seconds;
- // in "normalized CPU seconds" (see work_req.php)
+ // in "normalized CPU seconds" (see work_req.php)
double cpu_req_secs;
double cpu_req_instances;
double resource_share_fraction;
@@ -353,9 +353,9 @@ struct WORK_REQ {
bool no_cuda;
bool no_ati;
bool no_cpu;
- bool allow_non_preferred_apps;
- bool allow_beta_work;
- std::vector preferred_apps;
+ bool allow_non_preferred_apps;
+ bool allow_beta_work;
+ std::vector preferred_apps;
bool has_reliable_version;
// whether the host has a reliable app version
diff --git a/sched/sched_util.cpp b/sched/sched_util.cpp
index 0a82c35456..a068b73977 100644
--- a/sched/sched_util.cpp
+++ b/sched/sched_util.cpp
@@ -150,8 +150,8 @@ void get_log_path(char* p, const char* filename) {
}
static void filename_hash(const char* filename, int fanout, char* dir) {
- std::string s = md5_string((const unsigned char*)filename, strlen(filename));
- int x = strtol(s.substr(1, 7).c_str(), 0, 16);
+ std::string s = md5_string((const unsigned char*)filename, strlen(filename));
+ int x = strtol(s.substr(1, 7).c_str(), 0, 16);
sprintf(dir, "%x", x % fanout);
}
@@ -160,7 +160,7 @@ static void filename_hash(const char* filename, int fanout, char* dir) {
//
int dir_hier_path(
const char* filename, const char* root, int fanout,
- char* path, bool create
+ char* path, bool create
) {
char dir[256], dirpath[256];
int retval;
@@ -190,7 +190,7 @@ int dir_hier_path(
//
int dir_hier_url(
const char* filename, const char* root, int fanout,
- char* result
+ char* result
) {
char dir[256];
@@ -272,13 +272,13 @@ bool is_arg(const char* x, const char* y) {
#ifdef GCL_SIMULATOR
-void simulator_signal_handler(int signum){
+void simulator_signal_handler(int signum) {
FILE *fsim;
char currenttime[64];
fsim = fopen(config.project_path("simulator/sim_time.txt"),"r");
if(fsim){
fscanf(fsim,"%s", currenttime);
- simtime = atof(currenttime);
+ simtime = atof(currenttime);
fclose(fsim);
}
log_messages.printf(MSG_NORMAL,
diff --git a/sched/sched_util.h b/sched/sched_util.h
index 631ede52bb..db2f03be5a 100644
--- a/sched/sched_util.h
+++ b/sched/sched_util.h
@@ -43,14 +43,14 @@ extern void get_log_path(char*, const char*);
//
extern int dir_hier_path(
const char* filename, const char* root, int fanout,
- char* result, bool create=false
+ char* result, bool create=false
);
// convert filename to URL in a hierarchical directory system
//
extern int dir_hier_url(
const char* filename, const char* root, int fanout,
- char* result
+ char* result
);
extern void compute_avg_turnaround(HOST& host, double turnaround);
---|