added factorization options

merge-amgext
Cirdans-Home 4 years ago
parent a5fc17719a
commit d4f5fc395d

@ -52,7 +52,7 @@ CMODOBJS=amg_c_prec_type.o amg_c_ilu_fact_mod.o \
MODOBJS=amg_base_prec_type.o amg_prec_type.o amg_prec_mod.o \ MODOBJS=amg_base_prec_type.o amg_prec_type.o amg_prec_mod.o \
amg_s_prec_mod.o amg_d_prec_mod.o amg_c_prec_mod.o amg_z_prec_mod.o \ amg_s_prec_mod.o amg_d_prec_mod.o amg_c_prec_mod.o amg_z_prec_mod.o \
amg_base_ainv_mod.o \ amg_base_ainv_mod.o amg_ainv_mod.o\
$(SMODOBJS) $(DMODOBJS) $(CMODOBJS) $(ZMODOBJS) $(SMODOBJS) $(DMODOBJS) $(CMODOBJS) $(ZMODOBJS)
@ -186,6 +186,10 @@ amg_s_invt_solver.o: amg_base_ainv_mod.o amg_s_base_ainv_mod.o
amg_d_invt_solver.o: amg_base_ainv_mod.o amg_d_base_ainv_mod.o amg_d_invt_solver.o: amg_base_ainv_mod.o amg_d_base_ainv_mod.o
amg_c_invt_solver.o: amg_base_ainv_mod.o amg_c_base_ainv_mod.o amg_c_invt_solver.o: amg_base_ainv_mod.o amg_c_base_ainv_mod.o
amg_z_invt_solver.o: amg_base_ainv_mod.o amg_z_base_ainv_mod.o amg_z_invt_solver.o: amg_base_ainv_mod.o amg_z_base_ainv_mod.o
amg_ainv_mod.o: amg_s_ainv_solver.o amg_d_ainv_solver.o amg_c_ainv_solver.o \
amg_z_ainv_solver.o amg_s_invk_solver.o amg_d_invk_solver.o amg_c_invk_solver.o \
amg_z_invk_solver.o amg_s_invt_solver.o amg_d_invt_solver.o amg_c_invt_solver.o \
amg_z_invt_solver.o
veryclean: clean veryclean: clean
/bin/rm -f $(LIBNAME) /bin/rm -f $(LIBNAME)

