diff --git a/tests/Bcmatch/Makefile b/tests/Bcmatch/Makefile index e0f9b6b2..42a1cf2b 100644 --- a/tests/Bcmatch/Makefile +++ b/tests/Bcmatch/Makefile @@ -24,16 +24,19 @@ BCM_INCDIR=$(BCM_DIR)/include BCM_LIBDIR=$(BCM_DIR)/lib BCM_LDLIBS=-lBCM -L$(BCM_LIBDIR) $(HSL_LIBS) $(SPRAL_LIBS) +CDEFINES=$(MLDCDEFINES) -I$(BCM_INCDIR) + LINKOPT= EXEDIR=./runs all: mld_d_pde3d BCMOBJS= mld_d_bcmatch_aggregator_mod.o mld_d_bcmatch_aggregator_mat_asb.o \ - mld_d_bcmatch_aggregator_tprol.o mld_d_bcmatch_map_to_tprol.o + mld_d_bcmatch_aggregator_tprol.o mld_d_bcmatch_map_to_tprol.o \ + mld_daggrmat_unsmth_spmm_asb.o bootCMatch_interface.o mld_d_pde3d: mld_d_pde3d.o data_input.o $(BCMOBJS) - $(FLINK) $(LINKOPT) mld_d_pde3d.o data_input.o $(BCMOBJS) -o mld_d_pde3d $(MLD_LIBS) $(BCMLIBS) $(PSBLAS_LIBS) $(LDLIBS) + $(FLINK) $(LINKOPT) mld_d_pde3d.o data_input.o $(BCMOBJS) -o mld_d_pde3d $(MLD_LIBS) $(BCM_LDLIBS) $(PSBLAS_LIBS) $(LDLIBS) /bin/mv mld_d_pde3d $(EXEDIR) mld_d_pde3d.o: data_input.o mld_d_bcmatch_aggregator_mod.o diff --git a/tests/Bcmatch/mld_d_bcmatch_aggregator_mat_asb.f90 b/tests/Bcmatch/mld_d_bcmatch_aggregator_mat_asb.f90 index 3ec938d9..1566dced 100644 --- a/tests/Bcmatch/mld_d_bcmatch_aggregator_mat_asb.f90 +++ b/tests/Bcmatch/mld_d_bcmatch_aggregator_mat_asb.f90 @@ -156,7 +156,7 @@ subroutine mld_d_bcmatch_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac, integer(psb_ipk_) :: err_act integer(psb_ipk_) :: debug_level, debug_unit - name='mld_d_base_aggregator_mat_asb' + name='mld_d_bcmatch_aggregator_mat_asb' if (psb_get_errstatus().ne.0) return call psb_erractionsave(err_act) debug_unit = psb_get_debug_unit() @@ -165,26 +165,12 @@ subroutine mld_d_bcmatch_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac, ictxt = desc_a%get_context() call psb_info(ictxt,me,np) - call mld_check_def(parms%aggr_kind,'Smoother',& - & mld_smooth_prol_,is_legal_ml_aggr_kind) - call mld_check_def(parms%coarse_mat,'Coarse matrix',& - & mld_distr_mat_,is_legal_ml_coarse_mat) - call mld_check_def(parms%aggr_filter,'Use filtered matrix',& - & mld_no_filter_mat_,is_legal_aggr_filter) - call mld_check_def(parms%smoother_pos,'smooth_pos',& - & mld_pre_smooth_,is_legal_ml_smooth_pos) - call mld_check_def(parms%aggr_omega_alg,'Omega Alg.',& - & mld_eig_est_,is_legal_ml_aggr_omega_alg) - call mld_check_def(parms%aggr_eig,'Eigenvalue estimate',& - & mld_max_norm_,is_legal_ml_aggr_eig) - call mld_check_def(parms%aggr_omega_val,'Omega',dzero,is_legal_d_omega) - ! ! Build the coarse-level matrix from the fine-level one, starting from ! the mapping defined by mld_aggrmap_bld and applying the aggregation - ! algorithm specified by p%iprcparm(mld_aggr_kind_) + ! algorithm specified by ! - select case (parms%aggr_kind) + select case (parms%aggr_prol) case (mld_no_smooth_) call mld_daggrmat_unsmth_spmm_asb(a,desc_a,ilaggr,nlaggr,& diff --git a/tests/Bcmatch/mld_d_bcmatch_aggregator_mod.F90 b/tests/Bcmatch/mld_d_bcmatch_aggregator_mod.F90 index 891ca7e6..a70c0946 100644 --- a/tests/Bcmatch/mld_d_bcmatch_aggregator_mod.F90 +++ b/tests/Bcmatch/mld_d_bcmatch_aggregator_mod.F90 @@ -146,22 +146,51 @@ module mld_d_bcmatch_aggregator_mod end subroutine mld_d_bcmatch_aggregator_build_tprol end interface -!!$ interface -!!$ subroutine mld_d_bcmatch_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,& -!!$ & op_prol,op_restr,info) -!!$ import :: mld_d_bcmatch_aggregator_type, psb_desc_type, psb_dspmat_type, psb_dpk_, & -!!$ & psb_ipk_, psb_long_int_k_, mld_dml_parms -!!$ implicit none -!!$ class(mld_d_bcmatch_aggregator_type), target, intent(inout) :: ag -!!$ type(mld_dml_parms), intent(inout) :: parms -!!$ type(psb_dspmat_type), intent(in) :: a -!!$ type(psb_desc_type), intent(in) :: desc_a -!!$ integer(psb_ipk_), intent(inout) :: ilaggr(:), nlaggr(:) -!!$ type(psb_dspmat_type), intent(inout) :: op_prol -!!$ type(psb_dspmat_type), intent(out) :: ac,op_restr -!!$ integer(psb_ipk_), intent(out) :: info -!!$ end subroutine mld_d_bcmatch_aggregator_mat_asb -!!$ end interface + interface + subroutine mld_d_bcmatch_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,& + & op_prol,op_restr,info) + import :: mld_d_bcmatch_aggregator_type, psb_desc_type, psb_dspmat_type, psb_dpk_, & + & psb_ipk_, psb_long_int_k_, mld_dml_parms + implicit none + class(mld_d_bcmatch_aggregator_type), target, intent(inout) :: ag + type(mld_dml_parms), intent(inout) :: parms + type(psb_dspmat_type), intent(in) :: a + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(inout) :: ilaggr(:), nlaggr(:) + type(psb_dspmat_type), intent(inout) :: op_prol + type(psb_dspmat_type), intent(out) :: ac,op_restr + integer(psb_ipk_), intent(out) :: info + end subroutine mld_d_bcmatch_aggregator_mat_asb + end interface + + + interface + subroutine mld_d_bcmatch_map_to_tprol(desc_a,ilaggr,nlaggr,valaggr, op_prol,info) + import :: mld_d_bcmatch_aggregator_type, psb_desc_type, psb_dspmat_type, psb_dpk_, & + & psb_ipk_, psb_long_int_k_, mld_dml_parms + implicit none + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), allocatable, intent(inout) :: ilaggr(:),nlaggr(:) + real(psb_dpk_), allocatable, intent(inout) :: valaggr(:) + type(psb_dspmat_type), intent(out) :: op_prol + integer(psb_ipk_), intent(out) :: info + end subroutine mld_d_bcmatch_map_to_tprol + end interface + + interface + subroutine mld_daggrmat_unsmth_spmm_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_restr,info) + import :: mld_d_bcmatch_aggregator_type, psb_desc_type, psb_dspmat_type, psb_dpk_, & + & psb_ipk_, psb_long_int_k_, mld_dml_parms + implicit none + type(psb_dspmat_type), intent(in) :: a + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(inout) :: ilaggr(:), nlaggr(:) + type(mld_dml_parms), intent(inout) :: parms + type(psb_dspmat_type), intent(inout) :: op_prol + type(psb_dspmat_type), intent(out) :: ac,op_restr + integer(psb_ipk_), intent(out) :: info + end subroutine mld_daggrmat_unsmth_spmm_asb + end interface contains diff --git a/tests/Bcmatch/mld_d_bcmatch_aggregator_tprol.f90 b/tests/Bcmatch/mld_d_bcmatch_aggregator_tprol.f90 index d6b511fe..22453c83 100644 --- a/tests/Bcmatch/mld_d_bcmatch_aggregator_tprol.f90 +++ b/tests/Bcmatch/mld_d_bcmatch_aggregator_tprol.f90 @@ -206,6 +206,7 @@ end module bcm_CSRMatrix_mod subroutine mld_d_bcmatch_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info) use psb_base_mod + use mld_d_prec_type use mld_d_bcmatch_aggregator_mod, mld_protect_name => mld_d_bcmatch_aggregator_build_tprol use mld_d_inner_mod !use bcm_CSRMatrix_mod @@ -217,12 +218,12 @@ subroutine mld_d_bcmatch_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr type(psb_dspmat_type), intent(in) :: a type(psb_desc_type), intent(in) :: desc_a integer(psb_ipk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:) - real(psb_dpk_), allocatable:: valaggr(:) type(psb_dspmat_type), intent(out) :: op_prol integer(psb_ipk_), intent(out) :: info ! Local variables + real(psb_dpk_), allocatable:: valaggr(:) type(psb_dspmat_type) :: a_tmp type(bcm_CSRMatrix) :: C, P integer(c_int) :: match_algorithm, n_sweeps, max_csize, max_nlevels @@ -280,10 +281,10 @@ subroutine mld_d_bcmatch_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr info = psb_success_ - call mld_check_def(parms%ml_type,'Multilevel type',& - & mld_mult_ml_,is_legal_ml_type) - call mld_check_def(parms%aggr_alg,'Aggregation',& - & mld_dec_aggr_,is_legal_ml_aggr_alg) + call mld_check_def(parms%ml_cycle,'Multilevel cycle',& + & mld_mult_ml_,is_legal_ml_cycle) + call mld_check_def(parms%par_aggr_alg,'Aggregation',& + & mld_dec_aggr_,is_legal_ml_par_aggr_alg) call mld_check_def(parms%aggr_ord,'Ordering',& & mld_aggr_ord_nat_,is_legal_ml_aggr_ord) call mld_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs) @@ -340,7 +341,7 @@ subroutine mld_d_bcmatch_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr call psb_sum(ictxt,nlaggr(1:np)) - call mld_bcmatch_map_to_tprol(desc_a,ilaggr,nlaggr,valaggr,op_prol,info) + call mld_d_bcmatch_map_to_tprol(desc_a,ilaggr,nlaggr,valaggr,op_prol,info) if (info /= psb_success_) then call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_bcmatch_map_to_tprol') goto 9999 diff --git a/tests/Bcmatch/mld_d_bcmatch_map_to_tprol.f90 b/tests/Bcmatch/mld_d_bcmatch_map_to_tprol.f90 index 960f9cb9..6d289454 100644 --- a/tests/Bcmatch/mld_d_bcmatch_map_to_tprol.f90 +++ b/tests/Bcmatch/mld_d_bcmatch_map_to_tprol.f90 @@ -89,7 +89,8 @@ subroutine mld_d_bcmatch_map_to_tprol(desc_a,ilaggr,nlaggr,valaggr, op_prol,info) use psb_base_mod - use mld_d_inner_mod, mld_protect_name => mld_d_bcmatch_map_to_tprol + use mld_d_inner_mod!, mld_protect_name => mld_d_bcmatch_map_to_tprol + use mld_d_bcmatch_aggregator_mod, mld_protect_name => mld_d_bcmatch_map_to_tprol implicit none diff --git a/tests/Bcmatch/mld_daggrmat_unsmth_spmm_asb.f90 b/tests/Bcmatch/mld_daggrmat_unsmth_spmm_asb.f90 index 54173b30..49a42446 100644 --- a/tests/Bcmatch/mld_daggrmat_unsmth_spmm_asb.f90 +++ b/tests/Bcmatch/mld_daggrmat_unsmth_spmm_asb.f90 @@ -98,7 +98,7 @@ ! subroutine mld_daggrmat_unsmth_spmm_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_restr,info) use psb_base_mod - use mld_d_inner_mod, mld_protect_name => mld_daggrmat_unsmth_spmm_asb + use mld_d_inner_mod!, mld_protect_name => mld_daggrmat_unsmth_spmm_asb implicit none