Fix compilation for BCM example. Next we need to stitch together the codes.

stopcriterion
Salvatore Filippone 6 years ago
parent f8c7a1a4ba
commit 377340f221

@ -24,16 +24,19 @@ BCM_INCDIR=$(BCM_DIR)/include
BCM_LIBDIR=$(BCM_DIR)/lib BCM_LIBDIR=$(BCM_DIR)/lib
BCM_LDLIBS=-lBCM -L$(BCM_LIBDIR) $(HSL_LIBS) $(SPRAL_LIBS) BCM_LDLIBS=-lBCM -L$(BCM_LIBDIR) $(HSL_LIBS) $(SPRAL_LIBS)
CDEFINES=$(MLDCDEFINES) -I$(BCM_INCDIR)
LINKOPT= LINKOPT=
EXEDIR=./runs EXEDIR=./runs
all: mld_d_pde3d all: mld_d_pde3d
BCMOBJS= mld_d_bcmatch_aggregator_mod.o mld_d_bcmatch_aggregator_mat_asb.o \ 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) 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) /bin/mv mld_d_pde3d $(EXEDIR)
mld_d_pde3d.o: data_input.o mld_d_bcmatch_aggregator_mod.o mld_d_pde3d.o: data_input.o mld_d_bcmatch_aggregator_mod.o

@ -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_) :: err_act
integer(psb_ipk_) :: debug_level, debug_unit 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 if (psb_get_errstatus().ne.0) return
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit() 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() ictxt = desc_a%get_context()
call psb_info(ictxt,me,np) 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 ! Build the coarse-level matrix from the fine-level one, starting from
! the mapping defined by mld_aggrmap_bld and applying the aggregation ! 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_) case (mld_no_smooth_)
call mld_daggrmat_unsmth_spmm_asb(a,desc_a,ilaggr,nlaggr,& call mld_daggrmat_unsmth_spmm_asb(a,desc_a,ilaggr,nlaggr,&

@ -146,22 +146,51 @@ module mld_d_bcmatch_aggregator_mod
end subroutine mld_d_bcmatch_aggregator_build_tprol end subroutine mld_d_bcmatch_aggregator_build_tprol
end interface end interface
!!$ interface interface
!!$ subroutine mld_d_bcmatch_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,& subroutine mld_d_bcmatch_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,&
!!$ & op_prol,op_restr,info) & op_prol,op_restr,info)
!!$ import :: mld_d_bcmatch_aggregator_type, psb_desc_type, psb_dspmat_type, psb_dpk_, & import :: mld_d_bcmatch_aggregator_type, psb_desc_type, psb_dspmat_type, psb_dpk_, &
!!$ & psb_ipk_, psb_long_int_k_, mld_dml_parms & psb_ipk_, psb_long_int_k_, mld_dml_parms
!!$ implicit none implicit none
!!$ class(mld_d_bcmatch_aggregator_type), target, intent(inout) :: ag class(mld_d_bcmatch_aggregator_type), target, intent(inout) :: ag
!!$ type(mld_dml_parms), intent(inout) :: parms type(mld_dml_parms), intent(inout) :: parms
!!$ type(psb_dspmat_type), intent(in) :: a type(psb_dspmat_type), intent(in) :: a
!!$ type(psb_desc_type), intent(in) :: desc_a type(psb_desc_type), intent(in) :: desc_a
!!$ integer(psb_ipk_), intent(inout) :: ilaggr(:), nlaggr(:) integer(psb_ipk_), intent(inout) :: ilaggr(:), nlaggr(:)
!!$ type(psb_dspmat_type), intent(inout) :: op_prol type(psb_dspmat_type), intent(inout) :: op_prol
!!$ type(psb_dspmat_type), intent(out) :: ac,op_restr type(psb_dspmat_type), intent(out) :: ac,op_restr
!!$ integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
!!$ end subroutine mld_d_bcmatch_aggregator_mat_asb end subroutine mld_d_bcmatch_aggregator_mat_asb
!!$ end interface 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 contains

@ -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) subroutine mld_d_bcmatch_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
use psb_base_mod 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_bcmatch_aggregator_mod, mld_protect_name => mld_d_bcmatch_aggregator_build_tprol
use mld_d_inner_mod use mld_d_inner_mod
!use bcm_CSRMatrix_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_dspmat_type), intent(in) :: a
type(psb_desc_type), intent(in) :: desc_a type(psb_desc_type), intent(in) :: desc_a
integer(psb_ipk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:) integer(psb_ipk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
real(psb_dpk_), allocatable:: valaggr(:)
type(psb_dspmat_type), intent(out) :: op_prol type(psb_dspmat_type), intent(out) :: op_prol
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
! Local variables ! Local variables
real(psb_dpk_), allocatable:: valaggr(:)
type(psb_dspmat_type) :: a_tmp type(psb_dspmat_type) :: a_tmp
type(bcm_CSRMatrix) :: C, P type(bcm_CSRMatrix) :: C, P
integer(c_int) :: match_algorithm, n_sweeps, max_csize, max_nlevels 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_ info = psb_success_
call mld_check_def(parms%ml_type,'Multilevel type',& call mld_check_def(parms%ml_cycle,'Multilevel cycle',&
& mld_mult_ml_,is_legal_ml_type) & mld_mult_ml_,is_legal_ml_cycle)
call mld_check_def(parms%aggr_alg,'Aggregation',& call mld_check_def(parms%par_aggr_alg,'Aggregation',&
& mld_dec_aggr_,is_legal_ml_aggr_alg) & mld_dec_aggr_,is_legal_ml_par_aggr_alg)
call mld_check_def(parms%aggr_ord,'Ordering',& call mld_check_def(parms%aggr_ord,'Ordering',&
& mld_aggr_ord_nat_,is_legal_ml_aggr_ord) & mld_aggr_ord_nat_,is_legal_ml_aggr_ord)
call mld_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs) 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 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 if (info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_bcmatch_map_to_tprol') call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_bcmatch_map_to_tprol')
goto 9999 goto 9999

@ -89,7 +89,8 @@
subroutine mld_d_bcmatch_map_to_tprol(desc_a,ilaggr,nlaggr,valaggr, op_prol,info) subroutine mld_d_bcmatch_map_to_tprol(desc_a,ilaggr,nlaggr,valaggr, op_prol,info)
use psb_base_mod 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 implicit none

@ -98,7 +98,7 @@
! !
subroutine mld_daggrmat_unsmth_spmm_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_restr,info) subroutine mld_daggrmat_unsmth_spmm_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_restr,info)
use psb_base_mod 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 implicit none

Loading…
Cancel
Save