@ -74,6 +74,8 @@ program amg_d_pde3d
use amg_d_pde3d_exp_mod use amg_d_pde3d_exp_mod
use amg_d_pde3d_gauss_mod use amg_d_pde3d_gauss_mod
use amg_d_genpde_mod use amg_d_genpde_mod
use amg_ainv_mod
use amg_d_ilu_solver
implicit none implicit none
! input parameters ! input parameters
@ -113,6 +115,9 @@ program amg_d_pde3d
type(solverdata) :: s_choice type(solverdata) :: s_choice
! preconditioner data ! preconditioner data
type(amg_d_invt_solver_type) :: invtsv
type(amg_d_invk_solver_type) :: invksv
type(amg_d_ainv_solver_type) :: ainvsv
type precdata type precdata
! preconditioner type ! preconditioner type
@ -144,7 +149,9 @@ program amg_d_pde3d
character(len=16) :: prol ! prolongation over application of AS character(len=16) :: prol ! prolongation over application of AS
character(len=16) :: solve ! local subsolver type: ILU, MILU, ILUT, character(len=16) :: solve ! local subsolver type: ILU, MILU, ILUT,
! UMF, MUMPS, SLU, FWGS, BWGS, JAC ! UMF, MUMPS, SLU, FWGS, BWGS, JAC
character(len=16) :: variant ! AINV variant: LLK, etc
integer(psb_ipk_) :: fill ! fill-in for incomplete LU factorization integer(psb_ipk_) :: fill ! fill-in for incomplete LU factorization
integer(psb_ipk_) :: invfill ! Inverse fill-in for INVK
real(psb_dpk_) :: thr ! threshold for ILUT factorization real(psb_dpk_) :: thr ! threshold for ILUT factorization
! AMG post-smoother; ignored by 1-lev preconditioner ! AMG post-smoother; ignored by 1-lev preconditioner
@ -155,7 +162,9 @@ program amg_d_pde3d
character(len=16) :: prol2 ! prolongation over application of AS character(len=16) :: prol2 ! prolongation over application of AS
character(len=16) :: solve2 ! local subsolver type: ILU, MILU, ILUT, character(len=16) :: solve2 ! local subsolver type: ILU, MILU, ILUT,
! UMF, MUMPS, SLU, FWGS, BWGS, JAC ! UMF, MUMPS, SLU, FWGS, BWGS, JAC
character(len=16) :: variant2 ! AINV variant: LLK, etc
integer(psb_ipk_) :: fill2 ! fill-in for incomplete LU factorization integer(psb_ipk_) :: fill2 ! fill-in for incomplete LU factorization
integer(psb_ipk_) :: invfill2 ! Inverse fill-in for INVK
real(psb_dpk_) :: thr2 ! threshold for ILUT factorization real(psb_dpk_) :: thr2 ! threshold for ILUT factorization
! coarsest-level solver ! coarsest-level solver
@ -298,14 +307,26 @@ program amg_d_pde3d
call prec%set('smoother_sweeps', p_choice%jsweeps, info) call prec%set('smoother_sweeps', p_choice%jsweeps, info)
select case (psb_toupper(p_choice%smther)) select case (psb_toupper(p_choice%smther))
case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI') case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI','L1-FBGS')
! do nothing ! do nothing
case default case default
call prec%set('sub_ovr', p_choice%novr, info) call prec%set('sub_ovr', p_choice%novr, info)
call prec%set('sub_restr', p_choice%restr, info) call prec%set('sub_restr', p_choice%restr, info)
call prec%set('sub_prol', p_choice%prol, info) call prec%set('sub_prol', p_choice%prol, info)
select case(trim(psb_toupper(p_choice%solve)))
case('INVK')
call prec%set(invksv, info)
case('INVT')
call prec%set(invtsv, info)
case('AINV')
call prec%set(ainvsv, info)
call prec%set('ainv_alg', p_choice%variant, info)
case default
call prec%set('sub_solve', p_choice%solve, info) call prec%set('sub_solve', p_choice%solve, info)
end select
call prec%set('sub_fillin', p_choice%fill, info) call prec%set('sub_fillin', p_choice%fill, info)
call prec%set('inv_fillin', p_choice%invfill, info)
call prec%set('sub_iluthrs', p_choice%thr, info) call prec%set('sub_iluthrs', p_choice%thr, info)
end select end select
@ -313,14 +334,26 @@ program amg_d_pde3d
call prec%set('smoother_type', p_choice%smther2, info,pos='post') call prec%set('smoother_type', p_choice%smther2, info,pos='post')
call prec%set('smoother_sweeps', p_choice%jsweeps2, info,pos='post') call prec%set('smoother_sweeps', p_choice%jsweeps2, info,pos='post')
select case (psb_toupper(p_choice%smther2)) select case (psb_toupper(p_choice%smther2))
case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI') case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI','L1-FBGS')
! do nothing ! do nothing
case default case default
call prec%set('sub_ovr', p_choice%novr2, info,pos='post') call prec%set('sub_ovr', p_choice%novr2, info,pos='post')
call prec%set('sub_restr', p_choice%restr2, info,pos='post') call prec%set('sub_restr', p_choice%restr2, info,pos='post')
call prec%set('sub_prol', p_choice%prol2, info,pos='post') call prec%set('sub_prol', p_choice%prol2, info,pos='post')
select case(trim(psb_toupper(p_choice%solve2)))
case('INVK')
call prec%set(invksv, info, pos='post')
case('INVT')
call prec%set(invtsv, info, pos='post')
case('AINV')
call prec%set(ainvsv, info, pos='post')
call prec%set('ainv_alg', p_choice%variant2, info, pos='post')
case default
call prec%set('sub_solve', p_choice%solve2, info, pos='post') call prec%set('sub_solve', p_choice%solve2, info, pos='post')
end select
call prec%set('sub_fillin', p_choice%fill2, info,pos='post') call prec%set('sub_fillin', p_choice%fill2, info,pos='post')
call prec%set('inv_fillin', p_choice%invfill2, info,pos='post')
call prec%set('sub_iluthrs', p_choice%thr2, info,pos='post') call prec%set('sub_iluthrs', p_choice%thr2, info,pos='post')
end select end select
end if end if
@ -508,7 +541,9 @@ contains
call read_data(prec%restr,inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%variant,inp_unit) ! AINV variant
call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%invfill,inp_unit) !Inverse fill-in for INVK
call read_data(prec%thr,inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
@ -517,7 +552,9 @@ contains
call read_data(prec%restr2,inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%variant2,inp_unit) ! AINV variant
call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%invfill2,inp_unit) !Inverse fill-in for INVK
call read_data(prec%thr2,inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
@ -571,7 +608,9 @@ contains
call psb_bcast(ctxt,prec%restr) call psb_bcast(ctxt,prec%restr)
call psb_bcast(ctxt,prec%prol) call psb_bcast(ctxt,prec%prol)
call psb_bcast(ctxt,prec%solve) call psb_bcast(ctxt,prec%solve)
call psb_bcast(ctxt,prec%variant)
call psb_bcast(ctxt,prec%fill) call psb_bcast(ctxt,prec%fill)
call psb_bcast(ctxt,prec%invfill)
call psb_bcast(ctxt,prec%thr) call psb_bcast(ctxt,prec%thr)
! broadcast second (post-)smoother ! broadcast second (post-)smoother
call psb_bcast(ctxt,prec%smther2) call psb_bcast(ctxt,prec%smther2)
@ -580,7 +619,9 @@ contains
call psb_bcast(ctxt,prec%restr2) call psb_bcast(ctxt,prec%restr2)
call psb_bcast(ctxt,prec%prol2) call psb_bcast(ctxt,prec%prol2)
call psb_bcast(ctxt,prec%solve2) call psb_bcast(ctxt,prec%solve2)
call psb_bcast(ctxt,prec%variant2)
call psb_bcast(ctxt,prec%fill2) call psb_bcast(ctxt,prec%fill2)
call psb_bcast(ctxt,prec%invfill2)
call psb_bcast(ctxt,prec%thr2) call psb_bcast(ctxt,prec%thr2)
! broadcast AMG parameters ! broadcast AMG parameters

@ -74,6 +74,8 @@ program amg_s_pde3d
use amg_s_pde3d_exp_mod use amg_s_pde3d_exp_mod
use amg_s_pde3d_gauss_mod use amg_s_pde3d_gauss_mod
use amg_s_genpde_mod use amg_s_genpde_mod
use amg_ainv_mod
use amg_s_ilu_solver
implicit none implicit none
! input parameters ! input parameters
@ -113,6 +115,9 @@ program amg_s_pde3d
type(solverdata) :: s_choice type(solverdata) :: s_choice
! preconditioner data ! preconditioner data
type(amg_s_invt_solver_type) :: invtsv
type(amg_s_invk_solver_type) :: invksv
type(amg_s_ainv_solver_type) :: ainvsv
type precdata type precdata
! preconditioner type ! preconditioner type
@ -144,7 +149,9 @@ program amg_s_pde3d
character(len=16) :: prol ! prolongation over application of AS character(len=16) :: prol ! prolongation over application of AS
character(len=16) :: solve ! local subsolver type: ILU, MILU, ILUT, character(len=16) :: solve ! local subsolver type: ILU, MILU, ILUT,
! UMF, MUMPS, SLU, FWGS, BWGS, JAC ! UMF, MUMPS, SLU, FWGS, BWGS, JAC
character(len=16) :: variant ! AINV variant: LLK, etc
integer(psb_ipk_) :: fill ! fill-in for incomplete LU factorization integer(psb_ipk_) :: fill ! fill-in for incomplete LU factorization
integer(psb_ipk_) :: invfill ! Inverse fill-in for INVK
real(psb_spk_) :: thr ! threshold for ILUT factorization real(psb_spk_) :: thr ! threshold for ILUT factorization
! AMG post-smoother; ignored by 1-lev preconditioner ! AMG post-smoother; ignored by 1-lev preconditioner
@ -155,7 +162,9 @@ program amg_s_pde3d
character(len=16) :: prol2 ! prolongation over application of AS character(len=16) :: prol2 ! prolongation over application of AS
character(len=16) :: solve2 ! local subsolver type: ILU, MILU, ILUT, character(len=16) :: solve2 ! local subsolver type: ILU, MILU, ILUT,
! UMF, MUMPS, SLU, FWGS, BWGS, JAC ! UMF, MUMPS, SLU, FWGS, BWGS, JAC
character(len=16) :: variant2 ! AINV variant: LLK, etc
integer(psb_ipk_) :: fill2 ! fill-in for incomplete LU factorization integer(psb_ipk_) :: fill2 ! fill-in for incomplete LU factorization
integer(psb_ipk_) :: invfill2 ! Inverse fill-in for INVK
real(psb_spk_) :: thr2 ! threshold for ILUT factorization real(psb_spk_) :: thr2 ! threshold for ILUT factorization
! coarsest-level solver ! coarsest-level solver
@ -298,14 +307,26 @@ program amg_s_pde3d
call prec%set('smoother_sweeps', p_choice%jsweeps, info) call prec%set('smoother_sweeps', p_choice%jsweeps, info)
select case (psb_toupper(p_choice%smther)) select case (psb_toupper(p_choice%smther))
case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI') case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI','L1-FBGS')
! do nothing ! do nothing
case default case default
call prec%set('sub_ovr', p_choice%novr, info) call prec%set('sub_ovr', p_choice%novr, info)
call prec%set('sub_restr', p_choice%restr, info) call prec%set('sub_restr', p_choice%restr, info)
call prec%set('sub_prol', p_choice%prol, info) call prec%set('sub_prol', p_choice%prol, info)
select case(trim(psb_toupper(p_choice%solve)))
case('INVK')
call prec%set(invksv, info)
case('INVT')
call prec%set(invtsv, info)
case('AINV')
call prec%set(ainvsv, info)
call prec%set('ainv_alg', p_choice%variant, info)
case default
call prec%set('sub_solve', p_choice%solve, info) call prec%set('sub_solve', p_choice%solve, info)
end select
call prec%set('sub_fillin', p_choice%fill, info) call prec%set('sub_fillin', p_choice%fill, info)
call prec%set('inv_fillin', p_choice%invfill, info)
call prec%set('sub_iluthrs', p_choice%thr, info) call prec%set('sub_iluthrs', p_choice%thr, info)
end select end select
@ -313,14 +334,26 @@ program amg_s_pde3d
call prec%set('smoother_type', p_choice%smther2, info,pos='post') call prec%set('smoother_type', p_choice%smther2, info,pos='post')
call prec%set('smoother_sweeps', p_choice%jsweeps2, info,pos='post') call prec%set('smoother_sweeps', p_choice%jsweeps2, info,pos='post')
select case (psb_toupper(p_choice%smther2)) select case (psb_toupper(p_choice%smther2))
case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI') case ('GS','BWGS','FBGS','JACOBI','L1-JACOBI','L1-FBGS')
! do nothing ! do nothing
case default case default
call prec%set('sub_ovr', p_choice%novr2, info,pos='post') call prec%set('sub_ovr', p_choice%novr2, info,pos='post')
call prec%set('sub_restr', p_choice%restr2, info,pos='post') call prec%set('sub_restr', p_choice%restr2, info,pos='post')
call prec%set('sub_prol', p_choice%prol2, info,pos='post') call prec%set('sub_prol', p_choice%prol2, info,pos='post')
select case(trim(psb_toupper(p_choice%solve2)))
case('INVK')
call prec%set(invksv, info, pos='post')
case('INVT')
call prec%set(invtsv, info, pos='post')
case('AINV')
call prec%set(ainvsv, info, pos='post')
call prec%set('ainv_alg', p_choice%variant2, info, pos='post')
case default
call prec%set('sub_solve', p_choice%solve2, info, pos='post') call prec%set('sub_solve', p_choice%solve2, info, pos='post')
end select
call prec%set('sub_fillin', p_choice%fill2, info,pos='post') call prec%set('sub_fillin', p_choice%fill2, info,pos='post')
call prec%set('inv_fillin', p_choice%invfill2, info,pos='post')
call prec%set('sub_iluthrs', p_choice%thr2, info,pos='post') call prec%set('sub_iluthrs', p_choice%thr2, info,pos='post')
end select end select
end if end if
@ -508,7 +541,9 @@ contains
call read_data(prec%restr,inp_unit) ! restriction over application of AS call read_data(prec%restr,inp_unit) ! restriction over application of AS
call read_data(prec%prol,inp_unit) ! prolongation over application of AS call read_data(prec%prol,inp_unit) ! prolongation over application of AS
call read_data(prec%solve,inp_unit) ! local subsolver call read_data(prec%solve,inp_unit) ! local subsolver
call read_data(prec%variant,inp_unit) ! AINV variant
call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU call read_data(prec%fill,inp_unit) ! fill-in for incomplete LU
call read_data(prec%invfill,inp_unit) !Inverse fill-in for INVK
call read_data(prec%thr,inp_unit) ! threshold for ILUT call read_data(prec%thr,inp_unit) ! threshold for ILUT
! Second smoother/ AMG post-smoother (if NONE ignored in main) ! Second smoother/ AMG post-smoother (if NONE ignored in main)
call read_data(prec%smther2,inp_unit) ! smoother type call read_data(prec%smther2,inp_unit) ! smoother type
@ -517,7 +552,9 @@ contains
call read_data(prec%restr2,inp_unit) ! restriction over application of AS call read_data(prec%restr2,inp_unit) ! restriction over application of AS
call read_data(prec%prol2,inp_unit) ! prolongation over application of AS call read_data(prec%prol2,inp_unit) ! prolongation over application of AS
call read_data(prec%solve2,inp_unit) ! local subsolver call read_data(prec%solve2,inp_unit) ! local subsolver
call read_data(prec%variant2,inp_unit) ! AINV variant
call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU call read_data(prec%fill2,inp_unit) ! fill-in for incomplete LU
call read_data(prec%invfill2,inp_unit) !Inverse fill-in for INVK
call read_data(prec%thr2,inp_unit) ! threshold for ILUT call read_data(prec%thr2,inp_unit) ! threshold for ILUT
! general AMG data ! general AMG data
call read_data(prec%mlcycle,inp_unit) ! AMG cycle type call read_data(prec%mlcycle,inp_unit) ! AMG cycle type
@ -571,7 +608,9 @@ contains
call psb_bcast(ctxt,prec%restr) call psb_bcast(ctxt,prec%restr)
call psb_bcast(ctxt,prec%prol) call psb_bcast(ctxt,prec%prol)
call psb_bcast(ctxt,prec%solve) call psb_bcast(ctxt,prec%solve)
call psb_bcast(ctxt,prec%variant)
call psb_bcast(ctxt,prec%fill) call psb_bcast(ctxt,prec%fill)
call psb_bcast(ctxt,prec%invfill)
call psb_bcast(ctxt,prec%thr) call psb_bcast(ctxt,prec%thr)
! broadcast second (post-)smoother ! broadcast second (post-)smoother
call psb_bcast(ctxt,prec%smther2) call psb_bcast(ctxt,prec%smther2)
@ -580,7 +619,9 @@ contains
call psb_bcast(ctxt,prec%restr2) call psb_bcast(ctxt,prec%restr2)
call psb_bcast(ctxt,prec%prol2) call psb_bcast(ctxt,prec%prol2)
call psb_bcast(ctxt,prec%solve2) call psb_bcast(ctxt,prec%solve2)
call psb_bcast(ctxt,prec%variant2)
call psb_bcast(ctxt,prec%fill2) call psb_bcast(ctxt,prec%fill2)
call psb_bcast(ctxt,prec%invfill2)
call psb_bcast(ctxt,prec%thr2) call psb_bcast(ctxt,prec%thr2)
! broadcast AMG parameters ! broadcast AMG parameters

