Added set to parmatch

mergeparmatch
Cirdans-Home 4 years ago
parent a65f618a96
commit 5aa3cfca1b

@ -267,13 +267,15 @@ module amg_base_prec_type
integer(psb_ipk_), parameter :: amg_dec_aggr_ = 0 integer(psb_ipk_), parameter :: amg_dec_aggr_ = 0
integer(psb_ipk_), parameter :: amg_sym_dec_aggr_ = 1 integer(psb_ipk_), parameter :: amg_sym_dec_aggr_ = 1
integer(psb_ipk_), parameter :: amg_ext_aggr_ = 2 integer(psb_ipk_), parameter :: amg_ext_aggr_ = 2
integer(psb_ipk_), parameter :: amg_max_par_aggr_alg_ = amg_ext_aggr_ integer(psb_ipk_), parameter :: amg_coupled_aggr_ = 3
integer(psb_ipk_), parameter :: amg_max_par_aggr_alg_ = amg_coupled_aggr_
! !
! Legal values for entry: amg_aggr_type_ ! Legal values for entry: amg_aggr_type_
! !
integer(psb_ipk_), parameter :: amg_noalg_ = 0 integer(psb_ipk_), parameter :: amg_noalg_ = 0
integer(psb_ipk_), parameter :: amg_soc1_ = 1 integer(psb_ipk_), parameter :: amg_soc1_ = 1
integer(psb_ipk_), parameter :: amg_soc2_ = 2 integer(psb_ipk_), parameter :: amg_soc2_ = 2
integer(psb_ipk_), parameter :: amg_matchboxp_ = 3
! !
! Legal values for entry: amg_aggr_prol_ ! Legal values for entry: amg_aggr_prol_
! !
@ -362,12 +364,13 @@ module amg_base_prec_type
character(len=15), parameter, private :: & character(len=15), parameter, private :: &
& matrix_names(0:1)=(/'distributed ','replicated '/) & matrix_names(0:1)=(/'distributed ','replicated '/)
character(len=18), parameter, private :: & character(len=18), parameter, private :: &
& aggr_type_names(0:2)=(/'None ',& & aggr_type_names(0:3)=(/'None ',&
& 'SOC measure 1 ', 'SOC Measure 2 '/) & 'SOC measure 1 ', 'SOC Measure 2 ',&
& 'Parallel Matching '/)
character(len=18), parameter, private :: & character(len=18), parameter, private :: &
& par_aggr_alg_names(0:2)=(/& & par_aggr_alg_names(0:3)=(/&
& 'decoupled aggr. ', 'sym. dec. aggr. ',& & 'decoupled aggr. ', 'sym. dec. aggr. ',&
& 'user defined aggr.'/) & 'user defined aggr.', 'coupled aggr. '/)
character(len=18), parameter, private :: & character(len=18), parameter, private :: &
& ord_names(0:1)=(/'Natural ordering ','Desc. degree ord. '/) & ord_names(0:1)=(/'Natural ordering ','Desc. degree ord. '/)
character(len=6), parameter, private :: & character(len=6), parameter, private :: &
@ -842,14 +845,22 @@ contains
is_legal_ml_cycle = ((ip>=amg_no_ml_).and.(ip<=amg_max_ml_cycle_)) is_legal_ml_cycle = ((ip>=amg_no_ml_).and.(ip<=amg_max_ml_cycle_))
return return
end function is_legal_ml_cycle end function is_legal_ml_cycle
function is_legal_ml_par_aggr_alg(ip) function is_legal_coupled_par_aggr_alg(ip)
implicit none implicit none
integer(psb_ipk_), intent(in) :: ip integer(psb_ipk_), intent(in) :: ip
logical :: is_legal_ml_par_aggr_alg logical :: is_legal_coupled_par_aggr_alg
is_legal_ml_par_aggr_alg = ((ip>=amg_dec_aggr_).and.(ip<=amg_max_par_aggr_alg_)) is_legal_coupled_par_aggr_alg = (ip == amg_coupled_aggr_)
return return
end function is_legal_ml_par_aggr_alg end function is_legal_coupled_par_aggr_alg
function is_legal_decoupled_par_aggr_alg(ip)
implicit none
integer(psb_ipk_), intent(in) :: ip
logical :: is_legal_decoupled_par_aggr_alg
is_legal_decoupled_par_aggr_alg = ((ip>=amg_dec_aggr_).and.(ip<=amg_max_par_aggr_alg_))
return
end function is_legal_decoupled_par_aggr_alg
function is_legal_ml_aggr_type(ip) function is_legal_ml_aggr_type(ip)
implicit none implicit none
integer(psb_ipk_), intent(in) :: ip integer(psb_ipk_), intent(in) :: ip

