From 758d52f1757cb1a39ed7525ba8a6ed59b1f1c837 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 17 Dec 2015 16:56:25 +0000 Subject: [PATCH] mld2p4-2.0-maint: mlprec/impl/mld_caggrmat_asb.f90 mlprec/impl/mld_daggrmat_asb.f90 mlprec/impl/mld_dcoarse_bld.f90 mlprec/impl/mld_saggrmat_asb.f90 mlprec/impl/mld_zaggrmat_asb.f90 mlprec/mld_base_prec_type.F90 Use clean_zeros method. --- mlprec/impl/mld_caggrmat_asb.f90 | 4 +++- mlprec/impl/mld_daggrmat_asb.f90 | 4 +++- mlprec/impl/mld_dcoarse_bld.f90 | 1 + mlprec/impl/mld_saggrmat_asb.f90 | 4 +++- mlprec/impl/mld_zaggrmat_asb.f90 | 4 +++- mlprec/mld_base_prec_type.F90 | 1 + 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mlprec/impl/mld_caggrmat_asb.f90 b/mlprec/impl/mld_caggrmat_asb.f90 index 739c5ed5..5bafe5d2 100644 --- a/mlprec/impl/mld_caggrmat_asb.f90 +++ b/mlprec/impl/mld_caggrmat_asb.f90 @@ -173,8 +173,9 @@ subroutine mld_caggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) case(mld_distr_mat_) - nzl = ac%get_nzeros() call ac%mv_to(bcoo) + if (p%parms%clean_zeros) call bcoo%clean_zeros(info) + nzl = bcoo%get_nzeros() if (info == psb_success_) call psb_cdall(ictxt,p%desc_ac,info,nl=nlaggr(me+1)) if (info == psb_success_) call psb_cdins(nzl,bcoo%ia,bcoo%ja,p%desc_ac,info) @@ -237,6 +238,7 @@ subroutine mld_caggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) ! call psb_cdall(ictxt,p%desc_ac,info,mg=ntaggr,repl=.true.) if (info == psb_success_) call psb_cdasb(p%desc_ac,info) + if ((info == psb_success_).and.p%parms%clean_zeros) call ac%clean_zeros(info) if (info == psb_success_) & & call psb_gather(p%ac,ac,p%desc_ac,info,dupl=psb_dupl_add_,keeploc=.false.) diff --git a/mlprec/impl/mld_daggrmat_asb.f90 b/mlprec/impl/mld_daggrmat_asb.f90 index e090ae5e..46f612da 100644 --- a/mlprec/impl/mld_daggrmat_asb.f90 +++ b/mlprec/impl/mld_daggrmat_asb.f90 @@ -173,8 +173,9 @@ subroutine mld_daggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) case(mld_distr_mat_) - nzl = ac%get_nzeros() call ac%mv_to(bcoo) + if (p%parms%clean_zeros) call bcoo%clean_zeros(info) + nzl = bcoo%get_nzeros() if (info == psb_success_) call psb_cdall(ictxt,p%desc_ac,info,nl=nlaggr(me+1)) if (info == psb_success_) call psb_cdins(nzl,bcoo%ia,bcoo%ja,p%desc_ac,info) @@ -237,6 +238,7 @@ subroutine mld_daggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) ! call psb_cdall(ictxt,p%desc_ac,info,mg=ntaggr,repl=.true.) if (info == psb_success_) call psb_cdasb(p%desc_ac,info) + if ((info == psb_success_).and.p%parms%clean_zeros) call ac%clean_zeros(info) if (info == psb_success_) & & call psb_gather(p%ac,ac,p%desc_ac,info,dupl=psb_dupl_add_,keeploc=.false.) diff --git a/mlprec/impl/mld_dcoarse_bld.f90 b/mlprec/impl/mld_dcoarse_bld.f90 index c3d6bdeb..8d8b5e86 100644 --- a/mlprec/impl/mld_dcoarse_bld.f90 +++ b/mlprec/impl/mld_dcoarse_bld.f90 @@ -136,6 +136,7 @@ subroutine mld_dcoarse_bld(a,desc_a,p,info) call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_aggrmat_asb') goto 9999 end if + ! ! Fix the base_a and base_desc pointers for handling of residuals. ! This is correct because this routine is only called at levels >=2. diff --git a/mlprec/impl/mld_saggrmat_asb.f90 b/mlprec/impl/mld_saggrmat_asb.f90 index a07d13ff..e9290a32 100644 --- a/mlprec/impl/mld_saggrmat_asb.f90 +++ b/mlprec/impl/mld_saggrmat_asb.f90 @@ -173,8 +173,9 @@ subroutine mld_saggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) case(mld_distr_mat_) - nzl = ac%get_nzeros() call ac%mv_to(bcoo) + if (p%parms%clean_zeros) call bcoo%clean_zeros(info) + nzl = bcoo%get_nzeros() if (info == psb_success_) call psb_cdall(ictxt,p%desc_ac,info,nl=nlaggr(me+1)) if (info == psb_success_) call psb_cdins(nzl,bcoo%ia,bcoo%ja,p%desc_ac,info) @@ -237,6 +238,7 @@ subroutine mld_saggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) ! call psb_cdall(ictxt,p%desc_ac,info,mg=ntaggr,repl=.true.) if (info == psb_success_) call psb_cdasb(p%desc_ac,info) + if ((info == psb_success_).and.p%parms%clean_zeros) call ac%clean_zeros(info) if (info == psb_success_) & & call psb_gather(p%ac,ac,p%desc_ac,info,dupl=psb_dupl_add_,keeploc=.false.) diff --git a/mlprec/impl/mld_zaggrmat_asb.f90 b/mlprec/impl/mld_zaggrmat_asb.f90 index 1c484b4f..12268cc7 100644 --- a/mlprec/impl/mld_zaggrmat_asb.f90 +++ b/mlprec/impl/mld_zaggrmat_asb.f90 @@ -173,8 +173,9 @@ subroutine mld_zaggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) case(mld_distr_mat_) - nzl = ac%get_nzeros() call ac%mv_to(bcoo) + if (p%parms%clean_zeros) call bcoo%clean_zeros(info) + nzl = bcoo%get_nzeros() if (info == psb_success_) call psb_cdall(ictxt,p%desc_ac,info,nl=nlaggr(me+1)) if (info == psb_success_) call psb_cdins(nzl,bcoo%ia,bcoo%ja,p%desc_ac,info) @@ -237,6 +238,7 @@ subroutine mld_zaggrmat_asb(a,desc_a,ilaggr,nlaggr,p,info) ! call psb_cdall(ictxt,p%desc_ac,info,mg=ntaggr,repl=.true.) if (info == psb_success_) call psb_cdasb(p%desc_ac,info) + if ((info == psb_success_).and.p%parms%clean_zeros) call ac%clean_zeros(info) if (info == psb_success_) & & call psb_gather(p%ac,ac,p%desc_ac,info,dupl=psb_dupl_add_,keeploc=.false.) diff --git a/mlprec/mld_base_prec_type.F90 b/mlprec/mld_base_prec_type.F90 index d0bbbcb4..738117c2 100644 --- a/mlprec/mld_base_prec_type.F90 +++ b/mlprec/mld_base_prec_type.F90 @@ -101,6 +101,7 @@ module mld_base_prec_type integer(psb_ipk_) :: aggr_alg, aggr_kind integer(psb_ipk_) :: aggr_omega_alg, aggr_eig, aggr_filter integer(psb_ipk_) :: coarse_mat, coarse_solve + logical :: clean_zeros=.true. contains procedure, pass(pm) :: clone => ml_parms_clone procedure, pass(pm) :: descr => ml_parms_descr