mirror of https://github.com/BOINC/boinc.git
- scheduler: added (correct this time!) support for
<alt_platform> tags in scheduler requests. - file_deleter: add check for -dont_delete_batches sched/ file_deleter.C handle_request.C sched_array.C,h sched_locality.C,h sched_resend.C,h sched_send.C,h server_types.h svn path=/trunk/boinc/; revision=12512
This commit is contained in:
parent
9b8a9d8173
commit
2e7b82b631
|
@ -4135,3 +4135,16 @@ Rom 30 Apr 2007 (HEAD)
|
||||||
- Tag for 5.9.5 release, all platforms
|
- Tag for 5.9.5 release, all platforms
|
||||||
boinc_core_release_5_9_5
|
boinc_core_release_5_9_5
|
||||||
|
|
||||||
|
David 30 Apr 2007
|
||||||
|
- scheduler: added (correct this time!) support for
|
||||||
|
<alt_platform> tags in scheduler requests.
|
||||||
|
- file_deleter: add check for -dont_delete_batches
|
||||||
|
|
||||||
|
sched/
|
||||||
|
file_deleter.C
|
||||||
|
handle_request.C
|
||||||
|
sched_array.C,h
|
||||||
|
sched_locality.C,h
|
||||||
|
sched_resend.C,h
|
||||||
|
sched_send.C,h
|
||||||
|
server_types.h
|
||||||
|
|
|
@ -20,26 +20,36 @@ array(
|
||||||
'',
|
'',
|
||||||
1168202706
|
1168202706
|
||||||
),
|
),
|
||||||
array('boinc-irc.exe',
|
array(
|
||||||
'Boinc mIRC',
|
'http://www.weebl00.nl/leiterow/zowtar/BOINC/',
|
||||||
'1.0',
|
'BOINC mIRC',
|
||||||
'A ready setup mIRC to take you straight there',
|
'0.1',
|
||||||
'http://comatosed.net/boinc/boinc-irc.exe',
|
'MRC file for sending your BOINC status on IRC',
|
||||||
'Windows',
|
'http://www.weebl00.nl/leiterow/zowtar/BOINC/',
|
||||||
'Built in security systems for DCC and MSG systems and some other nice toys 2.00MB',
|
'all',
|
||||||
1089651337
|
'',
|
||||||
),
|
1177964485
|
||||||
array('boinc.mrc',
|
|
||||||
'Boinc mircstats',
|
|
||||||
'0.4',
|
|
||||||
'Script to show your Boinc stats on IRC (with mIRC)',
|
|
||||||
'http://sqreal.no-ip.org/boinc.mrc',
|
|
||||||
'Windows',
|
|
||||||
'This addon shows your boinc details to IRC like Credits, current progress , pulse, gaussian, spike, team ...
|
|
||||||
<br>
|
|
||||||
Put the .mrc on your mIRC main dir and type',
|
|
||||||
1162833635
|
|
||||||
),
|
),
|
||||||
|
//array('boinc-irc.exe',
|
||||||
|
// 'Boinc mIRC',
|
||||||
|
// '1.0',
|
||||||
|
// 'A ready setup mIRC to take you straight there',
|
||||||
|
// 'http://comatosed.net/boinc/boinc-irc.exe',
|
||||||
|
// 'Windows',
|
||||||
|
// 'Built in security systems for DCC and MSG systems and some other nice toys 2.00MB',
|
||||||
|
// 1089651337
|
||||||
|
//),
|
||||||
|
//array('boinc.mrc',
|
||||||
|
// 'Boinc mircstats',
|
||||||
|
// '0.4',
|
||||||
|
// 'Script to show your Boinc stats on IRC (with mIRC)',
|
||||||
|
// 'http://sqreal.no-ip.org/boinc.mrc',
|
||||||
|
// 'Windows',
|
||||||
|
// 'This addon shows your boinc details to IRC like Credits, current progress , pulse, gaussian, spike, team ...
|
||||||
|
// <br>
|
||||||
|
// Put the .mrc on your mIRC main dir and type',
|
||||||
|
// 1162833635
|
||||||
|
//),
|
||||||
array('boincdv_v0306.zip',
|
array('boincdv_v0306.zip',
|
||||||
'BoincDV',
|
'BoincDV',
|
||||||
'',
|
'',
|
||||||
|
|
|
@ -565,6 +565,8 @@ int main(int argc, char** argv) {
|
||||||
id_remainder = atoi(argv[++i]);
|
id_remainder = atoi(argv[++i]);
|
||||||
} else if (!strcmp(argv[i], "-dont_delete_antiques")) {
|
} else if (!strcmp(argv[i], "-dont_delete_antiques")) {
|
||||||
dont_delete_antiques = true;
|
dont_delete_antiques = true;
|
||||||
|
} else if (!strcmp(argv[i], "-dont_delete_batches")) {
|
||||||
|
dont_delete_batches = true;
|
||||||
} else {
|
} else {
|
||||||
log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL,
|
log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL,
|
||||||
"Unrecognized arg: %s\n", argv[i]
|
"Unrecognized arg: %s\n", argv[i]
|
||||||
|
|
|
@ -487,8 +487,7 @@ static int update_host_record(HOST& initial_host, HOST& xhost, USER& user) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int send_result_abort(
|
int send_result_abort(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, SCHED_SHMEM& ss
|
||||||
SCHED_SHMEM& ss
|
|
||||||
) {
|
) {
|
||||||
int aborts_sent = 0;
|
int aborts_sent = 0;
|
||||||
DB_IN_PROGRESS_RESULT result;
|
DB_IN_PROGRESS_RESULT result;
|
||||||
|
@ -1187,6 +1186,7 @@ void process_request(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, SCHED_SHMEM& ss,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, SCHED_SHMEM& ss,
|
||||||
char* code_sign_key
|
char* code_sign_key
|
||||||
) {
|
) {
|
||||||
|
PLATFORM_LIST platforms;
|
||||||
PLATFORM* platform;
|
PLATFORM* platform;
|
||||||
int retval;
|
int retval;
|
||||||
double last_rpc_time;
|
double last_rpc_time;
|
||||||
|
@ -1318,16 +1318,15 @@ void process_request(
|
||||||
}
|
}
|
||||||
retval = modify_host_struct(sreq, reply.host);
|
retval = modify_host_struct(sreq, reply.host);
|
||||||
|
|
||||||
// look up the client's platform in the DB
|
// look up the client's platform(s) in the DB
|
||||||
//
|
//
|
||||||
platform = ss.lookup_platform(sreq.platform.name);
|
platform = ss.lookup_platform(sreq.platform.name);
|
||||||
if (!platform) {
|
if (platform) platforms.list.push_back(platform);
|
||||||
for (i=0; i<sreq.alt_platforms.size(); i++) {
|
for (i=0; i<sreq.alt_platforms.size(); i++) {
|
||||||
platform = ss.lookup_platform(sreq.alt_platforms[i].name);
|
platform = ss.lookup_platform(sreq.alt_platforms[i].name);
|
||||||
if (platform) break;
|
if (platform) platforms.list.push_back(platform);
|
||||||
}
|
}
|
||||||
}
|
if (platforms.list.size() == 0) {
|
||||||
if (!platform) {
|
|
||||||
sprintf(buf, "platform '%s' not found", sreq.platform.name);
|
sprintf(buf, "platform '%s' not found", sreq.platform.name);
|
||||||
USER_MESSAGE um(buf, "low");
|
USER_MESSAGE um(buf, "low");
|
||||||
reply.insert_message(um);
|
reply.insert_message(um);
|
||||||
|
@ -1344,13 +1343,13 @@ void process_request(
|
||||||
handle_results(sreq, reply);
|
handle_results(sreq, reply);
|
||||||
|
|
||||||
if (config.resend_lost_results && sreq.have_other_results_list) {
|
if (config.resend_lost_results && sreq.have_other_results_list) {
|
||||||
if (resend_lost_work(sreq, reply, *platform, ss)) {
|
if (resend_lost_work(sreq, reply, platforms, ss)) {
|
||||||
ok_to_send_work = false;
|
ok_to_send_work = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.send_result_abort && sreq.have_other_results_list) {
|
if (config.send_result_abort && sreq.have_other_results_list) {
|
||||||
send_result_abort(sreq, reply, *platform, ss);
|
send_result_abort(sreq, reply, ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if last RPC was within config.min_sendwork_interval, don't send work
|
// if last RPC was within config.min_sendwork_interval, don't send work
|
||||||
|
@ -1377,7 +1376,7 @@ void process_request(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ok_to_send_work) {
|
if (ok_to_send_work) {
|
||||||
send_work(sreq, reply, *platform, ss);
|
send_work(sreq, reply, platforms, ss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
// send only results that were previously infeasible for some host
|
// send only results that were previously infeasible for some host
|
||||||
//
|
//
|
||||||
void scan_work_array(
|
void scan_work_array(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss
|
SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
int i, j, retval, n, rnd_off;
|
int i, j, retval, n, rnd_off;
|
||||||
|
@ -140,7 +140,7 @@ void scan_work_array(
|
||||||
// Find the app and app_version for the client's platform.
|
// Find the app and app_version for the client's platform.
|
||||||
// If none, treat the WU as infeasible
|
// If none, treat the WU as infeasible
|
||||||
//
|
//
|
||||||
if (anonymous(platform)) {
|
if (anonymous(platforms.list[0])) {
|
||||||
app = ss.lookup_app(wu.appid);
|
app = ss.lookup_app(wu.appid);
|
||||||
found = sreq.has_version(*app);
|
found = sreq.has_version(*app);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
@ -148,7 +148,7 @@ void scan_work_array(
|
||||||
}
|
}
|
||||||
avp = NULL;
|
avp = NULL;
|
||||||
} else {
|
} else {
|
||||||
found = find_app_version(reply.wreq, wu, platform, ss, app, avp);
|
found = find_app_version(reply.wreq, wu, platforms, ss, app, avp);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
wu_result.infeasible_count++;
|
wu_result.infeasible_count++;
|
||||||
continue;
|
continue;
|
||||||
|
@ -277,7 +277,7 @@ void scan_work_array(
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = add_result_to_reply(
|
retval = add_result_to_reply(
|
||||||
result, wu, sreq, reply, platform, app, avp
|
result, wu, sreq, reply, platforms, app, avp
|
||||||
);
|
);
|
||||||
|
|
||||||
// add_result_to_reply() fails only in fairly pathological cases -
|
// add_result_to_reply() fails only in fairly pathological cases -
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
extern void scan_work_array(
|
extern void scan_work_array(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM_LIST&, SCHED_SHMEM&
|
||||||
SCHED_SHMEM& ss
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ int decrement_disk_space_locality(
|
||||||
//
|
//
|
||||||
static int possibly_send_result(
|
static int possibly_send_result(
|
||||||
DB_RESULT& result,
|
DB_RESULT& result,
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss
|
SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
DB_WORKUNIT wu;
|
DB_WORKUNIT wu;
|
||||||
|
@ -304,10 +304,10 @@ static int possibly_send_result(
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = get_app_version(
|
retval = get_app_version(
|
||||||
wu, app, avp, sreq, reply, platform, ss
|
wu, app, avp, sreq, reply, platforms, ss
|
||||||
);
|
);
|
||||||
|
|
||||||
if (retval==ERR_NO_APP_VERSION && !strcmp("anonymous", platform.name)) {
|
if (retval==ERR_NO_APP_VERSION && anonymous(platforms.list[0])) {
|
||||||
char help_msg_buf[512];
|
char help_msg_buf[512];
|
||||||
sprintf(help_msg_buf, "To get more %s work, finish current work, stop BOINC, remove app_info.xml file, and restart.", config.long_name);
|
sprintf(help_msg_buf, "To get more %s work, finish current work, stop BOINC, remove app_info.xml file, and restart.", config.long_name);
|
||||||
USER_MESSAGE um(help_msg_buf, "high");
|
USER_MESSAGE um(help_msg_buf, "high");
|
||||||
|
@ -317,7 +317,7 @@ static int possibly_send_result(
|
||||||
|
|
||||||
if (retval) return ERR_NO_APP_VERSION;
|
if (retval) return ERR_NO_APP_VERSION;
|
||||||
|
|
||||||
return add_result_to_reply(result, wu, sreq, reply, platform, app, avp);
|
return add_result_to_reply(result, wu, sreq, reply, platforms, app, avp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the work generator can not make more work for this
|
// returns true if the work generator can not make more work for this
|
||||||
|
@ -495,7 +495,7 @@ static void flag_for_possible_removal(char* filename) {
|
||||||
static int send_results_for_file(
|
static int send_results_for_file(
|
||||||
char* filename,
|
char* filename,
|
||||||
int& nsent,
|
int& nsent,
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss,
|
SCHED_SHMEM& ss,
|
||||||
bool /*in_working_set*/
|
bool /*in_working_set*/
|
||||||
) {
|
) {
|
||||||
|
@ -651,7 +651,7 @@ static int send_results_for_file(
|
||||||
// This *should* always work.
|
// This *should* always work.
|
||||||
//
|
//
|
||||||
retval_send = possibly_send_result(
|
retval_send = possibly_send_result(
|
||||||
result, sreq, reply, platform, ss
|
result, sreq, reply, platforms, ss
|
||||||
);
|
);
|
||||||
boinc_db.commit_transaction();
|
boinc_db.commit_transaction();
|
||||||
|
|
||||||
|
@ -715,7 +715,7 @@ static int send_results_for_file(
|
||||||
// min_resultname = R.filename;
|
// min_resultname = R.filename;
|
||||||
//
|
//
|
||||||
static int send_new_file_work_deterministic_seeded(
|
static int send_new_file_work_deterministic_seeded(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss, int& nsent, const char *start_f, const char *end_f
|
SCHED_SHMEM& ss, int& nsent, const char *start_f, const char *end_f
|
||||||
) {
|
) {
|
||||||
DB_RESULT result;
|
DB_RESULT result;
|
||||||
|
@ -756,7 +756,7 @@ static int send_new_file_work_deterministic_seeded(
|
||||||
);
|
);
|
||||||
|
|
||||||
retval = send_results_for_file(
|
retval = send_results_for_file(
|
||||||
filename, nsent, sreq, reply, platform, ss, false
|
filename, nsent, sreq, reply, platforms, ss, false
|
||||||
);
|
);
|
||||||
|
|
||||||
if (retval==ERR_NO_APP_VERSION || retval==ERR_INSUFFICIENT_RESOURCE) return retval;
|
if (retval==ERR_NO_APP_VERSION || retval==ERR_INSUFFICIENT_RESOURCE) return retval;
|
||||||
|
@ -793,7 +793,7 @@ static bool is_host_slow(SCHEDULER_REQUEST& sreq) {
|
||||||
// if it has not sent any new work.
|
// if it has not sent any new work.
|
||||||
//
|
//
|
||||||
static int send_new_file_work_deterministic(
|
static int send_new_file_work_deterministic(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss
|
SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
char start_filename[256];
|
char start_filename[256];
|
||||||
|
@ -808,7 +808,7 @@ static int send_new_file_work_deterministic(
|
||||||
|
|
||||||
// start deterministic search with randomly chosen filename, go to
|
// start deterministic search with randomly chosen filename, go to
|
||||||
// lexical maximum
|
// lexical maximum
|
||||||
send_new_file_work_deterministic_seeded(sreq, reply, platform, ss, nsent, start_filename, NULL);
|
send_new_file_work_deterministic_seeded(sreq, reply, platforms, ss, nsent, start_filename, NULL);
|
||||||
if (nsent) {
|
if (nsent) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -817,7 +817,7 @@ static int send_new_file_work_deterministic(
|
||||||
// filename, continue to randomly choosen one
|
// filename, continue to randomly choosen one
|
||||||
if (!getfile_retval && reply.work_needed(true)) {
|
if (!getfile_retval && reply.work_needed(true)) {
|
||||||
send_new_file_work_deterministic_seeded(
|
send_new_file_work_deterministic_seeded(
|
||||||
sreq, reply, platform, ss, nsent, "", start_filename
|
sreq, reply, platforms, ss, nsent, "", start_filename
|
||||||
);
|
);
|
||||||
if (nsent) {
|
if (nsent) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -829,7 +829,7 @@ static int send_new_file_work_deterministic(
|
||||||
|
|
||||||
|
|
||||||
static int send_new_file_work_working_set(
|
static int send_new_file_work_working_set(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss
|
SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
char filename[256];
|
char filename[256];
|
||||||
|
@ -843,20 +843,20 @@ static int send_new_file_work_working_set(
|
||||||
);
|
);
|
||||||
|
|
||||||
return send_results_for_file(
|
return send_results_for_file(
|
||||||
filename, nsent, sreq, reply, platform, ss, true
|
filename, nsent, sreq, reply, platforms, ss, true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// prototype
|
// prototype
|
||||||
static int send_old_work(
|
static int send_old_work(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss, int t_min, int t_max);
|
SCHED_SHMEM& ss, int t_min, int t_max);
|
||||||
|
|
||||||
// The host doesn't have any files for which work is available.
|
// The host doesn't have any files for which work is available.
|
||||||
// Pick new file to send. Returns nonzero if no work is available.
|
// Pick new file to send. Returns nonzero if no work is available.
|
||||||
//
|
//
|
||||||
static int send_new_file_work(
|
static int send_new_file_work(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss
|
SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
@ -878,7 +878,7 @@ static int send_new_file_work(
|
||||||
"send_new_file_work(): try to send old work\n"
|
"send_new_file_work(): try to send old work\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
retval_sow=send_old_work(sreq, reply, platform, ss, start, end);
|
retval_sow=send_old_work(sreq, reply, platforms, ss, start, end);
|
||||||
|
|
||||||
if (retval_sow==ERR_NO_APP_VERSION || retval_sow==ERR_INSUFFICIENT_RESOURCE) return retval_sow;
|
if (retval_sow==ERR_NO_APP_VERSION || retval_sow==ERR_INSUFFICIENT_RESOURCE) return retval_sow;
|
||||||
|
|
||||||
|
@ -888,7 +888,7 @@ static int send_new_file_work(
|
||||||
"send_new_file_work(%d): try to send from working set\n", retry
|
"send_new_file_work(%d): try to send from working set\n", retry
|
||||||
);
|
);
|
||||||
retry++;
|
retry++;
|
||||||
retval_snfwws=send_new_file_work_working_set(sreq, reply, platform, ss);
|
retval_snfwws=send_new_file_work_working_set(sreq, reply, platforms, ss);
|
||||||
if (retval_snfwws==ERR_NO_APP_VERSION || retval_snfwws==ERR_INSUFFICIENT_RESOURCE) return retval_snfwws;
|
if (retval_snfwws==ERR_NO_APP_VERSION || retval_snfwws==ERR_INSUFFICIENT_RESOURCE) return retval_snfwws;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -897,7 +897,7 @@ static int send_new_file_work(
|
||||||
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG,
|
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG,
|
||||||
"send_new_file_work(): try deterministic method\n"
|
"send_new_file_work(): try deterministic method\n"
|
||||||
);
|
);
|
||||||
if (send_new_file_work_deterministic(sreq, reply, platform, ss)) {
|
if (send_new_file_work_deterministic(sreq, reply, platforms, ss)) {
|
||||||
// if no work remains at all,
|
// if no work remains at all,
|
||||||
// we learn it here and return nonzero.
|
// we learn it here and return nonzero.
|
||||||
//
|
//
|
||||||
|
@ -917,7 +917,7 @@ static int send_new_file_work(
|
||||||
// t_min=INT_MIN if you wish to leave off the left constraint.
|
// t_min=INT_MIN if you wish to leave off the left constraint.
|
||||||
//
|
//
|
||||||
static int send_old_work(
|
static int send_old_work(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss, int t_min, int t_max
|
SCHED_SHMEM& ss, int t_min, int t_max
|
||||||
) {
|
) {
|
||||||
char buf[1024], filename[256];
|
char buf[1024], filename[256];
|
||||||
|
@ -945,7 +945,7 @@ static int send_old_work(
|
||||||
|
|
||||||
retval = result.lookup(buf);
|
retval = result.lookup(buf);
|
||||||
if (!retval) {
|
if (!retval) {
|
||||||
retval = possibly_send_result(result, sreq, reply, platform, ss);
|
retval = possibly_send_result(result, sreq, reply, platforms, ss);
|
||||||
boinc_db.commit_transaction();
|
boinc_db.commit_transaction();
|
||||||
if (!retval) {
|
if (!retval) {
|
||||||
double age=(now-result.create_time)/3600.0;
|
double age=(now-result.create_time)/3600.0;
|
||||||
|
@ -955,7 +955,7 @@ static int send_old_work(
|
||||||
extract_retval=extract_filename(result.name, filename);
|
extract_retval=extract_filename(result.name, filename);
|
||||||
if (!extract_retval) {
|
if (!extract_retval) {
|
||||||
send_results_for_file(
|
send_results_for_file(
|
||||||
filename, nsent, sreq, reply, platform, ss, false
|
filename, nsent, sreq, reply, platforms, ss, false
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// David, is this right? Is this the only place in
|
// David, is this right? Is this the only place in
|
||||||
|
@ -1003,7 +1003,7 @@ bool file_info_order(const FILE_INFO& fi1, const FILE_INFO& fi2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_work_locality(
|
void send_work_locality(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss
|
SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
int i, nsent, nfiles, j;
|
int i, nsent, nfiles, j;
|
||||||
|
@ -1090,7 +1090,7 @@ void send_work_locality(
|
||||||
//
|
//
|
||||||
if (config.locality_scheduling_send_timeout && sreq.host.n_bwdown>100000) {
|
if (config.locality_scheduling_send_timeout && sreq.host.n_bwdown>100000) {
|
||||||
int until=time(0)-config.locality_scheduling_send_timeout;
|
int until=time(0)-config.locality_scheduling_send_timeout;
|
||||||
int retval_sow=send_old_work(sreq, reply, platform, ss, INT_MIN, until);
|
int retval_sow=send_old_work(sreq, reply, platforms, ss, INT_MIN, until);
|
||||||
if (retval_sow==ERR_NO_APP_VERSION || retval_sow==ERR_INSUFFICIENT_RESOURCE) return;
|
if (retval_sow==ERR_NO_APP_VERSION || retval_sow==ERR_INSUFFICIENT_RESOURCE) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1103,7 +1103,7 @@ void send_work_locality(
|
||||||
if (!reply.work_needed(true)) break;
|
if (!reply.work_needed(true)) break;
|
||||||
FILE_INFO& fi = sreq.file_infos[k];
|
FILE_INFO& fi = sreq.file_infos[k];
|
||||||
retval_srff=send_results_for_file(
|
retval_srff=send_results_for_file(
|
||||||
fi.name, nsent, sreq, reply, platform, ss, false
|
fi.name, nsent, sreq, reply, platforms, ss, false
|
||||||
);
|
);
|
||||||
|
|
||||||
if (retval_srff==ERR_NO_APP_VERSION || retval_srff==ERR_INSUFFICIENT_RESOURCE) return;
|
if (retval_srff==ERR_NO_APP_VERSION || retval_srff==ERR_INSUFFICIENT_RESOURCE) return;
|
||||||
|
@ -1126,7 +1126,7 @@ void send_work_locality(
|
||||||
// send new files if needed
|
// send new files if needed
|
||||||
//
|
//
|
||||||
if (reply.work_needed(true)) {
|
if (reply.work_needed(true)) {
|
||||||
send_new_file_work(sreq, reply, platform, ss);
|
send_new_file_work(sreq, reply, platforms, ss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,11 @@
|
||||||
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
extern void send_work_locality(
|
extern void send_work_locality(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM_LIST&, SCHED_SHMEM&
|
||||||
SCHED_SHMEM& ss
|
|
||||||
);
|
);
|
||||||
|
|
||||||
extern int decrement_disk_space_locality(
|
extern int decrement_disk_space_locality(
|
||||||
WORKUNIT& wu, SCHEDULER_REQUEST& request,
|
WORKUNIT& wu, SCHEDULER_REQUEST& request, SCHEDULER_REPLY& reply
|
||||||
SCHEDULER_REPLY& reply
|
|
||||||
);
|
);
|
||||||
|
|
||||||
extern int delete_file_from_host(SCHEDULER_REQUEST&, SCHEDULER_REPLY&);
|
extern int delete_file_from_host(SCHEDULER_REQUEST&, SCHEDULER_REPLY&);
|
||||||
|
|
|
@ -85,8 +85,8 @@ static int possibly_give_result_new_deadline(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool resend_lost_work(
|
bool resend_lost_work(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply,
|
||||||
SCHED_SHMEM& ss
|
PLATFORM_LIST& platforms, SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
DB_RESULT result;
|
DB_RESULT result;
|
||||||
std::vector<DB_RESULT>results;
|
std::vector<DB_RESULT>results;
|
||||||
|
@ -142,7 +142,7 @@ bool resend_lost_work(
|
||||||
sreq.core_client_major_version*100 + sreq.core_client_minor_version;
|
sreq.core_client_major_version*100 + sreq.core_client_minor_version;
|
||||||
|
|
||||||
retval = get_app_version(
|
retval = get_app_version(
|
||||||
wu, app, avp, sreq, reply, platform, ss
|
wu, app, avp, sreq, reply, platforms, ss
|
||||||
);
|
);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
log_messages.printf( SCHED_MSG_LOG::MSG_CRITICAL,
|
log_messages.printf( SCHED_MSG_LOG::MSG_CRITICAL,
|
||||||
|
@ -201,7 +201,7 @@ bool resend_lost_work(
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = add_result_to_reply(
|
retval = add_result_to_reply(
|
||||||
result, wu, sreq, reply, platform, app, avp
|
result, wu, sreq, reply, platforms, app, avp
|
||||||
);
|
);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
log_messages.printf( SCHED_MSG_LOG::MSG_CRITICAL,
|
log_messages.printf( SCHED_MSG_LOG::MSG_CRITICAL,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
extern bool resend_lost_work(
|
extern bool resend_lost_work(
|
||||||
SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM&, SCHED_SHMEM&
|
SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM_LIST&, SCHED_SHMEM&
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,8 @@ const int MAX_SECONDS_TO_SEND = (28*SECONDS_IN_DAY);
|
||||||
const double DEFAULT_RAM_SIZE = 64000000;
|
const double DEFAULT_RAM_SIZE = 64000000;
|
||||||
// if host sends us an impossible RAM size, use this instead
|
// if host sends us an impossible RAM size, use this instead
|
||||||
|
|
||||||
bool anonymous(PLATFORM& platform) {
|
bool anonymous(PLATFORM* platform) {
|
||||||
return (!strcmp(platform.name, "anonymous"));
|
return (!strcmp(platform->name, "anonymous"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SCHEDULER_REQUEST::has_version(APP& app) {
|
bool SCHEDULER_REQUEST::has_version(APP& app) {
|
||||||
|
@ -76,15 +76,15 @@ bool SCHEDULER_REQUEST::has_version(APP& app) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the app and app_version for the client's platform.
|
// Find an app and app_version for the client's platform(s).
|
||||||
//
|
//
|
||||||
int get_app_version(
|
int get_app_version(
|
||||||
WORKUNIT& wu, APP* &app, APP_VERSION* &avp,
|
WORKUNIT& wu, APP* &app, APP_VERSION* &avp,
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss
|
SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
bool found;
|
bool found;
|
||||||
if (anonymous(platform)) {
|
if (anonymous(platforms.list[0])) {
|
||||||
app = ss.lookup_app(wu.appid);
|
app = ss.lookup_app(wu.appid);
|
||||||
found = sreq.has_version(*app);
|
found = sreq.has_version(*app);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
|
@ -95,7 +95,7 @@ int get_app_version(
|
||||||
}
|
}
|
||||||
avp = NULL;
|
avp = NULL;
|
||||||
} else {
|
} else {
|
||||||
found = find_app_version(reply.wreq, wu, platform, ss, app, avp);
|
found = find_app_version(reply.wreq, wu, platforms, ss, app, avp);
|
||||||
if (!found) {
|
if (!found) {
|
||||||
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG, "Didn't find app version\n");
|
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG, "Didn't find app version\n");
|
||||||
return ERR_NO_APP_VERSION;
|
return ERR_NO_APP_VERSION;
|
||||||
|
@ -486,7 +486,7 @@ int insert_wu_tags(WORKUNIT& wu, APP& app) {
|
||||||
// return false if none
|
// return false if none
|
||||||
//
|
//
|
||||||
bool find_app_version(
|
bool find_app_version(
|
||||||
WORK_REQ& wreq, WORKUNIT& wu, PLATFORM& platform, SCHED_SHMEM& ss,
|
WORK_REQ& wreq, WORKUNIT& wu, PLATFORM_LIST& platforms, SCHED_SHMEM& ss,
|
||||||
APP*& app, APP_VERSION*& avp
|
APP*& app, APP_VERSION*& avp
|
||||||
) {
|
) {
|
||||||
app = ss.lookup_app(wu.appid);
|
app = ss.lookup_app(wu.appid);
|
||||||
|
@ -496,18 +496,20 @@ bool find_app_version(
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
avp = ss.lookup_app_version(app->id, platform.id, app->min_version);
|
unsigned int i;
|
||||||
if (!avp) {
|
for (i=0; i<platforms.list.size(); i++) {
|
||||||
|
PLATFORM* p = platforms.list[i];
|
||||||
|
avp = ss.lookup_app_version(app->id, p->id, app->min_version);
|
||||||
|
if (avp) return true;
|
||||||
|
}
|
||||||
log_messages.printf(
|
log_messages.printf(
|
||||||
SCHED_MSG_LOG::MSG_DEBUG,
|
SCHED_MSG_LOG::MSG_DEBUG,
|
||||||
"no app version available: APP#%d PLATFORM#%d min_version %d\n",
|
"no app version available: APP#%d PLATFORM#%d min_version %d\n",
|
||||||
app->id, platform.id, app->min_version
|
app->id, platforms.list[0]->id, app->min_version
|
||||||
);
|
);
|
||||||
wreq.no_app_version = true;
|
wreq.no_app_version = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// verify that the given APP_VERSION will work with the core client
|
// verify that the given APP_VERSION will work with the core client
|
||||||
//
|
//
|
||||||
|
@ -531,7 +533,7 @@ bool app_core_compatible(WORK_REQ& wreq, APP_VERSION& av) {
|
||||||
// Add the app and app_version to the reply also.
|
// Add the app and app_version to the reply also.
|
||||||
//
|
//
|
||||||
int add_wu_to_reply(
|
int add_wu_to_reply(
|
||||||
WORKUNIT& wu, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
WORKUNIT& wu, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
APP* app, APP_VERSION* avp
|
APP* app, APP_VERSION* avp
|
||||||
) {
|
) {
|
||||||
int retval;
|
int retval;
|
||||||
|
@ -551,8 +553,8 @@ int add_wu_to_reply(
|
||||||
reply.insert_app_version_unique(*avp2);
|
reply.insert_app_version_unique(*avp2);
|
||||||
log_messages.printf(
|
log_messages.printf(
|
||||||
SCHED_MSG_LOG::MSG_DEBUG,
|
SCHED_MSG_LOG::MSG_DEBUG,
|
||||||
"[HOST#%d] Sending app_version %s %s %d\n",
|
"[HOST#%d] Sending app_version %s %d %d\n",
|
||||||
reply.host.id, app->name, platform.name, avp2->version_num
|
reply.host.id, app->name, avp2->platformid, avp2->version_num
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -690,14 +692,14 @@ void SCHEDULER_REPLY::got_bad_result() {
|
||||||
|
|
||||||
int add_result_to_reply(
|
int add_result_to_reply(
|
||||||
DB_RESULT& result, WORKUNIT& wu, SCHEDULER_REQUEST& request,
|
DB_RESULT& result, WORKUNIT& wu, SCHEDULER_REQUEST& request,
|
||||||
SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
APP* app, APP_VERSION* avp
|
APP* app, APP_VERSION* avp
|
||||||
) {
|
) {
|
||||||
int retval;
|
int retval;
|
||||||
double wu_seconds_filled;
|
double wu_seconds_filled;
|
||||||
bool resent_result = false;
|
bool resent_result = false;
|
||||||
|
|
||||||
retval = add_wu_to_reply(wu, reply, platform, app, avp);
|
retval = add_wu_to_reply(wu, reply, platforms, app, avp);
|
||||||
if (retval) return retval;
|
if (retval) return retval;
|
||||||
|
|
||||||
// in the scheduling locality case,
|
// in the scheduling locality case,
|
||||||
|
@ -814,7 +816,7 @@ int add_result_to_reply(
|
||||||
}
|
}
|
||||||
|
|
||||||
int send_work(
|
int send_work(
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM_LIST& platforms,
|
||||||
SCHED_SHMEM& ss
|
SCHED_SHMEM& ss
|
||||||
) {
|
) {
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -864,14 +866,14 @@ int send_work(
|
||||||
|
|
||||||
if (config.locality_scheduling) {
|
if (config.locality_scheduling) {
|
||||||
reply.wreq.infeasible_only = false;
|
reply.wreq.infeasible_only = false;
|
||||||
send_work_locality(sreq, reply, platform, ss);
|
send_work_locality(sreq, reply, platforms, ss);
|
||||||
} else {
|
} else {
|
||||||
// give top priority to results that require a 'reliable host'
|
// give top priority to results that require a 'reliable host'
|
||||||
//
|
//
|
||||||
if (reply.wreq.host_info.reliable) {
|
if (reply.wreq.host_info.reliable) {
|
||||||
reply.wreq.reliable_only = true;
|
reply.wreq.reliable_only = true;
|
||||||
reply.wreq.infeasible_only = false;
|
reply.wreq.infeasible_only = false;
|
||||||
scan_work_array(sreq, reply, platform, ss);
|
scan_work_array(sreq, reply, platforms, ss);
|
||||||
}
|
}
|
||||||
reply.wreq.reliable_only = false;
|
reply.wreq.reliable_only = false;
|
||||||
|
|
||||||
|
@ -886,17 +888,17 @@ int send_work(
|
||||||
"[HOST#%d] will accept beta work. Scanning for beta work.\n",
|
"[HOST#%d] will accept beta work. Scanning for beta work.\n",
|
||||||
reply.host.id
|
reply.host.id
|
||||||
);
|
);
|
||||||
scan_work_array(sreq, reply, platform, ss);
|
scan_work_array(sreq, reply, platforms, ss);
|
||||||
}
|
}
|
||||||
reply.wreq.beta_only = false;
|
reply.wreq.beta_only = false;
|
||||||
|
|
||||||
// give next priority to results that were infeasible for some other host
|
// give next priority to results that were infeasible for some other host
|
||||||
//
|
//
|
||||||
reply.wreq.infeasible_only = true;
|
reply.wreq.infeasible_only = true;
|
||||||
scan_work_array(sreq, reply, platform, ss);
|
scan_work_array(sreq, reply, platforms, ss);
|
||||||
|
|
||||||
reply.wreq.infeasible_only = false;
|
reply.wreq.infeasible_only = false;
|
||||||
scan_work_array(sreq, reply, platform, ss);
|
scan_work_array(sreq, reply, platforms, ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
log_messages.printf(
|
log_messages.printf(
|
||||||
|
|
|
@ -19,23 +19,23 @@
|
||||||
|
|
||||||
extern int get_app_version(
|
extern int get_app_version(
|
||||||
WORKUNIT& wu, APP* &app, APP_VERSION* &avp,
|
WORKUNIT& wu, APP* &app, APP_VERSION* &avp,
|
||||||
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform,
|
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply,
|
||||||
SCHED_SHMEM& ss
|
PLATFORM_LIST& platforms, SCHED_SHMEM& ss
|
||||||
);
|
);
|
||||||
|
|
||||||
extern int send_work(
|
extern int send_work(
|
||||||
SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM&, SCHED_SHMEM&
|
SCHEDULER_REQUEST&, SCHEDULER_REPLY&, PLATFORM_LIST&, SCHED_SHMEM&
|
||||||
);
|
);
|
||||||
|
|
||||||
extern int add_result_to_reply(
|
extern int add_result_to_reply(
|
||||||
DB_RESULT& result, WORKUNIT& wu, SCHEDULER_REQUEST&, SCHEDULER_REPLY&,
|
DB_RESULT& result, WORKUNIT& wu, SCHEDULER_REQUEST&, SCHEDULER_REPLY&,
|
||||||
PLATFORM&, APP* app, APP_VERSION* avp
|
PLATFORM_LIST&, APP* app, APP_VERSION* avp
|
||||||
);
|
);
|
||||||
|
|
||||||
extern bool anonymous(PLATFORM&);
|
extern bool anonymous(PLATFORM*);
|
||||||
|
|
||||||
extern bool find_app_version(
|
extern bool find_app_version(
|
||||||
WORK_REQ& wreq, WORKUNIT& wu, PLATFORM& platform, SCHED_SHMEM& ss,
|
WORK_REQ& wreq, WORKUNIT& wu, PLATFORM_LIST& platform, SCHED_SHMEM& ss,
|
||||||
APP*& app, APP_VERSION*& avp
|
APP*& app, APP_VERSION*& avp
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,10 @@ struct CLIENT_PLATFORM {
|
||||||
int parse(FILE*);
|
int parse(FILE*);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct PLATFORM_LIST {
|
||||||
|
std::vector<PLATFORM*> list;
|
||||||
|
};
|
||||||
|
|
||||||
struct SCHEDULER_REQUEST {
|
struct SCHEDULER_REQUEST {
|
||||||
char authenticator[256];
|
char authenticator[256];
|
||||||
CLIENT_PLATFORM platform;
|
CLIENT_PLATFORM platform;
|
||||||
|
|
Loading…
Reference in New Issue