Date: Fri, 21 Nov 2008 20:15:10 -0700 (MST)
From: Julien Langou
To: lapackers@cs.berkeley.edu, lapackers@cs.ukt.edu
Subject: [Lapack] "*** Error: Time for operations was zero" while building 'lapack-3.2' (fwd)
Hello lapackers,
Good resolution after release: "fix problems as soon as they occur".
I need help with experience LAPACKers. Does anyone know why at the end of
TESTSECOND we call a blank routine that does nothing? It's too obvious to be a
simple coding mistake, so there is probably a reason for the piece of code to
be there. I do not see the reason.
In respect with Sergei Steshenko's email, here is what I propose.
(1) once more increase ten fold the initial timing routine in LAPACK. I propose
to perform 5,000 AXPY of vectors of size 1,000 (as opposed to vectors of size
100).
(2) with respect to Sergei Steshenko's problem, I have no idea why AVG is
negative in his case (that makes no sense) but it is and we might want to
protect us against this. I.e. check this before we print some result. If AVG is
negative then I skip the WRITE and do not issue an error message. (In this
case, we can not time the timer. Not a big deal.)
(3) I have rewritten the error message. Instead of writing:
*** Error: Time for operations was zero'
we write:
*** Warning: Time for operations was less or equal than zero =>
timing in TESTING might be dubious
(4) HELP !!! Is there a reason for the code to call MYSUB at the end !!! I
do not see what the trick is. The code ends with
CALL MYSUB ( NMAX, X, Y )
where MYSUB is:
SUBROUTINE MYSUB(N,X,Y)
INTEGER N
REAL X(N), Y(N)
RETURN
END
????
So since I did not understand, I removed these lines in my working
copy.
Best wishes,
Below is the diff of the proposed working copy and the 3.2 version.
Attached is the code.
Julien
Index: secondtst.f
===================================================================
--- secondtst.f (revision 602)
+++ secondtst.f (working copy)
@@ -6,7 +6,7 @@
*
* .. Parameters ..
INTEGER NMAX, ITS
- PARAMETER ( NMAX = 100, ITS = 5000 )
+ PARAMETER ( NMAX = 1000, ITS = 5000 )
* ..
* .. Local Scalars ..
INTEGER I, J
@@ -33,7 +33,7 @@
10 CONTINUE
ALPHA = 0.315
*
-* Time 1,000,000 SAXPY operations
+* Time 10,000,000 SAXPY operations
*
T1 = SECOND( )
DO 30 J = 1, ITS
@@ -45,7 +45,7 @@
T2 = SECOND( )
WRITE( 6, 9999 )T2 - T1
IF( T2-T1.GT.0.0 ) THEN
- WRITE( 6, 9998 )1.0 / ( T2-T1 )
+ WRITE( 6, 9998 )10.0E+00 / ( T2-T1 )
ELSE
WRITE( 6, 9994 )
END IF
@@ -66,26 +66,22 @@
* to SECOND.
*
WRITE( 6, 9997 )T2 - T1
- AVG = ( ( T2-T1 ) - TNOSEC ) * 1000./REAL( ITS )
- WRITE( 6, 9996 )AVG
+ AVG = ( ( T2-T1 ) - TNOSEC ) * 1000.0E+00 / REAL( ITS )
+ IF( AVG.GT.0.0 )
+ $ WRITE( 6, 9996 )AVG
*
* Compute the equivalent number of floating point operations used
* by an average call to SECOND.
*
- IF( TNOSEC.GT.0.0 )
+ IF(( AVG.GT.0.0 ).AND.( TNOSEC.GT.0.0 ))
$ WRITE( 6, 9995 )1000.*AVG / TNOSEC
*
- 9999 FORMAT( ' Time for 1,000,000 SAXPY ops = ', G10.3, ' seconds' )
- 9998 FORMAT( ' SAXPY performance rate = ', G10.3, ' mflops ' )
- 9997 FORMAT( ' Including SECOND, time = ', G10.3, ' seconds' )
- 9996 FORMAT( ' Average time for SECOND = ', G10.3,
+ 9999 FORMAT( ' Time for 10,000,000 SAXPY ops = ', G10.3, ' seconds' )
+ 9998 FORMAT( ' SAXPY performance rate = ', G10.3, ' mflops ' )
+ 9997 FORMAT( ' Including SECOND, time = ', G10.3, ' seconds' )
+ 9996 FORMAT( ' Average time for SECOND = ', G10.3,
$ ' milliseconds' )
- 9995 FORMAT( ' Equivalent floating point ops = ', G10.3, ' ops' )
- 9994 FORMAT( ' *** Error: Time for operations was zero' )
- CALL MYSUB(NMAX,X,Y)
+ 9995 FORMAT( ' Equivalent floating point ops = ', G10.3, ' ops' )
+ 9994 FORMAT( ' *** Warning: Time for operations was less or equal',
+ $ ' than zero => timing in TESTING might be dubious' )
END
- SUBROUTINE MYSUB(N,X,Y)
- INTEGER N
- REAL X(N), Y(N)
- RETURN
- END
---------- Forwarded message ----------
Date: Thu, 20 Nov 2008 14:20:30 -0700
From: Sergei Steshenko
To: "lapack@cs.utk.edu"
Subject: [Lapack] "*** Error: Time for operations was zero" while building 'lapack-3.2'
Hello,
while building 'lapack-3.2' I've noticed
"*** Error: Time for operations was zero"
in the following piece of screen output:
"
make[1]: Leaving directory
`/mnt/sdb8/sergei/AFSWD_debug/build/lapack-3.2/INSTALL'
ASCII character set
Tests completed
Epsilon = 5.96046448E-08
Safe minimum = 1.17549435E-38
Base = 2.0000000
Precision = 1.19209290E-07
Number of digits in mantissa = 24.000000
Rounding mode = 1.00000000
Minimum exponent = -125.00000
Underflow threshold = 1.17549435E-38
Largest exponent = 128.00000
Overflow threshold = 3.40282347E+38
Reciprocal of safe minimum = 8.50705917E+37
Epsilon = 1.11022302462515654E-016
Safe minimum = 2.22507385850720138E-308
Base = 2.0000000000000000
Precision = 2.22044604925031308E-016
Number of digits in mantissa = 53.000000000000000
Rounding mode = 1.00000000000000000
Minimum exponent = -1021.0000000000000
Underflow threshold = 2.22507385850720138E-308
Largest exponent = 1024.0000000000000
Overflow threshold = 1.79769313486231571E+308
Reciprocal of safe minimum = 4.49423283715578977E+307
Time for 1,000,000 SAXPY ops = 0.400E-02 seconds
SAXPY performance rate = 250. mflops
Including SECOND, time = 0.00 seconds
Average time for SECOND = -0.800E-03 milliseconds
Equivalent floating point ops = -200. ops
Time for 1,000,000 DAXPY ops = 0.00 seconds
*** Error: Time for operations was zero
Including DSECND, time = 0.00 seconds
Average time for DSECND = 0.00 milliseconds
LAPACK 3 . 2 . 0
( cd SRC; make )
".
Are these lines:
"
Equivalent floating point ops = -200. ops
Time for 1,000,000 DAXPY ops = 0.00 seconds
*** Error: Time for operations was zero
Including DSECND, time = 0.00 seconds
Average time for DSECND = 0.00 milliseconds
LAPACK 3 . 2 . 0
"
an indication of trouble ? In addition to 0 times I'm concerned regarding
"-200" in "Equivalent floating point ops = -200. ops" - I'm not
sure negative number makes sense here.
Thanks,
Sergei.