diff --git a/checkin_notes b/checkin_notes
index 0bcd20692b..1bdc59c34f 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -7318,3 +7318,12 @@ David 14 Oct 2011
index.php
inc/
db_ops.inc
+
+David 16 Oct 2011
+ - client simulator: make the output more graphical
+
+ html/
+ inc/
+ util.inc
+ client/
+ sim.cpp
diff --git a/client/sim.cpp b/client/sim.cpp
index 9e4a25c75b..09cc49bdfe 100644
--- a/client/sim.cpp
+++ b/client/sim.cpp
@@ -784,18 +784,29 @@ const char* colors[] = {
"#aa00aa",
"#aaaa00",
"#00aaaa",
- "#0000cc",
- "#00cc00",
- "#cc0000",
- "#cc00cc",
- "#cccc00",
- "#00cccc",
+ "#8800aa",
+ "#aa0088",
+ "#88aa00",
+ "#aa8800",
+ "#00aa88",
+ "#0088aa",
};
-#define NCOLORS 12
+#define NCOLORS 18
#define WIDTH1 100
#define WIDTH2 400
+void show_project_colors() {
+ fprintf(html_out, "Projects:
\n");
+ for (unsigned int i=0; i%s | \n",
+ colors[p->index%NCOLORS], p->project_name
+ );
+ }
+ fprintf(html_out, "
\n");
+}
void job_count(PROJECT* p, int rsc_type, int& in_progress, int& done) {
in_progress = done = 0;
@@ -833,7 +844,14 @@ void show_resource(int rsc_type) {
}
PROJECT* p = rp->project;
- fprintf(html_out, "%.2f: %s%s: %.2fG%s
\n",
+ if (!found) {
+ found = true;
+ fprintf(html_out,
+ "\n"
+ "#devs | Job name | FLOPS left |
\n"
+ );
+ }
+ fprintf(html_out, "%.2f | %s%s | %.0fG%s |
\n",
ninst,
colors[p->index%NCOLORS],
atp->result->rr_sim_misses_deadline?"*":"",
@@ -841,24 +859,29 @@ void show_resource(int rsc_type) {
atp->flops_left/1e9,
buf
);
- found = true;
}
- if (!found) fprintf(html_out, "IDLE");
- fprintf(html_out, "
Jobs");
+ if (found) {
+ fprintf(html_out, "
\n");
+ } else {
+ fprintf(html_out, "IDLE\n");
+ }
+ fprintf(html_out,
+ "Project | Jobs in progress | Jobs done |
\n"
+ );
found = false;
for (i=0; i%s: %d in prog, %d done\n",
- p->project_name, in_progress, done
+ fprintf(html_out, "%s | %d | %d | \n",
+ colors[p->index%NCOLORS], p->project_name, in_progress, done
);
found = true;
}
}
- if (!found) fprintf(html_out, " ---\n");
- fprintf(html_out, "");
+ //if (!found) fprintf(html_out, " ---\n");
+ fprintf(html_out, "
");
}
int nproc_types = 1;
@@ -874,12 +897,16 @@ void html_start() {
}
setbuf(html_out, 0);
fprintf(index_file, "
Timeline\n", TIMELINE_FNAME);
- fprintf(html_out, "BOINC client simulator
\n");
+ fprintf(html_out,
+ "\n"
+ "BOINC client emulator results
\n"
+ );
+ show_project_colors();
fprintf(html_out,
"Time | \n", WIDTH1
);
fprintf(html_out,
- "CPU Job name and estimated time left color denotes project * means EDF mode | ", WIDTH2
+ "CPU * means EDF mode | ", WIDTH2
);
if (coprocs.have_nvidia()) {
fprintf(html_out, "NVIDIA GPU | ", WIDTH2);
diff --git a/doc/sim/sim_web.php b/doc/sim/sim_web.php
index 8acca3173e..20a7dbf7ee 100644
--- a/doc/sim/sim_web.php
+++ b/doc/sim/sim_web.php
@@ -86,7 +86,7 @@ function show_scenarios() {
Scenarios
The inputs to BCE, called scenarios,
describe a particular computer and the project to which it's attached.
- A scenario consists of 4 files:
+ A scenario consists of:
- client_state.xml: describes the host and projects.
Any projects that don't currently have tasks are ignored.
@@ -305,7 +305,7 @@ function show_scenario() {
}
row2("Input files", $x);
end_table();
- show_button("sim_web.php?action=simulation_form&scen=$name",
+ show_button("sim_web.php?action=simulation_form_short&scen=$name",
"Do new simulation",
"Do new simulation"
);
@@ -330,9 +330,29 @@ function show_scenario() {
page_tail();
}
-// form for simulation parameters:
-// duration, time step, policy options
-//
+function simulation_form_short() {
+ $scen = get_str("scen");
+ page_head("Do simulation");
+ start_table();
+ echo "
+ \n";
+ end_table();
+ page_tail();
+}
+
function simulation_form() {
$scen = get_str("scen");
page_head("Do simulation");
@@ -484,6 +504,9 @@ case "show_scenario":
case "simulation_form":
simulation_form();
break;
+case "simulation_form_short":
+ simulation_form_short();
+ break;
case "simulation_action":
simulation_action();
break;
diff --git a/html/inc/util.inc b/html/inc/util.inc
index bc1c132c76..2dd00bde32 100644
--- a/html/inc/util.inc
+++ b/html/inc/util.inc
@@ -590,22 +590,25 @@ function post_int($name, $optional=false) {
}
function get_str($name, $optional=false) {
- if (!isset($_GET[$name])) {
+ if (isset($_GET[$name])) {
+ $x = $_GET[$name];
+ } else {
if (!$optional) {
error_page("missing or bad parameter: $name");
}
$x = null;
- } else {
- $x = $_GET[$name];
}
return undo_magic_quotes($x);
}
function post_str($name, $optional=false) {
- $x = null;
- if (isset($_POST[$name])) $x = $_POST[$name];
- if (!$x && !$optional) {
- error_page("missing or bad parameter: $name");
+ if (isset($_POST[$name])) {
+ $x = $_POST[$name];
+ } else {
+ if (!$optional) {
+ error_page("missing or bad parameter: $name");
+ }
+ $x = null;
}
return undo_magic_quotes($x);
}
---|