@ -80,7 +80,7 @@ module dmatchboxp_mod
subroutine dMatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,& subroutine dMatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate, myrank, numprocs, icomm,& & verdistance, mate, myrank, numprocs, icomm,&
& msgindsent,msgactualsent,msgpercent,& & msgindsent,msgactualsent,msgpercent,&
& ph0_time, ph1_time, ph2_time, ph1_card, ph2_card) bind(c,name='MatchBoxPC') & ph0_time, ph1_time, ph2_time, ph1_card, ph2_card) bind(c,name='dMatchBoxPC')
use iso_c_binding use iso_c_binding
import :: psb_c_ipk_, psb_c_lpk_, psb_c_mpk_, psb_c_epk_ import :: psb_c_ipk_, psb_c_lpk_, psb_c_mpk_, psb_c_epk_
implicit none implicit none

@ -80,7 +80,7 @@ module smatchboxp_mod
subroutine sMatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,& subroutine sMatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
& verdistance, mate, myrank, numprocs, icomm,& & verdistance, mate, myrank, numprocs, icomm,&
& msgindsent,msgactualsent,msgpercent,& & msgindsent,msgactualsent,msgpercent,&
& ph0_time, ph1_time, ph2_time, ph1_card, ph2_card) bind(c,name='MatchBoxPC') & ph0_time, ph1_time, ph2_time, ph1_card, ph2_card) bind(c,name='sMatchBoxPC')
use iso_c_binding use iso_c_binding
import :: psb_c_ipk_, psb_c_lpk_, psb_c_mpk_, psb_c_epk_ import :: psb_c_ipk_, psb_c_lpk_, psb_c_mpk_, psb_c_epk_
implicit none implicit none

@ -172,6 +172,24 @@ MilanLongInt* msgIndSent, MilanLongInt* msgActualSent, MilanReal* msgPercent,
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time, MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
MilanLongInt* ph1_card, MilanLongInt* ph2_card ); MilanLongInt* ph1_card, MilanLongInt* ph2_card );
void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt* verLocPtr, MilanLongInt* verLocInd, MilanReal* edgeLocWeight,
MilanLongInt* verDistance,
MilanLongInt* Mate,
MilanInt myRank, MilanInt numProcs, MilanInt icomm,
MilanLongInt* msgIndSent, MilanLongInt* msgActualSent, MilanReal* msgPercent,
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
MilanLongInt* ph1_card, MilanLongInt* ph2_card );
void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
MilanLongInt* verLocPtr, MilanLongInt* verLocInd, MilanFloat* edgeLocWeight,
MilanLongInt* verDistance,
MilanLongInt* Mate,
MilanInt myRank, MilanInt numProcs, MilanInt icomm,
MilanLongInt* msgIndSent, MilanLongInt* msgActualSent, MilanReal* msgPercent,
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
MilanLongInt* ph1_card, MilanLongInt* ph2_card );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -112,7 +112,7 @@ subroutine amg_c_dec_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_dec_aggr_,is_legal_decoupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs)

@ -1,4 +1,4 @@
! ! is_legal_decoupled_par_aggr_alg
! !
! AMG4PSBLAS version 1.0 ! AMG4PSBLAS version 1.0
! Algebraic Multigrid Package ! Algebraic Multigrid Package
@ -117,7 +117,7 @@ subroutine amg_c_symdec_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_dec_aggr_,is_legal_decoupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs)

@ -112,7 +112,7 @@ subroutine amg_d_dec_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_dec_aggr_,is_legal_decoupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs)

@ -177,7 +177,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_coupled_aggr_,is_legal_coupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs)

@ -1,4 +1,4 @@
! ! is_legal_decoupled_par_aggr_alg
! !
! AMG4PSBLAS version 1.0 ! AMG4PSBLAS version 1.0
! Algebraic Multigrid Package ! Algebraic Multigrid Package
@ -117,7 +117,7 @@ subroutine amg_d_symdec_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_dec_aggr_,is_legal_decoupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs)

@ -112,7 +112,7 @@ subroutine amg_s_dec_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_dec_aggr_,is_legal_decoupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs)

@ -177,7 +177,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_coupled_aggr_,is_legal_coupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs)

@ -1,4 +1,4 @@
! ! is_legal_decoupled_par_aggr_alg
! !
! AMG4PSBLAS version 1.0 ! AMG4PSBLAS version 1.0
! Algebraic Multigrid Package ! Algebraic Multigrid Package
@ -117,7 +117,7 @@ subroutine amg_s_symdec_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_dec_aggr_,is_legal_decoupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs)

@ -112,7 +112,7 @@ subroutine amg_z_dec_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_dec_aggr_,is_legal_decoupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs)

