📄 timer.f
字号:
t0 = wclock() Do j = 1, nrep! --- Prevent smart compilers from being too smart ... jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n4, 4 y(i,jsw) = x1(i) * x2(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 17 ) Then If ( n > 0 ) Then n3 = 3 * n t0 = wclock() Do j = 1, nrep! --- Prevent smart compilers from being too smart ... jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n3, 3 y(i,jsw) = x1(i) / x2(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 18 ) Then If ( n > 0 ) Then n4 = n * 4 t0 = wclock() Do j = 1, nrep! - Prevent smart compilers from being too smart ... jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n4, 4 y(i,jsw) = x1(i) / x2(i) End Do End Do t1 = wclock() - t0! - Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 19 ) Then If ( n > 0 ) Then n3 = 3 * n s(1) = zero s(2) = zero t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j ) ssw = s(jsw)!$omp parallel do reduction(+:ssw) Do i = 1, n3, 3 ssw = ssw + x1(i)*x2(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 20 ) Then If ( n > 0 ) Then n4 = n * 4 s(1) = zero s(2) = zero t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j ) ssw = s(jsw)!$omp parallel do reduction(+:ssw) Do i = 1, n4, 4 ssw = ssw + x1(i)*x2(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 21 ) Then If ( n > 0 ) Then n3 = 3 * n t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n3, 3 y(i,jsw) = y(i,jsw) + c0*x1(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 22 ) Then If ( n > 0 ) Then n4 = n * 4 t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n4, 4 y(i,jsw) = y(i,jsw) + c0*x1(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 23 ) Then If ( n > 0 ) Then n3 = 3 * n t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n3, 3 y(i,jsw) = x1(i) + c0*x2(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 24 ) Then If ( n > 0 ) Then n4 = n * 4 t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n4, 4 y(i,jsw) = x1(i) + c0*x2(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 25 ) Then If ( n > 0 ) Then Call permut( n, ind, -1990 ) t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n y(ind(i),jsw) = x1(i) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 26 ) Then If ( n > 0 ) Then Call permut( n, ind, -1990 ) t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n y(i,jsw) = x1(ind(i)) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 27 ) Then If ( n > 0 ) Then Call permut( n, ind, -1990 ) t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n y(i,jsw) = x1(ind(i)) * x2(ind(i)) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 28 ) Then If ( n > 0 ) Then Call permut( n, ind, -1990 ) t0 = wclock()! --- Prevent smart compilers from being too smart ... Do j = 1, nrep jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n y(i,jsw) = x1(ind(i)) / x2(ind(i)) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 29 ) Then If ( n > 0 ) Then Call permut( n, ind, -1990 ) s(1) = zero s(2) = zero t0 = wclock() Do j = 1, nrep! --- Prevent smart compilers from being too smart ... jsw = jswitch( krit, indj, j ) ssw = s(jsw)!$omp parallel do reduction(+:ssw) Do i = 1, n ssw = ssw + x1(ind(i)) * x2(ind(i)) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 30 ) Then If ( n > 0 ) Then Call permut( n, ind, -1990 ) t0 = wclock() Do j = 1, nrep! --- Prevent smart compilers from being too smart ... jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n y(i,jsw) = y(i,jsw) + c0 * x1(ind(i)) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- Else If ( kern == 31 ) Then If ( n > 0 ) Then Call permut( n, ind, -1990 ) t0 = wclock() Do j = 1, nrep! --- Prevent smart compilers from being too smart ... jsw = jswitch( krit, indj, j )!$omp parallel do Do i = 1, n y(i,jsw) = x1(ind(i)) + c0 * x2(ind(i)) End Do End Do t1 = wclock() - t0! --- Correct for repetition loop. corr = wclock() Do j = 1, nrep jsw = jswitch( krit, indj, j ) End Do time = ( t1 - wclock() + corr ) / nrep End If! ---------------------------------------------------------------------- End If! ---------------------------------------------------------------------- End Subroutine timer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -