diff options
-rw-r--r-- | Experiment.C | 53 | ||||
-rw-r--r-- | Experiment.h | 5 | ||||
-rw-r--r-- | Makefile | 33 | ||||
-rw-r--r-- | Run.C | 1069 | ||||
-rwxr-xr-x | pChase.sh | 5 | ||||
-rwxr-xr-x | pChase64_NUMA | bin | 47016 -> 50553 bytes | |||
-rwxr-xr-x | pChase64_SMP | bin | 46208 -> 50417 bytes |
7 files changed, 660 insertions, 505 deletions
diff --git a/Experiment.C b/Experiment.C index 07f18a4..9c73576 100644 --- a/Experiment.C +++ b/Experiment.C @@ -37,6 +37,7 @@ Experiment::Experiment() : bytes_per_thread (DEFAULT_BYTES_PER_THREAD), num_threads (DEFAULT_THREADS), bytes_per_test (DEFAULT_BYTES_PER_TEST), + seconds (DEFAULT_SECONDS), iterations (DEFAULT_ITERATIONS), experiments (DEFAULT_EXPERIMENTS), output_mode (TABLE), @@ -85,8 +86,14 @@ Experiment::parse_args(int argc, char* argv[]) { int error = 0; for (int i=1; i < argc; i++) { - if (strcasecmp(argv[i], "-s") == 0 || strcasecmp(argv[i], "--strict") == 0) { + if (strcasecmp(argv[i], "-x") == 0 || strcasecmp(argv[i], "--strict") == 0) { this->strict = 1; + } else if (strcasecmp(argv[i], "-s") == 0 || strcasecmp(argv[i], "--seconds") == 0) { + i++; + if (i == argc) { error = 1; break; } + this->seconds = Experiment::parse_real(argv[i]); + this->iterations = 0; + if (this->seconds == 0) { error = 1; break; } } else if (strcasecmp(argv[i], "-l") == 0 || strcasecmp(argv[i], "--line") == 0) { i++; if (i == argc) { error = 1; break; } @@ -116,6 +123,7 @@ Experiment::parse_args(int argc, char* argv[]) i++; if (i == argc) { error = 1; break; } this->iterations = Experiment::parse_number(argv[i]); + this->seconds = 0; if (this->iterations == 0) { error = 1; break; } } else if (strcasecmp(argv[i], "-e") == 0 || strcasecmp(argv[i], "--experiments") == 0) { i++; @@ -201,12 +209,13 @@ Experiment::parse_args(int argc, char* argv[]) printf(" [-c|--chain] <number> # bytes per chain (used to compute pages per chain)\n"); printf(" [-r|--references] <number> # chains per thread (memory loading)\n"); printf(" [-t|--threads] <number> # number of threads (concurrency and contention)\n"); - printf(" [-i|--iterations] <number> # iterations\n"); + printf(" [-i|--iterations] <number> # iterations per experiment\n"); printf(" [-e|--experiments] <number> # experiments\n"); printf(" [-a|--access] <pattern> # memory access pattern\n"); printf(" [-o|--output] <format> # output format\n"); printf(" [-n|--numa] <placement> # numa placement\n"); - printf(" [-s|--strict] # fail rather than adjust options to sensible values\n"); + printf(" [-s|--seconds] <number> # run each experiment for <number> seconds\n"); + printf(" [-x|--strict] # fail rather than adjust options to sensible values\n"); printf("\n"); printf("<pattern> is selected from the following:\n"); printf(" random # all chains are accessed randomly\n"); @@ -241,7 +250,7 @@ Experiment::parse_args(int argc, char* argv[]) printf("To determine the number of NUMA domains currently available\n"); printf("on your system, use a command such as \"numastat\".\n"); printf("\n"); - printf("Final note: strict is not yet implemented, and\n"); + printf("Final note: strict is not yet fully implemented, and\n"); printf("maps do not gracefully handle ill-formed map specifications.\n"); return 1; @@ -342,6 +351,33 @@ Experiment::parse_number( const char* s ) return result; } + +float +Experiment::parse_real( const char* s ) +{ + float result = 0; + bool decimal = false; + float power = 1; + + int len = strlen( s ); + for (int i=0; i < len; i++) { + if ( '0' <= s[i] && s[i] <= '9' ) { + if (! decimal) { + result = result * 10 + s[i] - '0'; + } else { + power = power / 10; + result = result + (s[i] - '0') * power; + } + } else if ( '.' == s[i] ) { + decimal = true; + } else { + break; + } + } + + return result; +} + void Experiment::alloc_local() { @@ -422,6 +458,11 @@ Experiment::alloc_map() // search for one or several ',' c = 0; while (*p != '\0' && *p != ';') { + if (chains <= c || threads <= t) { + // error in the thread/chain specification + fprintf(stderr, "Malformed map.\n"); + exit(1); + } int i = 0; while (*p != '\0' && *p != ';') { if (*p == ',') { p++; break; } @@ -510,7 +551,7 @@ Experiment::print() const char* Experiment::access() { - char* result = NULL; + const char* result = NULL; if (this->access_pattern == RANDOM) { result = "random"; @@ -526,7 +567,7 @@ Experiment::access() const char* Experiment::placement() { - char* result = NULL; + const char* result = NULL; if (this->numa_placement == LOCAL) { result = "local"; diff --git a/Experiment.h b/Experiment.h index ae1be1e..5459949 100644 --- a/Experiment.h +++ b/Experiment.h @@ -23,6 +23,7 @@ public: int parse_args(int argc, char* argv[]); int64 parse_number( const char* s ); + float parse_real( const char* s ); const char* placement(); const char* access(); @@ -43,6 +44,7 @@ public: int64 num_threads; // number of threads in the experiment int64 bytes_per_test; // test working set size (bytes) + float seconds; // number of seconds per experiment int64 iterations; // number of iterations per experiment int64 experiments; // number of experiments per test @@ -82,7 +84,8 @@ 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_ITERATIONS = 1; + const static int32 DEFAULT_SECONDS = 1; + const static int32 DEFAULT_ITERATIONS = 0; const static int32 DEFAULT_EXPERIMENTS = 1; const static int32 DEFAULT_OUTPUT_MODE = 1; @@ -1,21 +1,42 @@ -SRC = Main.C Chain.C Experiment.C Lock.C Output.C Run.C SpinBarrier.C Timer.C Thread.C Types.C +# MODE=NUMA make -j # # BIT = { 32 | 64 } # MODE = { NUMA | SMP } # -BIT = 64 +# BIT = 64 # MODE = NUMA +# MODE = SMP + +ifneq ($(BIT), 64) +ifneq ($(BIT), 32) +BIT = 64 +endif +endif + +ifneq ($(MODE), NUMA) +ifneq ($(MODE), SMP) MODE = SMP -# LIB = -lpthread -lnuma +endif +endif + +ifeq ($(MODE), NUMA) +LIB = -lpthread -lnuma +endif + +ifeq ($(MODE), SMP) LIB = -lpthread +endif +SRC = Main.C Chain.C Experiment.C Lock.C Output.C Run.C SpinBarrier.C Timer.C Thread.C Types.C HDR = $(SRC:.C=.h) OBJ = $(SRC:.C=.o) EXE = pChase$(BIT)_$(MODE) RM = /bin/rm MV = /bin/mv +CI = /usr/bin/ci +CO = /usr/bin/co CXXFLAGS= -O3 -m$(BIT) -D$(MODE) @@ -32,3 +53,9 @@ rmexe: rmobj: $(RM) -rf $(OBJ) + +ci: + $(CI) -f $(SRC) $(HDR) Makefile + +co: + $(CO) -l $(SRC) $(HDR) Makefile @@ -25,13 +25,14 @@ #include "SpinBarrier.h" +static double max( double v1, double v2 ); static double min( double v1, double v2 ); +static void chase_pointers(int64 chains_per_thread, int64 iterations, Chain** root); Lock Run::global_mutex; int64 Run::_ops_per_chain = 0; double Run::_seconds = 1E9; - Run::Run() : exp(NULL), bp(NULL) { @@ -91,8 +92,50 @@ Run::run() } } + if (this->exp->iterations <= 0) { + volatile static double istart = 0; + volatile static double istop = 0; + volatile static double elapsed = 0; + volatile static int64 iters = 1; + volatile static double bound = max(0.2, 10 * Timer::resolution()); + for (iters=1; elapsed <= bound; iters=iters<<1) { + this->bp->barrier(); + + // start timer + if (this->thread_id() == 0) { + istart = Timer::seconds(); + } + this->bp->barrier(); + + // chase pointers + chase_pointers(this->exp->chains_per_thread, iters, root); + + // barrier + this->bp->barrier(); + + // stop timer + if (this->thread_id() == 0) { + istop = Timer::seconds(); + elapsed = istop - istart; + } + this->bp->barrier(); + } + + // calculate the number of iterations + if (this->thread_id() == 0) { + if (0 < this->exp->seconds) { + this->exp->iterations = max(1, 0.9999 + 0.5 * this->exp->seconds * iters / elapsed); + } else { + this->exp->iterations = max(1, 0.9999 + iters / elapsed); + } + } + this->bp->barrier(); + } +#if defined(UNDEFINED) +#endif + // barrier - for (int e=-1; e <= this->exp->experiments; e++) { + for (int e=0; e < this->exp->experiments; e++) { this->bp->barrier(); // start timer @@ -101,495 +144,8 @@ Run::run() this->bp->barrier(); // chase pointers - if (this->exp->chains_per_thread == 1) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - while (a != NULL) { - a = a->next; - } - this->mem_check( a ); - } - } else if (this->exp->chains_per_thread == 2) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - while (a != NULL) { - a = a->next; - b = b->next; - } - this->mem_check( a ); - this->mem_check( b ); - } - } else if (this->exp->chains_per_thread == 3) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - } - } else if (this->exp->chains_per_thread == 4) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - } - } else if (this->exp->chains_per_thread == 5) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - } - } else if (this->exp->chains_per_thread == 6) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - } - } else if (this->exp->chains_per_thread == 7) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - } - } else if (this->exp->chains_per_thread == 8) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - } - } else if (this->exp->chains_per_thread == 9) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - Chain* j = root[8]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - j = j->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - this->mem_check( j ); - } - } else if (this->exp->chains_per_thread == 10) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - Chain* j = root[8]; - Chain* k = root[9]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - j = j->next; - k = k->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - this->mem_check( j ); - this->mem_check( k ); - } - } else if (this->exp->chains_per_thread == 11) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - Chain* j = root[8]; - Chain* k = root[9]; - Chain* l = root[10]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - j = j->next; - k = k->next; - l = l->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - this->mem_check( j ); - this->mem_check( k ); - this->mem_check( l ); - } - } else if (this->exp->chains_per_thread == 12) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - Chain* j = root[8]; - Chain* k = root[9]; - Chain* l = root[10]; - Chain* m = root[11]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - j = j->next; - k = k->next; - l = l->next; - m = m->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - this->mem_check( j ); - this->mem_check( k ); - this->mem_check( l ); - this->mem_check( m ); - } - } else if (this->exp->chains_per_thread == 13) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - Chain* j = root[8]; - Chain* k = root[9]; - Chain* l = root[10]; - Chain* m = root[11]; - Chain* n = root[12]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - j = j->next; - k = k->next; - l = l->next; - m = m->next; - n = n->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - this->mem_check( j ); - this->mem_check( k ); - this->mem_check( l ); - this->mem_check( m ); - this->mem_check( n ); - } - } else if (this->exp->chains_per_thread == 14) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - Chain* j = root[8]; - Chain* k = root[9]; - Chain* l = root[10]; - Chain* m = root[11]; - Chain* n = root[12]; - Chain* o = root[13]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - j = j->next; - k = k->next; - l = l->next; - m = m->next; - n = n->next; - o = o->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - this->mem_check( j ); - this->mem_check( k ); - this->mem_check( l ); - this->mem_check( m ); - this->mem_check( n ); - this->mem_check( o ); - } - } else if (this->exp->chains_per_thread == 15) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - Chain* j = root[8]; - Chain* k = root[9]; - Chain* l = root[10]; - Chain* m = root[11]; - Chain* n = root[12]; - Chain* o = root[13]; - Chain* p = root[14]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - j = j->next; - k = k->next; - l = l->next; - m = m->next; - n = n->next; - o = o->next; - p = p->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - this->mem_check( j ); - this->mem_check( k ); - this->mem_check( l ); - this->mem_check( m ); - this->mem_check( n ); - this->mem_check( o ); - this->mem_check( p ); - } - } else if (this->exp->chains_per_thread == 16) { - for (int i=0; i < this->exp->iterations; i++) { - Chain* a = root[0]; - Chain* b = root[1]; - Chain* c = root[2]; - Chain* d = root[3]; - Chain* e = root[4]; - Chain* f = root[5]; - Chain* g = root[6]; - Chain* h = root[7]; - Chain* j = root[8]; - Chain* k = root[9]; - Chain* l = root[10]; - Chain* m = root[11]; - Chain* n = root[12]; - Chain* o = root[13]; - Chain* p = root[14]; - Chain* q = root[15]; - while (a != NULL) { - a = a->next; - b = b->next; - c = c->next; - d = d->next; - e = e->next; - f = f->next; - g = g->next; - h = h->next; - j = j->next; - k = k->next; - l = l->next; - m = m->next; - n = n->next; - o = o->next; - p = p->next; - q = q->next; - } - this->mem_check( a ); - this->mem_check( b ); - this->mem_check( c ); - this->mem_check( d ); - this->mem_check( e ); - this->mem_check( f ); - this->mem_check( g ); - this->mem_check( h ); - this->mem_check( j ); - this->mem_check( k ); - this->mem_check( l ); - this->mem_check( m ); - this->mem_check( n ); - this->mem_check( o ); - this->mem_check( p ); - this->mem_check( q ); - } - } + chase_pointers(this->exp->chains_per_thread, this->exp->iterations, root); + // barrier this->bp->barrier(); @@ -610,7 +166,6 @@ Run::run() this->bp->barrier(); - for (int i=0; i < this->exp->chains_per_thread; i++) { if (chain_memory[i] != NULL) delete [] chain_memory[i]; } @@ -627,6 +182,13 @@ Run::mem_check( Chain *m ) } static double +max( double v1, double v2 ) +{ + if (v1 < v2) return v2; + return v1; +} + +static double min( double v1, double v2 ) { if (v2 < v1) return v2; @@ -759,3 +321,526 @@ Run::reverse_mem_init( Chain *mem ) return root; } + +static int64 dumb_ck = 0; +void +mem_chk( Chain *m ) +{ + if (m == NULL) dumb_ck += 1; +} + +static void +chase_pointers( + int64 chains_per_thread, // memory loading per thread + int64 iterations, // number of iterations per experiment + Chain** root // +) +{ + // chase pointers + switch (chains_per_thread) { + default: + case 1: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + while (a != NULL) { + a = a->next; + } + mem_chk( a ); + } + break; + case 2: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + while (a != NULL) { + a = a->next; + b = b->next; + } + mem_chk( a ); + mem_chk( b ); + } + break; + case 3: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + } + break; + case 4: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + } + break; + case 5: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + } + break; + case 6: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + } + break; + case 7: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + } + break; + case 8: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + } + break; + case 9: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + Chain* j = root[8]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + j = j->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + mem_chk( j ); + } + break; + case 10: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + Chain* j = root[8]; + Chain* k = root[9]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + j = j->next; + k = k->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + mem_chk( j ); + mem_chk( k ); + } + break; + case 11: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + Chain* j = root[8]; + Chain* k = root[9]; + Chain* l = root[10]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + j = j->next; + k = k->next; + l = l->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + mem_chk( j ); + mem_chk( k ); + mem_chk( l ); + } + break; + case 12: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + Chain* j = root[8]; + Chain* k = root[9]; + Chain* l = root[10]; + Chain* m = root[11]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + j = j->next; + k = k->next; + l = l->next; + m = m->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + mem_chk( j ); + mem_chk( k ); + mem_chk( l ); + mem_chk( m ); + } + break; + case 13: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + Chain* j = root[8]; + Chain* k = root[9]; + Chain* l = root[10]; + Chain* m = root[11]; + Chain* n = root[12]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + j = j->next; + k = k->next; + l = l->next; + m = m->next; + n = n->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + mem_chk( j ); + mem_chk( k ); + mem_chk( l ); + mem_chk( m ); + mem_chk( n ); + } + break; + case 14: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + Chain* j = root[8]; + Chain* k = root[9]; + Chain* l = root[10]; + Chain* m = root[11]; + Chain* n = root[12]; + Chain* o = root[13]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + j = j->next; + k = k->next; + l = l->next; + m = m->next; + n = n->next; + o = o->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + mem_chk( j ); + mem_chk( k ); + mem_chk( l ); + mem_chk( m ); + mem_chk( n ); + mem_chk( o ); + } + break; + case 15: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + Chain* j = root[8]; + Chain* k = root[9]; + Chain* l = root[10]; + Chain* m = root[11]; + Chain* n = root[12]; + Chain* o = root[13]; + Chain* p = root[14]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + j = j->next; + k = k->next; + l = l->next; + m = m->next; + n = n->next; + o = o->next; + p = p->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + mem_chk( j ); + mem_chk( k ); + mem_chk( l ); + mem_chk( m ); + mem_chk( n ); + mem_chk( o ); + mem_chk( p ); + } + break; + case 16: + for (int i=0; i < iterations; i++) { + Chain* a = root[0]; + Chain* b = root[1]; + Chain* c = root[2]; + Chain* d = root[3]; + Chain* e = root[4]; + Chain* f = root[5]; + Chain* g = root[6]; + Chain* h = root[7]; + Chain* j = root[8]; + Chain* k = root[9]; + Chain* l = root[10]; + Chain* m = root[11]; + Chain* n = root[12]; + Chain* o = root[13]; + Chain* p = root[14]; + Chain* q = root[15]; + while (a != NULL) { + a = a->next; + b = b->next; + c = c->next; + d = d->next; + e = e->next; + f = f->next; + g = g->next; + h = h->next; + j = j->next; + k = k->next; + l = l->next; + m = m->next; + n = n->next; + o = o->next; + p = p->next; + q = q->next; + } + mem_chk( a ); + mem_chk( b ); + mem_chk( c ); + mem_chk( d ); + mem_chk( e ); + mem_chk( f ); + mem_chk( g ); + mem_chk( h ); + mem_chk( j ); + mem_chk( k ); + mem_chk( l ); + mem_chk( m ); + mem_chk( n ); + mem_chk( o ); + mem_chk( p ); + mem_chk( q ); + } + } +} @@ -3,7 +3,6 @@ pgm=./pChase64_NUMA b=(8k 16k 24k 32k 48k 64k 96k 128k 192k 256k 384k 512k 768k 1m 1536k 2m 3m 4m 6m 8m 12m 16m ) -s=(2m 2m 1536k 1m 96k 64k 48k 32k 24k 16k 12k 8k 6k 1k 768 512 384 256 192 128 96 64 ) c=5 date @@ -20,11 +19,11 @@ do do for access in random "forward 1" do - for ((i=0; $i < ${#s[*]}; i++)) + for ((i=0; $i < ${#b[*]}; i++)) do for ((j=0; $j < $c; j++)) do - $pgm -p $page -t $threads -r $refs -n add $offset -a $access -c ${b[$i]} -i ${s[$i]} -o csv + $pgm -p $page -t $threads -r $refs -n add $offset -a $access -c ${b[$i]} -s 1.0 -o csv done done done diff --git a/pChase64_NUMA b/pChase64_NUMA Binary files differindex 7086a99..f42a29a 100755 --- a/pChase64_NUMA +++ b/pChase64_NUMA diff --git a/pChase64_SMP b/pChase64_SMP Binary files differindex d61d2d9..b6ee9a2 100755 --- a/pChase64_SMP +++ b/pChase64_SMP |