diff options
| author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-06-11 21:44:56 -0400 |
|---|---|---|
| committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-06-11 21:44:56 -0400 |
| commit | e9285d0cdea756a2830f0ace378e4197b36869aa (patch) | |
| tree | c936ca400ec6593b24aadb75f961229f0b238e01 /dis/original/Update | |
| parent | 18b1585116344646e544d6e3a92f3690356026a9 (diff) | |
Add initial instrumentation to and fix warnings in DIS stressmarks
Changes:
- Backpoint fix to randInt range
- Instrument benchmarks with time tracking
- assert inputs are correct length to fix compiler warnings
Problems:
- Timing on a per-loop basis is non representative of real-world
workloads, as we clear the cache after every loop. These all need
to be re-instrumented to record times for the whole benchmark,
rather than per-loop.
Diffstat (limited to 'dis/original/Update')
| -rw-r--r-- | dis/original/Update/update.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dis/original/Update/update.c b/dis/original/Update/update.c index 92384cd..1fd8197 100644 --- a/dis/original/Update/update.c +++ b/dis/original/Update/update.c | |||
| @@ -55,8 +55,8 @@ int main(int argc, char** argv){ | |||
| 55 | unsigned int hops; | 55 | unsigned int hops; |
| 56 | unsigned int l; | 56 | unsigned int l; |
| 57 | 57 | ||
| 58 | fscanf(stdin, "%u %u %u %d %u %u %u", | 58 | assert(fscanf(stdin, "%u %u %u %d %u %u %u", |
| 59 | &f, &l, &maxhops, &seed, &initial, &minStop, &maxStop); | 59 | &f, &l, &maxhops, &seed, &initial, &minStop, &maxStop) == 7); |
| 60 | 60 | ||
| 61 | assert((f >= MIN_FIELD_SIZE) && (f <= MAX_FIELD_SIZE)); | 61 | assert((f >= MIN_FIELD_SIZE) && (f <= MAX_FIELD_SIZE)); |
| 62 | w = (unsigned int )l; | 62 | w = (unsigned int )l; |
| @@ -92,7 +92,7 @@ int main(int argc, char** argv){ | |||
| 92 | unsigned int max, min; | 92 | unsigned int max, min; |
| 93 | unsigned int partition; | 93 | unsigned int partition; |
| 94 | unsigned int high; | 94 | unsigned int high; |
| 95 | START_LOOP | 95 | if (hops % 100 == 0) {START_LOOP} // These loops are too quick to sample individually |
| 96 | max = MAX_FIELD_SIZE; | 96 | max = MAX_FIELD_SIZE; |
| 97 | min = 0; | 97 | min = 0; |
| 98 | high = 0; | 98 | high = 0; |
| @@ -125,7 +125,7 @@ int main(int argc, char** argv){ | |||
| 125 | field[index] = sum % (f-w); | 125 | field[index] = sum % (f-w); |
| 126 | index = (partition+hops)%(f-w); | 126 | index = (partition+hops)%(f-w); |
| 127 | hops++; | 127 | hops++; |
| 128 | STOP_LOOP | 128 | if (hops % 100 == 0) {STOP_LOOP} // These loops are too quick to sample individually |
| 129 | }/* end for loop */ | 129 | }/* end for loop */ |
| 130 | 130 | ||
| 131 | startTime = time(NULL) - startTime; | 131 | startTime = time(NULL) - startTime; |
