diff --git a/checkin_notes b/checkin_notes index 979cca8094..97a9afdfd8 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/html/user/lammps.php b/html/user/lammps.php index dc73e5d4d7..e754d24f7a 100644 --- a/html/user/lammps.php +++ b/html/user/lammps.php @@ -121,7 +121,11 @@ function show_submit_form($user) { row2("Area", area_select()); row2("", ""); end_table(); - echo ""; + echo " +
+ File sandbox + "; + page_tail(); } diff --git a/html/user/sandbox.php b/html/user/sandbox.php index ab1831a2b5..e75df05b37 100644 --- a/html/user/sandbox.php +++ b/html/user/sandbox.php @@ -47,8 +47,8 @@ function list_files($user) {
Submit LAMMPS jobs + "; page_tail(); } diff --git a/ssim/ssim.cpp b/ssim/ssim.cpp index 596bf1aee3..340de05303 100644 --- a/ssim/ssim.cpp +++ b/ssim/ssim.cpp @@ -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); } }; diff --git a/ssim/ssim.php b/ssim/ssim.php index ef5217b16d..aa5a2d34a1 100644 --- a/ssim/ssim.php +++ b/ssim/ssim.php @@ -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);