summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Besard <tim.besard@gmail.com>2011-11-28 17:44:47 +0100
committerTim Besard <tim.besard@gmail.com>2011-11-28 17:44:47 +0100
commit7815be3ae957e4eb5bb8a66ad12180bbd150caf3 (patch)
tree0fee458b2b9f91debdc08a4f843bf24a43c45305 /src
parentca97869a32b268a6e0cf04a29f2d0ee97385d63f (diff)
Reverted part of the output option removal.
Diffstat (limited to 'src')
-rw-r--r--src/experiment.cpp18
-rw-r--r--src/experiment.h2
-rw-r--r--src/output.cpp7
3 files changed, 21 insertions, 6 deletions
diff --git a/src/experiment.cpp b/src/experiment.cpp
index dcec720..847cbd2 100644
--- a/src/experiment.cpp
+++ b/src/experiment.cpp
@@ -87,8 +87,10 @@ Experiment::~Experiment() {
// forward <stride> exclusive OR and mask
// reverse <stride> addition and offset
// -o or --output output mode
-// csv csv format (one entry per experiment)
-// table human-readable table of values (averaged)
+// hdr header only
+// csv csv only
+// both header + csv
+// table human-readable table of averaged values
// -n or --numa numa placement
// local local allocation of all chains
// xor <mask> exclusive OR and mask
@@ -280,6 +282,12 @@ int Experiment::parse_args(int argc, char* argv[]) {
this->output_mode = TABLE;
} else if (strcasecmp(argv[i], "csv") == 0) {
this->output_mode = CSV;
+ } else if (strcasecmp(argv[i], "both") == 0) {
+ this->output_mode = BOTH;
+ } else if (strcasecmp(argv[i], "hdr") == 0) {
+ this->output_mode = HEADER;
+ } else if (strcasecmp(argv[i], "header") == 0) {
+ this->output_mode = HEADER;
} else {
error = 1;
break;
@@ -356,8 +364,10 @@ int Experiment::parse_args(int argc, char* argv[]) {
printf("Note: <stride> is always a small positive integer.\n");
printf("\n");
printf("<format> is selected from the following:\n");
- printf(" csv # results in csv format (one entry per experiment)\n");
- printf(" table # human-readable table of values (averaged)\n");
+ printf(" hdr # csv header only\n");
+ printf(" csv # results in csv format only\n");
+ printf(" both # header and results in csv format\n");
+ printf(" table # human-readable table of averaged values\n");
printf("\n");
printf("<hint> is selected from the following:\n");
printf(" none # do not use prefetching\n");
diff --git a/src/experiment.h b/src/experiment.h
index 332835d..38aee3c 100644
--- a/src/experiment.h
+++ b/src/experiment.h
@@ -63,7 +63,7 @@ public:
enum { NONE, T0, T1, T2, NTA }
prefetch_hint; // use of prefetching
- enum { CSV, TABLE }
+ enum { CSV, BOTH, HEADER, TABLE }
output_mode; // results output mode
enum { RANDOM, STRIDED }
diff --git a/src/output.cpp b/src/output.cpp
index c675945..75ae845 100644
--- a/src/output.cpp
+++ b/src/output.cpp
@@ -28,7 +28,12 @@
//
void Output::print(Experiment &e, int64 ops, std::vector<double> seconds, double ck_res) {
- if (e.output_mode == Experiment::CSV) {
+ if (e.output_mode == Experiment::HEADER) {
+ Output::header(e, ops, ck_res);
+ } else if (e.output_mode == Experiment::CSV) {
+ for (int i = 0; i < seconds.size(); i++)
+ Output::csv(e, ops, seconds[i], ck_res);
+ } else if (e.output_mode == Experiment::BOTH) {
Output::header(e, ops, ck_res);
for (int i = 0; i < seconds.size(); i++)
Output::csv(e, ops, seconds[i], ck_res);