Added options to set and test program

implement-ainv
Cirdans-Home 4 years ago
parent 0c9098065a
commit 526dc1c260

@ -56,10 +56,10 @@ psb_s_bjacprec.o psb_s_diagprec.o psb_s_nullprec.o: psb_prec_mod.o psb_s_base_pr
psb_d_bjacprec.o psb_d_diagprec.o psb_d_nullprec.o: psb_prec_mod.o psb_d_base_prec_mod.o
psb_c_bjacprec.o psb_c_diagprec.o psb_c_nullprec.o: psb_prec_mod.o psb_c_base_prec_mod.o
psb_z_bjacprec.o psb_z_diagprec.o psb_z_nullprec.o: psb_prec_mod.o psb_z_base_prec_mod.o
psb_s_bjacprec.o: psb_s_ilu_fact_mod.o psb_s_ainv_fact_mod.o
psb_d_bjacprec.o: psb_d_ilu_fact_mod.o psb_d_ainv_fact_mod.o
psb_c_bjacprec.o: psb_c_ilu_fact_mod.o psb_c_ainv_fact_mod.o
psb_z_bjacprec.o: psb_z_ilu_fact_mod.o psb_z_ainv_fact_mod.o
psb_s_bjacprec.o: psb_s_ilu_fact_mod.o psb_s_ainv_fact_mod.o psb_s_invk_fact_mod psb_s_invt_fact_mod
psb_d_bjacprec.o: psb_d_ilu_fact_mod.o psb_d_ainv_fact_mod.o psb_d_invk_fact_mod psb_d_invt_fact_mod
psb_c_bjacprec.o: psb_c_ilu_fact_mod.o psb_c_ainv_fact_mod.o psb_c_invk_fact_mod psb_c_invt_fact_mod
psb_z_bjacprec.o: psb_z_ilu_fact_mod.o psb_z_ainv_fact_mod.o psb_z_invk_fact_mod psb_z_invt_fact_mod
psb_d_ainv_fact_mod.o: psb_prec_const_mod.o psb_ainv_tools_mod.o
psb_s_ainv_fact_mod.o: psb_prec_const_mod.o psb_ainv_tools_mod.o
psb_c_ainv_fact_mod.o: psb_prec_const_mod.o psb_ainv_tools_mod.o

