PROGRAM MATMUL_TIME C INTEGER I, J, K INTEGER SIZE, NTIMES, M, N, P PARAMETER (SIZE=1000) PARAMETER (M=SIZE,N=SIZE,P=SIZE) PARAMETER (NTIMES=1) REAL*8 A, B, C, AROW DIMENSION A(M,N), B(N,P), C(N,P), AROW(N) !HPF$ DISTRIBUTE (*,BLOCK) :: A, B !HPF$ ALIGN C(:,:) WITH B(:,:) C INTEGER L REAL WALLTIME, MFLOPS INTEGER HZ, CLOCK0, CLOCK1, CLOCK2 REAL ETIME REAL TARRAY(2), TIME0, TIME1, TIME2 C DO I = 1, M DO J = 1, N A(I,J) = 1.0 ENDDO ENDDO DO I = 1, N DO J = 1, P B(I,J) = 1.0 ENDDO ENDDO C TIME0 = ETIME(TARRAY) DO L = 1, NTIMES DO J = 1, P DO I = 1, M C(I,J) = 0.0 ENDDO ENDDO DO I = 1, M DO II = 1, N AROW(II) = A(I,II) ENDDO !HPF$ INDEPENDENT DO J = 1, P DO K = 1, N C(I,J) = C(I,J) + AROW(K) * B(K,J) ENDDO ENDDO ENDDO CALL DUMMY(C) ENDDO TIME1 = ETIME(TARRAY) DO I = 1, NTIMES CALL DUMMY(C) ENDDO TIME2 = ETIME(TARRAY) C WALLTIME = ((TIME1 - TIME0) - (TIME2 - TIME1)) / REAL(NTIMES) MFLOPS = (M*P*(2*N-1)) / (WALLTIME * 1.0E+06) PRINT *, WALLTIME, TIME0, TIME1, TIME2 C PRINT *, "M =",M,", N =",N,", P =",P PRINT *, "MFLOPS = ", MFLOPS PRINT *, "C(1,1) = ", C(1,1) C END C SUBROUTINE DUMMY(C) REAL*8 C RETURN END