From 19b5e9bc1576e575a3034d9a6af2483ba2a49f2b Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Wed, 14 Oct 2009 16:04:55 +0000 Subject: [PATCH] mld2p4-2: mlprec/mld_daggrmat_smth_asb.F90 mlprec/mld_dcoarse_bld.f90 mlprec/mld_dilu_bld.f90 mlprec/mld_dsub_solve.f90 tests/pdegen/runs/ppde.inp Found and fixed bugs in building. Some preconditioners work, testing not complete yet. --- mlprec/mld_daggrmat_smth_asb.F90 | 9 ++++++--- mlprec/mld_dcoarse_bld.f90 | 4 +++- mlprec/mld_dilu_bld.f90 | 2 ++ mlprec/mld_dsub_solve.f90 | 5 +++-- tests/pdegen/runs/ppde.inp | 14 +++++++------- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/mlprec/mld_daggrmat_smth_asb.F90 b/mlprec/mld_daggrmat_smth_asb.F90 index 1e5dba40..79bd27e7 100644 --- a/mlprec/mld_daggrmat_smth_asb.F90 +++ b/mlprec/mld_daggrmat_smth_asb.F90 @@ -222,14 +222,14 @@ subroutine mld_daggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info) call acoo4%set_nzeros(nrow) endif call acoo4%set_dupl(psb_dupl_add_) - + call acsr4%mv_from_coo(acoo4,info) if (info==0) call a%cscnv(acsr3,info,dupl=psb_dupl_add_) if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& & ' Initial copies done.' - + if (filter_mat) then ! ! Build the filtered matrix Af from A @@ -265,6 +265,7 @@ subroutine mld_daggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info) end if end do call acoof%set_nzeros(k) + call acoof%set_dupl(psb_dupl_add_) call acsrf%mv_from_coo(acoof,info) end if @@ -369,6 +370,7 @@ subroutine mld_daggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info) if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& & 'Done NUMBMM 1' + else ! ! Build the smoothed prolongator using the original matrix @@ -407,6 +409,7 @@ subroutine mld_daggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info) end if call acsr4%free() + call acsr1%set_dupl(psb_dupl_add_) call am1%mv_from(acsr1) if (ml_global_nmb) then @@ -435,7 +438,7 @@ subroutine mld_daggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info) call psb_numbmm(a,am1,am3) if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & 'Done NUMBMM 2' + & 'Done NUMBMM 2',p%iprcparm(mld_aggr_kind_), mld_smooth_prol_ if (p%iprcparm(mld_aggr_kind_) == mld_smooth_prol_) then call am2%transp(am1) diff --git a/mlprec/mld_dcoarse_bld.f90 b/mlprec/mld_dcoarse_bld.f90 index c2c33a7f..909cd8cd 100644 --- a/mlprec/mld_dcoarse_bld.f90 +++ b/mlprec/mld_dcoarse_bld.f90 @@ -123,7 +123,8 @@ subroutine mld_dcoarse_bld(a,desc_a,p,info) ! call mld_aggrmap_bld(p%iprcparm(mld_aggr_alg_),p%rprcparm(mld_aggr_thresh_),& & a,desc_a,ilaggr,nlaggr,info) - if(info /= 0) then + + if (info /= 0) then call psb_errpush(4010,name,a_err='mld_aggrmap_bld') goto 9999 end if @@ -134,6 +135,7 @@ subroutine mld_dcoarse_bld(a,desc_a,p,info) ! algorithm specified by p%iprcparm(mld_aggr_kind_) ! call mld_aggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) + if(info /= 0) then call psb_errpush(4010,name,a_err='mld_aggrmat_asb') goto 9999 diff --git a/mlprec/mld_dilu_bld.f90 b/mlprec/mld_dilu_bld.f90 index 0a670d24..18547a9a 100644 --- a/mlprec/mld_dilu_bld.f90 +++ b/mlprec/mld_dilu_bld.f90 @@ -263,7 +263,9 @@ subroutine mld_dilu_bld(a,p,upd,info,blck) end if + call p%av(mld_l_pr_)%set_asb() call p%av(mld_l_pr_)%trim() + call p%av(mld_u_pr_)%set_asb() call p%av(mld_u_pr_)%trim() if (debug_level >= psb_debug_outer_) & diff --git a/mlprec/mld_dsub_solve.f90 b/mlprec/mld_dsub_solve.f90 index 2e6f49c6..f21bc998 100644 --- a/mlprec/mld_dsub_solve.f90 +++ b/mlprec/mld_dsub_solve.f90 @@ -195,12 +195,12 @@ subroutine mld_dsub_solve(alpha,prec,x,beta,y,desc_data,trans,work,info) ! factorization of the blocks (distributed matrix) or approximately ! solve a system through ILU(k)/MILU(k)/ILU(k,t) (replicated matrix). ! - + select case(trans_) case('N') - call psb_spsm(done,prec%av(mld_l_pr_),x,dzero,ww,desc_data,info,& & trans=trans_,scale='L',diag=prec%d,choice=psb_none_,work=aux) + if (info == 0) call psb_spsm(alpha,prec%av(mld_u_pr_),ww,beta,y,desc_data,info,& & trans=trans_,scale='U',choice=psb_none_, work=aux) @@ -283,6 +283,7 @@ subroutine mld_dsub_solve(alpha,prec,x,beta,y,desc_data,trans,work,info) end select if (info /= 0) then + call psb_errpush(4001,name,a_err='Error in subsolve') goto 9999 endif diff --git a/tests/pdegen/runs/ppde.inp b/tests/pdegen/runs/ppde.inp index 3b793714..1f1e8c98 100644 --- a/tests/pdegen/runs/ppde.inp +++ b/tests/pdegen/runs/ppde.inp @@ -1,28 +1,28 @@ BICGSTAB ! Iterative method: BiCGSTAB BiCG CGS RGMRES BiCGSTABL CG CSR ! Storage format CSR COO JAD -50 ! IDIM; domain size is idim**3 +40 ! IDIM; domain size is idim**3 2 ! ISTOPC 00100 ! ITMAX 01 ! ITRACE 30 ! IRST (restart for RGMRES and BiCGSTABL) 1.d-6 ! EPS -3L-M-RAS-I-D4 ! Longer descriptive name for preconditioner (up to 20 chars) +2L-M-RAS-I-D4 ! Longer descriptive name for preconditioner (up to 20 chars) ML ! Preconditioner NONE DIAG BJAC AS ML -0 ! Number of overlap layers for AS preconditioner at finest level +1 ! Number of overlap layers for AS preconditioner at finest level HALO ! Restriction operator NONE HALO NONE ! Prolongation operator NONE SUM AVG ILU ! Subdomain solver ILU MILU ILUT UMF SLU -0 ! Level-set N for ILU(N) +1 ! Level-set N for ILU(N) 1.d-4 ! Threshold T for ILU(T,P) -3 ! Number of levels in a multilevel preconditioner -MINENERGY ! Kind of aggregation: SMOOTHED, NONSMOOTHED, MINENERGY +2 ! Number of levels in a multilevel preconditioner +SMOOTHED ! Kind of aggregation: SMOOTHED, NONSMOOTHED, MINENERGY DEC ! Type of aggregation DEC SYMDEC GLB MULT ! Type of multilevel correction: ADD MULT POST ! Side of multiplicative correction PRE POST TWOSIDE (ignored for ADD) DIST ! Coarse level: matrix distribution DIST REPL BJAC ! Coarse level: solver BJAC UMF SLU SLUDIST ILU ! Coarse level: subsolver ILU UMF SLU SLUDIST -1 ! Coarse level: Level-set N for ILU(N) +0 ! Coarse level: Level-set N for ILU(N) 1.d-4 ! Coarse level: Threshold T for ILU(T,P) 4 ! Coarse level: Number of Jacobi sweeps 0.10d0 ! Smoother Aggregation Threshold: >= 0.0