May 9 2025 9:47:07.994 PM timer_omp_get_wtime(): FORTRAN90 version. Test omp_get_wtime(). omp_get_wtime ( ) is an OpenMP function. It returns elapsed wall clock time in seconds. Number of processors is 8 Number of threads requested = 8 TEST01 Time the FORTRAN90 RANDOM_NUMBER routine: call random_number ( x(1:n) ) Data vectors will be of minimum size 1 Data vectors will be of maximum size 262144 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 Min Ave Max 1 0.000004 0.000000 0.000000 0.000000 0.000000 0.000000 0.000001 0.000004 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 4 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 8 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 16 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 32 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 64 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 128 0.000001 0.000001 0.000000 0.000001 0.000001 0.000000 0.000001 0.000001 256 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 0.000001 512 0.000003 0.000002 0.000002 0.000002 0.000002 0.000002 0.000002 0.000003 1024 0.000005 0.000004 0.000004 0.000004 0.000004 0.000004 0.000004 0.000005 2048 0.000010 0.000008 0.000009 0.000008 0.000008 0.000008 0.000009 0.000010 4096 0.000020 0.000017 0.000017 0.000017 0.000017 0.000017 0.000017 0.000020 8192 0.000043 0.000034 0.000034 0.000033 0.000034 0.000033 0.000035 0.000043 16384 0.000127 0.000068 0.000067 0.000068 0.000068 0.000067 0.000079 0.000127 32768 0.000169 0.000136 0.000135 0.000136 0.000179 0.000135 0.000151 0.000179 65536 0.000335 0.000270 0.000270 0.000312 0.000267 0.000267 0.000291 0.000335 131072 0.000712 0.000538 0.000581 0.000539 0.000582 0.000538 0.000590 0.000712 262144 0.001376 0.001145 0.001137 0.001146 0.001123 0.001123 0.001185 0.001376 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 262144 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000010 0.000002 0.000002 0.000002 0.000002 8192 0.000013 0.000004 0.000004 0.000004 0.000004 16384 0.000026 0.000009 0.000009 0.000009 0.000009 32768 0.000051 0.000018 0.000018 0.000018 0.000018 65536 0.000102 0.000036 0.000035 0.000035 0.000035 131072 0.000246 0.000074 0.000072 0.000072 0.000071 262144 0.000413 0.000204 0.000157 0.000155 0.000151 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000003 0.000002 0.000002 0.000002 0.000002 8192 0.000005 0.000005 0.000005 0.000005 0.000005 16384 0.000013 0.000010 0.000010 0.000010 0.000010 32768 0.000026 0.000020 0.000020 0.000020 0.000020 65536 0.000041 0.000040 0.000039 0.000040 0.000040 131072 0.000083 0.000080 0.000080 0.000080 0.000079 262144 0.000178 0.000171 0.000167 0.000165 0.000165 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000006 0.000006 0.000006 0.000006 0.000006 8192 0.000013 0.000013 0.000013 0.000013 0.000013 16384 0.000025 0.000025 0.000025 0.000025 0.000025 32768 0.000051 0.000051 0.000051 0.000051 0.000051 65536 0.000101 0.000101 0.000101 0.000101 0.000101 131072 0.000202 0.000204 0.000204 0.000202 0.000202 262144 0.000406 0.000406 0.000406 0.000443 0.000408 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000034 0.000022 0.000022 0.000022 0.000022 8192 0.000044 0.000043 0.000044 0.000044 0.000044 16384 0.000089 0.000086 0.000089 0.000086 0.000089 32768 0.000170 0.000171 0.000171 0.000172 0.000178 65536 0.000342 0.000355 0.000356 0.000351 0.000348 131072 0.000710 0.000712 0.000712 0.000712 0.000712 262144 0.001424 0.001427 0.001425 0.001423 0.001423 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 262144 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000008 0.000008 0.000008 0.000008 0.000008 8192 0.000017 0.000017 0.000017 0.000017 0.000017 16384 0.000035 0.000034 0.000033 0.000033 0.000033 32768 0.000067 0.000067 0.000067 0.000067 0.000067 65536 0.000133 0.000133 0.000133 0.000133 0.000134 131072 0.000267 0.000267 0.000266 0.000266 0.000269 262144 0.000533 0.000537 0.000538 0.000536 0.000534 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000009 0.000009 0.000009 0.000009 0.000009 8192 0.000017 0.000017 0.000017 0.000017 0.000017 16384 0.000035 0.000035 0.000034 0.000034 0.000034 32768 0.000069 0.000069 0.000069 0.000068 0.000068 65536 0.000137 0.000137 0.000138 0.000139 0.000137 131072 0.000275 0.000293 0.000274 0.000314 0.000275 262144 0.000549 0.000590 0.000590 0.000553 0.000550 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000007 0.000007 0.000007 0.000007 0.000007 8192 0.000015 0.000015 0.000014 0.000015 0.000015 16384 0.000029 0.000029 0.000029 0.000029 0.000029 32768 0.000058 0.000058 0.000058 0.000058 0.000058 65536 0.000118 0.000117 0.000117 0.000117 0.000117 131072 0.000236 0.000234 0.000233 0.000234 0.000235 262144 0.000473 0.000477 0.000471 0.000472 0.000474 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000028 0.000028 0.000027 0.000027 0.000027 8192 0.000055 0.000071 0.000053 0.000053 0.000053 16384 0.000109 0.000109 0.000107 0.000120 0.000107 32768 0.000219 0.000214 0.000214 0.000214 0.000214 65536 0.000438 0.000430 0.000428 0.000430 0.000439 131072 0.000877 0.000858 0.000857 0.000858 0.000878 262144 0.001757 0.001719 0.001721 0.001718 0.001774 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 262144 Number of repetitions of the operation: 5 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 1024 0.000004 0.000003 0.000003 0.000003 0.000003 2048 0.000006 0.000006 0.000006 0.000006 0.000006 4096 0.000013 0.000013 0.000013 0.000013 0.000013 8192 0.000025 0.000025 0.000027 0.000025 0.000025 16384 0.000051 0.000051 0.000051 0.000051 0.000051 32768 0.000102 0.000102 0.000101 0.000101 0.000101 65536 0.000204 0.000203 0.000203 0.000204 0.000202 131072 0.000451 0.000447 0.000408 0.000407 0.000409 262144 0.000876 0.000820 0.000819 0.000818 0.000814 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.000001 0.000000 0.000001 0.000000 0.000000 16 0.000016 0.000016 0.000016 0.000016 0.000016 64 0.000988 0.001015 0.001015 0.001014 0.001047 256 0.102566 0.101886 0.101388 0.101269 0.101186 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.000011 0.000002 0.000002 0.000003 0.000003 16 0.000001 0.000001 0.000003 0.000003 0.000003 64 0.000062 0.000033 0.000072 0.000095 0.000075 256 0.001675 0.001685 0.001724 0.001688 0.001672 1024 0.099398 0.089559 0.088667 0.088958 0.095371 TIMER_OMP_GET_WTIME(): Normal end of execution. May 9 2025 9:47:09.219 PM