Job-size matching: fix bug in size_census.php, and add an --all_apps option. From Jon Sonntag

This commit is contained in:
David Anderson 2014-02-20 09:43:46 -08:00
parent f161120f25
commit 054d70b4ee
1 changed files with 12 additions and 5 deletions

View File

@ -17,11 +17,14 @@
// You should have received a copy of the GNU Lesser General Public License // You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. // along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// size_census // size_census [--all_apps]
// for each multi-size app, // for each multi-size app,
// find the N quantiles of its effective speed, // find the N quantiles of its effective speed,
// and write them to a file. // and write them to a file.
// See http://boinc.berkeley.edu/trac/wiki/JobSizeMatching // See http://boinc.berkeley.edu/trac/wiki/JobSizeMatching
//
// --all_apps: compute quantiles for all apps;
// use this during setup and testing.
error_reporting(E_ALL); error_reporting(E_ALL);
ini_set('display_errors', true); ini_set('display_errors', true);
@ -34,11 +37,10 @@ function do_app($app) {
// joined to the host // joined to the host
$db = BoincDb::get(); $db = BoincDb::get();
$dbn = $db->db_name;
$query = "select et_avg, host.on_frac, host.active_frac " . $query = "select et_avg, host.on_frac, host.active_frac " .
" from $dbn.host_app_version, $dbn.host, $dbn.app_version " . " from DBNAME.host_app_version, DBNAME.host, DBNAME.app_version " .
" where host_app_version.app_version_id = app_version.id " . " where host_app_version.app_version_id = app_version.id " .
" and app_version.appid = 1 " . " and app_version.appid = $app->id " .
" and et_n > 0 " . " and et_n > 0 " .
" and host.id = host_app_version.host_id"; " and host.id = host_app_version.host_id";
$result = $db->do_query($query); $result = $db->do_query($query);
@ -57,7 +59,12 @@ function do_app($app) {
fclose($f); fclose($f);
} }
$apps = BoincApp::enum("deprecated=0 and n_size_classes>1"); if ($argc == 2 && $argv[1]=="--all_apps") {
$apps = BoincApp::enum("deprecated=0");
} else {
$apps = BoincApp::enum("deprecated=0 and n_size_classes>1");
}
foreach ($apps as $app) { foreach ($apps as $app) {
do_app($app); do_app($app);
} }