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/Matrix | |
| 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/Matrix')
| -rwxr-xr-x | dis/original/Matrix/ver2/matrix.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/dis/original/Matrix/ver2/matrix.c b/dis/original/Matrix/ver2/matrix.c index 56245a6..957d7c5 100755 --- a/dis/original/Matrix/ver2/matrix.c +++ b/dis/original/Matrix/ver2/matrix.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | #include <time.h> | 41 | #include <time.h> |
| 42 | #include <assert.h> | 42 | #include <assert.h> |
| 43 | #include "DISstressmarkRNG.h" | 43 | #include "DISstressmarkRNG.h" |
| 44 | #include "extra.h" | ||
| 44 | 45 | ||
| 45 | #define MIN_SEED -2147483647 | 46 | #define MIN_SEED -2147483647 |
| 46 | #define MAX_SEED -1 | 47 | #define MAX_SEED -1 |
| @@ -60,6 +61,8 @@ | |||
| 60 | */ | 61 | */ |
| 61 | 62 | ||
| 62 | static int dim; | 63 | static int dim; |
| 64 | int argc; | ||
| 65 | char** argv; | ||
| 63 | 66 | ||
| 64 | /* | 67 | /* |
| 65 | * matrix * vector | 68 | * matrix * vector |
| @@ -329,6 +332,7 @@ void biConjugateGradient(double *value, | |||
| 329 | int i; | 332 | int i; |
| 330 | int l; | 333 | int l; |
| 331 | int ll; | 334 | int ll; |
| 335 | SET_UP | ||
| 332 | 336 | ||
| 333 | alpha = 0; | 337 | alpha = 0; |
| 334 | beta = 0; | 338 | beta = 0; |
| @@ -365,6 +369,7 @@ void biConjugateGradient(double *value, | |||
| 365 | iteration = 0; | 369 | iteration = 0; |
| 366 | 370 | ||
| 367 | while ((iteration < maxIterations) && (error > errorTolerance)){ | 371 | while ((iteration < maxIterations) && (error > errorTolerance)){ |
| 372 | START_LOOP | ||
| 368 | 373 | ||
| 369 | /* | 374 | /* |
| 370 | * alpha = (transpose(vectorR) * vectorR) / | 375 | * alpha = (transpose(vectorR) * vectorR) / |
| @@ -429,6 +434,7 @@ void biConjugateGradient(double *value, | |||
| 429 | error = vectorValue(tmpVector1)/vectorValue(vectorB); | 434 | error = vectorValue(tmpVector1)/vectorValue(vectorB); |
| 430 | 435 | ||
| 431 | iteration++; | 436 | iteration++; |
| 437 | STOP_LOOP | ||
| 432 | } | 438 | } |
| 433 | 439 | ||
| 434 | *actualError = error; | 440 | *actualError = error; |
| @@ -440,6 +446,7 @@ void biConjugateGradient(double *value, | |||
| 440 | 446 | ||
| 441 | free(vectorR); | 447 | free(vectorR); |
| 442 | free(vectorP); | 448 | free(vectorP); |
| 449 | WRITE_TO_FILE | ||
| 443 | 450 | ||
| 444 | return; | 451 | return; |
| 445 | } | 452 | } |
| @@ -508,9 +515,10 @@ void create_CRS(double *matrixA, | |||
| 508 | } | 515 | } |
| 509 | 516 | ||
| 510 | 517 | ||
| 511 | 518 | int main(int _argc, char** _argv) | |
| 512 | int main() | ||
| 513 | { | 519 | { |
| 520 | argc = _argc; | ||
| 521 | argv = _argv; | ||
| 514 | int seed; | 522 | int seed; |
| 515 | int numberNonzero; | 523 | int numberNonzero; |
| 516 | int maxIterations; | 524 | int maxIterations; |
