"; echo "

Welcome to CPHSTL's benchmark form generator.


\n"; echo "

By filling out the appropriate fields you can generate a benchmark"; echo " form for use with the CPHSTL benchmarking tool.

\n\n"; #Gør globale variable tilgængelig i denne funktion global $status, $title, $computer, $gateway, $compiler, $compiler_options, $step; global $include_files, $constructor_call, $connection_protocol, $transfer_protocol, $dual_exists; global $driver, $function_name, $function_stat, $time_unit, $mem_measurement, $mem_type, $papi_path; global $start_interval, $end_interval, $runner, $gnuplot_title, $curve_title, $scriptname; #form til levering af inputs til generering af skema echo "
\n"; echo "\n"; echo ""; echo "\n\n"; #herunder hentes de forskellige argumenter til genererings siden echo "\n"; echo ""; echo "
1. General input.
This section contains fields that must be filled in every time a form is generated.
\n"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "
Benchmark title:
\n"; echo "The title is only used to name classes and functions in the form.
Constructor name:
\n"; echo "Enter the name of the constructor here, only the name no paranthesis.
Driver:
\n"; echo "Select time if you want to measure the execution time of your program.
"; echo "Select memory if you want a memory measurement.
"; echo "Select branch if you want to obtain the branch misprediction ratio.
"; echo "Select function if you want to obtain statistics about a certain function.
"; echo "If you choose memory you must fill in the fields in section 7 below.
"; echo "If you choose branch you must fill in the field in section 7 marked PAPI path
"; echo "If you choose function you must fill in the fields in section 8 below."; echo "
Measurement interval:
\n"; echo "Please choose an interval in which to measure your program.
[ \n"; echo " - ] in steps of:"; echo "
Runner:
\n"; echo "Select gnuplot to get the result of the benchmark in a gnuplot."; echo " Select text to get the result printed on the screen. If you select gnuplot"; echo " please fill in the fields in section 4 below.
\n"; echo "
"; echo ""; echo "\n\n"; echo "\n"; echo ""; echo "
2. Remote execution.
This section contains fields that must be filled in if the benchmark is to be run remotely.
\n"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "
Computer:
\n"; echo "Enter the hostname of the remote computer here.
Gateway:
\n"; echo "If you need to use a gateway to get to the benchmark host enter the name of"; echo " the gateway here.
Connection protocol:
\n"; echo "Select which protocol to use when connecting to the remote host.
Transfer protocol:
\n"; echo "Select which protocol to use for copying files to the remote host.
\n"; echo "
"; echo ""; echo "\n\n"; echo "\n"; echo ""; echo "
3. Compiler settings.
This section contains fields that allow you to adjust compiler settings.
\n"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "
Compiler:
\n"; echo "The default compiler is g++. If you want to use another enter it"; echo " here.
Compiler options:
\n"; echo "The defaults compiler options are:
-Wall -W -pedantic -ansi.
If you want to extend these"; echo " compiler options enter the individual options separated by semicolons here. Beware that certain optimizations"; echo " such as -O3 can cause problems when function has been selected as driver.
Include files:
\n"; echo "If you need to include any files in the benchmark drivers enter them"; echo " separated by semicolons here.
\n"; echo "
"; echo ""; echo "\n\n"; echo "\n"; echo ""; echo "
4. Gnuplot settings.
This section contains fields that allow you to adjust the settings for gnuplot.
"; echo "This section is only relevant if you have chosen gnuplot as the runner in section 1.
\n"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "
Gnuplot title:
\n"; echo "Please enter a title for the gnuplot.
Curve title:
\n"; echo "Please enter a title for the curve drawn by gnuplot.
\n"; echo "
"; echo ""; echo "\n\n"; echo "\n"; echo ""; echo "
5. Time settings.
This section is only relevant if you have chosen time as the driver in section 1.
\n"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "
Time unit:
\n"; echo "Please choose which unit to measure the execution time in.
Dual exists:
\n"; echo "Check this box if your functor has a member function called dual.
\n"; echo "
"; echo ""; echo "\n\n"; echo "\n"; echo ""; echo "
6. Memory measurement.
This section is only relevant if you have chosen memory or branch as the driver in section 1.
\n"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "
Memory measurement:
\n"; echo "Please choose which measurement to report.
Memory measurement type:
\n"; echo "Please choose which strategi to use to obtain the measurement.
PAPI path:
\n"; echo "Enter the path where PAPI is installed on the benchmark host in this field.
\n"; echo "
"; echo ""; echo "\n\n"; echo "\n"; echo ""; echo "
7. Function settings.
This section is only relevant if you have chosen function as the driver in section 1.
\n"; echo ""; echo "\n\n"; echo "\n"; echo "\n\n"; echo "\n"; echo "\n\n"; echo "
Function name:
\n"; echo "Enter the name of the function to profile in this field.
Function statistic:
\n"; echo "Please choose which statistic to report.

