From 05b684ddbb947e60cb41a09f87878cb61c16a9a8 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Wed, 19 Apr 2023 13:23:48 +0200 Subject: [PATCH] Updated use of exscan in CSC --- base/serial/impl/psb_c_csc_impl.F90 | 10 ++++------ base/serial/impl/psb_d_csc_impl.F90 | 10 ++++------ base/serial/impl/psb_s_csc_impl.F90 | 10 ++++------ base/serial/impl/psb_z_csc_impl.F90 | 10 ++++------ 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/base/serial/impl/psb_c_csc_impl.F90 b/base/serial/impl/psb_c_csc_impl.F90 index c573a40d..7532d5a0 100644 --- a/base/serial/impl/psb_c_csc_impl.F90 +++ b/base/serial/impl/psb_c_csc_impl.F90 @@ -2228,16 +2228,14 @@ subroutine psb_c_mv_csc_from_coo(a,b,info) #if defined(OPENMP) - !$OMP PARALLEL default(none) & - !$OMP shared(nr,a,itemp,nza) & - !$OMP private(i,info) + !$OMP PARALLEL default(shared) !$OMP WORKSHARE a%icp(:) = 0 !$OMP END WORKSHARE !$OMP DO schedule(STATIC) & - !$OMP private(k) + !$OMP private(k,i) do k=1,nza i = itemp(k) !$OMP ATOMIC UPDATE @@ -2245,16 +2243,16 @@ subroutine psb_c_mv_csc_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO + call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) !$OMP END PARALLEL - #else a%icp(:) = 0 do k=1,nza i = itemp(k) a%icp(i) = a%icp(i) + 1 end do -#endif call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) +#endif call a%set_host() diff --git a/base/serial/impl/psb_d_csc_impl.F90 b/base/serial/impl/psb_d_csc_impl.F90 index 891df5a3..38f746de 100644 --- a/base/serial/impl/psb_d_csc_impl.F90 +++ b/base/serial/impl/psb_d_csc_impl.F90 @@ -2228,16 +2228,14 @@ subroutine psb_d_mv_csc_from_coo(a,b,info) #if defined(OPENMP) - !$OMP PARALLEL default(none) & - !$OMP shared(nr,a,itemp,nza) & - !$OMP private(i,info) + !$OMP PARALLEL default(shared) !$OMP WORKSHARE a%icp(:) = 0 !$OMP END WORKSHARE !$OMP DO schedule(STATIC) & - !$OMP private(k) + !$OMP private(k,i) do k=1,nza i = itemp(k) !$OMP ATOMIC UPDATE @@ -2245,16 +2243,16 @@ subroutine psb_d_mv_csc_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO + call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) !$OMP END PARALLEL - #else a%icp(:) = 0 do k=1,nza i = itemp(k) a%icp(i) = a%icp(i) + 1 end do -#endif call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) +#endif call a%set_host() diff --git a/base/serial/impl/psb_s_csc_impl.F90 b/base/serial/impl/psb_s_csc_impl.F90 index 2bf77184..d1fb8c4b 100644 --- a/base/serial/impl/psb_s_csc_impl.F90 +++ b/base/serial/impl/psb_s_csc_impl.F90 @@ -2228,16 +2228,14 @@ subroutine psb_s_mv_csc_from_coo(a,b,info) #if defined(OPENMP) - !$OMP PARALLEL default(none) & - !$OMP shared(nr,a,itemp,nza) & - !$OMP private(i,info) + !$OMP PARALLEL default(shared) !$OMP WORKSHARE a%icp(:) = 0 !$OMP END WORKSHARE !$OMP DO schedule(STATIC) & - !$OMP private(k) + !$OMP private(k,i) do k=1,nza i = itemp(k) !$OMP ATOMIC UPDATE @@ -2245,16 +2243,16 @@ subroutine psb_s_mv_csc_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO + call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) !$OMP END PARALLEL - #else a%icp(:) = 0 do k=1,nza i = itemp(k) a%icp(i) = a%icp(i) + 1 end do -#endif call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) +#endif call a%set_host() diff --git a/base/serial/impl/psb_z_csc_impl.F90 b/base/serial/impl/psb_z_csc_impl.F90 index 22ea3677..2735bcbd 100644 --- a/base/serial/impl/psb_z_csc_impl.F90 +++ b/base/serial/impl/psb_z_csc_impl.F90 @@ -2228,16 +2228,14 @@ subroutine psb_z_mv_csc_from_coo(a,b,info) #if defined(OPENMP) - !$OMP PARALLEL default(none) & - !$OMP shared(nr,a,itemp,nza) & - !$OMP private(i,info) + !$OMP PARALLEL default(shared) !$OMP WORKSHARE a%icp(:) = 0 !$OMP END WORKSHARE !$OMP DO schedule(STATIC) & - !$OMP private(k) + !$OMP private(k,i) do k=1,nza i = itemp(k) !$OMP ATOMIC UPDATE @@ -2245,16 +2243,16 @@ subroutine psb_z_mv_csc_from_coo(a,b,info) !$OMP END ATOMIC end do !$OMP END DO + call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) !$OMP END PARALLEL - #else a%icp(:) = 0 do k=1,nza i = itemp(k) a%icp(i) = a%icp(i) + 1 end do -#endif call psi_exscan(nc+1,a%icp,info,shift=ione,ibase=ione) +#endif call a%set_host()