#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("Matrix C set, %d rows, %d cols\n", rowsC, colsC); 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 matmult matmult.c -O3 CC-6287 cc: VECTOR File = matmult.c, Line = 15 A loop was not vectorized because it contains a call to function "rand" on line 18. CC-6287 cc: VECTOR File = matmult.c, Line = 17 A loop was not vectorized because it contains a call to function "rand" on line 18. CC-6287 cc: VECTOR File = matmult.c, Line = 27 A loop was not vectorized because it contains a call to function "printf" on line 30. CC-6287 cc: VECTOR File = matmult.c, Line = 29 A loop was not vectorized because it contains a call to function "printf" on line 30. CC-6294 cc: VECTOR File = matmult.c, Line = 43 A loop was not vectorized because a better candidate was found at line 45. CC-6204 cc: VECTOR File = matmult.c, Line = 45 A loop was vectorized. CC-6204 cc: VECTOR File = matmult.c, Line = 48 A loop was vectorized. CC-6287 cc: VECTOR File = matmult.c, Line = 15 A loop was not vectorized because it contains a call to function "rand" on line 18. CC-6287 cc: VECTOR File = matmult.c, Line = 17 A loop was not vectorized because it contains a call to function "rand" on line 18. sn3313% matmult Matrix A set, 500 rows, 500 cols Matrix B set, 500 rows, 500 cols Matrix C set, 500 rows, 500 cols Time = 0 sec, 48 microsec sn3313% Linux Transformer ./matmult Matrix A set, 500 rows, 500 cols Matrix B set, 500 rows, 500 cols Matrix C set, 500 rows, 500 cols Time = 12 sec, 857357 microsec Linux Element rlatimer@helium:~/MPI/Matrix$ ./matmult Matrix A set, 500 rows, 500 cols Matrix B set, 500 rows, 500 cols Matrix C set, 500 rows, 500 cols Time = 4 sec, 572827 microsec sn3313% matmult Matrix A set, 800 rows, 800 cols Matrix B set, 800 rows, 800 cols Matrix C set, 800 rows, 800 cols Time = 0 sec, 47 microsec Transformer ./matmult Matrix A set, 800 rows, 800 cols Matrix B set, 800 rows, 800 cols Matrix C set, 800 rows, 800 cols Time = 83 sec, 1854435 microsec Element ./matmult Matrix A set, 800 rows, 800 cols Matrix B set, 800 rows, 800 cols Matrix C set, 800 rows, 800 cols Time = 20 sec, 1578604 microsec */