\n"; echo ""; echo "\n\n"; echo "\n"; echo "
8. Generate form.
\n"; #to knapper i bunden til at henholdsvis generere et skema og nulstille inputs. echo ""; echo "\n\n"; echo "\n"; echo "\n\n"; echo "
\n"; echo "
\n"; echo "
\n"; } # Her genereres skeamet. function generate(){ global $status, $title, $computer, $gateway, $compiler, $compiler_options, $step; global $include_files, $constructor_call, $connection_protocol, $transfer_protocol, $dual_exists; global $driver, $function_name, $function_stat, $time_unit, $mem_measurement, $mem_type, $papi_path; global $start_interval, $end_interval, $runner, $gnuplot_title, $curve_title, $scriptname; if ($title==""): error("No title has been entered!
"); elseif ($constructor_call==""): error("No constructor call has been entered!
"); elseif ($computer=="" and !$gateway==""): error("A gateway has been entered by no computer to connect to from the gateway has been entered!
"); elseif ($start_interval=="" or $end_interval==""): error("A full measurement interval must be entered!
"); elseif ($start_interval > $end_interval): error("The start value of your measurement interval must be larger than or equal to the end value!
"); elseif ($driver=="function" and $function_name==""): error("You have chosen to use the function driver, but you have not specified which function to profile!
"); elseif ($driver=="memory" and $papi_path==""): error("You have chosen to use the memory driver, but you have not specified a PAPI path!
"); elseif ($driver=="branch" and $papi_path==""): error("You have chosen to use the branch driver, but you have not specified a PAPI path!
"); else: $titlelist = explode(" ",$title); $title = implode("",$titlelist); $titlelist = explode(",",$title); $title = implode("",$titlelist); $titlelist = explode(":",$title); $title = implode("",$titlelist); $titlelist = explode(";",$title); $title = implode("",$titlelist); $titlelist = explode(".",$title); $title = implode("",$titlelist); echo "
\n"; echo "

You have generated the following benchmarking form:


\n"; echo "
\n"; $form = "#! /usr/bin/env python2.2\n"; $form = $form . """"\nThis form has been automatically generated by the CPHSTL Benchmarking form generator.\n"; $form = $form . """"\n\nimport benchmark\nimport string\n\n"; $form = $form . "class $title" . "_case(benchmark.case):\n"; $form = $form . "  def __init__(self, n):\n"; $form = $form . "    benchmark.case.__init__(self)\n"; $form = $form . "    self.n = n\n"; if (!$computer==""): $form = $form . "    self.computer = '$computer'\n"; endif; if (!$gateway==""): $form = $form . "    self.gateway = '$gateway'\n"; endif; if ($driver=="function"): $form = $form . "    self.counted_function = '$function_name'\n"; endif; if ($driver=="memory"): $form = $form . "    self.papi_path = '$papi_path'\n"; $form = $form . "    self.papitype = '$mem_type'\n"; endif; if ($driver=="branch"): $form = $form . "    self.papi_path = '$papi_path'\n"; endif; if (!$compiler==""): $form = $form . "    self.compiler = '$compiler'\n"; endif; if (!$compiler_options==""): $options = explode(";",$compiler_options); $outputline = ""; for($i=0;$i\n
\n";
	echo "$form";
	echo "

\n"; echo "
\n"; $form = str_replace(" ", " ", $form); $form = str_replace(""", "\"", $form); $fp = fopen("benchmark_form.py", "w"); $status = fwrite($fp, $form); fclose($fp); echo "Right click and choose \"Save as\" here to save the generated form as a file!
\n"; echo "

If you want to modify you inputs or generate another form press Try again!


\n"; goback(); echo "
"; endif; } function goback(){ echo "
\n"; echo "\n"; echo "
\n"; } function error($error){ echo "
\n"; echo "\n"; echo "\n"; echo "\n
\n"; echo "\"A

The following error has occurred while generating the form:

\"A
\n"; echo "

$error

\n"; goback(); echo "
\n"; } switch($status){ case ""; mainpage(); break; case "generate"; #er der foretaget en generering generate(); break; } #slut på php #det fine html validerings mærke, der checker om siden det sidder på overholder html 4.01 ?>


Valid HTML 4.01!