global_prefs.xml: (the host's preferences)
global_prefs_override.xml: (the host's preferences override file)
cc_config.xml: (the client configuration options)
The following control how long the simulation runs.
Duration may not exceed TimeStep*10000.
Time step:
Duration:
Scheduling policy options:
Client uses Recent Estimated Credit scheduling?
(default: debt-based scheduling)
Server does EDF simulation to predict deadline misses?
(default: approximate method)
Client uses only round-robin CPU scheduling?
(default: round-robin and EDF hybrid)
"; } // ?? the actual function doesn't seem to work here function file_put_contents_aux($fname, $str) { $f = fopen($fname, "w"); if (!$f) die("fopen"); $x = fwrite($f, $str); if (!$x) die("fwrite"); fclose($f); } if ($_POST['submit']) { chdir("sim"); $prefix = tempnam("/tmp", "sim"); $x = $_POST['client_state']; if (!strlen($x)) { die("missing state"); } $state_fname = $prefix."client_state.xml"; file_put_contents_aux($state_fname, $x); $x = $_POST['global_prefs']; if (strlen($x)) { $prefs_fname = $prefix."global_prefs.xml"; file_put_contents_aux($prefs_fname, $x); } $x = $_POST['global_prefs_override']; if (strlen($x)) { $prefs_override_fname = $prefix."global_prefs_override.xml"; file_put_contents_aux($prefs_override_fname, $x); } $x = $_POST['cc_config']; if (strlen($x)) { $config_fname = $prefix."cc_config.xml"; file_put_contents_aux($config_fname, $x); } $duration = $_POST['duration']; $delta = $_POST['delta']; if ($delta < 1) { echo "time step must be >= 1"; exit(); } if ($duration/$delta > 10000) { echo "duration/step must be <= 10000"; exit(); } $suw = ''; if ($_POST['suw']) { $suw = '--server_uses_workload'; } $rr_only = ''; if ($_POST['rr_only']) { $rr_only = '--cpu_sched_rr_only'; } $prog = "./sim_debt"; if ($_POST['use_rec']) { $prog = "./sim_rec"; } $cmd = "$prog --duration $duration --delta $delta $suw --file_prefix $prefix $rr_only $llflag"; $x = system($cmd); Header("Location: ".$prefix."index.html"); } else { page_head("BOINC client simulator"); echo " This is a web interface to the BOINC client simulator. Fill in the following form to specify the parameters of your simulation. The results will be shown in your browser.
"; show_form(); } ?>