@ -448,6 +448,11 @@ subroutine psb_c_bjac_precinit(prec,info)
info = psb_success_
call psb_realloc(psb_ifpsz,prec%iprcparm,info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_Errpush(info,name)
goto 9999
end if
call psb_realloc(psb_rfpsz,prec%rprcparm,info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
@ -1122,15 +1127,13 @@ subroutine psb_c_bjac_precsetr(prec,what,val,info)
call psb_erractionsave(err_act)
info = psb_success_
if (.not.allocated(prec%iprcparm)) then
if (.not.allocated(prec%rprcparm)) then
info = 1124
call psb_errpush(info,name,a_err="preconditioner")
goto 9999
end if
select case(what)
case (psb_f_type_)
prec%iprcparm(psb_f_type_) = val
case (psb_fact_eps_)
prec%rprcparm(psb_fact_eps_) = val

@ -354,9 +354,9 @@ subroutine psb_ccprecseti(prec,what,val,info,ilev,ilmax,pos,idx)
! We need to convert from the 'what' string to the corresponding integer
! value befor passing the call to the set of the inner method.
select case (psb_toupper(what))
case ("SUB_FILLIN")
case ('SUB_FILLIN')
call prec%prec%precset(psb_ilu_fill_in_,val,info)
case('INV_FILLIN')
case ('INV_FILLIN')
call prec%prec%precset(psb_inv_fillin_,val,info)
case default
info = psb_err_invalid_args_combination_
@ -383,7 +383,7 @@ subroutine psb_ccprecsetr(prec,what,val,info,ilev,ilmax,pos,idx)
character(len=*), optional, intent(in) :: pos
! Local variables
character(len=*), parameter :: name='amg_precsetr'
character(len=*), parameter :: name='psb_precsetr'
info = psb_success_
@ -419,7 +419,7 @@ subroutine psb_ccprecsetc(prec,what,string,info,ilev,ilmax,pos,idx)
character(len=*), optional, intent(in) :: pos
! Local variables
character(len=*), parameter :: name='amg_precsetc'
character(len=*), parameter :: name='psb_precsetc'
info = psb_success_
@ -437,6 +437,10 @@ subroutine psb_ccprecsetc(prec,what,string,info,ilev,ilmax,pos,idx)
call prec%prec%precset(psb_ilu_ialg_,psb_ilu_t_,info)
case("AINV")
call prec%prec%precset(psb_f_type_,psb_f_ainv_,info)
case("INVK")
call prec%prec%precset(psb_f_type_,psb_f_invk_,info)
case("INVT")
call prec%prec%precset(psb_f_type_,psb_f_invt_,info)
case default
! Default to ILU(0) factorization
call prec%prec%precset(psb_f_type_,psb_f_ilu_n_,info)

@ -448,6 +448,11 @@ subroutine psb_d_bjac_precinit(prec,info)
info = psb_success_
call psb_realloc(psb_ifpsz,prec%iprcparm,info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_Errpush(info,name)
goto 9999
end if
call psb_realloc(psb_rfpsz,prec%rprcparm,info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
@ -1122,15 +1127,13 @@ subroutine psb_d_bjac_precsetr(prec,what,val,info)
call psb_erractionsave(err_act)
info = psb_success_
if (.not.allocated(prec%iprcparm)) then
if (.not.allocated(prec%rprcparm)) then
info = 1124
call psb_errpush(info,name,a_err="preconditioner")
goto 9999
end if
select case(what)
case (psb_f_type_)
prec%iprcparm(psb_f_type_) = val
case (psb_fact_eps_)
prec%rprcparm(psb_fact_eps_) = val

@ -354,9 +354,9 @@ subroutine psb_dcprecseti(prec,what,val,info,ilev,ilmax,pos,idx)
! We need to convert from the 'what' string to the corresponding integer
! value befor passing the call to the set of the inner method.
select case (psb_toupper(what))
case ("SUB_FILLIN")
case ('SUB_FILLIN')
call prec%prec%precset(psb_ilu_fill_in_,val,info)
case('INV_FILLIN')
case ('INV_FILLIN')
call prec%prec%precset(psb_inv_fillin_,val,info)
case default
info = psb_err_invalid_args_combination_
@ -383,7 +383,7 @@ subroutine psb_dcprecsetr(prec,what,val,info,ilev,ilmax,pos,idx)
character(len=*), optional, intent(in) :: pos
! Local variables
character(len=*), parameter :: name='amg_precsetr'
character(len=*), parameter :: name='psb_precsetr'
info = psb_success_
@ -419,7 +419,7 @@ subroutine psb_dcprecsetc(prec,what,string,info,ilev,ilmax,pos,idx)
character(len=*), optional, intent(in) :: pos
! Local variables
character(len=*), parameter :: name='amg_precsetc'
character(len=*), parameter :: name='psb_precsetc'
info = psb_success_
@ -437,6 +437,10 @@ subroutine psb_dcprecsetc(prec,what,string,info,ilev,ilmax,pos,idx)
call prec%prec%precset(psb_ilu_ialg_,psb_ilu_t_,info)
case("AINV")
call prec%prec%precset(psb_f_type_,psb_f_ainv_,info)
case("INVK")
call prec%prec%precset(psb_f_type_,psb_f_invk_,info)
case("INVT")
call prec%prec%precset(psb_f_type_,psb_f_invt_,info)
case default
! Default to ILU(0) factorization
call prec%prec%precset(psb_f_type_,psb_f_ilu_n_,info)

@ -448,6 +448,11 @@ subroutine psb_s_bjac_precinit(prec,info)
info = psb_success_
call psb_realloc(psb_ifpsz,prec%iprcparm,info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_Errpush(info,name)
goto 9999
end if
call psb_realloc(psb_rfpsz,prec%rprcparm,info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
@ -1122,15 +1127,13 @@ subroutine psb_s_bjac_precsetr(prec,what,val,info)
call psb_erractionsave(err_act)
info = psb_success_
if (.not.allocated(prec%iprcparm)) then
if (.not.allocated(prec%rprcparm)) then
info = 1124
call psb_errpush(info,name,a_err="preconditioner")
goto 9999
end if
select case(what)
case (psb_f_type_)
prec%iprcparm(psb_f_type_) = val
case (psb_fact_eps_)
prec%rprcparm(psb_fact_eps_) = val

@ -354,9 +354,9 @@ subroutine psb_scprecseti(prec,what,val,info,ilev,ilmax,pos,idx)
! We need to convert from the 'what' string to the corresponding integer
! value befor passing the call to the set of the inner method.
select case (psb_toupper(what))
case ("SUB_FILLIN")
case ('SUB_FILLIN')
call prec%prec%precset(psb_ilu_fill_in_,val,info)
case('INV_FILLIN')
case ('INV_FILLIN')
call prec%prec%precset(psb_inv_fillin_,val,info)
case default
info = psb_err_invalid_args_combination_
@ -383,7 +383,7 @@ subroutine psb_scprecsetr(prec,what,val,info,ilev,ilmax,pos,idx)
character(len=*), optional, intent(in) :: pos
! Local variables
character(len=*), parameter :: name='amg_precsetr'
character(len=*), parameter :: name='psb_precsetr'
info = psb_success_
@ -419,7 +419,7 @@ subroutine psb_scprecsetc(prec,what,string,info,ilev,ilmax,pos,idx)
character(len=*), optional, intent(in) :: pos
! Local variables
character(len=*), parameter :: name='amg_precsetc'
character(len=*), parameter :: name='psb_precsetc'
info = psb_success_
@ -437,6 +437,10 @@ subroutine psb_scprecsetc(prec,what,string,info,ilev,ilmax,pos,idx)
call prec%prec%precset(psb_ilu_ialg_,psb_ilu_t_,info)
case("AINV")
call prec%prec%precset(psb_f_type_,psb_f_ainv_,info)
case("INVK")
call prec%prec%precset(psb_f_type_,psb_f_invk_,info)
case("INVT")
call prec%prec%precset(psb_f_type_,psb_f_invt_,info)
case default
! Default to ILU(0) factorization
call prec%prec%precset(psb_f_type_,psb_f_ilu_n_,info)

@ -448,6 +448,11 @@ subroutine psb_z_bjac_precinit(prec,info)
info = psb_success_
call psb_realloc(psb_ifpsz,prec%iprcparm,info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
call psb_Errpush(info,name)
goto 9999
end if
call psb_realloc(psb_rfpsz,prec%rprcparm,info)
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
@ -1122,15 +1127,13 @@ subroutine psb_z_bjac_precsetr(prec,what,val,info)
call psb_erractionsave(err_act)
info = psb_success_
if (.not.allocated(prec%iprcparm)) then
if (.not.allocated(prec%rprcparm)) then
info = 1124
call psb_errpush(info,name,a_err="preconditioner")
goto 9999
end if
select case(what)
case (psb_f_type_)
prec%iprcparm(psb_f_type_) = val
case (psb_fact_eps_)
prec%rprcparm(psb_fact_eps_) = val

@ -354,9 +354,9 @@ subroutine psb_zcprecseti(prec,what,val,info,ilev,ilmax,pos,idx)
! We need to convert from the 'what' string to the corresponding integer
! value befor passing the call to the set of the inner method.
select case (psb_toupper(what))
case ("SUB_FILLIN")
case ('SUB_FILLIN')
call prec%prec%precset(psb_ilu_fill_in_,val,info)
case('INV_FILLIN')
case ('INV_FILLIN')
call prec%prec%precset(psb_inv_fillin_,val,info)
case default
info = psb_err_invalid_args_combination_
@ -383,7 +383,7 @@ subroutine psb_zcprecsetr(prec,what,val,info,ilev,ilmax,pos,idx)
character(len=*), optional, intent(in) :: pos
! Local variables
character(len=*), parameter :: name='amg_precsetr'
character(len=*), parameter :: name='psb_precsetr'
info = psb_success_
@ -419,7 +419,7 @@ subroutine psb_zcprecsetc(prec,what,string,info,ilev,ilmax,pos,idx)
character(len=*), optional, intent(in) :: pos
! Local variables
character(len=*), parameter :: name='amg_precsetc'
character(len=*), parameter :: name='psb_precsetc'
info = psb_success_
@ -437,6 +437,10 @@ subroutine psb_zcprecsetc(prec,what,string,info,ilev,ilmax,pos,idx)
call prec%prec%precset(psb_ilu_ialg_,psb_ilu_t_,info)
case("AINV")
call prec%prec%precset(psb_f_type_,psb_f_ainv_,info)
case("INVK")
call prec%prec%precset(psb_f_type_,psb_f_invk_,info)
case("INVT")
call prec%prec%precset(psb_f_type_,psb_f_invt_,info)
case default
! Default to ILU(0) factorization
call prec%prec%precset(psb_f_type_,psb_f_ilu_n_,info)

@ -681,6 +681,14 @@ program psb_d_pde3d
call prec%set('inv_thresh', parms%inv_thresh, info)
call prec%set('inv_fillin', parms%inv_fill, info)
call prec%set('ilut_scale', parms%ilut_scale, info)
case ("INVK")
call prec%set('sub_fillin', parms%fill, info)
call prec%set('inv_fillin', parms%inv_fill, info)
case ("INVT")
call prec%set('sub_fillin', parms%fill, info)
call prec%set('inv_fillin', parms%inv_fill, info)
call prec%set('sub_iluthrs', parms%thresh, info)
call prec%set('inv_thresh', parms%inv_thresh, info)
case default
! Do nothing, use default setting in the init routine
end select
@ -884,6 +892,9 @@ contains
write(psb_out_unit,'("Threshold : ",es12.5)') parms%thresh
write(psb_out_unit,'("Scaling : ",a)') parms%ilut_scale
case ('INVK')
write(psb_out_unit,'("Fill in : ",i0)') parms%fill
write(psb_out_unit,'("Invese Fill in : ",i0)') parms%inv_fill
case ('INVT')
write(psb_out_unit,'("Fill in : ",i0)') parms%fill
write(psb_out_unit,'("Threshold : ",es12.5)') parms%thresh
write(psb_out_unit,'("Invese Fill in : ",i0)') parms%inv_fill

@ -681,6 +681,14 @@ program psb_s_pde3d
call prec%set('inv_thresh', parms%inv_thresh, info)
call prec%set('inv_fillin', parms%inv_fill, info)
call prec%set('ilut_scale', parms%ilut_scale, info)
case ("INVK")
call prec%set('sub_fillin', parms%fill, info)
call prec%set('inv_fillin', parms%inv_fill, info)
case ("INVT")
call prec%set('sub_fillin', parms%fill, info)
call prec%set('inv_fillin', parms%inv_fill, info)
call prec%set('sub_iluthrs', parms%thresh, info)
call prec%set('inv_thresh', parms%inv_thresh, info)
case default
! Do nothing, use default setting in the init routine
end select
@ -884,6 +892,9 @@ contains
write(psb_out_unit,'("Threshold : ",es12.5)') parms%thresh
write(psb_out_unit,'("Scaling : ",a)') parms%ilut_scale
case ('INVK')
write(psb_out_unit,'("Fill in : ",i0)') parms%fill
write(psb_out_unit,'("Invese Fill in : ",i0)') parms%inv_fill
case ('INVT')
write(psb_out_unit,'("Fill in : ",i0)') parms%fill
write(psb_out_unit,'("Threshold : ",es12.5)') parms%thresh
write(psb_out_unit,'("Invese Fill in : ",i0)') parms%inv_fill

Loading…
Cancel
Save