38 parameter( nmax = 1000, its = 50000 )
42 DOUBLE PRECISION alpha, avg, t1, t2, tnosec, total
45 DOUBLE PRECISION x( nmax ), y( nmax )
60 total = dble(nmax) * dble(its) * 2.0
65 x( i ) = dble( 1 ) / dble( i )
66 y( i ) = dble( nmax-i ) / dble( nmax )
75 y( i ) = y( i ) + alpha*x( i )
81 WRITE( 6, 9999 )total, tnosec
82 IF( tnosec.GT.0.0 )
THEN
83 WRITE( 6, 9998 )(total/1.0d6)/tnosec
93 y( i ) = y( i ) + alpha*x( i )
102 WRITE( 6, 9997 )t2 - t1
103 avg = ( ( t2-t1 ) - tnosec ) * 1000.0d+00/dble( its )
105 $
WRITE( 6, 9996 )avg
110 IF(( avg.GT.0.0 ).AND.( tnosec.GT.0.0 ))
111 $
WRITE( 6, 9995 )(avg/1000) * total / tnosec
113 9999
FORMAT(
' Time for ', g10.3,
' DAXPY ops = ', g10.3,
' seconds' )
114 9998
FORMAT(
' DAXPY performance rate = ', g10.3,
' mflops ' )
115 9997
FORMAT(
' Including DSECND, time = ', g10.3,
' seconds' )
116 9996
FORMAT(
' Average time for DSECND = ', g10.3,
118 9995
FORMAT(
' Equivalent floating point ops = ', g10.3,
' ops' )
119 9994
FORMAT(
' *** Warning: Time for operations was less or equal',
120 $
' than zero => timing in TESTING might be dubious' )
123 SUBROUTINE mysub(N,X,Y)
125 DOUBLE PRECISION X(N), Y(N)