questions on gfortran

Tim Prince tprince@myrealbox.com
Fri May 11 14:07:00 GMT 2007


Luca Trevisani wrote:
>
> PROGRAM PROVA
>  IMPLICIT NONE
>  INTEGER, PARAMETER :: WP = KIND(1.0D0)
>  INTEGER, PARAMETER :: NX=10000, NY=10000
>  INTEGER :: I, J
>  REAL(WP) :: A(NX,NY), X(NX), Y(NY)
>  REAL(WP) :: T1, T2
>  CALL CPU_TIME(T1)
>  DO I=1,NX
>     X(I)=2.0_WP/REAL((NX+1)*I-1,WP)
>  END DO
>  DO I=1,NY
>     Y(I)=2.0_WP/REAL((NY+1)*I-1,WP)
>  END DO
>  DO J=1,NY
>     DO I=1,NX
>        A(I,J)=SIN(1.0_WP+REAL(I+J,WP))
>     END DO
>  END DO
>  CALL CPU_TIME(T2)
>  PRINT *, 'Execution time:', T2-T1
> END PROGRAM PROVA
>
>
> In conclusion, now it seems to me that actually all flags other than 
> -O2 are
> almost uninfluential on the execution speed, both under win32 and under
> linux...
>
You're talking about execution speed of sin(), but I doubt you 
recompiled the sin() function or used a vectorized library.



More information about the Fortran mailing list