- web: link between LAMMPS job submission page and file sandbox page

svn path=/trunk/boinc/; revision=25090
This commit is contained in:
David Anderson 2012-01-18 09:04:35 +00:00
parent e5aa5f813a
commit 8dd9d309fa
5 changed files with 56 additions and 9 deletions

View File

@ -666,3 +666,10 @@ David 17 Jan 2012
ssim.php
lib/
str_util.cpp
David 18 Jan 2012
- web: link between LAMMPS job submission page and file sandbox page
html/user/
lammps.php
sandbox.php

View File

@ -121,7 +121,11 @@ function show_submit_form($user) {
row2("Area", area_select());
row2("", "<input type=submit value=Prepare>");
end_table();
echo "</form>";
echo "</form>
<p>
<a href=sandbox.php>File sandbox</a>
";
page_tail();
}

View File

@ -47,8 +47,8 @@ function list_files($user) {
<form action=sandbox.php method=post ENCTYPE=\"multipart/form-data\">
<input type=hidden name=action value=upload_file>
Upload a file to your sandbox:
<br><input size=80 type=file name=new_file>
<br> <input type=submit value=Upload>
<p><input size=80 type=file name=new_file>
<p> <input type=submit value=Upload>
</form>
<hr>
";
@ -85,6 +85,9 @@ function list_files($user) {
}
end_table();
}
echo "
<p><a href=lammps.php>Submit LAMMPS jobs</a>
";
page_tail();
}

View File

@ -399,6 +399,20 @@ struct STATS_ITEM {
break;
}
}
void print_summary(FILE* f) {
double dt = sim.now - start_time;
switch (kind) {
case DISK:
fprintf(f, "%f\n", integral/dt);
break;
case NETWORK:
fprintf(f, "%f\n", integral/dt);
break;
case FAULT_TOLERANCE:
fprintf(f, "%f\n", extreme_val);
break;
}
}
};
// represents a file to be stored.
@ -466,6 +480,13 @@ struct DFILE : EVENT {
download_rate.print();
printf(" Fault tolerance level:\n");
fault_tolerance.print();
FILE* f = fopen("summary.txt", "w");
fault_tolerance.print_summary(f);
disk_usage.print_summary(f);
upload_rate.print_summary(f);
download_rate.print_summary(f);
fclose(f);
}
};

View File

@ -42,7 +42,7 @@ function parse_input_file($filename) {
return $x;
}
function make_graph($input, $title, $index) {
function make_graph($input, $prefix, $title, $index) {
$gp_filename = $input->name."_$prefix.gp";
$f = fopen($gp_filename, "w");
fprintf($f, "set terminal png small size 1024, 768
@ -62,9 +62,22 @@ plot ");
fclose($f);
$png_filename = $input->name."_$prefix.png";
$cmd = "gnuplot < $gp_filename > $png_filename";
echo "$cmd\n";
system($cmd);
}
function parse_output_file($fname) {
$f = fopen($fname, "r");
if (!$f) {
die("no output file $fname\n");
}
$ft = (int)fgets($f);
$du = (double)fgets($f);
$ul = (double)fgets($f);
$dl = (double)fgets($f);
return array($ft, $du, $ul, $dl);
}
if ($argc != 2) {
die("usage: ssim.php infile\n");
}
@ -75,16 +88,15 @@ foreach ($input->policy as $p) {
die("no policy file '$p'\n");
}
foreach ($input->host_life_mean as $hlm) {
$cmd = "ssim --policy_file $p --host_life_mean $hlm --connect_interval $input->connect_interval --mean_xfer_rate $input->mean_xfer_rate";
//system($cmd);
$cmd = "ssim --policy $p --host_life_mean $hlm --connect_interval $input->connect_interval --mean_xfer_rate $input->mean_xfer_rate > /dev/null";
echo "$cmd\n";
system($cmd);
list($du, $ul, $dl, $ft) = parse_output_file("summary.txt");
printf($datafile, "$hlm $du $ul $dl $ft\n");
fprintf($datafile, "$hlm $du $ul $dl $ft\n");
}
fclose($datafile);
}
exit();
make_graph($input, "du", "Disk usage", 2);
make_graph($input, "ub", "Upload bandwidth", 3);
make_graph($input, "db", "Download bandwidth", 4);