March 6 2008 12:15:20.374 PM TIMER_SYSTEM_CLOCK FORTRAN90 version. Demonstrate the use of the SYSTEM_CLOCK timer. SYSTEM_CLOCK is a FORTRAN90 built in routine. call system_clock ( count, rate, max ) which is a real time clock (NOT a CPU time clock!). The accuracy of the timings is determined by the integer ( kind = 4 ) type of the arguments. SYSTEM_CLOCK with INTEGER arguments reports: The current clock count is 85393848 The clock count per second is 1000 The maximum clock count is 2147483647 The minimum measurable time in seconds: 0.100000E-02 The maximum measurable time: Seconds: 0.214748E+07 = Minutes: 35791.4 = Hours: 596.523 = Days: 24.8551 Estimated time to call INTEGER SYSTEM_CLOCK = 0.00000 seconds TEST01 Time the FORTRAN90 RANDOM_NUMBER routine: call random_number ( x(1:n) ) Data vectors will be of minimum size 1024 Data vectors will be of maximum size 1048576 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 1024 0.000000 0.000000 0.000000 0.000000 0.000000 2048 0.000000 0.000000 0.000000 0.000000 0.000000 4096 0.000000 0.000000 0.001000 0.001000 0.000000 8192 0.001000 0.001000 0.000000 0.000000 0.001000 16384 0.001000 0.001000 0.002000 0.002000 0.001000 32768 0.003000 0.003000 0.002000 0.002000 0.003000 65536 0.006000 0.005000 0.005000 0.005000 0.005000 131072 0.011000 0.010000 0.010000 0.010000 0.010000 262144 0.022000 0.020000 0.021000 0.020000 0.020000 524288 0.044000 0.040000 0.041000 0.041000 0.040000 1048576 0.089000 0.081000 0.081000 0.081000 0.081000 TEST02 Time vectorized operations: y(1:n) = x(1:n) y(1:n) = PI * x(1:n) ) y(1:n) = sqrt ( x(1:n) ) y(1:n) = exp ( x(1:n) ) Data vectors will be of minimum size 4096 Data vectors will be of maximum size 4194304 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000000 0.000000 0.000000 0.000000 0.000000 8192 0.000000 0.000000 0.000000 0.000000 0.000000 16384 0.001000 0.000000 0.000000 0.000000 0.000000 32768 0.001000 0.001000 0.000000 0.001000 0.000000 65536 0.002000 0.000000 0.001000 0.000000 0.001000 131072 0.002000 0.001000 0.001000 0.002000 0.001000 262144 0.005000 0.003000 0.002000 0.002000 0.003000 524288 0.009000 0.005000 0.005000 0.005000 0.006000 1048576 0.020000 0.011000 0.011000 0.011000 0.010000 2097152 0.037000 0.022000 0.023000 0.022000 0.022000 4194304 0.073000 0.043000 0.043000 0.043000 0.043000 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000000 0.000000 0.001000 0.000000 0.001000 8192 0.000000 0.000000 0.000000 0.000000 0.000000 16384 0.000000 0.001000 0.000000 0.000000 0.000000 32768 0.000000 0.001000 0.001000 0.000000 0.001000 65536 0.001000 0.001000 0.001000 0.001000 0.001000 131072 0.002000 0.001000 0.003000 0.002000 0.003000 262144 0.005000 0.004000 0.004000 0.005000 0.003000 524288 0.010000 0.009000 0.010000 0.010000 0.010000 1048576 0.018000 0.020000 0.020000 0.019000 0.018000 2097152 0.039000 0.039000 0.038000 0.033000 0.039000 4194304 0.077000 0.074000 0.078000 0.079000 0.077000 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000000 0.000000 0.000000 0.000000 0.000000 8192 0.000000 0.000000 0.000000 0.000000 0.000000 16384 0.000000 0.001000 0.000000 0.000000 0.001000 32768 0.001000 0.001000 0.000000 0.001000 0.001000 65536 0.001000 0.001000 0.002000 0.001000 0.002000 131072 0.003000 0.003000 0.003000 0.004000 0.003000 262144 0.006000 0.006000 0.007000 0.006000 0.006000 524288 0.013000 0.013000 0.013000 0.013000 0.012000 1048576 0.026000 0.025000 0.026000 0.025000 0.026000 2097152 0.051000 0.051000 0.051000 0.051000 0.051000 4194304 0.102000 0.101000 0.102000 0.102000 0.102000 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.001000 0.000000 0.000000 0.000000 0.000000 8192 0.001000 0.000000 0.000000 0.000000 0.000000 16384 0.001000 0.001000 0.001000 0.001000 0.001000 32768 0.002000 0.002000 0.002000 0.002000 0.002000 65536 0.004000 0.004000 0.004000 0.004000 0.004000 131072 0.008000 0.009000 0.008000 0.008000 0.009000 262144 0.016000 0.017000 0.017000 0.017000 0.016000 524288 0.033000 0.034000 0.034000 0.034000 0.033000 1048576 0.068000 0.068000 0.068000 0.067000 0.067000 2097152 0.135000 0.135000 0.134000 0.134000 0.135000 4194304 0.270000 0.270000 0.268000 0.268000 0.268000 TEST03 Time the unvectorized loops: do i = 1, n y(i) = x(i) y(i) = PI * x(i) ) y(i) = sqrt ( x(i) ) y(i) = exp ( x(i) ) end do Data vectors will be of minimum size 4096 Data vectors will be of maximum size 4194304 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000000 0.000000 0.000000 0.001000 0.000000 8192 0.000000 0.000000 0.000000 0.000000 0.000000 16384 0.001000 0.000000 0.000000 0.000000 0.000000 32768 0.001000 0.001000 0.000000 0.001000 0.000000 65536 0.001000 0.001000 0.001000 0.000000 0.001000 131072 0.003000 0.001000 0.002000 0.001000 0.002000 262144 0.005000 0.004000 0.003000 0.004000 0.003000 524288 0.011000 0.007000 0.007000 0.007000 0.007000 1048576 0.021000 0.013000 0.014000 0.013000 0.014000 2097152 0.042000 0.027000 0.027000 0.027000 0.027000 4194304 0.084000 0.054000 0.054000 0.054000 0.055000 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000000 0.000000 0.000000 0.000000 0.000000 8192 0.001000 0.001000 0.000000 0.000000 0.000000 16384 0.000000 0.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.001000 0.000000 0.001000 65536 0.001000 0.001000 0.001000 0.000000 0.001000 131072 0.002000 0.002000 0.002000 0.001000 0.002000 262144 0.004000 0.004000 0.004000 0.004000 0.003000 524288 0.007000 0.007000 0.007000 0.008000 0.007000 1048576 0.015000 0.015000 0.015000 0.015000 0.015000 2097152 0.029000 0.029000 0.030000 0.030000 0.029000 4194304 0.059000 0.059000 0.059000 0.059000 0.060000 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.001000 0.000000 0.000000 0.000000 0.000000 8192 0.000000 0.000000 0.000000 0.000000 0.000000 16384 0.000000 0.001000 0.001000 0.001000 0.000000 32768 0.001000 0.001000 0.001000 0.001000 0.001000 65536 0.002000 0.002000 0.002000 0.002000 0.002000 131072 0.004000 0.004000 0.005000 0.005000 0.004000 262144 0.009000 0.008000 0.008000 0.008000 0.008000 524288 0.017000 0.016000 0.017000 0.017000 0.016000 1048576 0.034000 0.033000 0.033000 0.033000 0.033000 2097152 0.066000 0.066000 0.066000 0.066000 0.067000 4194304 0.133000 0.133000 0.133000 0.133000 0.132000 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000000 0.001000 0.001000 0.000000 0.000000 8192 0.000000 0.001000 0.001000 0.000000 0.000000 16384 0.001000 0.001000 0.001000 0.001000 0.001000 32768 0.002000 0.002000 0.002000 0.003000 0.002000 65536 0.004000 0.005000 0.005000 0.004000 0.005000 131072 0.009000 0.009000 0.009000 0.009000 0.009000 262144 0.018000 0.018000 0.018000 0.018000 0.018000 524288 0.036000 0.036000 0.036000 0.036000 0.036000 1048576 0.072000 0.072000 0.072000 0.072000 0.072000 2097152 0.144000 0.144000 0.144000 0.144000 0.144000 4194304 0.288000 0.288000 0.289000 0.288000 0.288000 TEST04 Time the 2D nearest neighbor problem. Given X(2,N) and Y(2), find X(2,*) closest to Y(2). do i = 1, n if distance ( x(2,i), y ) < minimum so far x_min = x(2,i) end do Data vectors will be of minimum size 1024 Data vectors will be of maximum size 1048576 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 1024 0.000000 0.000000 0.000000 0.000000 0.000000 2048 0.000000 0.000000 0.000000 0.000000 0.000000 4096 0.000000 0.000000 0.000000 0.000000 0.000000 8192 0.000000 0.000000 0.001000 0.001000 0.001000 16384 0.001000 0.001000 0.000000 0.001000 0.001000 32768 0.002000 0.002000 0.002000 0.002000 0.001000 65536 0.003000 0.003000 0.004000 0.003000 0.004000 131072 0.007000 0.007000 0.007000 0.007000 0.007000 262144 0.014000 0.014000 0.014000 0.014000 0.014000 524288 0.029000 0.029000 0.028000 0.028000 0.028000 1048576 0.057000 0.056000 0.056000 0.056000 0.056000 TEST05 Time the matrix multiplication problem. Compute C = A * B where A is an L by M matrix, B is an M by N matrix, and so C is an L by N matrix. Minimum value of L = M = N = 4 Maximum value of L = M = N = 1024 Number of repetitions of the operation: 5 Use nested DO loops for matrix multiplication. Timing results using nested DO loops: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4 0.000000 0.000000 0.000000 0.000000 0.000000 16 0.000000 0.000000 0.000000 0.000000 0.000000 64 0.007000 0.008000 0.008000 0.008000 0.008000 256 0.702000 0.701000 0.701000 0.702000 0.702000 Use the MATMUL routine for matrix multiplication. Timing results using MATMUL: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4 0.000000 0.000000 0.000000 0.000000 0.000000 16 0.000000 0.000000 0.000000 0.000000 0.000000 64 0.000000 0.001000 0.001000 0.000000 0.001000 256 0.026000 0.025000 0.025000 0.026000 0.026000 1024 4.507000 4.502000 4.509000 4.505000 4.504000 TIMER_SYSTEM_CLOCK Normal end of execution. March 6 2008 12:16:25.714 PM