diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2020-05-29 12:44:28 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2020-05-29 12:44:28 -0400 |
| commit | 8dfefc152f16f9fd9e8aa0910fd4d23d6543d87e (patch) | |
| tree | 4e5c596dadf1df4fb77c9a10b3e483939c6aa018 /dis/original/Pointer/pointer.c | |
| parent | 43ce989b5077913f18a5b083501498f5e1a6d349 (diff) | |
Add DIS benchmarks and scripts as they were used for Joshua's PRP
Note that Neighborhood has been modified to use less space
Diffstat (limited to 'dis/original/Pointer/pointer.c')
| -rw-r--r-- | dis/original/Pointer/pointer.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dis/original/Pointer/pointer.c b/dis/original/Pointer/pointer.c index 0c4966f..a0aa62e 100644 --- a/dis/original/Pointer/pointer.c +++ b/dis/original/Pointer/pointer.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <assert.h> | 17 | #include <assert.h> |
| 18 | #include <stdlib.h> | 18 | #include <stdlib.h> |
| 19 | #include "DISstressmarkRNG.h" | 19 | #include "DISstressmarkRNG.h" |
| 20 | #include "extra.h" | ||
| 20 | 21 | ||
| 21 | #define MIN_FIELD_SIZE 16 | 22 | #define MIN_FIELD_SIZE 16 |
| 22 | #define MAX_FIELD_SIZE 16777216 | 23 | #define MAX_FIELD_SIZE 16777216 |
| @@ -34,7 +35,7 @@ | |||
| 34 | /* | 35 | /* |
| 35 | * main() | 36 | * main() |
| 36 | */ | 37 | */ |
| 37 | int main(){ | 38 | int main(int argc, char** argv){ |
| 38 | 39 | ||
| 39 | unsigned int *field; | 40 | unsigned int *field; |
| 40 | unsigned int f; | 41 | unsigned int f; |
| @@ -53,6 +54,7 @@ int main(){ | |||
| 53 | }*thread; | 54 | }*thread; |
| 54 | 55 | ||
| 55 | unsigned int l; | 56 | unsigned int l; |
| 57 | SET_UP | ||
| 56 | 58 | ||
| 57 | fscanf(stdin, "%lu %u %lu %ld %u", | 59 | fscanf(stdin, "%lu %u %lu %ld %u", |
| 58 | &f, &l, &maxhops, &seed, &n); | 60 | &f, &l, &maxhops, &seed, &n); |
| @@ -84,12 +86,12 @@ int main(){ | |||
| 84 | for (l=0; l<f; l++){ | 86 | for (l=0; l<f; l++){ |
| 85 | field[l] = randInt(0, f-w); | 87 | field[l] = randInt(0, f-w); |
| 86 | } | 88 | } |
| 87 | |||
| 88 | startTime = time(NULL); | 89 | startTime = time(NULL); |
| 89 | clock(); | 90 | clock(); |
| 90 | 91 | ||
| 91 | for (l=0; l<n; l++) | 92 | for (l=0; l<n; l++) |
| 92 | { | 93 | { |
| 94 | START_LOOP | ||
| 93 | unsigned int index; | 95 | unsigned int index; |
| 94 | unsigned int minStop, maxStop; | 96 | unsigned int minStop, maxStop; |
| 95 | unsigned int hops; | 97 | unsigned int hops; |
| @@ -140,6 +142,7 @@ for (l=0; l<n; l++) | |||
| 140 | hops++; | 142 | hops++; |
| 141 | }/* end loop ll */ | 143 | }/* end loop ll */ |
| 142 | thread[l].hops = hops; | 144 | thread[l].hops = hops; |
| 145 | STOP_LOOP | ||
| 143 | } /* end while */ | 146 | } /* end while */ |
| 144 | 147 | ||
| 145 | startTime = time(NULL) - startTime; | 148 | startTime = time(NULL) - startTime; |
| @@ -151,5 +154,6 @@ for (l=0; l<n; l++) | |||
| 151 | fprintf(stderr, "total time = %u seconds.\n", (unsigned int)startTime); | 154 | fprintf(stderr, "total time = %u seconds.\n", (unsigned int)startTime); |
| 152 | free (field); | 155 | free (field); |
| 153 | free (thread); | 156 | free (thread); |
| 157 | WRITE_TO_FILE | ||
| 154 | 158 | ||
| 155 | } | 159 | } |
