From d1f6a8ea0d64cc84eba87af87b7b53749075e9e2 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 15 May 2007 20:47:42 +0000 Subject: [PATCH] added sim_form.php svn path=/trunk/boinc/; revision=12672 --- doc/sim_form.php | 175 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 doc/sim_form.php diff --git a/doc/sim_form.php b/doc/sim_form.php new file mode 100644 index 0000000000..49bf2c52e5 --- /dev/null +++ b/doc/sim_form.php @@ -0,0 +1,175 @@ +BOINC client simulator +
+ + sim_projects.xml: +
+ + +

+ sim_host.xml: +
+ + +

+ sim_prefs.xml: +
+ + +

+ cc_config.xml: +
+ + +

+ Duration: + Time step: +

+ Server uses workload? +

+ Client uses RR CPU sched? +

+ DCF: Normal + : Stats + : Dual + : None +

+ + +

+ "; +} + +if ($_POST['submit']) { + chdir("sim"); + + $x1 = file_put_contents("sim_projects.xml", $_POST['projects']); + $x2 = file_put_contents("sim_host.xml", $_POST['host']); + $x3 = file_put_contents("sim_prefs.xml", $_POST['prefs']); + $x4 = file_put_contents("cc_config.xml", $_POST['cc_config']); + if (!$x1 || !$x2 || !$x3 || !$x4) { + echo "Can't write files - check permissions\n"; + exit(); + } + $duration = $_POST['duration']; + + if ($duration > 100000) { + echo "duration must be <= 100000"; + exit(); + } + $delta = $_POST['delta']; + if ($delta < 1) { + echo "time step must be >= 1"; + exit(); + } + + $suw = ''; + if ($_POST['suw']) { + $suw = '--server_uses_workload'; + } + + $rr_only = ''; + if ($_POST['rr_only']) { + $rr_only = '--cpu_sched_rr_only'; + } + + $dcfflag = ""; + $dcf = ($_POST['dcf']); + if ($dcf == "stats") { + $dcfflag = '--dcf_stats'; + } else if ($dcf == 'none') { + $dcfflag = '--dcf_dont_use'; + } else if ($dcf == 'dual') { + $dcfflag = '--dual_dcf'; + } + + Header("Location: sim/sim_out.html"); + $cmd = "./sim --duration $duration --delta $delta $suw $dcfflag $rr_only"; + system("/bin/rm sim_log.txt sim_out.html"); + system($cmd); +} else { + show_form(); +} + +?>