summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Besard <tim.besard@gmail.com>2011-11-21 10:51:18 +0100
committerTim Besard <tim.besard@gmail.com>2011-11-21 10:51:18 +0100
commit1f00352cc6436fe7d82edcceeb86fae4a9d31bf9 (patch)
tree8f9abfddfbd37e846f4fc3f1f1f9e99c7b959c3a
parent23582a8aff400cf0c698650b29a3a6e13f159de3 (diff)
Removing stream mode due to not being implemented.
-rw-r--r--src/experiment.cpp15
-rw-r--r--src/experiment.h2
-rw-r--r--src/run.cpp353
-rw-r--r--src/run.h1
4 files changed, 1 insertions, 370 deletions
diff --git a/src/experiment.cpp b/src/experiment.cpp
index 9b6af7c..c9e5771 100644
--- a/src/experiment.cpp
+++ b/src/experiment.cpp
@@ -266,18 +266,6 @@ int Experiment::parse_args(int argc, char* argv[]) {
error = 1;
break;
}
- } else if (strcasecmp(argv[i], "stream") == 0) {
- this->access_pattern = STREAM;
- i++;
- if (i == argc) {
- error = 1;
- break;
- }
- this->stride = Experiment::parse_number(argv[i]);
- if (this->stride == 0) {
- error = 1;
- break;
- }
} else {
error = 1;
break;
@@ -371,7 +359,6 @@ int Experiment::parse_args(int argc, char* argv[]) {
printf(" random # all chains are accessed randomly\n");
printf(" forward <stride> # chains are in forward order with constant stride\n");
printf(" reverse <stride> # chains are in reverse order with constant stride\n");
- printf(" stream <stride> # references are calculated rather than read from memory\n");
printf("\n");
printf("Note: <stride> is always a small positive integer.\n");
printf("\n");
@@ -712,8 +699,6 @@ const char* Experiment::access() {
result = "forward";
} else if (this->access_pattern == STRIDED && this->stride < 0) {
result = "reverse";
- } else if (this->access_pattern == STREAM) {
- result = "stream";
}
return result;
diff --git a/src/experiment.h b/src/experiment.h
index 539e96a..727719a 100644
--- a/src/experiment.h
+++ b/src/experiment.h
@@ -65,7 +65,7 @@ public:
enum { CSV, BOTH, HEADER, TABLE }
output_mode; // results output mode
- enum { RANDOM, STRIDED, STREAM }
+ enum { RANDOM, STRIDED }
access_pattern; // memory access pattern
int64 stride;
diff --git a/src/run.cpp b/src/run.cpp
index 4eaa8cd..dc4ec96 100644
--- a/src/run.cpp
+++ b/src/run.cpp
@@ -44,9 +44,6 @@ typedef benchmark (*generator)(int64 chains_per_thread,
static benchmark chase_pointers(int64 chains_per_thread,
int64 bytes_per_line, int64 bytes_per_chain,
int64 stride, int64 loop_length, int32 prefetch_hint);
-static benchmark follow_streams(int64 chains_per_thread,
- int64 bytes_per_line, int64 bytes_per_chain,
- int64 stride, int64 loop_length, int32 prefetch_hint);
Lock Run::global_mutex;
int64 Run::_ops_per_chain = 0;
@@ -110,9 +107,6 @@ int Run::run() {
root[i] = reverse_mem_init(chain_memory[i]);
}
gen = chase_pointers;
- } else if (this->exp->access_pattern == Experiment::STREAM) {
- root[i] = stream_mem_init(chain_memory[i]);
- gen = follow_streams;
}
}
@@ -455,350 +449,3 @@ static benchmark chase_pointers(int64 chains_per_thread, // memory loading per t
return fn;
}
-
-// NOT WRITTEN YET -- DMP
-// JUST A PLACE HOLDER!
-Chain* Run::stream_mem_init(Chain *mem) {
-// fprintf(stderr, "made it into stream_mem_init.\n");
-// fprintf(stderr, "chains_per_thread = %ld\n", this->exp->chains_per_thread);
-// fprintf(stderr, "iterations = %ld\n", this->exp->iterations);
-// fprintf(stderr, "bytes_per_chain = %ld\n", this->exp->bytes_per_chain);
-// fprintf(stderr, "stride = %ld\n", this->exp->stride);
- int64 local_ops_per_chain = 0;
- double* tmp = (double *) mem;
- int64 refs_per_line = this->exp->bytes_per_line / sizeof(double);
- int64 refs_per_chain = this->exp->bytes_per_chain / sizeof(double);
-// fprintf(stderr, "refs_per_chain = %ld\n", refs_per_chain);
-
- for (int64 i = 0; i < refs_per_chain;
- i += this->exp->stride * refs_per_line) {
- tmp[i] = 0;
- local_ops_per_chain += 1;
- }
-
- Run::global_mutex.lock();
- Run::_ops_per_chain = local_ops_per_chain;
- Run::global_mutex.unlock();
-
-// fprintf(stderr, "made it out of stream_mem_init.\n");
- return mem;
-}
-
-static int64 summ_ck = 0;
-void sum_chk(double t) {
- if (t != 0)
- summ_ck += 1;
-}
-
-// NOT WRITTEN YET -- DMP
-// JUST A PLACE HOLDER!
-static benchmark follow_streams(int64 chains_per_thread, // memory loading per thread
- int64 bytes_per_line, // ignored
- int64 bytes_per_chain, // ignored
- int64 stride, // ignored
- int64 loop_length, // ignored
- int32 prefetch_hint // ignored
- ) {
- return 0;
- /*
- int64 refs_per_line = bytes_per_line / sizeof(double);
- int64 refs_per_chain = bytes_per_chain / sizeof(double);
-
- // chase pointers
- switch (chains_per_thread) {
- default:
- case 1:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j];
- }
- sum_chk(t);
- }
- break;
- case 2:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j];
- }
- sum_chk(t);
- }
- break;
- case 3:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j];
- }
- sum_chk(t);
- }
- break;
- case 4:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j];
- }
- sum_chk(t);
- }
- break;
- case 5:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j];
- }
- sum_chk(t);
- }
- break;
- case 6:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j];
- }
- sum_chk(t);
- }
- break;
- case 7:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j];
- }
- sum_chk(t);
- }
- break;
- case 8:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j];
- }
- sum_chk(t);
- }
- break;
- case 9:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- double* a8 = (double *) root[8];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j] + a8[j];
- }
- sum_chk(t);
- }
- break;
- case 10:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- double* a8 = (double *) root[8];
- double* a9 = (double *) root[9];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j] + a8[j] + a9[j];
- }
- sum_chk(t);
- }
- break;
- case 11:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- double* a8 = (double *) root[8];
- double* a9 = (double *) root[9];
- double* a10 = (double *) root[10];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j] + a8[j] + a9[j] + a10[j];
- }
- sum_chk(t);
- }
- break;
- case 12:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- double* a8 = (double *) root[8];
- double* a9 = (double *) root[9];
- double* a10 = (double *) root[10];
- double* a11 = (double *) root[11];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j] + a8[j] + a9[j] + a10[j] + a11[j];
- }
- sum_chk(t);
- }
- break;
- case 13:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- double* a8 = (double *) root[8];
- double* a9 = (double *) root[9];
- double* a10 = (double *) root[10];
- double* a11 = (double *) root[11];
- double* a12 = (double *) root[12];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j] + a8[j] + a9[j] + a10[j] + a11[j] + a12[j];
- }
- sum_chk(t);
- }
- break;
- case 14:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- double* a8 = (double *) root[8];
- double* a9 = (double *) root[9];
- double* a10 = (double *) root[10];
- double* a11 = (double *) root[11];
- double* a12 = (double *) root[12];
- double* a13 = (double *) root[13];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j] + a8[j] + a9[j] + a10[j] + a11[j] + a12[j]
- + a13[j];
- }
- sum_chk(t);
- }
- break;
- case 15:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- double* a8 = (double *) root[8];
- double* a9 = (double *) root[9];
- double* a10 = (double *) root[10];
- double* a11 = (double *) root[11];
- double* a12 = (double *) root[12];
- double* a13 = (double *) root[13];
- double* a14 = (double *) root[14];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j] + a8[j] + a9[j] + a10[j] + a11[j] + a12[j]
- + a13[j] + a14[j];
- }
- sum_chk(t);
- }
- break;
- case 16:
- for (int64 i = 0; i < iterations; i++) {
- double t = 0;
- double* a0 = (double *) root[0];
- double* a1 = (double *) root[1];
- double* a2 = (double *) root[2];
- double* a3 = (double *) root[3];
- double* a4 = (double *) root[4];
- double* a5 = (double *) root[5];
- double* a6 = (double *) root[6];
- double* a7 = (double *) root[7];
- double* a8 = (double *) root[8];
- double* a9 = (double *) root[9];
- double* a10 = (double *) root[10];
- double* a11 = (double *) root[11];
- double* a12 = (double *) root[12];
- double* a13 = (double *) root[13];
- double* a14 = (double *) root[14];
- double* a15 = (double *) root[15];
- for (int64 j = 0; j < refs_per_chain; j += stride * refs_per_line) {
- t += a0[j] + a1[j] + a2[j] + a3[j] + a4[j] + a5[j] + a6[j]
- + a7[j] + a8[j] + a9[j] + a10[j] + a11[j] + a12[j]
- + a13[j] + a14[j] + a15[j];
- }
- sum_chk(t);
- }
- break;
- }
- */
-}
diff --git a/src/run.h b/src/run.h
index dbc698f..78fb577 100644
--- a/src/run.h
+++ b/src/run.h
@@ -52,7 +52,6 @@ private:
Chain* random_mem_init(Chain *m);
Chain* forward_mem_init(Chain *m);
Chain* reverse_mem_init(Chain *m);
- Chain* stream_mem_init(Chain *m);
static Lock global_mutex; // global lock
static int64 _ops_per_chain; // total number of operations per chain