May 9 2025 9:47:09.344 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 type of the arguments. SYSTEM_CLOCK with INTEGER arguments reports: The current clock count is 254987058 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.000000 0.000000 0.000000 8192 0.000000 0.000000 0.000000 0.000000 0.000000 16384 0.000000 0.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.000000 0.000000 65536 0.000000 0.000000 0.000000 0.001000 0.000000 131072 0.001000 0.000000 0.000000 0.000000 0.001000 262144 0.000000 0.001000 0.001000 0.000000 0.000000 524288 0.002000 0.001000 0.000000 0.001000 0.001000 1048576 0.002000 0.002000 0.002000 0.002000 0.002000 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.000000 0.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.000000 0.000000 65536 0.001000 0.000000 0.000000 0.000000 0.000000 131072 0.000000 0.000000 0.000000 0.000000 0.000000 262144 0.000000 0.000000 0.000000 0.000000 0.000000 524288 0.001000 0.000000 0.001000 0.000000 0.000000 1048576 0.001000 0.001000 0.001000 0.000000 0.001000 2097152 0.002000 0.002000 0.001000 0.001000 0.001000 4194304 0.006000 0.002000 0.003000 0.003000 0.003000 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.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.000000 0.000000 65536 0.000000 0.000000 0.000000 0.000000 0.000000 131072 0.000000 0.000000 0.000000 0.000000 0.000000 262144 0.000000 0.000000 0.001000 0.000000 0.000000 524288 0.001000 0.000000 0.000000 0.000000 0.000000 1048576 0.001000 0.001000 0.000000 0.001000 0.001000 2097152 0.002000 0.002000 0.001000 0.002000 0.002000 4194304 0.003000 0.002000 0.003000 0.003000 0.003000 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.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.000000 0.000000 65536 0.000000 0.000000 0.000000 0.000000 0.000000 131072 0.000000 0.001000 0.000000 0.000000 0.000000 262144 0.000000 0.000000 0.000000 0.000000 0.000000 524288 0.000000 0.001000 0.000000 0.000000 0.001000 1048576 0.001000 0.001000 0.001000 0.001000 0.001000 2097152 0.001000 0.002000 0.002000 0.002000 0.002000 4194304 0.004000 0.004000 0.004000 0.004000 0.004000 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.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.000000 0.000000 65536 0.000000 0.000000 0.000000 0.000000 0.000000 131072 0.000000 0.000000 0.001000 0.001000 0.001000 262144 0.001000 0.001000 0.001000 0.001000 0.001000 524288 0.001000 0.002000 0.002000 0.002000 0.002000 1048576 0.004000 0.004000 0.004000 0.004000 0.004000 2097152 0.007000 0.008000 0.008000 0.008000 0.008000 4194304 0.016000 0.016000 0.015000 0.016000 0.015000 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.000000 0.000000 8192 0.000000 0.000000 0.000000 0.000000 0.000000 16384 0.000000 0.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.001000 0.000000 65536 0.000000 0.000000 0.001000 0.000000 0.000000 131072 0.001000 0.001000 0.000000 0.000000 0.001000 262144 0.001000 0.001000 0.001000 0.000000 0.001000 524288 0.002000 0.001000 0.001000 0.001000 0.001000 1048576 0.003000 0.002000 0.002000 0.003000 0.003000 2097152 0.006000 0.005000 0.005000 0.005000 0.005000 4194304 0.012000 0.010000 0.009000 0.010000 0.010000 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.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.000000 0.000000 65536 0.000000 0.001000 0.000000 0.001000 0.000000 131072 0.000000 0.000000 0.000000 0.000000 0.000000 262144 0.000000 0.000000 0.000000 0.001000 0.000000 524288 0.001000 0.001000 0.001000 0.001000 0.001000 1048576 0.002000 0.002000 0.003000 0.002000 0.003000 2097152 0.005000 0.005000 0.005000 0.005000 0.005000 4194304 0.010000 0.009000 0.010000 0.009000 0.010000 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.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.000000 0.000000 65536 0.000000 0.000000 0.000000 0.000000 0.000000 131072 0.000000 0.001000 0.000000 0.001000 0.000000 262144 0.000000 0.001000 0.001000 0.001000 0.000000 524288 0.001000 0.001000 0.001000 0.001000 0.001000 1048576 0.002000 0.002000 0.002000 0.002000 0.002000 2097152 0.004000 0.004000 0.004000 0.005000 0.004000 4194304 0.009000 0.009000 0.009000 0.008000 0.009000 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000000 0.001000 0.000000 0.000000 0.000000 8192 0.000000 0.000000 0.000000 0.000000 0.000000 16384 0.000000 0.000000 0.000000 0.000000 0.000000 32768 0.000000 0.000000 0.000000 0.001000 0.000000 65536 0.000000 0.000000 0.001000 0.000000 0.001000 131072 0.001000 0.000000 0.001000 0.001000 0.001000 262144 0.002000 0.001000 0.001000 0.002000 0.001000 524288 0.003000 0.002000 0.003000 0.002000 0.003000 1048576 0.005000 0.005000 0.005000 0.005000 0.005000 2097152 0.010000 0.011000 0.011000 0.011000 0.011000 4194304 0.021000 0.021000 0.021000 0.021000 0.021000 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.001000 0.000000 0.000000 0.000000 16384 0.000000 0.000000 0.000000 0.000000 0.001000 32768 0.000000 0.000000 0.000000 0.000000 0.000000 65536 0.001000 0.000000 0.000000 0.001000 0.000000 131072 0.000000 0.000000 0.001000 0.000000 0.000000 262144 0.001000 0.002000 0.001000 0.001000 0.001000 524288 0.002000 0.002000 0.002000 0.002000 0.003000 1048576 0.004000 0.004000 0.004000 0.004000 0.004000 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.001000 0.001000 0.001000 0.001000 0.001000 256 0.080000 0.082000 0.081000 0.080000 0.081000 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.000000 0.000000 0.000000 0.000000 256 0.001000 0.001000 0.001000 0.001000 0.001000 1024 0.051000 0.050000 0.051000 0.051000 0.050000 TIMER_SYSTEM_CLOCK Normal end of execution. May 9 2025 9:47:11.423 PM