diff --git a/Makefile.incl b/Makefile.incl index a1427fdef3..537a0f95ba 100644 --- a/Makefile.incl +++ b/Makefile.incl @@ -18,13 +18,13 @@ RSA_LIBS = -lcrypto AM_LIBTOOLFLAGS = AM_CPPFLAGS = \ - -I$(top_srcdir)/lib \ -I$(top_srcdir)/api \ -I$(top_srcdir)/db \ - -I$(top_srcdir)/client \ - -I$(top_srcdir)/tools \ - -I$(top_srcdir)/sched \ + -I$(top_srcdir)/lib \ -I$(top_srcdir)/lib/mac \ + -I$(top_srcdir)/sched \ + -I$(top_srcdir)/tools \ + -I$(top_srcdir)/vda \ $(PTHREAD_CFLAGS) AM_CFLAGS = -Wall -Wextra -Wshadow -Wredundant-decls -Wdisabled-optimization -Wpointer-arith -Wstrict-aliasing diff --git a/checkin_notes b/checkin_notes index 21b31e2b96..c9594513ac 100644 --- a/checkin_notes +++ b/checkin_notes @@ -2296,3 +2296,23 @@ Rytis 27 Feb 2012 sched/ antique_file_deleter.cpp + +David 27 Feb 2012 + - VDA: add some log messages + - scheduler: add VDA + - client, web: change default prefs to min_buf=.1 days, max_buf=.5 days + - scheduler: app plan function for vbox requires 7.0+ client + + Makefile.incl + sched/ + antique_file_deleter.cpp + sched_config.cpp,h + sched_customize.cpp + handle_request.cpp + html/inc/ + prefs.inc + lib/ + prefs.cpp + vda/ + vda.cpp + sched_vda.cpp,h diff --git a/html/inc/prefs.inc b/html/inc/prefs.inc index 8ac791e7ca..a3ba79ece5 100644 --- a/html/inc/prefs.inc +++ b/html/inc/prefs.inc @@ -219,12 +219,12 @@ $net_prefs = array( "" ), "work_buf_min_days", - new NUM_SPEC(tra("days"), 0, 10, 0) + new NUM_SPEC(tra("days"), 0, 10, .1) ), new PREF_NUM( tra("... and up to an additional"), "work_buf_additional_days", - new NUM_SPEC(tra("days"), 0, 10, .25) + new NUM_SPEC(tra("days"), 0, 10, .5) ), new PREF_BOOL( tra( diff --git a/lib/prefs.cpp b/lib/prefs.cpp index 616942ce5b..f632c4d8c1 100644 --- a/lib/prefs.cpp +++ b/lib/prefs.cpp @@ -219,7 +219,7 @@ void GLOBAL_PREFS::defaults() { hangup_if_dialed = false; dont_verify_images = false; work_buf_min_days = 0.1; - work_buf_additional_days = 0.25; + work_buf_additional_days = 0.5; max_ncpus_pct = 0; max_ncpus = 0; cpu_scheduling_period_minutes = 60; diff --git a/sched/antique_file_deleter.cpp b/sched/antique_file_deleter.cpp index 5a688ccab7..e1e785d0b1 100644 --- a/sched/antique_file_deleter.cpp +++ b/sched/antique_file_deleter.cpp @@ -150,14 +150,14 @@ int delete_antiques_from_dir(char*dirpath, time_t mtime, uid_t uid) { // stat errno = 0; - if (lstat(path, &fstat) ) { + if (lstat(path, &fstat)) { log_messages.printf(MSG_NORMAL, "delete_antiques_from_dir(): couldn't stat '%s: %s (%d)'\n", path, strerror(errno), errno ); // regular file - } else if (fstat.st_mode & S_IFMT != S_IFREG) { + } else if ((fstat.st_mode & S_IFMT) != S_IFREG) { log_messages.printf(MSG_DEBUG,"not a regular plain file\n"); // skip hidden files such as ".nfs" diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index 8dc60b9345..1daecb2fe3 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -47,6 +47,8 @@ #include "util.h" #include "filesys.h" +#include "sched_vda.h" + #include "credit.h" #include "sched_main.h" #include "sched_types.h" @@ -1251,6 +1253,9 @@ void process_request(char* code_sign_key) { handle_results(); handle_file_xfer_results(); + if (config.enable_vda) { + handle_vda(); + } // Do this before resending lost jobs // diff --git a/sched/sched_config.cpp b/sched/sched_config.cpp index bfc40492ed..b719ac0632 100644 --- a/sched/sched_config.cpp +++ b/sched/sched_config.cpp @@ -318,6 +318,7 @@ int SCHED_CONFIG::parse(FILE* f) { if (xp.parse_bool("debug_resend", debug_resend)) continue; if (xp.parse_bool("debug_send", debug_send)) continue; if (xp.parse_bool("debug_user_messages", debug_user_messages)) continue; + if (xp.parse_bool("debug_vda", debug_vda)) continue; if (xp.parse_bool("debug_version_select", debug_version_select)) continue; if (xp.parse_str("debug_req_reply_dir", debug_req_reply_dir, sizeof(debug_req_reply_dir))) continue; diff --git a/sched/sched_config.h b/sched/sched_config.h index 3fe05c83b9..3812683d95 100644 --- a/sched/sched_config.h +++ b/sched/sched_config.h @@ -188,6 +188,7 @@ struct SCHED_CONFIG { bool debug_resend; bool debug_send; bool debug_user_messages; + bool debug_vda; bool debug_version_select; char debug_req_reply_dir[256]; // keep sched_request and sched_reply diff --git a/sched/sched_customize.cpp b/sched/sched_customize.cpp index 978b438907..a384fa1f9c 100644 --- a/sched/sched_customize.cpp +++ b/sched/sched_customize.cpp @@ -523,6 +523,13 @@ static inline bool app_plan_vbox( ) { bool can_use_multicore = true; + // host must run 7.0+ client + // + if (sreq.core_client_major_version < 7) { + add_no_work_message("BOINC client 7.0+ required for Virtualbox jobs"); + return false; + } + // host must have VirtualBox 3.2 or later // if (strlen(sreq.host.virtualbox_version) == 0) { diff --git a/vda/sched_vda.cpp b/vda/sched_vda.cpp index 2146835914..f17a5cc3c3 100644 --- a/vda/sched_vda.cpp +++ b/vda/sched_vda.cpp @@ -21,8 +21,9 @@ #include #include -#include "sched_types.h" +#include "sched_config.h" #include "sched_msgs.h" +#include "sched_types.h" using std::map; using std::string; @@ -68,6 +69,11 @@ void handle_vda() { ); return; } + if (config.debug_vda) { + log_messages.printf(MSG_NORMAL, + "[vda] DB: has chunk %s\n", ch.name + ); + } chunks.insert(pair(string(ch.name), ch)); } @@ -80,8 +86,13 @@ void handle_vda() { for (i=0; ifile_xfer_results.size(); i++) { RESULT& r = g_request->file_xfer_results[i]; if (!starts_with(r.name, "upload_")) continue; - char* file_name = r.name + strlen("upload_"); - if (!strstr(file_name, "vdafile")) continue; + //char* file_name = r.name + strlen("upload_"); + if (!strstr(r.name, "vdafile")) continue; + if (config.debug_vda) { + log_messages.printf(MSG_NORMAL, + "[vda] DB: completed upload %s\n", r.name + ); + } } // process list of present files; @@ -92,6 +103,11 @@ void handle_vda() { // for (i=0; ifile_infos.size(); i++) { FILE_INFO& fi = g_request->file_infos[i]; + if (config.debug_vda) { + log_messages.printf(MSG_NORMAL, + "[vda] request: client has file %s\n", fi.name + ); + } } // for each vda_chunk_host not in file list: @@ -103,6 +119,11 @@ void handle_vda() { while (it != chunks.end()) { DB_VDA_CHUNK_HOST& ch = (*it).second; if (!ch.found) { + if (config.debug_vda) { + log_messages.printf(MSG_NORMAL, + "[vda] in DB but not on client: %s\n", ch.name + ); + } ch.delete_from_db(); chunks.erase(it); mark_for_update(ch.vda_file_id); @@ -116,11 +137,23 @@ void handle_vda() { // if (g_request->host.d_project_share) { double x = g_request->host.d_boinc_used_project; + if (config.debug_vda) { + log_messages.printf(MSG_NORMAL, + "[vda] share: %f used: %f\n", + g_request->host.d_project_share, x + ); + } it = chunks.begin(); while (x > g_request->host.d_project_share && it != chunks.end()) { DB_VDA_CHUNK_HOST& ch = (*it).second; FILE_INFO fi; strcpy(fi.name, ch.name); + if (config.debug_vda) { + log_messages.printf(MSG_NORMAL, + "[vda] deleting: %s\n", ch.name + ); + } + //x -= ch.size; g_reply->file_deletes.push_back(fi); it++; } @@ -134,8 +167,18 @@ void handle_vda() { if (!ch.transfer_in_progress) continue; if (!ch.transfer_wait) continue; if (ch.present_on_host) { + if (config.debug_vda) { + log_messages.printf(MSG_NORMAL, + "[vda] sending upload command: %s\n", ch.name + ); + } // upload } else { + if (config.debug_vda) { + log_messages.printf(MSG_NORMAL, + "[vda] sending download command: %s\n", ch.name + ); + } // download } } diff --git a/vda/sched_vda.h b/vda/sched_vda.h new file mode 100644 index 0000000000..5fcad4d7ed --- /dev/null +++ b/vda/sched_vda.h @@ -0,0 +1,18 @@ +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2012 University of California +// +// 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. +// +// BOINC 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. +// +// You should have received a copy of the GNU Lesser General Public License +// along with BOINC. If not, see . + +extern void handle_vda(); diff --git a/vda/vdad.cpp b/vda/vdad.cpp index 886b9bff47..a8621e06d1 100644 --- a/vda/vdad.cpp +++ b/vda/vdad.cpp @@ -212,6 +212,8 @@ int VDA_FILE_AUX::choose_host() { int retval; DB_HOST host; + return 467; + // replenish cache if needed // if (!available_hosts.size()) {