From a955c124a133efbb15d5346f9252ef100dfb7d12 Mon Sep 17 00:00:00 2001 From: kamischi <karl-michael.schindler@web.de> Date: Thu, 29 Feb 2024 11:02:44 +0100 Subject: [PATCH] try openmp --- source/f90/quanc8.f90 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/f90/quanc8.f90 b/source/f90/quanc8.f90 index c34529b..86ee4f3 100644 --- a/source/f90/quanc8.f90 +++ b/source/f90/quanc8.f90 @@ -106,9 +106,13 @@ subroutine quanc8(fun, a, b, abserr, relerr, result, errest, nofun, flag, eps, t x(6) = (x(4) + x(8)) / 2 x(10) = (x(8) + x(12)) / 2 x(14) = (x(12) + x(16)) / 2 +!*** !$OMP PARALLEL shared (f, x, eps, thick, layers, nper) private (j) +!*** !$OMP DO do j = 2, 16, 2 f(j) = fun(x(j), eps, thick, layers, nper, size(eps)) enddo +!*** !$OMP END DO NOWAIT +!*** !$OMP END PARALLEL nofun = 9 do @@ -121,8 +125,14 @@ subroutine quanc8(fun, a, b, abserr, relerr, result, errest, nofun, flag, eps, t f(1) = fun(x(1), eps, thick, layers, nper, size(eps)) do j = 3, 15, 2 x(j) = (x(j - 1) + x(j + 1)) / 2 + enddo +!*** !$OMP PARALLEL shared (f, x, eps, thick, layers, nper) private (j) +!*** !$OMP DO SCHEDULE(auto) + do j = 3, 15, 2 f(j) = fun(x(j), eps, thick, layers, nper, size(eps)) enddo +!*** !$OMP END DO NOWAIT +!*** !$OMP END PARALLEL nofun = nofun + 8 step = (x(16) - x0) / 16.0d0 qleft = (w0 * (f0 + f(8)) + w1 * (f(1) + f(7)) + w2 * (f(2) + f(6)) & -- GitLab