From 82665f4e7910260fc8eb877a9ced248c9056e0b0 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sat, 2 Jan 2021 17:07:41 +0100 Subject: [PATCH] Put additional OpenMP directives. --- base/serial/impl/psb_c_csr_impl.f90 | 3 ++- base/serial/impl/psb_d_csr_impl.f90 | 3 ++- base/serial/impl/psb_s_csr_impl.f90 | 3 ++- base/serial/impl/psb_z_csr_impl.f90 | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index 25d0a086..f4522a6f 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -1328,7 +1328,8 @@ function psb_c_csr_csnmi(a) result(res) res = szero if (a%is_dev()) call a%sync() - do i = 1, a%get_nrows() + !$omp parallel do private(i,acc) reduction(max: res) + do i = 1, a%get_nrows() acc = szero do j=a%irp(i),a%irp(i+1)-1 acc = acc + abs(a%val(j)) diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index 853476d6..aa300c73 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -1328,7 +1328,8 @@ function psb_d_csr_csnmi(a) result(res) res = dzero if (a%is_dev()) call a%sync() - do i = 1, a%get_nrows() + !$omp parallel do private(i,acc) reduction(max: res) + do i = 1, a%get_nrows() acc = dzero do j=a%irp(i),a%irp(i+1)-1 acc = acc + abs(a%val(j)) diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index 76140d07..79289234 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -1328,7 +1328,8 @@ function psb_s_csr_csnmi(a) result(res) res = szero if (a%is_dev()) call a%sync() - do i = 1, a%get_nrows() + !$omp parallel do private(i,acc) reduction(max: res) + do i = 1, a%get_nrows() acc = szero do j=a%irp(i),a%irp(i+1)-1 acc = acc + abs(a%val(j)) diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index d16e39eb..1f1025ab 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -1328,7 +1328,8 @@ function psb_z_csr_csnmi(a) result(res) res = dzero if (a%is_dev()) call a%sync() - do i = 1, a%get_nrows() + !$omp parallel do private(i,acc) reduction(max: res) + do i = 1, a%get_nrows() acc = dzero do j=a%irp(i),a%irp(i+1)-1 acc = acc + abs(a%val(j))