diff options
Diffstat (limited to 'dis/Update')
| -rw-r--r-- | dis/Update/update.c | 14 |
1 files changed, 8 insertions, 6 deletions
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){ | |||
| 48 | unsigned short int w; | 48 | unsigned short int w; |
| 49 | unsigned int maxhops; | 49 | unsigned int maxhops; |
| 50 | int seed; | 50 | int seed; |
| 51 | time_t startTime; | 51 | time_t startTime, endTime; |
| 52 | unsigned int initial; | 52 | unsigned int initial; |
| 53 | unsigned int minStop; | 53 | unsigned int minStop; |
| 54 | unsigned int maxStop; | 54 | unsigned int maxStop; |
| @@ -83,6 +83,7 @@ int main(int argc, char** argv){ | |||
| 83 | hops = 0; | 83 | hops = 0; |
| 84 | index = initial; | 84 | index = initial; |
| 85 | 85 | ||
| 86 | START_LOOP | ||
| 86 | while ((hops < maxhops) && | 87 | while ((hops < maxhops) && |
| 87 | (!((index >= minStop) && | 88 | (!((index >= minStop) && |
| 88 | (index < maxStop)))){ | 89 | (index < maxStop)))){ |
| @@ -92,7 +93,6 @@ int main(int argc, char** argv){ | |||
| 92 | unsigned int max, min; | 93 | unsigned int max, min; |
| 93 | unsigned int partition; | 94 | unsigned int partition; |
| 94 | unsigned int high; | 95 | unsigned int high; |
| 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,13 +125,15 @@ 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 | if (hops % 100 == 0) {STOP_LOOP} // These loops are too quick to sample individually | ||
| 129 | }/* end for loop */ | 128 | }/* end for loop */ |
| 129 | STOP_LOOP | ||
| 130 | 130 | ||
| 131 | startTime = time(NULL) - startTime; | 131 | endTime = time(NULL); |
| 132 | 132 | ||
| 133 | fprintf(stdout, "%u hops\n", hops); | 133 | volatile int _stop_optimizer = hops; |
| 134 | fprintf(stderr, "total time = %u seconds.\n", (unsigned int)startTime); | 134 | //fprintf(stdout, "%u hops\n", hops); |
| 135 | fprintf(stderr, "time for update stressmark = %f seconds.\n", | ||
| 136 | difftime(endTime, startTime)); | ||
| 135 | free(field); | 137 | free(field); |
| 136 | WRITE_TO_FILE | 138 | WRITE_TO_FILE |
| 137 | return(1); | 139 | return(1); |
