#include #include #define ROWSA 800 #define COLSA 800 #define ROWSB 800 #define COLSB 800 #define MAXROWS 800 #define MAXCOLS 800 void setMatrix(int a[MAXROWS][MAXCOLS], int rows, int cols) { int i, j; for (i=0; i starttimeSec) { totalSec = endtimeSec-starttimeSec; totalMicro = endtimeMicro + (1000000 - starttimeMicro); } else { totalSec = 0; totalMicro = endtimeMicro - starttimeMicro; } printf("Time = %d sec, %d microsec\n", totalSec, totalMicro); /* printMatrix(a, rowsA, colsA); printf("\n"); printMatrix(b, rowsB, colsB); printf("\n"); printMatrix(c, rowsC, colsC); */ return 0; } /* Cray: cc -h report=vf -o matStarter matStarter.c -O3 Transformer and Element: gcc -o matStarter matStarter.c ("O3" optimizes maximum, "-h report=vf" stores a report of optimization in filename.V) Transformer: ./matStarter Matrix A set, 800 rows, 800 cols Matrix B set, 800 rows, 800 cols Matrix C set, 800 rows, 800 cols Time = 0 sec, 77947 microsec Element: ./matStarter Matrix A set, 800 rows, 800 cols Matrix B set, 800 rows, 800 cols Matrix C set, 800 rows, 800 cols Time = 0 sec, 39469 microsec Cray: sn3313% matStarter Matrix A set, 800 rows, 800 cols Matrix B set, 800 rows, 800 cols Matrix C set, 800 rows, 800 cols Time = 0 sec, 434 microsec matStarter.V: (this is generated by "-h report=vf" in the compile line CC-6287 cc: VECTOR File = matStarter.c, Line = 15 A loop was not vectorized because it contains a call to function "rand" on line 18. CC-6287 cc: VECTOR File = matStarter.c, Line = 17 A loop was not vectorized because it contains a call to function "rand" on line 18. CC-6287 cc: VECTOR File = matStarter.c, Line = 27 A loop was not vectorized because it contains a call to function "printf" on line 30. CC-6287 cc: VECTOR File = matStarter.c, Line = 29 A loop was not vectorized because it contains a call to function "printf" on line 30. CC-6290 cc: VECTOR File = matStarter.c, Line = 43 A loop was not vectorized because a recurrence was found between "b" and "c" at line 47. CC-6207 cc: VECTOR File = matStarter.c, Line = 45 A loop was vectorized with a computed safe vector length. CC-6287 cc: VECTOR File = matStarter.c, Line = 15 A loop was not vectorized because it contains a call to function "rand" on line 18. CC-6287 cc: VECTOR File = matStarter.c, Line = 17 A loop was not vectorized because it contains a call to function "rand" on line 18. */