20081218 121142.431 TIMER_ETIME FORTRAN77 version Demonstrate the use of the ETIME timer. ETIME is a routine built into most UNIX compilers. real etime real tarray(2) cpu = etime ( tarray ) returning elapsed CPU time in seconds. ETIME reports: The current CPU time is 0.324300E-02 TARRAY(1) = 0.849000E-03 TARRAY(2) = 0.239400E-02 TEST03 Time the following 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.000079 0.000052 0.000053 0.000058 0.000053 8192 0.000141 0.000099 0.000098 0.000101 0.000101 16384 0.000250 0.000218 0.000195 0.000195 0.000199 32768 0.000493 0.000391 0.000395 0.000375 0.000385 65536 0.001081 0.000789 0.000782 0.000785 0.000771 131072 0.002090 0.001660 0.001581 0.001628 0.001629 262144 0.004197 0.003209 0.003240 0.003137 0.003197 524288 0.008373 0.006463 0.006562 0.006459 0.006447 1048576 0.016915 0.013010 0.013153 0.012909 0.012915 2097152 0.033829 0.026050 0.025921 0.025976 0.026022 4194304 0.067668 0.051983 0.052193 0.053643 0.051690 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000057 0.000056 0.000057 0.000057 0.000057 8192 0.000106 0.000106 0.000106 0.000106 0.000107 16384 0.000208 0.000210 0.000210 0.000209 0.000217 32768 0.000415 0.000415 0.000414 0.000434 0.000417 65536 0.000854 0.000848 0.000878 0.000851 0.000885 131072 0.001742 0.001734 0.001729 0.001715 0.001743 262144 0.003434 0.003432 0.003458 0.003434 0.003514 524288 0.006923 0.006921 0.006892 0.006877 0.007043 1048576 0.014063 0.014046 0.014147 0.014061 0.014114 2097152 0.028030 0.027994 0.028069 0.028161 0.028547 4194304 0.056346 0.056106 0.056169 0.056196 0.056825 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000139 0.000126 0.000126 0.000127 0.000149 8192 0.000245 0.000255 0.000245 0.000247 0.000247 16384 0.000537 0.000504 0.000489 0.000489 0.000489 32768 0.000976 0.000976 0.000992 0.000985 0.000976 65536 0.002542 0.002034 0.001978 0.002014 0.001989 131072 0.004022 0.004044 0.004069 0.004167 0.003987 262144 0.008181 0.008203 0.008017 0.008184 0.007968 524288 0.016398 0.016319 0.016139 0.016387 0.016052 1048576 0.032243 0.032601 0.032365 0.032151 0.032280 2097152 0.064825 0.065103 0.064657 0.064503 0.064867 4194304 0.130709 0.129263 0.130669 0.129035 0.129284 Timing results: Vector Size Rep #1 Rep #2 Rep #3 Rep #4 Rep #5 4096 0.000352 0.000332 0.000332 0.000330 0.000340 8192 0.000673 0.000675 0.000661 0.000651 0.000651 16384 0.001294 0.001295 0.001293 0.001295 0.001295 32768 0.002587 0.002582 0.002597 0.002599 0.002583 65536 0.005204 0.005180 0.005396 0.005211 0.005190 131072 0.010452 0.010520 0.010497 0.010423 0.010434 262144 0.020865 0.020885 0.020923 0.020815 0.020840 524288 0.041745 0.041800 0.041759 0.041800 0.041787 1048576 0.083789 0.083712 0.083561 0.083449 0.083477 2097152 0.167316 0.167535 0.166926 0.167014 0.167050 4194304 0.335100 0.334566 0.334010 0.334036 0.334322 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.000054 0.000031 0.000031 0.000031 0.000033 2048 0.000059 0.000058 0.000055 0.000059 0.000060 4096 0.000112 0.000113 0.000114 0.000115 0.000135 8192 0.000234 0.000226 0.000225 0.000226 0.000226 16384 0.000463 0.000449 0.000408 0.000448 0.000451 32768 0.000908 0.000890 0.000894 0.000897 0.000898 65536 0.001796 0.001740 0.001664 0.001793 0.001806 131072 0.003472 0.003263 0.003606 0.003610 0.003633 262144 0.006978 0.007131 0.006990 0.006596 0.006864 524288 0.013929 0.013862 0.013553 0.013532 0.013659 1048576 0.026505 0.026854 0.026177 0.027142 0.027532 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.000044 0.000010 0.000010 0.000010 0.000010 16 0.000221 0.000130 0.000128 0.000130 0.000132 64 0.012205 0.011497 0.011486 0.011538 0.012110 256 2.786053 2.785320 2.787704 2.807461 2.793919 TIMER_ETIME Normal end of execution. 20081218 121213.600