From e9285d0cdea756a2830f0ace378e4197b36869aa Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Fri, 12 Jun 2020 01:44:56 +0000 Subject: 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. --- dis/original/Update/update.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dis/original/Update') 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){ unsigned int hops; unsigned int l; - fscanf(stdin, "%u %u %u %d %u %u %u", - &f, &l, &maxhops, &seed, &initial, &minStop, &maxStop); + assert(fscanf(stdin, "%u %u %u %d %u %u %u", + &f, &l, &maxhops, &seed, &initial, &minStop, &maxStop) == 7); assert((f >= MIN_FIELD_SIZE) && (f <= MAX_FIELD_SIZE)); w = (unsigned int )l; @@ -92,7 +92,7 @@ int main(int argc, char** argv){ unsigned int max, min; unsigned int partition; unsigned int high; - START_LOOP + if (hops % 100 == 0) {START_LOOP} // These loops are too quick to sample individually max = MAX_FIELD_SIZE; min = 0; high = 0; @@ -125,7 +125,7 @@ int main(int argc, char** argv){ field[index] = sum % (f-w); index = (partition+hops)%(f-w); hops++; - STOP_LOOP + if (hops % 100 == 0) {STOP_LOOP} // These loops are too quick to sample individually }/* end for loop */ startTime = time(NULL) - startTime; -- cgit v1.2.2