From 9a2eef3b9deabcd3c368cb9562485fe2dff05ec1 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Sat, 19 Nov 2011 15:36:56 +0100 Subject: Option renaming. --- src/experiment.cpp | 14 +++++++------- src/experiment.h | 4 ++-- src/output.cpp | 3 +++ src/run.cpp | 16 ++++++++-------- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/experiment.cpp b/src/experiment.cpp index 7e5d318..a156322 100644 --- a/src/experiment.cpp +++ b/src/experiment.cpp @@ -49,7 +49,7 @@ Experiment::Experiment() : bytes_per_thread (DEFAULT_BYTES_PER_THREAD), num_threads (DEFAULT_THREADS), bytes_per_test (DEFAULT_BYTES_PER_TEST), - busy_cycles (DEFAULT_BUSY_CYCLES), + loop_length (DEFAULT_LOOPLENGTH), seconds (DEFAULT_SECONDS), iterations (DEFAULT_ITERATIONS), experiments (DEFAULT_EXPERIMENTS), @@ -79,7 +79,7 @@ Experiment::~Experiment() { // -t or --threads number of threads (concurrency and contention) // -i or --iters iterations // -e or --experiments experiments -// -b or --busy amount of cycles processor should remain busy +// -g or --loop cycles to execute for each iteration (latency hiding) // -f or --prefetch prefetch data // -a or --access memory access pattern // random random access pattern @@ -200,14 +200,14 @@ int Experiment::parse_args(int argc, char* argv[]) { error = 1; break; } - } else if (strcasecmp(argv[i], "-b") == 0 - || strcasecmp(argv[i], "--busy") == 0) { + } else if (strcasecmp(argv[i], "-g") == 0 + || strcasecmp(argv[i], "--loop") == 0) { i++; if (i == argc) { error = 1; break; } - this->busy_cycles = Experiment::parse_number(argv[i]); + this->loop_length = Experiment::parse_number(argv[i]); if (this->experiments == 0) { error = 1; break; @@ -345,7 +345,7 @@ int Experiment::parse_args(int argc, char* argv[]) { printf(" [-o|--output] # output format\n"); printf(" [-n|--numa] # numa placement\n"); printf(" [-s|--seconds] # run each experiment for seconds\n"); - printf(" [-b|--busy] # how much processing cycles each loop should count\n"); + printf(" [-g|--loop] # cycles to execute for each iteration (latency hiding)\n"); printf(" [-f|--prefetch] # prefetch data\n"); printf(" [-x|--strict] # fail rather than adjust options to sensible values\n"); printf("\n"); @@ -655,7 +655,7 @@ void Experiment::print() { printf("bytes_per_thread = %d\n", bytes_per_thread); printf("num_threads = %d\n", num_threads); printf("bytes_per_test = %d\n", bytes_per_test); - printf("busy cycles = %d\n", busy_cycles); + printf("busy cycles = %d\n", loop_length); printf("prefetch = %d\n", prefetch); printf("iterations = %d\n", iterations); printf("experiments = %d\n", experiments); diff --git a/src/experiment.h b/src/experiment.h index 87ffbbb..3f6d0b1 100644 --- a/src/experiment.h +++ b/src/experiment.h @@ -53,7 +53,7 @@ public: int64 chains_per_thread;// memory loading per thread int64 num_threads; // number of threads in the experiment int64 bytes_per_test; // test working set size (bytes) - int64 busy_cycles; // processing cycles + int64 loop_length; // length of the inner loop (cycles) bool prefetch; // use of prefetching float seconds; // number of seconds per experiment @@ -96,7 +96,7 @@ public: const static int32 DEFAULT_BYTES_PER_THREAD = DEFAULT_BYTES_PER_CHAIN * DEFAULT_CHAINS_PER_THREAD; const static int32 DEFAULT_THREADS = 1; const static int32 DEFAULT_BYTES_PER_TEST = DEFAULT_BYTES_PER_THREAD * DEFAULT_THREADS; - const static int32 DEFAULT_BUSY_CYCLES = 0; + const static int32 DEFAULT_LOOPLENGTH = 0; const static int32 DEFAULT_SECONDS = 1; const static int32 DEFAULT_ITERATIONS = 0; const static int32 DEFAULT_EXPERIMENTS = 1; diff --git a/src/output.cpp b/src/output.cpp index 0fcc74d..0362cc1 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -49,6 +49,7 @@ void Output::header(Experiment &e, int64 ops, double secs, double ck_res) { printf("chains per thread,"); printf("number of threads,"); printf("iterations,"); + printf("loop length,"); printf("experiments,"); printf("access pattern,"); printf("stride,"); @@ -77,6 +78,7 @@ void Output::csv(Experiment &e, int64 ops, double secs, double ck_res) { printf("%lld,", e.chains_per_thread); printf("%ld,", e.num_threads); printf("%ld,", e.iterations); + printf("%ld,", e.loop_length); printf("%ld,", e.experiments); printf("%s,", e.access()); printf("%ld,", e.stride); @@ -118,6 +120,7 @@ void Output::table(Experiment &e, int64 ops, double secs, double ck_res) { printf("chains per thread = %ld\n", e.chains_per_thread); printf("number of threads = %ld\n", e.num_threads); printf("iterations = %ld\n", e.iterations); + printf("loop length = %ld\n", e.loop_length); printf("experiments = %ld\n", e.experiments); printf("access pattern = %s\n", e.access()); printf("stride = %ld\n", e.stride); diff --git a/src/run.cpp b/src/run.cpp index 54ef7c1..4ef6852 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -40,13 +40,13 @@ static double min(double v1, double v2); typedef void (*benchmark)(const Chain**); typedef benchmark (*generator)(int64 chains_per_thread, int64 bytes_per_line, int64 bytes_per_chain, - int64 stride, int64 busy_cycles, bool prefetch); + int64 stride, int64 loop_length, bool prefetch); static benchmark chase_pointers(int64 chains_per_thread, int64 bytes_per_line, int64 bytes_per_chain, - int64 stride, int64 busy_cycles, bool prefetch); + int64 stride, int64 loop_length, bool prefetch); static benchmark follow_streams(int64 chains_per_thread, int64 bytes_per_line, int64 bytes_per_chain, - int64 stride, int64 busy_cycles, bool prefetch); + int64 stride, int64 loop_length, bool prefetch); Lock Run::global_mutex; int64 Run::_ops_per_chain = 0; @@ -120,7 +120,7 @@ int Run::run() { // compile benchmark benchmark bench = gen(this->exp->chains_per_thread, this->exp->bytes_per_line, this->exp->bytes_per_chain, - this->exp->stride, this->exp->busy_cycles, + this->exp->stride, this->exp->loop_length, this->exp->prefetch); volatile static double istart = 0; @@ -170,7 +170,7 @@ int Run::run() { // compile benchmark benchmark bench = gen(this->exp->chains_per_thread, this->exp->bytes_per_line, this->exp->bytes_per_chain, - this->exp->stride, this->exp->busy_cycles, + this->exp->stride, this->exp->loop_length, this->exp->prefetch); for (int e = 0; e < this->exp->experiments; e++) { @@ -373,7 +373,7 @@ static benchmark chase_pointers(int64 chains_per_thread, // memory loading per t int64 bytes_per_line, // ignored int64 bytes_per_chain, // ignored int64 stride, // ignored - int64 busy_cycles, // processing cycles + int64 loop_length, // processing cycles bool prefetch // prefetch? ) { // Create Compiler. @@ -422,7 +422,7 @@ static benchmark chase_pointers(int64 chains_per_thread, // memory loading per t } // Wait - for (int i = 0; i < busy_cycles; i++) + for (int i = 0; i < loop_length; i++) c.nop(); // Test if end reached @@ -484,7 +484,7 @@ static benchmark follow_streams(int64 chains_per_thread, // memory loading per t int64 bytes_per_line, // ignored int64 bytes_per_chain, // ignored int64 stride, // ignored - int64 busy_cycles, // ignored + int64 loop_length, // ignored bool prefetch // ignored ) { return 0; -- cgit v1.2.3