@ -1,4 +1,4 @@
! ! is_legal_decoupled_par_aggr_alg
! !
! AMG4PSBLAS version 1.0 ! AMG4PSBLAS version 1.0
! Algebraic Multigrid Package ! Algebraic Multigrid Package
@ -117,7 +117,7 @@ subroutine amg_z_symdec_aggregator_build_tprol(ag,parms,ag_data,&
call amg_check_def(parms%ml_cycle,'Multilevel cycle',& call amg_check_def(parms%ml_cycle,'Multilevel cycle',&
& amg_mult_ml_,is_legal_ml_cycle) & amg_mult_ml_,is_legal_ml_cycle)
call amg_check_def(parms%par_aggr_alg,'Aggregation',& call amg_check_def(parms%par_aggr_alg,'Aggregation',&
& amg_dec_aggr_,is_legal_ml_par_aggr_alg) & amg_dec_aggr_,is_legal_decoupled_par_aggr_alg)
call amg_check_def(parms%aggr_ord,'Ordering',& call amg_check_def(parms%aggr_ord,'Ordering',&
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord) & amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs) call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs)

@ -42,6 +42,7 @@ subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_d_base_aggregator_mod use amg_d_base_aggregator_mod
use amg_d_dec_aggregator_mod use amg_d_dec_aggregator_mod
use amg_d_symdec_aggregator_mod use amg_d_symdec_aggregator_mod
use amg_d_parmatch_aggregator_mod
use amg_d_jac_smoother use amg_d_jac_smoother
use amg_d_as_smoother use amg_d_as_smoother
use amg_d_diag_solver use amg_d_diag_solver
@ -267,6 +268,8 @@ subroutine amg_d_base_onelev_csetc(lv,what,val,info,pos,idx)
allocate(amg_d_dec_aggregator_type :: lv%aggr, stat=info) allocate(amg_d_dec_aggregator_type :: lv%aggr, stat=info)
case('SYMDEC') case('SYMDEC')
allocate(amg_d_symdec_aggregator_type :: lv%aggr, stat=info) allocate(amg_d_symdec_aggregator_type :: lv%aggr, stat=info)
case('COUP','COUPLED')
allocate(amg_d_parmatch_aggregator_type :: lv%aggr, stat=info)
case default case default
info = psb_err_internal_error_ info = psb_err_internal_error_
end select end select

@ -42,6 +42,7 @@ subroutine amg_d_base_onelev_cseti(lv,what,val,info,pos,idx)
use amg_d_base_aggregator_mod use amg_d_base_aggregator_mod
use amg_d_dec_aggregator_mod use amg_d_dec_aggregator_mod
use amg_d_symdec_aggregator_mod use amg_d_symdec_aggregator_mod
use amg_d_parmatch_aggregator_mod
use amg_d_jac_smoother use amg_d_jac_smoother
use amg_d_as_smoother use amg_d_as_smoother
use amg_d_diag_solver use amg_d_diag_solver

@ -42,6 +42,7 @@ subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
use amg_s_base_aggregator_mod use amg_s_base_aggregator_mod
use amg_s_dec_aggregator_mod use amg_s_dec_aggregator_mod
use amg_s_symdec_aggregator_mod use amg_s_symdec_aggregator_mod
use amg_s_parmatch_aggregator_mod
use amg_s_jac_smoother use amg_s_jac_smoother
use amg_s_as_smoother use amg_s_as_smoother
use amg_s_diag_solver use amg_s_diag_solver
@ -247,6 +248,8 @@ subroutine amg_s_base_onelev_csetc(lv,what,val,info,pos,idx)
allocate(amg_s_dec_aggregator_type :: lv%aggr, stat=info) allocate(amg_s_dec_aggregator_type :: lv%aggr, stat=info)
case('SYMDEC') case('SYMDEC')
allocate(amg_s_symdec_aggregator_type :: lv%aggr, stat=info) allocate(amg_s_symdec_aggregator_type :: lv%aggr, stat=info)
case('COUP','COUPLED')
allocate(amg_s_parmatch_aggregator_type :: lv%aggr, stat=info)
case default case default
info = psb_err_internal_error_ info = psb_err_internal_error_
end select end select

@ -42,6 +42,7 @@ subroutine amg_s_base_onelev_cseti(lv,what,val,info,pos,idx)
use amg_s_base_aggregator_mod use amg_s_base_aggregator_mod
use amg_s_dec_aggregator_mod use amg_s_dec_aggregator_mod
use amg_s_symdec_aggregator_mod use amg_s_symdec_aggregator_mod
use amg_s_parmatch_aggregator_mod
use amg_s_jac_smoother use amg_s_jac_smoother
use amg_s_as_smoother use amg_s_as_smoother
use amg_s_diag_solver use amg_s_diag_solver

Loading…
Cancel
Save