diff --git a/checkin_notes b/checkin_notes index 85849bb3a9..8dc378dab7 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1580,3 +1580,9 @@ Rytis 12 Mar 2011 top_teams.php top_users.php view_profile.php + +David 12 Mar 2001 + - move client simulator PHP code to doc/sim + + doc/sim/ + various diff --git a/doc/projects.inc b/doc/projects.inc index 85257bd091..1afc97591c 100644 --- a/doc/projects.inc +++ b/doc/projects.inc @@ -13,7 +13,7 @@ $cogsci = array( array( array( "FreeHAL", - "http://freehal.net/freehal_at_home/", + "http://www.freehal.net/freehal_at_home/", "private", "Artificial intelligence", "Parse and convert semantic nets for use in FreeHAL, an artificial intelligence that uses semantic networks, stemmers, part of speech databases, and part of speech taggers in order to imitate human behavior in conversations." @@ -106,7 +106,7 @@ $biomed = array( ), array( "SIMAP", - "http://www.boincsimap.org/boincsimap/", + "http://boincsimap.org/boincsimap/", "University of Vienna", "Biology", "Calculate similarities between proteins. SIMAP provides a public database of the resulting data, which plays a key role in many bioinformatics research projects.", diff --git a/doc/sim.php b/doc/sim.php deleted file mode 100644 index ae0956d87f..0000000000 --- a/doc/sim.php +++ /dev/null @@ -1,114 +0,0 @@ -. - -// web interface to client simulator - -require_once("../inc/util.inc"); - -function show_scenario_summary($f) { - echo "$f"; - readfile("scenarios/$f/description"); - readfile("scenarios/$f/user_name"); - show # sims -} - -// show existing scenarios, "create scenario" button -// -function show_scenarios() { - page_head("Client simulator"); - $d = open_dir("scenarios"); - while ($f = readdir($d)) { - if ($f == ".") continue; - if ($f == "..") continue; - show_scenario_summary($f); - } - echo "Create new scenario"; - page_tail(); -} - -// show form for creating a scenario -// -function create_scenario_form() { - get_logged_in_user(); - page_head("Create scenario"); - echo "
- "; - page_tail(); -} - -function create_scenario() { - get_logged_in_user(); - if (!is_uploaded_file($_FILES['client_state']['tmp_name'])) { - - } - - // redirect to show_scenario -} - -function show_scenario() { - page_head(); - page_tail(); -} - -function simulation_form() { - page_head(); - page_tail(); -} - -function simulation_action() { - //redirect to show_simulation -} - -function show_simulation() { - page_head(); - page_tail(); -} - -$action = get_str("action", true); - -switch ($action) { -case "create_scenario_form": - create_scenario_form(); - break; -case "create_scenario": - create_scenario(); - break; -case "show_scenario": - show_scenario(); - break; -case "simulation_form": - simulation_form(); - break; -case "simulation_action": - simulation_action(); - break; -case "show_simulation": - show_simulation(); - break; -default: - show_scenarios(); -} - -?> diff --git a/doc/sim/sim_control.php b/doc/sim/sim_control.php new file mode 100644 index 0000000000..c2e82cc447 --- /dev/null +++ b/doc/sim/sim_control.php @@ -0,0 +1,183 @@ +name); + $sum2 = new RESULT($p2->name); + @mkdir($out_dir); + foreach ($set as $s) { + $sum1 = do_sim_aux($out_dir, $s, $p1, "p1", $sum1); + $sum2 = do_sim_aux($out_dir, $s, $p2, "p2", $sum2); + } + $sum1->scale(count($set)); + $sum2->scale(count($set)); + graph_2_results($title, $out_dir, $sum1, $sum2); +} + +// For a given policy and a set of parameterized scenarios, +// show the average results as a function of the parameter. +// Outputs are stored in the given directory. +// Subdirectories scenario_arg/ store individual sim outputs +// +function compare_scenario_params1($title, $set, $policy, $lo, $hi, $inc, $out_dir) { + @mkdir($out_dir); + $results = array(); + for ($x = $lo; $x <= $hi; $x += $inc) { + $sum = new RESULT($x); + foreach ($set as $s) { + $sum = do_sim_scenario_param($out_dir, $s, $policy, $x, $sum); + } + $results[] = $sum; + } + graph_n_results1($title, $out_dir, $results); +} + +// same, but compare 2 policies and graph only wasted CPU +// +function compare_scenario_params2($title, $xlabel, $lab1, $lab2, $set, $p1, $p2, $lo, $hi, $inc, $out_dir) { + @mkdir($out_dir); + $rr1 = array(); + $rr2 = array(); + for ($x = $lo; $x <= $hi; $x += $inc) { + $sum = new RESULT($x); + foreach ($set as $s) { + $sum = do_sim_scenario_param($out_dir, $s, $p1, $x, $sum); + } + $rr1[] = $sum; + $sum = new RESULT($x); + foreach ($set as $s) { + $sum = do_sim_scenario_param($out_dir, $s, $p2, $x, $sum); + } + $rr2[] = $sum; + } + graph_n_results2($title, $xlabel, $lab1, $lab2, $out_dir, $rr1, $rr2, 3); +} + +// compare two policies, varying rec_half_life +// +function compare_policy_params($title, $xlabel, $lab1, $lab2, $set, $p1, $p2, $lo, $hi, $inc, $out_dir) { + global $rec_half_life; + + @mkdir($out_dir); + $rr1 = array(); + $rr2 = array(); + for ($x = $lo; $x <= $hi; $x += $inc) { + $rec_half_life = $x; + $sum = new RESULT($x); + foreach ($set as $s) { + $sum1 = do_sim_policy_param($out_dir, $s, $p1, $x, $sum); + } + $rr1[] = $sum; + $sum = new RESULT($x); + foreach ($set as $s) { + $sum1 = do_sim_policy_param($out_dir, $s, $p2, $x, $sum); + } + $rr2[] = $sum; + } + graph_n_results2($title, $xlabel, $lab1, $lab2, $out_dir, $rr1, $rr2, 7); +} + +///////////// EXAMPLE USAGES //////////// + +// compare REC and debt scheduling for a set of scenarios +// +if (0) { + $p1 = new POLICY("JS_LOCAL"); + $p2 = new POLICY("JS_GLOBAL"); + $p2->use_rec = true; + compare_policies("Scenario 2", array("scen2"), $p1, $p2, "test1"); +} + +if (0) { + $p = new POLICY(""); + $p->use_rec = true; + $lo = 2e9; + $hi = 1e10; + $inc = 1e9; + compare_scenario_params1("Scenario 3", array("s3"), $p, $lo, $hi, $inc, "test2"); +} + +if (1) { + $p1 = new POLICY("WF_ORIG"); + $p2 = new POLICY("WF_HYST"); + $p2->use_hyst_fetch = true; + compare_policies("Scenario 4", array("scen4"), $p1, $p2, "test3"); +} + +if (0) { + $p1 = new POLICY("JS_LOCAL"); + $p2 = new POLICY("JS_GLOBAL"); + $p2->use_rec = true; + compare_policies("Scenario 4", array("scen4"), $p1, $p2, "test4"); +} + +if (0) { + $duration = 50* 86400; + $p1 = new POLICY("JS_LOCAL"); + $p2 = new POLICY("JS_GLOBAL"); + $p2->use_rec = true; + compare_policies("Scenario 3", array("scen3"), $p1, $p2, "test5"); +} + +// compare WRR and EDF +if (0) { + $p1 = new POLICY("JS_LOCAL"); + $p1->use_rec = true; + $p1->use_hyst_fetch = true; + $p1->cpu_sched_rr_only = true; + $p2 = new POLICY("JS_WRR"); + $p2->use_rec = true; + $p2->use_hyst_fetch = true; + $lo = 1000; + $hi = 2000; + $inc = 100; + compare_scenario_params2("Wasted processing", "Latency bound", "JS_WRR", "JS_LOCAL", array("scen5"), $p1, $p2, $lo, $hi, $inc, "test6"); +} + +// compare rec and debt over a range of rec_half_life +if (0) { + $p1 = new POLICY("JS_LOCAL"); + $p2 = new POLICY("JS_GLOBAL"); + $p2->use_rec = true; + $lo = 5*86400; + $hi = 40*86400; + $inc = 5*86400; + $duration = 50* 86400; + compare_policy_params("Resource share violation", "REC half-life", "JS_LOCAL", "JS_GLOBAL", array("scen3"), $p1, $p2, $lo, $hi, $inc, "test7"); +} + +if (0) { + $p1 = new POLICY("JS_LOCAL + WF_ORIG"); + $p2 = new POLICY("JS_GLOBAL + WF_HYSTERESIS"); + $p2->use_rec = true; + compare_policies("Scenario 4", array("scen4"), $p1, $p2, "test8"); +} +?> diff --git a/client/sim_scenario.php b/doc/sim/sim_scenario.php similarity index 100% rename from client/sim_scenario.php rename to doc/sim/sim_scenario.php diff --git a/client/sim_control.php b/doc/sim/sim_util.inc similarity index 53% rename from client/sim_control.php rename to doc/sim/sim_util.inc index 49ddc01874..86e5990e78 100644 --- a/client/sim_control.php +++ b/doc/sim/sim_util.inc @@ -1,28 +1,3 @@ -name); - $sum2 = new RESULT($p2->name); - @mkdir($out_dir); - foreach ($set as $s) { - $sum1 = do_sim_aux($out_dir, $s, $p1, "p1", $sum1); - $sum2 = do_sim_aux($out_dir, $s, $p2, "p2", $sum2); - } - $sum1->scale(count($set)); - $sum2->scale(count($set)); - graph_2_results($title, $out_dir, $sum1, $sum2); -} - -// For a given policy and a set of parameterized scenarios, -// show the average results as a function of the parameter. -// Outputs are stored in the given directory. -// Subdirectories scenario_arg/ store individual sim outputs -// -function compare_scenario_params1($title, $set, $policy, $lo, $hi, $inc, $out_dir) { - @mkdir($out_dir); - $results = array(); - for ($x = $lo; $x <= $hi; $x += $inc) { - $sum = new RESULT($x); - foreach ($set as $s) { - $sum = do_sim_scenario_param($out_dir, $s, $policy, $x, $sum); - } - $results[] = $sum; - } - graph_n_results1($title, $out_dir, $results); -} - -// same, but compare 2 policies and graph only wasted CPU -// -function compare_scenario_params2($title, $xlabel, $lab1, $lab2, $set, $p1, $p2, $lo, $hi, $inc, $out_dir) { - @mkdir($out_dir); - $rr1 = array(); - $rr2 = array(); - for ($x = $lo; $x <= $hi; $x += $inc) { - $sum = new RESULT($x); - foreach ($set as $s) { - $sum = do_sim_scenario_param($out_dir, $s, $p1, $x, $sum); - } - $rr1[] = $sum; - $sum = new RESULT($x); - foreach ($set as $s) { - $sum = do_sim_scenario_param($out_dir, $s, $p2, $x, $sum); - } - $rr2[] = $sum; - } - graph_n_results2($title, $xlabel, $lab1, $lab2, $out_dir, $rr1, $rr2, 3); -} - -// compare two policies, varying rec_half_life -// -function compare_policy_params($title, $xlabel, $lab1, $lab2, $set, $p1, $p2, $lo, $hi, $inc, $out_dir) { - global $rec_half_life; - - @mkdir($out_dir); - $rr1 = array(); - $rr2 = array(); - for ($x = $lo; $x <= $hi; $x += $inc) { - $rec_half_life = $x; - $sum = new RESULT($x); - foreach ($set as $s) { - $sum1 = do_sim_policy_param($out_dir, $s, $p1, $x, $sum); - } - $rr1[] = $sum; - $sum = new RESULT($x); - foreach ($set as $s) { - $sum1 = do_sim_policy_param($out_dir, $s, $p2, $x, $sum); - } - $rr2[] = $sum; - } - graph_n_results2($title, $xlabel, $lab1, $lab2, $out_dir, $rr1, $rr2, 7); -} - -///////////// EXAMPLE USAGES //////////// - -// compare REC and debt scheduling for a set of scenarios -// -if (0) { - $p1 = new POLICY("JS_LOCAL"); - $p2 = new POLICY("JS_GLOBAL"); - $p2->use_rec = true; - compare_policies("Scenario 2", array("scen2"), $p1, $p2, "test1"); -} - -if (0) { - $p = new POLICY(""); - $p->use_rec = true; - $lo = 2e9; - $hi = 1e10; - $inc = 1e9; - compare_scenario_params1("Scenario 3", array("s3"), $p, $lo, $hi, $inc, "test2"); -} - -if (1) { - $p1 = new POLICY("WF_ORIG"); - $p2 = new POLICY("WF_HYST"); - $p2->use_hyst_fetch = true; - compare_policies("Scenario 4", array("scen4"), $p1, $p2, "test3"); -} - -if (0) { - $p1 = new POLICY("JS_LOCAL"); - $p2 = new POLICY("JS_GLOBAL"); - $p2->use_rec = true; - compare_policies("Scenario 4", array("scen4"), $p1, $p2, "test4"); -} - -if (0) { - $duration = 50* 86400; - $p1 = new POLICY("JS_LOCAL"); - $p2 = new POLICY("JS_GLOBAL"); - $p2->use_rec = true; - compare_policies("Scenario 3", array("scen3"), $p1, $p2, "test5"); -} - -// compare WRR and EDF -if (0) { - $p1 = new POLICY("JS_LOCAL"); - $p1->use_rec = true; - $p1->use_hyst_fetch = true; - $p1->cpu_sched_rr_only = true; - $p2 = new POLICY("JS_WRR"); - $p2->use_rec = true; - $p2->use_hyst_fetch = true; - $lo = 1000; - $hi = 2000; - $inc = 100; - compare_scenario_params2("Wasted processing", "Latency bound", "JS_WRR", "JS_LOCAL", array("scen5"), $p1, $p2, $lo, $hi, $inc, "test6"); -} - -// compare rec and debt over a range of rec_half_life -if (0) { - $p1 = new POLICY("JS_LOCAL"); - $p2 = new POLICY("JS_GLOBAL"); - $p2->use_rec = true; - $lo = 5*86400; - $hi = 40*86400; - $inc = 5*86400; - $duration = 50* 86400; - compare_policy_params("Resource share violation", "REC half-life", "JS_LOCAL", "JS_GLOBAL", array("scen3"), $p1, $p2, $lo, $hi, $inc, "test7"); -} - -if (0) { - $p1 = new POLICY("JS_LOCAL + WF_ORIG"); - $p2 = new POLICY("JS_GLOBAL + WF_HYSTERESIS"); - $p2->use_rec = true; - compare_policies("Scenario 4", array("scen4"), $p1, $p2, "test8"); -} -?> diff --git a/doc/sim/sim_web.php b/doc/sim/sim_web.php new file mode 100644 index 0000000000..df6a444c91 --- /dev/null +++ b/doc/sim/sim_web.php @@ -0,0 +1,274 @@ +. + +// web interface to client simulator + +require_once("../inc/util.inc"); + +function show_scenario_summary($f) { + echo "$f"; + readfile("scenarios/$f/description"); + readfile("scenarios/$f/user_name"); +} + +// show existing scenarios, "create scenario" button +// +function show_scenarios() { + page_head("The BOINC Client Emulator"); + echo " + Welcome to the BOINC Client Emulator (BCE). + BCE emulates a BOINC client attached to one or more projects. + It predicts, in a few seconds, what the BOINC client will do + over a period of day or months. + This allows BOINC developers to fix bugs and improve performance. ++ The inputs to BCE, called scenarios, + describe a particular computer and the project to which it's attached. + A scenario consists of 4 files: +
+ You create a scenario by uploading these files to the BOINC server. + Then you can run any number of simulations based on the scenario. + The parameters of a simulation include +
+ client_state.xml + "; + if (file_exists("$d/global_prefs.xml")) { + echo "
global_prefs.xml\n"; + } + if (file_exists("$d/global_prefs_override.xml")) { + echo "
global_prefs_override.xml\n"; + } + if (file_exists("$d/cc_config.xml")) { + echo "
cc_config.xml\n"; + } + echo "Do new simulation\n"; + echo "
$f\n"; + } + + page_tail(); +} + +// form for simulation parameters: +// duration, time step, policy options +// +function simulation_form() { + $scen = get_str("name"); + page_head("Do simulation"); + echo "