From a3886552003d031acb9039e920b7c9ddce946ad6 Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Sat, 17 Oct 2020 14:43:46 -0400 Subject: DIS fixes used for (rejected) RTSS'20 submission - All: Output times to stderr and nothing to stdout - Field, Update, Pointer: change definition of a job to match other stressmark execution times more closely - Matrix: move all allocations into main() - Update: Use volatile to prevent computations from being optimized out - Transitive: Use volatile to prevent computations from being optimized out - Neighborhood: Use working version of drawLineSegment from original DIS sample code --- dis/Update/update.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'dis/Update/update.c') diff --git a/dis/Update/update.c b/dis/Update/update.c index 1fd8197..f5e770a 100644 --- a/dis/Update/update.c +++ b/dis/Update/update.c @@ -48,7 +48,7 @@ int main(int argc, char** argv){ unsigned short int w; unsigned int maxhops; int seed; - time_t startTime; + time_t startTime, endTime; unsigned int initial; unsigned int minStop; unsigned int maxStop; @@ -83,6 +83,7 @@ int main(int argc, char** argv){ hops = 0; index = initial; + START_LOOP while ((hops < maxhops) && (!((index >= minStop) && (index < maxStop)))){ @@ -92,7 +93,6 @@ int main(int argc, char** argv){ unsigned int max, min; unsigned int partition; unsigned int high; - if (hops % 100 == 0) {START_LOOP} // These loops are too quick to sample individually max = MAX_FIELD_SIZE; min = 0; high = 0; @@ -125,13 +125,15 @@ int main(int argc, char** argv){ field[index] = sum % (f-w); index = (partition+hops)%(f-w); hops++; - if (hops % 100 == 0) {STOP_LOOP} // These loops are too quick to sample individually }/* end for loop */ + STOP_LOOP - startTime = time(NULL) - startTime; + endTime = time(NULL); - fprintf(stdout, "%u hops\n", hops); - fprintf(stderr, "total time = %u seconds.\n", (unsigned int)startTime); + volatile int _stop_optimizer = hops; + //fprintf(stdout, "%u hops\n", hops); + fprintf(stderr, "time for update stressmark = %f seconds.\n", + difftime(endTime, startTime)); free(field); WRITE_TO_FILE return(1); -- cgit v1.2.2