diff --git a/checkin_notes b/checkin_notes index 3ec6e9ddcc..2fc9d4e1d2 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8906,24 +8906,24 @@ Charlie 7 Dec 2011 release_boinc.sh Rom 9 Dec 2011 - - VBOX: Remove unused function, I don't remember what I was going to use that - hook for. + - VBOX: Remove unused function, + I don't remember what I was going to use that hook for. samples/vboxwrapper/ vbox.cpp, .h vboxwrapper.cpp Rom 9 Dec 2011 - - VBOX: Remove the guru meditation state, apparently that is when the vbox host - process for the vm crashes. + - VBOX: Remove the guru meditation state, + apparently that is when the vbox host process for the vm crashes. samples/vboxwrapper/ vbox.cpp Rom 9 Dec 2011 - - VBOX: Add the ability for the wrapper to know if vboxmanage has hung or is stuck - in a loop. If so, terminate the process and return an error to the calling - function. + - VBOX: Add the ability for the wrapper to know if vboxmanage has hung + or is stuck in a loop. + If so, terminate the process and return an error. samples/vboxwrapper/ vbox.cpp @@ -8942,3 +8942,21 @@ Rom 9 Dec 2011 ptp_IsDialogBitmap.bmp ptp_splash.bmp ptp_Wizard.bmp + +David 10 Dec 2011 + - bug fixes in remote job submission tools + (manage_privileges and get_output.php). + From Nico Schlitter. + - change things so that + make_project --test_app + will produce input/output templates that are compatible + with the remote job submission tools + + tools/ + example_app_in,out (removed .xml from name) + manage_privileges + make_project + html/user/ + get_output.php + ssim/ + ssim.cpp diff --git a/html/user/get_output.php b/html/user/get_output.php index 93219d511d..a309271c9f 100644 --- a/html/user/get_output.php +++ b/html/user/get_output.php @@ -22,7 +22,7 @@ require_once("../inc/util.inc"); require_once("../inc/result.inc"); -require_once("../inc/submit_db.inc"); +require_once("../inc/submit_util.inc"); // get a single output file // diff --git a/ssim/ssim.cpp b/ssim/ssim.cpp index 34fc8c9145..bc69c5212e 100644 --- a/ssim/ssim.cpp +++ b/ssim/ssim.cpp @@ -58,16 +58,19 @@ // Terminology: // // A chunk may or may not be "present_on_server". -// An encoded data unit is "present_on_server" if at least N -// of its subunits are present_on_server. -// A data unit is "recoverable" if it can be reconstruct on the server, -// based on current state. -// A chunk is "recoverable" if it is assigned at least 1 host. -// (if it is downloading, it's still present on the server) -// An encoded data unit is "recoverable" if at least N +// A data unit is "recoverable" if it can be recovered on the server +// by uploading data from hosts. +// A chunk is recoverable if it's present on the server or on at least 1 host. +// (note: if it's downloading, it's still present on the server) +// An encoded data unit is recoverable if at least N // of its subunits are recoverable. +// A data unit is "reconstructible" if it can be reconstructed +// from data currently on the server. +// A chunk is reconstructible if it's present on the server. +// An encoded unit is reconstructible if at least N of its subunits are. + // A chunk is "uploading" if at least one of its instances // is being uploaded to the server. // An encoded data unit is "uploading" if at least @@ -107,7 +110,6 @@ using std::set; // similar, meta-packets per file #define META_N 10 - SIMULATOR sim; inline double drand() { @@ -221,7 +223,8 @@ struct CHUNK : DATA_UNIT { } virtual void start_upload() { // if no upload of this chunk is in progress, start one. - // NOTE: all instances are inherently present_on_host + // NOTE: all instances are inherently present_on_host, + // since this is only called if chunk is not present on server // CHUNK_ON_HOST* c; set::iterator i; @@ -281,21 +284,7 @@ struct META_CHUNK : DATA_UNIT { // a child has become unrecoverable. // reconstruct this data unit if we still can. // - void child_unrecoverable() { - int n = n_recoverable_children(); - printf("%s: a child of %s has become unrecoverable\n", now_str(), name); - if (n >= ENCODING_N) { - uploading = true; - for (unsigned int i=0; irecoverable()) { - c->start_upload(); - } - } - } else { - printf("%s: only %d recoverable children\n", now_str(), n); - } - } + void child_unrecoverable(); // start download of descendant chunks as needed // @@ -313,28 +302,7 @@ struct META_CHUNK : DATA_UNIT { // a child is now present on the server. // - void child_upload_complete() { - printf("%s: child upload complete for %s\n", now_str(), name); - int n = 0; - for (unsigned int i=0; iis_present_on_server()) { - n++; - } - } - if (n >= ENCODING_N) { - now_present(); - assign(); - if (parent && parent->uploading) { - parent->child_upload_complete(); - } else { - // if we're not reconstructing parent, - // delete any chunks not being downloaded - // - delete_chunks_from_server(); - } - } - } + void child_upload_complete(); }; static int next_file_id=0; @@ -485,66 +453,15 @@ CHUNK::CHUNK(META_CHUNK* mc, double s, int index) { parent->dfile->disk_usage.sample_inc(size, false); } -void CHUNK::host_failed(CHUNK_ON_HOST* p) { - set::iterator i = hosts.find(p); - hosts.erase(i); - printf("%s: handling loss of %s\n", now_str(), p->name); - if (_is_present_on_server) { - // if data is on server, make a new replica - // - assign(); - } else if (!hosts.empty()) { - start_upload(); - } else { - parent->child_unrecoverable(); - } -} - -void CHUNK::upload_complete() { - if (!_is_present_on_server) { - _is_present_on_server = true; - parent->dfile->disk_usage.sample_inc( - size, - parent->dfile->collecting_stats() - ); - } - assign(); - if (parent->uploading) { - parent->child_upload_complete(); - } -} - void CHUNK::now_present() { if (_is_present_on_server) return; _is_present_on_server = true; parent->dfile->disk_usage.sample_inc(size, false); } -void CHUNK::download_complete() { - // we can remove chunk from server if enough replicas - // have downloaded - // - int n=0; - set::iterator i; - for (i=hosts.begin(); i!=hosts.end(); i++) { - CHUNK_ON_HOST* c = *i; - if (c->present_on_host) { - n++; - } - } - if (n >= REPLICATION_LEVEL) { - printf("%s: %s replicated, removing from server\n", now_str(), name); - _is_present_on_server = false; - parent->dfile->disk_usage.sample_inc( - -size, - parent->dfile->collecting_stats() - ); - } - if (parent->dfile->pending_init_downloads) { - parent->dfile->pending_init_downloads--; - } -} - +// if there aren't enough replicas of this chunk, +// pick new hosts and start downloads +// void CHUNK::assign() { if (!_is_present_on_server) return; while (hosts.size() < REPLICATION_LEVEL) { @@ -606,6 +523,110 @@ META_CHUNK::META_CHUNK( } } +//////////////////// HOST FAILURE /////////////////////// + +void CHUNK::host_failed(CHUNK_ON_HOST* p) { + set::iterator i = hosts.find(p); + hosts.erase(i); + printf("%s: handling loss of %s\n", now_str(), p->name); + if (_is_present_on_server) { + // if data is on server, make a new replica + // + assign(); + } else if (!hosts.empty()) { + start_upload(); + } else { + parent->child_unrecoverable(); + } +} + +void META_CHUNK::child_unrecoverable() { + int n = n_recoverable_children(); + printf("%s: a child of %s has become unrecoverable\n", now_str(), name); + if (n >= ENCODING_N) { + uploading = true; + for (unsigned int i=0; irecoverable()) { + c->start_upload(); + } + } + } else { + printf("%s: only %d recoverable children\n", now_str(), n); + } +} + +//////////////////// UPLOAD COMPLETION ////////////////// + +void CHUNK::upload_complete() { + if (!_is_present_on_server) { + _is_present_on_server = true; + parent->dfile->disk_usage.sample_inc( + size, + parent->dfile->collecting_stats() + ); + } + assign(); + if (parent->uploading) { + parent->child_upload_complete(); + } +} + +void META_CHUNK::child_upload_complete() { + printf("%s: child upload complete for %s\n", now_str(), name); + int n = 0; + for (unsigned int i=0; iis_present_on_server()) { + n++; + } + } + if (n >= ENCODING_N) { + now_present(); + assign(); + if (parent && parent->uploading) { + parent->child_upload_complete(); + } else { + // if we're not reconstructing parent, + // delete any chunks not being downloaded + // + delete_chunks_from_server(); + } + } +} + +//////////////////// DOWNLOAD COMPLETION //////////////// + +// when a download completes, we need to decide whether +// to delete the chunk from the server. +// We can do this if: +// - enough replicas have downloaded +// - this chunk isn't needed for recovery going on elsewhere +// +void CHUNK::download_complete() { + int n=0; + set::iterator i; + for (i=hosts.begin(); i!=hosts.end(); i++) { + CHUNK_ON_HOST* c = *i; + if (c->present_on_host) { + n++; + } + } + if (n >= REPLICATION_LEVEL) { + printf("%s: %s replicated, removing from server\n", now_str(), name); + _is_present_on_server = false; + parent->dfile->disk_usage.sample_inc( + -size, + parent->dfile->collecting_stats() + ); + } + if (parent->dfile->pending_init_downloads) { + parent->dfile->pending_init_downloads--; + } +} + +//////////////////// + set dfiles; int main() { diff --git a/tools/example_app_in b/tools/example_app_in new file mode 100644 index 0000000000..313907c6a5 --- /dev/null +++ b/tools/example_app_in @@ -0,0 +1,12 @@ + + + 0 + + + + 0 + in + + -cpu_time 30 + + diff --git a/tools/example_app_in.xml b/tools/example_app_in.xml deleted file mode 100644 index 68045b4fb3..0000000000 --- a/tools/example_app_in.xml +++ /dev/null @@ -1,10 +0,0 @@ - - 0 - - - - 0 - in - - -cpu_time 30 - diff --git a/tools/example_app_out b/tools/example_app_out new file mode 100644 index 0000000000..96f8f51abc --- /dev/null +++ b/tools/example_app_out @@ -0,0 +1,15 @@ + + + + + + 5000000 + + + + + + out + + + diff --git a/tools/example_app_out.xml b/tools/example_app_out.xml deleted file mode 100644 index 94d5b710f7..0000000000 --- a/tools/example_app_out.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - 5000000 - - - - - - out - - diff --git a/tools/make_project b/tools/make_project index 90bbc664c8..60f9e6a696 100755 --- a/tools/make_project +++ b/tools/make_project @@ -306,8 +306,8 @@ if options.test_app: app_dir = proot+'/apps/example_app/' os.mkdir(app_dir) os.system('cp -r ../samples/example_app/bin/* ' + app_dir); - shutil.copy('example_app_in.xml', proot+'/templates/') - shutil.copy('example_app_out.xml', proot+'/templates/') + shutil.copy('example_app_in', proot+'/templates/') + shutil.copy('example_app_out', proot+'/templates/') shutil.copy('../tools/create_work_example', proot+'/bin/') httpd_conf_template_filename = os.path.join( diff --git a/tools/manage_privileges b/tools/manage_privileges index 3a2201d26d..bf3ca38da2 100755 --- a/tools/manage_privileges +++ b/tools/manage_privileges @@ -122,13 +122,13 @@ if ($argv[3] === "all") { } } else { if ($grant) { - BoincUserSubmit::insert("user_id=$user->id and manage_all=1"); + BoincUserSubmit::insert("set user_id=$user->id, manage_all=1)"); } else { die("User $user->id does not have global manage access\n"); } } } else { - $app = BoincApp::lookup_name($argv[3]); + $app = BoincApp::lookup("name='".$argv[3]."'"); if (!$app) die("no such app: ".$argv[2]."\n"); $busa = BoincUserSubmitApp::lookup("user_id=$user->id and app_id=$app->id"); if ($busa) { @@ -149,9 +149,9 @@ if ($argv[3] === "all") { if ($grant) { $bus = BoincUserSubmit::lookup_userid($user->id); if (!$bus) { - BoincUserSubmit::insert("user_id=$user->id=1"); + BoincUserSubmit::insert("set user_id=$user->id"); } - BoincUserSubmitApp::insert("user_id=$user->id and app_id=$app->id and manage=1"); + BoincUserSubmitApp::insert("set user_id=$user->id, app_id=$app->id, manage=1"); } else { die("User $user->id does not have manage access for $app->name\n"); }