From 5fbdfb14361a1419e0626166935d9524c151655a Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 16 Nov 2023 17:55:24 +0100 Subject: [PATCH 1/5] Fix free for jac_solver --- amgprec/amg_c_jac_solver.f90 | 5 ++++- amgprec/amg_d_jac_solver.f90 | 5 ++++- amgprec/amg_s_jac_solver.f90 | 5 ++++- amgprec/amg_z_jac_solver.f90 | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/amgprec/amg_c_jac_solver.f90 b/amgprec/amg_c_jac_solver.f90 index 55335f1b..90ed85ce 100644 --- a/amgprec/amg_c_jac_solver.f90 +++ b/amgprec/amg_c_jac_solver.f90 @@ -403,7 +403,10 @@ contains info = psb_success_ call sv%a%free() - call sv%dv%free(info) + if (allocated(sv%dv)) then + call sv%dv%free(info) + deallocate(sv%dv) + end if if (allocated(sv%d)) deallocate(sv%d) call psb_erractionrestore(err_act) diff --git a/amgprec/amg_d_jac_solver.f90 b/amgprec/amg_d_jac_solver.f90 index 25bb1375..eb7c93ce 100644 --- a/amgprec/amg_d_jac_solver.f90 +++ b/amgprec/amg_d_jac_solver.f90 @@ -403,7 +403,10 @@ contains info = psb_success_ call sv%a%free() - call sv%dv%free(info) + if (allocated(sv%dv)) then + call sv%dv%free(info) + deallocate(sv%dv) + end if if (allocated(sv%d)) deallocate(sv%d) call psb_erractionrestore(err_act) diff --git a/amgprec/amg_s_jac_solver.f90 b/amgprec/amg_s_jac_solver.f90 index 8cc66bbc..0ecbd10d 100644 --- a/amgprec/amg_s_jac_solver.f90 +++ b/amgprec/amg_s_jac_solver.f90 @@ -403,7 +403,10 @@ contains info = psb_success_ call sv%a%free() - call sv%dv%free(info) + if (allocated(sv%dv)) then + call sv%dv%free(info) + deallocate(sv%dv) + end if if (allocated(sv%d)) deallocate(sv%d) call psb_erractionrestore(err_act) diff --git a/amgprec/amg_z_jac_solver.f90 b/amgprec/amg_z_jac_solver.f90 index 28f1199e..5d273537 100644 --- a/amgprec/amg_z_jac_solver.f90 +++ b/amgprec/amg_z_jac_solver.f90 @@ -403,7 +403,10 @@ contains info = psb_success_ call sv%a%free() - call sv%dv%free(info) + if (allocated(sv%dv)) then + call sv%dv%free(info) + deallocate(sv%dv) + end if if (allocated(sv%d)) deallocate(sv%d) call psb_erractionrestore(err_act) From fc343853419b615c85696b88759270ffd94e51a3 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 16 Nov 2023 17:55:42 +0100 Subject: [PATCH 2/5] Fix matrix generation for samples --- .../advanced/pdegen/amg_d_pde2d_base_mod.f90 | 12 +++++------ .../advanced/pdegen/amg_d_pde2d_box_mod.f90 | 12 +++++------ .../advanced/pdegen/amg_d_pde2d_exp_mod.f90 | 16 +++++++-------- .../advanced/pdegen/amg_d_pde3d_base_mod.f90 | 18 ++++++++--------- .../advanced/pdegen/amg_d_pde3d_exp_mod.f90 | 18 ++++++++--------- .../advanced/pdegen/amg_d_pde3d_gauss_mod.f90 | 20 +++++++++---------- .../advanced/pdegen/amg_s_pde2d_base_mod.f90 | 12 +++++------ .../advanced/pdegen/amg_s_pde2d_box_mod.f90 | 12 +++++------ .../advanced/pdegen/amg_s_pde2d_exp_mod.f90 | 16 +++++++-------- .../advanced/pdegen/amg_s_pde3d_base_mod.f90 | 18 ++++++++--------- .../advanced/pdegen/amg_s_pde3d_exp_mod.f90 | 18 ++++++++--------- .../advanced/pdegen/amg_s_pde3d_gauss_mod.f90 | 20 +++++++++---------- samples/advanced/pdegen/runs/amg_pde3d.inp | 10 +++++----- 13 files changed, 101 insertions(+), 101 deletions(-) diff --git a/samples/advanced/pdegen/amg_d_pde2d_base_mod.f90 b/samples/advanced/pdegen/amg_d_pde2d_base_mod.f90 index 844405ef..a406e90e 100644 --- a/samples/advanced/pdegen/amg_d_pde2d_base_mod.f90 +++ b/samples/advanced/pdegen/amg_d_pde2d_base_mod.f90 @@ -46,37 +46,37 @@ contains ! functions parametrizing the differential equation ! function b1(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: b1 real(psb_dpk_), intent(in) :: x,y b1 = dzero/1.414_psb_dpk_ end function b1 function b2(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: b2 real(psb_dpk_), intent(in) :: x,y b2 = dzero/1.414_psb_dpk_ end function b2 function c(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: c real(psb_dpk_), intent(in) :: x,y c = dzero end function c function a1(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: a1 real(psb_dpk_), intent(in) :: x,y a1=done*epsilon end function a1 function a2(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: a2 real(psb_dpk_), intent(in) :: x,y a2=done*epsilon end function a2 function g(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: g real(psb_dpk_), intent(in) :: x,y g = dzero diff --git a/samples/advanced/pdegen/amg_d_pde2d_box_mod.f90 b/samples/advanced/pdegen/amg_d_pde2d_box_mod.f90 index 39cc66c0..db743633 100644 --- a/samples/advanced/pdegen/amg_d_pde2d_box_mod.f90 +++ b/samples/advanced/pdegen/amg_d_pde2d_box_mod.f90 @@ -46,37 +46,37 @@ contains ! functions parametrizing the differential equation ! function b1_box(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: b1_box real(psb_dpk_), intent(in) :: x,y b1_box = done/1.414_psb_dpk_ end function b1_box function b2_box(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: b2_box real(psb_dpk_), intent(in) :: x,y b2_box = done/1.414_psb_dpk_ end function b2_box function c_box(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: c_box real(psb_dpk_), intent(in) :: x,y c_box = dzero end function c_box function a1_box(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: a1_box real(psb_dpk_), intent(in) :: x,y a1_box=done*epsilon end function a1_box function a2_box(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: a2_box real(psb_dpk_), intent(in) :: x,y a2_box=done*epsilon end function a2_box function g_box(x,y) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: g_box real(psb_dpk_), intent(in) :: x,y g_box = dzero diff --git a/samples/advanced/pdegen/amg_d_pde2d_exp_mod.f90 b/samples/advanced/pdegen/amg_d_pde2d_exp_mod.f90 index 90fb8126..5dab37bc 100644 --- a/samples/advanced/pdegen/amg_d_pde2d_exp_mod.f90 +++ b/samples/advanced/pdegen/amg_d_pde2d_exp_mod.f90 @@ -46,37 +46,37 @@ contains ! functions parametrizing the differential equation ! function b1_exp(x,y) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: b1_exp real(psb_dpk_), intent(in) :: x,y b1_exp = dzero end function b1_exp function b2_exp(x,y) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: b2_exp real(psb_dpk_), intent(in) :: x,y b2_exp = dzero end function b2_exp function c_exp(x,y) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: c_exp real(psb_dpk_), intent(in) :: x,y c_exp = dzero end function c_exp function a1_exp(x,y) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: a1_exp real(psb_dpk_), intent(in) :: x,y - a1=done*epsilon*exp(-(x+y)) + a1_exp=done*epsilon*exp(-(x+y)) end function a1_exp function a2_exp(x,y) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: a2_exp real(psb_dpk_), intent(in) :: x,y - a2=done*epsilon*exp(-(x+y)) + a2_exp=done*epsilon*exp(-(x+y)) end function a2_exp function g_exp(x,y) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: g_exp real(psb_dpk_), intent(in) :: x,y g_exp = dzero diff --git a/samples/advanced/pdegen/amg_d_pde3d_base_mod.f90 b/samples/advanced/pdegen/amg_d_pde3d_base_mod.f90 index a6de1d87..57a43511 100644 --- a/samples/advanced/pdegen/amg_d_pde3d_base_mod.f90 +++ b/samples/advanced/pdegen/amg_d_pde3d_base_mod.f90 @@ -35,7 +35,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! module amg_d_pde3d_base_mod - use psb_base_mod, only : psb_dpk_, done + use psb_base_mod, only : psb_dpk_, done, dzero real(psb_dpk_), save, private :: epsilon=done/80 contains subroutine pde_set_parm(dat) @@ -46,49 +46,49 @@ contains ! functions parametrizing the differential equation ! function b1(x,y,z) - use psb_base_mod, only : psb_dpk_, done + implicit none real(psb_dpk_) :: b1 real(psb_dpk_), intent(in) :: x,y,z b1=done/sqrt(3.0_psb_dpk_) end function b1 function b2(x,y,z) - use psb_base_mod, only : psb_dpk_, done + implicit none real(psb_dpk_) :: b2 real(psb_dpk_), intent(in) :: x,y,z b2=done/sqrt(3.0_psb_dpk_) end function b2 function b3(x,y,z) - use psb_base_mod, only : psb_dpk_, done + implicit none real(psb_dpk_) :: b3 real(psb_dpk_), intent(in) :: x,y,z b3=done/sqrt(3.0_psb_dpk_) end function b3 function c(x,y,z) - use psb_base_mod, only : psb_dpk_, dzero, done + implicit none real(psb_dpk_) :: c real(psb_dpk_), intent(in) :: x,y,z c=dzero end function c function a1(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a1 real(psb_dpk_), intent(in) :: x,y,z a1=epsilon end function a1 function a2(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a2 real(psb_dpk_), intent(in) :: x,y,z a2=epsilon end function a2 function a3(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a3 real(psb_dpk_), intent(in) :: x,y,z a3=epsilon end function a3 function g(x,y,z) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: g real(psb_dpk_), intent(in) :: x,y,z g = dzero diff --git a/samples/advanced/pdegen/amg_d_pde3d_exp_mod.f90 b/samples/advanced/pdegen/amg_d_pde3d_exp_mod.f90 index e7249e6c..e7bcf6ef 100644 --- a/samples/advanced/pdegen/amg_d_pde3d_exp_mod.f90 +++ b/samples/advanced/pdegen/amg_d_pde3d_exp_mod.f90 @@ -35,7 +35,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! module amg_d_pde3d_exp_mod - use psb_base_mod, only : psb_dpk_, done + use psb_base_mod, only : psb_dpk_, done, dzero real(psb_dpk_), save, private :: epsilon=done/160 contains subroutine pde_set_parm(dat) @@ -46,49 +46,49 @@ contains ! functions parametrizing the differential equation ! function b1_exp(x,y,z) - use psb_base_mod, only : psb_dpk_, dzero + implicit none real(psb_dpk_) :: b1_exp real(psb_dpk_), intent(in) :: x,y,z b1_exp=dzero/sqrt(3.0_psb_dpk_) end function b1_exp function b2_exp(x,y,z) - use psb_base_mod, only : psb_dpk_, dzero + implicit none real(psb_dpk_) :: b2_exp real(psb_dpk_), intent(in) :: x,y,z b2_exp=dzero/sqrt(3.0_psb_dpk_) end function b2_exp function b3_exp(x,y,z) - use psb_base_mod, only : psb_dpk_, dzero + implicit none real(psb_dpk_) :: b3_exp real(psb_dpk_), intent(in) :: x,y,z b3_exp=dzero/sqrt(3.0_psb_dpk_) end function b3_exp function c_exp(x,y,z) - use psb_base_mod, only : psb_dpk_, dzero + implicit none real(psb_dpk_) :: c_exp real(psb_dpk_), intent(in) :: x,y,z c_exp=dzero end function c_exp function a1_exp(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a1_exp real(psb_dpk_), intent(in) :: x,y,z a1_exp=epsilon*exp(-(x+y+z)) end function a1_exp function a2_exp(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a2_exp real(psb_dpk_), intent(in) :: x,y,z a2_exp=epsilon*exp(-(x+y+z)) end function a2_exp function a3_exp(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a3_exp real(psb_dpk_), intent(in) :: x,y,z a3_exp=epsilon*exp(-(x+y+z)) end function a3_exp function g_exp(x,y,z) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: g_exp real(psb_dpk_), intent(in) :: x,y,z g_exp = dzero diff --git a/samples/advanced/pdegen/amg_d_pde3d_gauss_mod.f90 b/samples/advanced/pdegen/amg_d_pde3d_gauss_mod.f90 index 8a9eda7d..8dd5f71a 100644 --- a/samples/advanced/pdegen/amg_d_pde3d_gauss_mod.f90 +++ b/samples/advanced/pdegen/amg_d_pde3d_gauss_mod.f90 @@ -35,7 +35,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! module amg_d_pde3d_gauss_mod - use psb_base_mod, only : psb_dpk_, done + use psb_base_mod, only : psb_dpk_, done, dzero real(psb_dpk_), save, private :: epsilon=done/80 contains subroutine pde_set_parm(dat) @@ -46,49 +46,49 @@ contains ! functions parametrizing the differential equation ! function b1_gauss(x,y,z) - use psb_base_mod, only : psb_dpk_, done + implicit none real(psb_dpk_) :: b1_gauss real(psb_dpk_), intent(in) :: x,y,z b1_gauss=done/sqrt(3.0_psb_dpk_)-2*x*exp(-(x**2+y**2+z**2)) end function b1_gauss function b2_gauss(x,y,z) - use psb_base_mod, only : psb_dpk_, done + implicit none real(psb_dpk_) :: b2_gauss real(psb_dpk_), intent(in) :: x,y,z b2_gauss=done/sqrt(3.0_psb_dpk_)-2*y*exp(-(x**2+y**2+z**2)) end function b2_gauss function b3_gauss(x,y,z) - use psb_base_mod, only : psb_dpk_, done + implicit none real(psb_dpk_) :: b3_gauss real(psb_dpk_), intent(in) :: x,y,z b3_gauss=done/sqrt(3.0_psb_dpk_)-2*z*exp(-(x**2+y**2+z**2)) end function b3_gauss function c_gauss(x,y,z) - use psb_base_mod, only : psb_dpk_, dzero + implicit none real(psb_dpk_) :: c_gauss real(psb_dpk_), intent(in) :: x,y,z - c=dzero + c_gauss=dzero end function c_gauss function a1_gauss(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a1_gauss real(psb_dpk_), intent(in) :: x,y,z a1_gauss=epsilon*exp(-(x**2+y**2+z**2)) end function a1_gauss function a2_gauss(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a2_gauss real(psb_dpk_), intent(in) :: x,y,z a2_gauss=epsilon*exp(-(x**2+y**2+z**2)) end function a2_gauss function a3_gauss(x,y,z) - use psb_base_mod, only : psb_dpk_ + implicit none real(psb_dpk_) :: a3_gauss real(psb_dpk_), intent(in) :: x,y,z a3_gauss=epsilon*exp(-(x**2+y**2+z**2)) end function a3_gauss function g_gauss(x,y,z) - use psb_base_mod, only : psb_dpk_, done, dzero + implicit none real(psb_dpk_) :: g_gauss real(psb_dpk_), intent(in) :: x,y,z g_gauss = dzero diff --git a/samples/advanced/pdegen/amg_s_pde2d_base_mod.f90 b/samples/advanced/pdegen/amg_s_pde2d_base_mod.f90 index 09376a68..462c6154 100644 --- a/samples/advanced/pdegen/amg_s_pde2d_base_mod.f90 +++ b/samples/advanced/pdegen/amg_s_pde2d_base_mod.f90 @@ -46,37 +46,37 @@ contains ! functions parametrizing the differential equation ! function b1(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: b1 real(psb_spk_), intent(in) :: x,y b1 = szero/1.414_psb_spk_ end function b1 function b2(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: b2 real(psb_spk_), intent(in) :: x,y b2 = szero/1.414_psb_spk_ end function b2 function c(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: c real(psb_spk_), intent(in) :: x,y c = szero end function c function a1(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: a1 real(psb_spk_), intent(in) :: x,y a1=sone*epsilon end function a1 function a2(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: a2 real(psb_spk_), intent(in) :: x,y a2=sone*epsilon end function a2 function g(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: g real(psb_spk_), intent(in) :: x,y g = szero diff --git a/samples/advanced/pdegen/amg_s_pde2d_box_mod.f90 b/samples/advanced/pdegen/amg_s_pde2d_box_mod.f90 index 77e92514..9183521b 100644 --- a/samples/advanced/pdegen/amg_s_pde2d_box_mod.f90 +++ b/samples/advanced/pdegen/amg_s_pde2d_box_mod.f90 @@ -46,37 +46,37 @@ contains ! functions parametrizing the differential equation ! function b1_box(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: b1_box real(psb_spk_), intent(in) :: x,y b1_box = sone/1.414_psb_spk_ end function b1_box function b2_box(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: b2_box real(psb_spk_), intent(in) :: x,y b2_box = sone/1.414_psb_spk_ end function b2_box function c_box(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: c_box real(psb_spk_), intent(in) :: x,y c_box = szero end function c_box function a1_box(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: a1_box real(psb_spk_), intent(in) :: x,y a1_box=sone*epsilon end function a1_box function a2_box(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: a2_box real(psb_spk_), intent(in) :: x,y a2_box=sone*epsilon end function a2_box function g_box(x,y) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: g_box real(psb_spk_), intent(in) :: x,y g_box = szero diff --git a/samples/advanced/pdegen/amg_s_pde2d_exp_mod.f90 b/samples/advanced/pdegen/amg_s_pde2d_exp_mod.f90 index 80d34f28..3657546d 100644 --- a/samples/advanced/pdegen/amg_s_pde2d_exp_mod.f90 +++ b/samples/advanced/pdegen/amg_s_pde2d_exp_mod.f90 @@ -46,37 +46,37 @@ contains ! functions parametrizing the differential equation ! function b1_exp(x,y) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: b1_exp real(psb_spk_), intent(in) :: x,y b1_exp = szero end function b1_exp function b2_exp(x,y) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: b2_exp real(psb_spk_), intent(in) :: x,y b2_exp = szero end function b2_exp function c_exp(x,y) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: c_exp real(psb_spk_), intent(in) :: x,y c_exp = szero end function c_exp function a1_exp(x,y) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: a1_exp real(psb_spk_), intent(in) :: x,y - a1=sone*epsilon*exp(-(x+y)) + a1_exp=sone*epsilon*exp(-(x+y)) end function a1_exp function a2_exp(x,y) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: a2_exp real(psb_spk_), intent(in) :: x,y - a2=sone*epsilon*exp(-(x+y)) + a2_exp=sone*epsilon*exp(-(x+y)) end function a2_exp function g_exp(x,y) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: g_exp real(psb_spk_), intent(in) :: x,y g_exp = szero diff --git a/samples/advanced/pdegen/amg_s_pde3d_base_mod.f90 b/samples/advanced/pdegen/amg_s_pde3d_base_mod.f90 index ed420eda..0ce83989 100644 --- a/samples/advanced/pdegen/amg_s_pde3d_base_mod.f90 +++ b/samples/advanced/pdegen/amg_s_pde3d_base_mod.f90 @@ -35,7 +35,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! module amg_s_pde3d_base_mod - use psb_base_mod, only : psb_spk_, sone + use psb_base_mod, only : psb_spk_, sone, szero real(psb_spk_), save, private :: epsilon=sone/80 contains subroutine pde_set_parm(dat) @@ -46,49 +46,49 @@ contains ! functions parametrizing the differential equation ! function b1(x,y,z) - use psb_base_mod, only : psb_spk_, sone + implicit none real(psb_spk_) :: b1 real(psb_spk_), intent(in) :: x,y,z b1=sone/sqrt(3.0_psb_spk_) end function b1 function b2(x,y,z) - use psb_base_mod, only : psb_spk_, sone + implicit none real(psb_spk_) :: b2 real(psb_spk_), intent(in) :: x,y,z b2=sone/sqrt(3.0_psb_spk_) end function b2 function b3(x,y,z) - use psb_base_mod, only : psb_spk_, sone + implicit none real(psb_spk_) :: b3 real(psb_spk_), intent(in) :: x,y,z b3=sone/sqrt(3.0_psb_spk_) end function b3 function c(x,y,z) - use psb_base_mod, only : psb_spk_, szero, sone + implicit none real(psb_spk_) :: c real(psb_spk_), intent(in) :: x,y,z c=szero end function c function a1(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a1 real(psb_spk_), intent(in) :: x,y,z a1=epsilon end function a1 function a2(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a2 real(psb_spk_), intent(in) :: x,y,z a2=epsilon end function a2 function a3(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a3 real(psb_spk_), intent(in) :: x,y,z a3=epsilon end function a3 function g(x,y,z) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: g real(psb_spk_), intent(in) :: x,y,z g = szero diff --git a/samples/advanced/pdegen/amg_s_pde3d_exp_mod.f90 b/samples/advanced/pdegen/amg_s_pde3d_exp_mod.f90 index 242ed429..8ec96d00 100644 --- a/samples/advanced/pdegen/amg_s_pde3d_exp_mod.f90 +++ b/samples/advanced/pdegen/amg_s_pde3d_exp_mod.f90 @@ -35,7 +35,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! module amg_s_pde3d_exp_mod - use psb_base_mod, only : psb_spk_, sone + use psb_base_mod, only : psb_spk_, sone, szero real(psb_spk_), save, private :: epsilon=sone/160 contains subroutine pde_set_parm(dat) @@ -46,49 +46,49 @@ contains ! functions parametrizing the differential equation ! function b1_exp(x,y,z) - use psb_base_mod, only : psb_spk_, szero + implicit none real(psb_spk_) :: b1_exp real(psb_spk_), intent(in) :: x,y,z b1_exp=szero/sqrt(3.0_psb_spk_) end function b1_exp function b2_exp(x,y,z) - use psb_base_mod, only : psb_spk_, szero + implicit none real(psb_spk_) :: b2_exp real(psb_spk_), intent(in) :: x,y,z b2_exp=szero/sqrt(3.0_psb_spk_) end function b2_exp function b3_exp(x,y,z) - use psb_base_mod, only : psb_spk_, szero + implicit none real(psb_spk_) :: b3_exp real(psb_spk_), intent(in) :: x,y,z b3_exp=szero/sqrt(3.0_psb_spk_) end function b3_exp function c_exp(x,y,z) - use psb_base_mod, only : psb_spk_, szero + implicit none real(psb_spk_) :: c_exp real(psb_spk_), intent(in) :: x,y,z c_exp=szero end function c_exp function a1_exp(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a1_exp real(psb_spk_), intent(in) :: x,y,z a1_exp=epsilon*exp(-(x+y+z)) end function a1_exp function a2_exp(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a2_exp real(psb_spk_), intent(in) :: x,y,z a2_exp=epsilon*exp(-(x+y+z)) end function a2_exp function a3_exp(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a3_exp real(psb_spk_), intent(in) :: x,y,z a3_exp=epsilon*exp(-(x+y+z)) end function a3_exp function g_exp(x,y,z) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: g_exp real(psb_spk_), intent(in) :: x,y,z g_exp = szero diff --git a/samples/advanced/pdegen/amg_s_pde3d_gauss_mod.f90 b/samples/advanced/pdegen/amg_s_pde3d_gauss_mod.f90 index 20d4017d..fa6362e0 100644 --- a/samples/advanced/pdegen/amg_s_pde3d_gauss_mod.f90 +++ b/samples/advanced/pdegen/amg_s_pde3d_gauss_mod.f90 @@ -35,7 +35,7 @@ ! POSSIBILITY OF SUCH DAMAGE. ! module amg_s_pde3d_gauss_mod - use psb_base_mod, only : psb_spk_, sone + use psb_base_mod, only : psb_spk_, sone, szero real(psb_spk_), save, private :: epsilon=sone/80 contains subroutine pde_set_parm(dat) @@ -46,49 +46,49 @@ contains ! functions parametrizing the differential equation ! function b1_gauss(x,y,z) - use psb_base_mod, only : psb_spk_, sone + implicit none real(psb_spk_) :: b1_gauss real(psb_spk_), intent(in) :: x,y,z b1_gauss=sone/sqrt(3.0_psb_spk_)-2*x*exp(-(x**2+y**2+z**2)) end function b1_gauss function b2_gauss(x,y,z) - use psb_base_mod, only : psb_spk_, sone + implicit none real(psb_spk_) :: b2_gauss real(psb_spk_), intent(in) :: x,y,z b2_gauss=sone/sqrt(3.0_psb_spk_)-2*y*exp(-(x**2+y**2+z**2)) end function b2_gauss function b3_gauss(x,y,z) - use psb_base_mod, only : psb_spk_, sone + implicit none real(psb_spk_) :: b3_gauss real(psb_spk_), intent(in) :: x,y,z b3_gauss=sone/sqrt(3.0_psb_spk_)-2*z*exp(-(x**2+y**2+z**2)) end function b3_gauss function c_gauss(x,y,z) - use psb_base_mod, only : psb_spk_, szero + implicit none real(psb_spk_) :: c_gauss real(psb_spk_), intent(in) :: x,y,z - c=szero + c_gauss=szero end function c_gauss function a1_gauss(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a1_gauss real(psb_spk_), intent(in) :: x,y,z a1_gauss=epsilon*exp(-(x**2+y**2+z**2)) end function a1_gauss function a2_gauss(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a2_gauss real(psb_spk_), intent(in) :: x,y,z a2_gauss=epsilon*exp(-(x**2+y**2+z**2)) end function a2_gauss function a3_gauss(x,y,z) - use psb_base_mod, only : psb_spk_ + implicit none real(psb_spk_) :: a3_gauss real(psb_spk_), intent(in) :: x,y,z a3_gauss=epsilon*exp(-(x**2+y**2+z**2)) end function a3_gauss function g_gauss(x,y,z) - use psb_base_mod, only : psb_spk_, sone, szero + implicit none real(psb_spk_) :: g_gauss real(psb_spk_), intent(in) :: x,y,z g_gauss = szero diff --git a/samples/advanced/pdegen/runs/amg_pde3d.inp b/samples/advanced/pdegen/runs/amg_pde3d.inp index ac39c4af..faaae6b5 100644 --- a/samples/advanced/pdegen/runs/amg_pde3d.inp +++ b/samples/advanced/pdegen/runs/amg_pde3d.inp @@ -2,18 +2,18 @@ CSR ! Storage format CSR COO JAD 0040 ! IDIM; domain size. Linear system size is IDIM**3 CONST ! PDECOEFF: CONST, EXP, GAUSS Coefficients of the PDE -BICGSTAB ! Iterative method: BiCGSTAB BiCGSTABL BiCG CG CGS FCG GCR RGMRES +CG ! Iterative method: BiCGSTAB BiCGSTABL BiCG CG CGS FCG GCR RGMRES 2 ! ISTOPC -00500 ! ITMAX +00008 ! ITMAX 1 ! ITRACE 30 ! IRST (restart for RGMRES and BiCGSTABL) 1.d-6 ! EPS %%%%%%%%%%% Main preconditioner choices %%%%%%%%%%%%%%%% ML-VBM-VCYCLE-FBGS-D-BJAC ! Longer descriptive name for preconditioner (up to 20 chars) -BJAC ! Preconditioner type: NONE JACOBI GS FBGS BJAC AS ML +L1-JACOBI ! Preconditioner type: NONE JACOBI GS FBGS BJAC AS ML %%%%%%%%%%% First smoother (for all levels but coarsest) %%%%%%%%%%%%%%%% -BJAC ! Smoother type JACOBI FBGS GS BWGS BJAC AS. For 1-level, repeats previous. -1 ! Number of sweeps for smoother +L1-JACOBI ! Smoother type JACOBI FBGS GS BWGS BJAC AS. For 1-level, repeats previous. +4 ! Number of sweeps for smoother 0 ! Number of overlap layers for AS preconditioner HALO ! AS restriction operator: NONE HALO NONE ! AS prolongation operator: NONE SUM AVG From 5387e206b1aea05074881a233bdc874b098d4e3b Mon Sep 17 00:00:00 2001 From: sfilippone Date: Fri, 24 Nov 2023 16:07:22 +0100 Subject: [PATCH 3/5] Fixed sample programs --- Makefile | 4 +- samples/advanced/pdegen/Makefile | 28 ++--- samples/advanced/pdegen/amg_d_pde2d.F90 | 44 ++++---- .../advanced/pdegen/amg_d_pde2d_base_mod.f90 | 56 +++++----- .../advanced/pdegen/amg_d_pde2d_box_mod.f90 | 4 +- .../advanced/pdegen/amg_d_pde2d_exp_mod.f90 | 4 +- .../advanced/pdegen/amg_d_pde2d_gauss_mod.f90 | 89 +++++++++++++++ samples/advanced/pdegen/amg_d_pde3d.F90 | 44 ++++---- .../advanced/pdegen/amg_d_pde3d_base_mod.f90 | 72 ++++++------- .../advanced/pdegen/amg_d_pde3d_box_mod.f90 | 101 ++++++++++++++++++ .../advanced/pdegen/amg_d_pde3d_exp_mod.f90 | 4 +- .../advanced/pdegen/amg_d_pde3d_gauss_mod.f90 | 4 +- samples/advanced/pdegen/amg_s_pde2d.F90 | 44 ++++---- .../advanced/pdegen/amg_s_pde2d_base_mod.f90 | 56 +++++----- .../advanced/pdegen/amg_s_pde2d_box_mod.f90 | 4 +- .../advanced/pdegen/amg_s_pde2d_exp_mod.f90 | 4 +- .../advanced/pdegen/amg_s_pde2d_gauss_mod.f90 | 89 +++++++++++++++ samples/advanced/pdegen/amg_s_pde3d.F90 | 44 ++++---- .../advanced/pdegen/amg_s_pde3d_base_mod.f90 | 72 ++++++------- .../advanced/pdegen/amg_s_pde3d_box_mod.f90 | 101 ++++++++++++++++++ .../advanced/pdegen/amg_s_pde3d_exp_mod.f90 | 4 +- .../advanced/pdegen/amg_s_pde3d_gauss_mod.f90 | 4 +- 22 files changed, 638 insertions(+), 238 deletions(-) create mode 100644 samples/advanced/pdegen/amg_d_pde2d_gauss_mod.f90 create mode 100644 samples/advanced/pdegen/amg_d_pde3d_box_mod.f90 create mode 100644 samples/advanced/pdegen/amg_s_pde2d_gauss_mod.f90 create mode 100644 samples/advanced/pdegen/amg_s_pde3d_box_mod.f90 diff --git a/Makefile b/Makefile index fb87ee99..ecd50936 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,9 @@ include Make.inc all: objs lib -objs: amgp cbnd +objs: libdir amgp cbnd -lib: libdir objs +lib: objs cd amgprec && $(MAKE) lib cd cbind && $(MAKE) lib diff --git a/samples/advanced/pdegen/Makefile b/samples/advanced/pdegen/Makefile index b5092a22..fc9a7f21 100644 --- a/samples/advanced/pdegen/Makefile +++ b/samples/advanced/pdegen/Makefile @@ -8,23 +8,27 @@ FINCLUDES=$(FMFLAG). $(FMFLAG)$(AMGMODDIR) $(FMFLAG)$(AMGINCDIR) $(PSBLAS_INCLUD LINKOPT= EXEDIR=./runs +DGEN2D=amg_d_pde2d_base_mod.o amg_d_pde2d_exp_mod.o amg_d_pde2d_gauss_mod.o amg_d_pde2d_box_mod.o +DGEN3D=amg_d_pde3d_base_mod.o amg_d_pde3d_exp_mod.o amg_d_pde3d_gauss_mod.o amg_d_pde3d_box_mod.o +SGEN2D=amg_s_pde2d_base_mod.o amg_s_pde2d_exp_mod.o amg_s_pde2d_gauss_mod.o amg_s_pde2d_box_mod.o +SGEN3D=amg_s_pde3d_base_mod.o amg_s_pde3d_exp_mod.o amg_s_pde3d_gauss_mod.o amg_s_pde3d_box_mod.o all: amg_s_pde3d amg_d_pde3d amg_s_pde2d amg_d_pde2d -amg_d_pde3d: amg_d_pde3d.o amg_d_genpde_mod.o amg_d_pde3d_base_mod.o amg_d_pde3d_exp_mod.o amg_d_pde3d_gauss_mod.o data_input.o - $(FLINK) $(LINKOPT) amg_d_pde3d.o amg_d_genpde_mod.o amg_d_pde3d_base_mod.o amg_d_pde3d_exp_mod.o amg_d_pde3d_gauss_mod.o data_input.o -o amg_d_pde3d $(AMG_LIBS) $(PSBLAS_LIBS) $(LDLIBS) +amg_d_pde3d: amg_d_pde3d.o amg_d_genpde_mod.o $(DGEN3D) data_input.o + $(FLINK) $(LINKOPT) amg_d_pde3d.o amg_d_genpde_mod.o $(DGEN3D) data_input.o -o amg_d_pde3d $(AMG_LIBS) $(PSBLAS_LIBS) $(LDLIBS) /bin/mv amg_d_pde3d $(EXEDIR) -amg_s_pde3d: amg_s_pde3d.o amg_s_genpde_mod.o amg_s_pde3d_base_mod.o amg_s_pde3d_exp_mod.o amg_s_pde3d_gauss_mod.o data_input.o - $(FLINK) $(LINKOPT) amg_s_pde3d.o amg_s_genpde_mod.o amg_s_pde3d_base_mod.o amg_s_pde3d_exp_mod.o amg_s_pde3d_gauss_mod.o data_input.o -o amg_s_pde3d $(AMG_LIBS) $(PSBLAS_LIBS) $(LDLIBS) +amg_s_pde3d: amg_s_pde3d.o amg_s_genpde_mod.o $(SGEN3D) data_input.o + $(FLINK) $(LINKOPT) amg_s_pde3d.o amg_s_genpde_mod.o $(SGEN3D) data_input.o -o amg_s_pde3d $(AMG_LIBS) $(PSBLAS_LIBS) $(LDLIBS) /bin/mv amg_s_pde3d $(EXEDIR) -amg_d_pde2d: amg_d_pde2d.o amg_d_genpde_mod.o amg_d_pde2d_base_mod.o amg_d_pde2d_exp_mod.o amg_d_pde2d_box_mod.o data_input.o - $(FLINK) $(LINKOPT) amg_d_pde2d.o amg_d_genpde_mod.o amg_d_pde2d_base_mod.o amg_d_pde2d_exp_mod.o amg_d_pde2d_box_mod.o data_input.o -o amg_d_pde2d $(AMG_LIBS) $(PSBLAS_LIBS) $(LDLIBS) +amg_d_pde2d: amg_d_pde2d.o amg_d_genpde_mod.o $(DGEN2D) data_input.o + $(FLINK) $(LINKOPT) amg_d_pde2d.o amg_d_genpde_mod.o $(DGEN2D) data_input.o -o amg_d_pde2d $(AMG_LIBS) $(PSBLAS_LIBS) $(LDLIBS) /bin/mv amg_d_pde2d $(EXEDIR) -amg_s_pde2d: amg_s_pde2d.o amg_s_genpde_mod.o amg_s_pde2d_base_mod.o amg_s_pde2d_exp_mod.o amg_s_pde2d_box_mod.o data_input.o - $(FLINK) $(LINKOPT) amg_s_pde2d.o amg_s_genpde_mod.o amg_s_pde2d_base_mod.o amg_s_pde2d_exp_mod.o amg_s_pde2d_box_mod.o data_input.o -o amg_s_pde2d $(AMG_LIBS) $(PSBLAS_LIBS) $(LDLIBS) +amg_s_pde2d: amg_s_pde2d.o amg_s_genpde_mod.o $(SGEN2D) data_input.o + $(FLINK) $(LINKOPT) amg_s_pde2d.o amg_s_genpde_mod.o $(SGEN2D) data_input.o -o amg_s_pde2d $(AMG_LIBS) $(PSBLAS_LIBS) $(LDLIBS) /bin/mv amg_s_pde2d $(EXEDIR) amg_d_pde3d_rebld: amg_d_pde3d_rebld.o data_input.o @@ -33,10 +37,10 @@ amg_d_pde3d_rebld: amg_d_pde3d_rebld.o data_input.o amg_d_pde3d.o amg_s_pde3d.o amg_d_pde2d.o amg_s_pde2d.o: data_input.o -amg_d_pde3d.o: amg_d_genpde_mod.o amg_d_pde3d_base_mod.o amg_d_pde3d_exp_mod.o amg_d_pde3d_gauss_mod.o -amg_s_pde3d.o: amg_s_genpde_mod.o amg_s_pde3d_base_mod.o amg_s_pde3d_exp_mod.o amg_s_pde3d_gauss_mod.o -amg_d_pde2d.o: amg_d_genpde_mod.o amg_d_pde2d_base_mod.o amg_d_pde2d_exp_mod.o amg_d_pde2d_box_mod.o -amg_s_pde2d.o: amg_s_genpde_mod.o amg_s_pde2d_base_mod.o amg_s_pde2d_exp_mod.o amg_s_pde2d_box_mod.o +amg_d_pde3d.o: amg_d_genpde_mod.o $(DGEN3D) +amg_s_pde3d.o: amg_s_genpde_mod.o $(SGEN3D) +amg_d_pde2d.o: amg_d_genpde_mod.o $(DGEN2D) +amg_s_pde2d.o: amg_s_genpde_mod.o $(SGEN2D) check: all cd runs && ./amg_d_pde2d Date: Sun, 26 Nov 2023 11:43:10 +0100 Subject: [PATCH 4/5] Disable MATCHBOX with SERIAL_MPI and add error message --- amgprec/impl/aggregator/MatchBoxPC.cpp | 2 +- amgprec/impl/aggregator/MatchBoxPC.h | 3 +++ amgprec/impl/aggregator/clean.cpp | 2 ++ amgprec/impl/aggregator/computeCandidateMate.cpp | 3 +++ .../aggregator/parallelComputeCandidateMateB.cpp | 2 ++ amgprec/impl/aggregator/processExposedVertex.cpp | 2 ++ amgprec/impl/aggregator/processMatchedVertices.cpp | 2 ++ .../processMatchedVerticesAndSendMessages.cpp | 2 ++ amgprec/impl/aggregator/processMessages.cpp | 2 ++ amgprec/impl/aggregator/sendBundledMessages.cpp | 3 ++- amgprec/impl/level/amg_c_base_onelev_csetc.F90 | 14 +++++++++++++- amgprec/impl/level/amg_d_base_onelev_csetc.F90 | 14 +++++++++++++- amgprec/impl/level/amg_s_base_onelev_csetc.F90 | 14 +++++++++++++- amgprec/impl/level/amg_z_base_onelev_csetc.F90 | 14 +++++++++++++- 14 files changed, 73 insertions(+), 6 deletions(-) diff --git a/amgprec/impl/aggregator/MatchBoxPC.cpp b/amgprec/impl/aggregator/MatchBoxPC.cpp index 90b448dc..eb56adce 100644 --- a/amgprec/impl/aggregator/MatchBoxPC.cpp +++ b/amgprec/impl/aggregator/MatchBoxPC.cpp @@ -42,7 +42,6 @@ #include #if !defined(SERIAL_MPI) #include -#endif #include "MatchBoxPC.h" #ifdef __cplusplus @@ -127,3 +126,4 @@ void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge, #ifdef __cplusplus } #endif +#endif diff --git a/amgprec/impl/aggregator/MatchBoxPC.h b/amgprec/impl/aggregator/MatchBoxPC.h index a1fddb59..67486f2d 100644 --- a/amgprec/impl/aggregator/MatchBoxPC.h +++ b/amgprec/impl/aggregator/MatchBoxPC.h @@ -78,6 +78,8 @@ const int BundleTag = 9; // Predefined tag static vector DEFAULT_VECTOR; +#if !defined(SERIAL_MPI) + // MPI type map template MPI_Datatype TypeMap(); @@ -89,6 +91,7 @@ template <> inline MPI_Datatype TypeMap() { return MPI_DOUBLE; } template <> inline MPI_Datatype TypeMap() { return MPI_FLOAT; } +#endif #ifdef __cplusplus extern "C" diff --git a/amgprec/impl/aggregator/clean.cpp b/amgprec/impl/aggregator/clean.cpp index f316aee7..87bb699a 100644 --- a/amgprec/impl/aggregator/clean.cpp +++ b/amgprec/impl/aggregator/clean.cpp @@ -1,6 +1,7 @@ #include "MatchBoxPC.h" // TODO comment +#if !defined(SERIAL_MPI) void clean(MilanLongInt NLVer, MilanInt myRank, @@ -89,3 +90,4 @@ void clean(MilanLongInt NLVer, } } } +#endif diff --git a/amgprec/impl/aggregator/computeCandidateMate.cpp b/amgprec/impl/aggregator/computeCandidateMate.cpp index 7d4e7ce8..a21db656 100644 --- a/amgprec/impl/aggregator/computeCandidateMate.cpp +++ b/amgprec/impl/aggregator/computeCandidateMate.cpp @@ -9,6 +9,8 @@ * @param edgeLocWeight * @return */ +#if !defined(SERIAL_MPI) + MilanLongInt firstComputeCandidateMate(MilanLongInt adj1, MilanLongInt adj2, MilanLongInt *verLocInd, @@ -71,3 +73,4 @@ MilanLongInt computeCandidateMate(MilanLongInt adj1, return w; } +#endif diff --git a/amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp b/amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp index ffb8d2a3..cf340da2 100644 --- a/amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp +++ b/amgprec/impl/aggregator/parallelComputeCandidateMateB.cpp @@ -1,4 +1,5 @@ #include "MatchBoxPC.h" +#if !defined(SERIAL_MPI) void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer, MilanLongInt *verLocPtr, @@ -25,3 +26,4 @@ void PARALLEL_COMPUTE_CANDIDATE_MATE_B(MilanLongInt NLVer, } } } +#endif diff --git a/amgprec/impl/aggregator/processExposedVertex.cpp b/amgprec/impl/aggregator/processExposedVertex.cpp index 2b38ec7a..0336bed5 100644 --- a/amgprec/impl/aggregator/processExposedVertex.cpp +++ b/amgprec/impl/aggregator/processExposedVertex.cpp @@ -1,4 +1,5 @@ #include "MatchBoxPC.h" +#if !defined(SERIAL_MPI) void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer, MilanLongInt *candidateMate, @@ -193,3 +194,4 @@ void PARALLEL_PROCESS_EXPOSED_VERTEX_B(MilanLongInt NLVer, } // End of parallel region } +#endif diff --git a/amgprec/impl/aggregator/processMatchedVertices.cpp b/amgprec/impl/aggregator/processMatchedVertices.cpp index d9363c39..eadc0531 100644 --- a/amgprec/impl/aggregator/processMatchedVertices.cpp +++ b/amgprec/impl/aggregator/processMatchedVertices.cpp @@ -1,5 +1,6 @@ #include "MatchBoxPC.h" +#if !defined(SERIAL_MPI) void processMatchedVertices( MilanLongInt NLVer, vector &UChunkBeingProcessed, @@ -292,3 +293,4 @@ void processMatchedVertices( #endif } // End of parallel region } +#endif diff --git a/amgprec/impl/aggregator/processMatchedVerticesAndSendMessages.cpp b/amgprec/impl/aggregator/processMatchedVerticesAndSendMessages.cpp index 469d7a16..922b5860 100644 --- a/amgprec/impl/aggregator/processMatchedVerticesAndSendMessages.cpp +++ b/amgprec/impl/aggregator/processMatchedVerticesAndSendMessages.cpp @@ -1,5 +1,6 @@ #include "MatchBoxPC.h" //#define DEBUG_HANG_ +#if !defined(SERIAL_MPI) void processMatchedVerticesAndSendMessages( MilanLongInt NLVer, vector &UChunkBeingProcessed, @@ -306,3 +307,4 @@ void processMatchedVerticesAndSendMessages( cout << myRank<<" Done sending messages"< Date: Wed, 21 Feb 2024 11:51:18 +0100 Subject: [PATCH 5/5] Added "COARSE_INVFILL" --- amgprec/impl/amg_ccprecset.F90 | 14 ++++++++++++++ amgprec/impl/amg_dcprecset.F90 | 14 ++++++++++++++ amgprec/impl/amg_scprecset.F90 | 14 ++++++++++++++ amgprec/impl/amg_zcprecset.F90 | 14 ++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/amgprec/impl/amg_ccprecset.F90 b/amgprec/impl/amg_ccprecset.F90 index 70dc3013..9f4fb45f 100644 --- a/amgprec/impl/amg_ccprecset.F90 +++ b/amgprec/impl/amg_ccprecset.F90 @@ -194,6 +194,15 @@ subroutine amg_ccprecseti(p,what,val,info,ilev,ilmax,pos,idx) end if call p%precv(nlev_)%set('SUB_FILLIN',val,info,pos=pos) + case('COARSE_INVFILL') + if (ilev_ /= nlev_) then + write(psb_err_unit,*) name,& + & ': Error: Inconsistent specification of WHAT vs. ILEV' + info = -2 + return + end if + call p%precv(nlev_)%set('INV_FILLIN',val,info,pos=pos) + case('BJAC_ITRACE') if (ilev_ /= nlev_) then write(psb_err_unit,*) name,& @@ -243,6 +252,11 @@ subroutine amg_ccprecseti(p,what,val,info,ilev,ilmax,pos,idx) call p%precv(nlev_)%set('SUB_FILLIN',val,info,pos=pos) end if + case('COARSE_INVFILL') + if (nlev_ > 1) then + call p%precv(nlev_)%set('INV_FILLIN',val,info,pos=pos) + end if + case('BJAC_ITRACE') if (nlev_ > 1) then call p%precv(nlev_)%set('SMOOTHER_ITRACE',val,info,pos=pos) diff --git a/amgprec/impl/amg_dcprecset.F90 b/amgprec/impl/amg_dcprecset.F90 index deaced0d..f70ff55c 100644 --- a/amgprec/impl/amg_dcprecset.F90 +++ b/amgprec/impl/amg_dcprecset.F90 @@ -200,6 +200,15 @@ subroutine amg_dcprecseti(p,what,val,info,ilev,ilmax,pos,idx) end if call p%precv(nlev_)%set('SUB_FILLIN',val,info,pos=pos) + case('COARSE_INVFILL') + if (ilev_ /= nlev_) then + write(psb_err_unit,*) name,& + & ': Error: Inconsistent specification of WHAT vs. ILEV' + info = -2 + return + end if + call p%precv(nlev_)%set('INV_FILLIN',val,info,pos=pos) + case('BJAC_ITRACE') if (ilev_ /= nlev_) then write(psb_err_unit,*) name,& @@ -249,6 +258,11 @@ subroutine amg_dcprecseti(p,what,val,info,ilev,ilmax,pos,idx) call p%precv(nlev_)%set('SUB_FILLIN',val,info,pos=pos) end if + case('COARSE_INVFILL') + if (nlev_ > 1) then + call p%precv(nlev_)%set('INV_FILLIN',val,info,pos=pos) + end if + case('BJAC_ITRACE') if (nlev_ > 1) then call p%precv(nlev_)%set('SMOOTHER_ITRACE',val,info,pos=pos) diff --git a/amgprec/impl/amg_scprecset.F90 b/amgprec/impl/amg_scprecset.F90 index 754725ad..36601f05 100644 --- a/amgprec/impl/amg_scprecset.F90 +++ b/amgprec/impl/amg_scprecset.F90 @@ -194,6 +194,15 @@ subroutine amg_scprecseti(p,what,val,info,ilev,ilmax,pos,idx) end if call p%precv(nlev_)%set('SUB_FILLIN',val,info,pos=pos) + case('COARSE_INVFILL') + if (ilev_ /= nlev_) then + write(psb_err_unit,*) name,& + & ': Error: Inconsistent specification of WHAT vs. ILEV' + info = -2 + return + end if + call p%precv(nlev_)%set('INV_FILLIN',val,info,pos=pos) + case('BJAC_ITRACE') if (ilev_ /= nlev_) then write(psb_err_unit,*) name,& @@ -243,6 +252,11 @@ subroutine amg_scprecseti(p,what,val,info,ilev,ilmax,pos,idx) call p%precv(nlev_)%set('SUB_FILLIN',val,info,pos=pos) end if + case('COARSE_INVFILL') + if (nlev_ > 1) then + call p%precv(nlev_)%set('INV_FILLIN',val,info,pos=pos) + end if + case('BJAC_ITRACE') if (nlev_ > 1) then call p%precv(nlev_)%set('SMOOTHER_ITRACE',val,info,pos=pos) diff --git a/amgprec/impl/amg_zcprecset.F90 b/amgprec/impl/amg_zcprecset.F90 index 5317ca6c..edaed4aa 100644 --- a/amgprec/impl/amg_zcprecset.F90 +++ b/amgprec/impl/amg_zcprecset.F90 @@ -200,6 +200,15 @@ subroutine amg_zcprecseti(p,what,val,info,ilev,ilmax,pos,idx) end if call p%precv(nlev_)%set('SUB_FILLIN',val,info,pos=pos) + case('COARSE_INVFILL') + if (ilev_ /= nlev_) then + write(psb_err_unit,*) name,& + & ': Error: Inconsistent specification of WHAT vs. ILEV' + info = -2 + return + end if + call p%precv(nlev_)%set('INV_FILLIN',val,info,pos=pos) + case('BJAC_ITRACE') if (ilev_ /= nlev_) then write(psb_err_unit,*) name,& @@ -249,6 +258,11 @@ subroutine amg_zcprecseti(p,what,val,info,ilev,ilmax,pos,idx) call p%precv(nlev_)%set('SUB_FILLIN',val,info,pos=pos) end if + case('COARSE_INVFILL') + if (nlev_ > 1) then + call p%precv(nlev_)%set('INV_FILLIN',val,info,pos=pos) + end if + case('BJAC_ITRACE') if (nlev_ > 1) then call p%precv(nlev_)%set('SMOOTHER_ITRACE',val,info,pos=pos)