From 7815be3ae957e4eb5bb8a66ad12180bbd150caf3 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Mon, 28 Nov 2011 17:44:47 +0100 Subject: Reverted part of the output option removal. --- src/experiment.cpp | 18 ++++++++++++++---- src/experiment.h | 2 +- src/output.cpp | 7 ++++++- 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 exclusive OR and mask // reverse 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 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: is always a small positive integer.\n"); printf("\n"); printf(" 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(" 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 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); -- cgit v1.2.3