From 32994c7ce82dbdae0fd908b6f87bebf15b9f8a2e Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 13 Dec 2022 06:44:12 -0500 Subject: [PATCH] Better parameters in matchboxp_mod --- amgprec/amg_d_matchboxp_mod.f90 | 17 +++++++++-------- amgprec/amg_s_matchboxp_mod.f90 | 15 ++++++++------- amgprec/stZnqhkT | 1 - 3 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 amgprec/stZnqhkT diff --git a/amgprec/amg_d_matchboxp_mod.f90 b/amgprec/amg_d_matchboxp_mod.f90 index f6cb38ff..2df58797 100644 --- a/amgprec/amg_d_matchboxp_mod.f90 +++ b/amgprec/amg_d_matchboxp_mod.f90 @@ -146,6 +146,7 @@ contains & debug_ilaggr=.false., debug_sync=.false. integer(psb_ipk_), save :: idx_bldmtc=-1, idx_phase1=-1, idx_phase2=-1, idx_phase3=-1 logical, parameter :: do_timings=.true. + integer, parameter :: ilaggr_neginit=-1, ilaggr_nonlocal=-2 ictxt = desc_a%get_ctxt() call psb_info(ictxt,iam,np) @@ -187,7 +188,7 @@ contains call desc_a%l2gip(ilv,info,owned=.false.) call psb_geall(ilaggr,desc_a,info) - ilaggr = -1 + ilaggr = ilaggr_neginit call psb_geasb(ilaggr,desc_a,info) nr = a%get_nrows() nc = a%get_ncols() @@ -259,7 +260,7 @@ contains cycle else - if (ilaggr(k) == -1) then + if (ilaggr(k) == ilaggr_neginit) then wk = w(k) widx = w(idx) @@ -267,7 +268,7 @@ contains nrmagg = wmax*sqrt((wk/wmax)**2+(widx/wmax)**2) if (nrmagg > epsilon(nrmagg)) then if (idx <= nr) then - if (ilaggr(idx) == -1) then + if (ilaggr(idx) == ilaggr_neginit) then ! Now, if both vertices are local, the aggregate is local ! (kinda obvious). nlaggr(iam) = nlaggr(iam) + 1 @@ -294,7 +295,7 @@ contains ilaggr(k) = nlaggr(iam) nlpairs = nlpairs+1 else - ilaggr(k) = -2 + ilaggr(k) = ilaggr_nonlocal end if else ! Use a statistically unbiased tie-breaking rule, @@ -309,7 +310,7 @@ contains ilaggr(k) = nlaggr(iam) nlpairs = nlpairs+1 else - ilaggr(k) = -2 + ilaggr(k) = ilaggr_nonlocal end if end if end if @@ -332,7 +333,7 @@ contains if (do_timings) call psb_tic(idx_phase3) ! Ok, now compute offsets, gather halo and fix non-local - ! aggregates (those where ilaggr == -2) + ! aggregates (those where ilaggr == ilaggr_nonlocal) call psb_sum(ictxt,nlaggr) ntaggr = sum(nlaggr(0:np-1)) naggrm1 = sum(nlaggr(0:iam-1)) @@ -347,7 +348,7 @@ contains call psb_halo(wtemp,desc_a,info) ! Cleanup as yet unmarked entries do k=1,nr - if (ilaggr(k) == -2) then + if (ilaggr(k) == ilaggr_nonlocal) then idx = mate(k) if (idx > nr) then i = ilaggr(idx) @@ -1109,7 +1110,7 @@ contains verlocptr(:) = verlocptr(:) + 1 verlocind(:) = verlocind(:) + 1 verdistance(:) = verdistance(:) + 1 - if (me==0) write(0,*) 'Ph0/1/2 time ',ph0_time, ph1_time, ph2_time + if (debug_sync) then call psb_barrier(ictxt) if (me == 0) write(0,*)' Done MatchBoxP ' diff --git a/amgprec/amg_s_matchboxp_mod.f90 b/amgprec/amg_s_matchboxp_mod.f90 index 9061344f..9144d70e 100644 --- a/amgprec/amg_s_matchboxp_mod.f90 +++ b/amgprec/amg_s_matchboxp_mod.f90 @@ -146,6 +146,7 @@ contains & debug_ilaggr=.false., debug_sync=.false. integer(psb_ipk_), save :: idx_bldmtc=-1, idx_phase1=-1, idx_phase2=-1, idx_phase3=-1 logical, parameter :: do_timings=.true. + integer, parameter :: ilaggr_neginit=-1, ilaggr_nonlocal=-2 ictxt = desc_a%get_ctxt() call psb_info(ictxt,iam,np) @@ -187,7 +188,7 @@ contains call desc_a%l2gip(ilv,info,owned=.false.) call psb_geall(ilaggr,desc_a,info) - ilaggr = -1 + ilaggr = ilaggr_neginit call psb_geasb(ilaggr,desc_a,info) nr = a%get_nrows() nc = a%get_ncols() @@ -259,7 +260,7 @@ contains cycle else - if (ilaggr(k) == -1) then + if (ilaggr(k) == ilaggr_neginit) then wk = w(k) widx = w(idx) @@ -267,7 +268,7 @@ contains nrmagg = wmax*sqrt((wk/wmax)**2+(widx/wmax)**2) if (nrmagg > epsilon(nrmagg)) then if (idx <= nr) then - if (ilaggr(idx) == -1) then + if (ilaggr(idx) == ilaggr_neginit) then ! Now, if both vertices are local, the aggregate is local ! (kinda obvious). nlaggr(iam) = nlaggr(iam) + 1 @@ -294,7 +295,7 @@ contains ilaggr(k) = nlaggr(iam) nlpairs = nlpairs+1 else - ilaggr(k) = -2 + ilaggr(k) = ilaggr_nonlocal end if else ! Use a statistically unbiased tie-breaking rule, @@ -309,7 +310,7 @@ contains ilaggr(k) = nlaggr(iam) nlpairs = nlpairs+1 else - ilaggr(k) = -2 + ilaggr(k) = ilaggr_nonlocal end if end if end if @@ -332,7 +333,7 @@ contains if (do_timings) call psb_tic(idx_phase3) ! Ok, now compute offsets, gather halo and fix non-local - ! aggregates (those where ilaggr == -2) + ! aggregates (those where ilaggr == ilaggr_nonlocal) call psb_sum(ictxt,nlaggr) ntaggr = sum(nlaggr(0:np-1)) naggrm1 = sum(nlaggr(0:iam-1)) @@ -347,7 +348,7 @@ contains call psb_halo(wtemp,desc_a,info) ! Cleanup as yet unmarked entries do k=1,nr - if (ilaggr(k) == -2) then + if (ilaggr(k) == ilaggr_nonlocal) then idx = mate(k) if (idx > nr) then i = ilaggr(idx) diff --git a/amgprec/stZnqhkT b/amgprec/stZnqhkT deleted file mode 100644 index 8b277f0d..00000000 --- a/amgprec/stZnqhkT +++ /dev/null @@ -1 +0,0 @@ -!