@ -16,8 +16,10 @@ FBGS ! Smoother type JACOBI FBGS GS BWGS BJAC AS. For 1-l
0 ! Number of overlap layers for AS preconditioner 0 ! Number of overlap layers for AS preconditioner
HALO ! AS restriction operator: NONE HALO HALO ! AS restriction operator: NONE HALO
NONE ! AS prolongation operator: NONE SUM AVG NONE ! AS prolongation operator: NONE SUM AVG
ILU ! Subdomain solver for BJAC/AS: JACOBI GS BGS ILU ILUT MILU MUMPS SLU UMF INVK ! Subdomain solver for BJAC/AS: JACOBI GS BGS ILU ILUT MILU MUMPS SLU UMF
LLK ! AINV variant
0 ! Fill level P for ILU(P) and ILU(T,P) 0 ! Fill level P for ILU(P) and ILU(T,P)
1 ! Inverse Fill level P for INVK
1.d-4 ! Threshold T for ILU(T,P) 1.d-4 ! Threshold T for ILU(T,P)
%%%%%%%%%%% Second smoother, always ignored for non-ML %%%%%%%%%%%%%%%% %%%%%%%%%%% Second smoother, always ignored for non-ML %%%%%%%%%%%%%%%%
NONE ! Second (post) smoother, ignored if NONE NONE ! Second (post) smoother, ignored if NONE
@ -26,7 +28,9 @@ NONE ! Second (post) smoother, ignored if NONE
HALO ! AS restriction operator: NONE HALO HALO ! AS restriction operator: NONE HALO
NONE ! AS prolongation operator: NONE SUM AVG NONE ! AS prolongation operator: NONE SUM AVG
ILU ! Subdomain solver for BJAC/AS: JACOBI GS BGS ILU ILUT MILU MUMPS SLU UMF ILU ! Subdomain solver for BJAC/AS: JACOBI GS BGS ILU ILUT MILU MUMPS SLU UMF
LLK ! AINV variant
0 ! Fill level P for ILU(P) and ILU(T,P) 0 ! Fill level P for ILU(P) and ILU(T,P)
8 ! Inverse Fill level P for INVK
1.d-4 ! Threshold T for ILU(T,P) 1.d-4 ! Threshold T for ILU(T,P)
%%%%%%%%%%% Multilevel parameters %%%%%%%%%%%%%%%% %%%%%%%%%%% Multilevel parameters %%%%%%%%%%%%%%%%
VCYCLE ! Type of multilevel CYCLE: VCYCLE WCYCLE KCYCLE MULT ADD VCYCLE ! Type of multilevel CYCLE: VCYCLE WCYCLE KCYCLE MULT ADD

Loading…
Cancel
Save