mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-06 22:55:12 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e46f22a37c | ||
|
|
e5b1d7c3ca | ||
|
|
c4ededa9d0 | ||
|
|
5634157c8d | ||
|
|
1355765d14 | ||
|
|
152903e7df | ||
|
|
b1eedbb7ac | ||
|
|
485a94765b | ||
|
|
2f45f8631b | ||
|
|
e02df3725e | ||
|
|
ac42d7b1dd | ||
|
|
697f325df6 | ||
|
|
58d00b16c6 | ||
|
|
425743939c | ||
|
|
7e48a0a742 | ||
|
|
4f9254ebb0 | ||
|
|
90657b706f | ||
|
|
23a39a6c54 | ||
|
|
873f190961 | ||
|
|
87cdd76f8d | ||
|
|
45fabb5214 | ||
|
|
a9182021bb | ||
|
|
a8f4009cb1 | ||
|
|
794080e386 | ||
|
|
818f7a78a0 | ||
|
|
939d7c9a89 | ||
|
|
92f7cde375 | ||
|
|
af178daa84 | ||
|
|
49777a379b | ||
|
|
5768238f66 | ||
|
|
4c4b2b282e | ||
|
|
9d11a99ed4 | ||
|
|
9bc8b540b3 | ||
|
|
af75364c54 | ||
|
|
1270498170 | ||
|
|
b387308455 | ||
|
|
aba9b29717 | ||
|
|
94ca610bff | ||
|
|
2542c0fda4 | ||
|
|
8482067b52 | ||
|
|
7319dab30f | ||
|
|
4bbba3ebd7 | ||
|
|
988021ff24 | ||
|
|
4e177ce926 | ||
|
|
1fa94d0372 | ||
|
|
0fcbdd74cd | ||
|
|
ba854379e4 | ||
|
|
a6cbd64e65 | ||
|
|
5c589dbf30 | ||
|
|
10e9c53e54 | ||
|
|
0332920a63 | ||
|
|
9b9dfbd198 | ||
|
|
5909e541b0 | ||
|
|
941ca6568a | ||
|
|
39a9c4e4ed | ||
|
|
41b4373494 | ||
|
|
4bf009a1ab |
+113
-58
@@ -81,9 +81,9 @@ module amg_base_prec_type
|
||||
!
|
||||
! Version numbers
|
||||
!
|
||||
character(len=*), parameter :: amg_version_string_ = "1.0.0"
|
||||
character(len=*), parameter :: amg_version_string_ = "1.1.0"
|
||||
integer(psb_ipk_), parameter :: amg_version_major_ = 1
|
||||
integer(psb_ipk_), parameter :: amg_version_minor_ = 0
|
||||
integer(psb_ipk_), parameter :: amg_version_minor_ = 1
|
||||
integer(psb_ipk_), parameter :: amg_patchlevel_ = 0
|
||||
|
||||
type amg_ml_parms
|
||||
@@ -649,43 +649,52 @@ contains
|
||||
end if
|
||||
end subroutine ml_parms_mlcycledsc
|
||||
|
||||
subroutine ml_parms_mldescr(pm,iout,info)
|
||||
subroutine ml_parms_mldescr(pm,iout,info,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_ml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_ml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
character(1024) :: prefix_
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if ((pm%ml_cycle>=amg_no_ml_).and.(pm%ml_cycle<=amg_max_ml_cycle_)) then
|
||||
|
||||
|
||||
write(iout,*) ' Parallel aggregation algorithm: ',&
|
||||
write(iout,*) trim(prefix),' Parallel aggregation algorithm: ',&
|
||||
& par_aggr_alg_names(pm%par_aggr_alg)
|
||||
if (pm%aggr_type>0) write(iout,*) ' Aggregation type: ',&
|
||||
if (pm%aggr_type>0) write(iout,*) trim(prefix),' Aggregation type: ',&
|
||||
& aggr_type_names(pm%aggr_type)
|
||||
!if (pm%par_aggr_alg /= amg_ext_aggr_) then
|
||||
if ( pm%aggr_ord /= amg_aggr_ord_nat_) &
|
||||
& write(iout,*) ' with initial ordering: ',&
|
||||
& write(iout,*) trim(prefix),' with initial ordering: ',&
|
||||
& ord_names(pm%aggr_ord)
|
||||
write(iout,*) ' Aggregation prolongator: ', &
|
||||
write(iout,*) trim(prefix),' Aggregation prolongator: ', &
|
||||
& aggr_prols(pm%aggr_prol)
|
||||
if (pm%aggr_prol /= amg_no_smooth_) then
|
||||
write(iout,*) ' with: ', aggr_filters(pm%aggr_filter)
|
||||
write(iout,*) trim(prefix),' with: ', aggr_filters(pm%aggr_filter)
|
||||
if (pm%aggr_omega_alg == amg_eig_est_) then
|
||||
write(iout,*) ' Damping omega computation: spectral radius estimate'
|
||||
write(iout,*) ' Spectral radius estimate: ', &
|
||||
write(iout,*) trim(prefix),' Damping omega computation: spectral radius estimate'
|
||||
write(iout,*) trim(prefix),' Spectral radius estimate: ', &
|
||||
& eigen_estimates(pm%aggr_eig)
|
||||
else if (pm%aggr_omega_alg == amg_user_choice_) then
|
||||
write(iout,*) ' Damping omega computation: user defined value.'
|
||||
write(iout,*) trim(prefix),' Damping omega computation: user defined value.'
|
||||
else
|
||||
write(iout,*) ' Damping omega computation: unknown value in iprcparm!!'
|
||||
write(iout,*) trim(prefix),' Damping omega computation: unknown value in iprcparm!!'
|
||||
end if
|
||||
end if
|
||||
!end if
|
||||
else
|
||||
write(iout,*) ' Multilevel type: Unkonwn value. Something is amiss....',&
|
||||
write(iout,*) trim(prefix),' Multilevel type: Unkonwn value. Something is amiss....',&
|
||||
& pm%ml_cycle
|
||||
end if
|
||||
|
||||
@@ -693,15 +702,16 @@ contains
|
||||
|
||||
end subroutine ml_parms_mldescr
|
||||
|
||||
subroutine ml_parms_descr(pm,iout,info,coarse)
|
||||
subroutine ml_parms_descr(pm,iout,info,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_ml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
logical, intent(in), optional :: coarse
|
||||
class(amg_ml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
logical :: coarse_
|
||||
|
||||
info = psb_success_
|
||||
@@ -712,7 +722,7 @@ contains
|
||||
end if
|
||||
|
||||
if (coarse_) then
|
||||
call pm%coarsedescr(iout,info)
|
||||
call pm%coarsedescr(iout,info,prefix=prefix)
|
||||
end if
|
||||
|
||||
return
|
||||
@@ -720,81 +730,126 @@ contains
|
||||
end subroutine ml_parms_descr
|
||||
|
||||
|
||||
subroutine ml_parms_coarsedescr(pm,iout,info)
|
||||
subroutine ml_parms_coarsedescr(pm,iout,info,prefix)
|
||||
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_ml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_ml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
write(iout,*) ' Coarse matrix: ',&
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) trim(prefix),' Coarse matrix: ',&
|
||||
& matrix_names(pm%coarse_mat)
|
||||
select case(pm%coarse_solve)
|
||||
case (amg_bjac_,amg_as_)
|
||||
write(iout,*) ' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
write(iout,*) ' Coarse solver: ',&
|
||||
write(iout,*) trim(prefix),' Coarse solver: ',&
|
||||
& 'Block Jacobi'
|
||||
write(iout,*) trim(prefix),' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
case (amg_l1_bjac_)
|
||||
write(iout,*) ' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
write(iout,*) ' Coarse solver: ',&
|
||||
write(iout,*) trim(prefix),' Coarse solver: ',&
|
||||
& 'L1-Block Jacobi'
|
||||
case (amg_jac_)
|
||||
write(iout,*) ' Number of sweeps : ',&
|
||||
write(iout,*) trim(prefix),' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
write(iout,*) ' Coarse solver: ',&
|
||||
case (amg_jac_)
|
||||
write(iout,*) trim(prefix),' Coarse solver: ',&
|
||||
& 'Point Jacobi'
|
||||
write(iout,*) trim(prefix),' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
case (amg_l1_jac_)
|
||||
write(iout,*) trim(prefix),' Coarse solver: ',&
|
||||
& 'L1-Jacobi'
|
||||
write(iout,*) trim(prefix),' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
case (amg_l1_fbgs_)
|
||||
write(iout,*) trim(prefix),' Coarse solver: ',&
|
||||
& 'L1 Forward-Backward Gauss-Seidel (Hybrid)'
|
||||
write(iout,*) trim(prefix),' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
case (amg_l1_gs_)
|
||||
write(iout,*) trim(prefix),' Coarse solver: ',&
|
||||
& 'L1 Gauss-Seidel (Hybrid)'
|
||||
write(iout,*) trim(prefix),' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
case (amg_fbgs_)
|
||||
write(iout,*) trim(prefix),' Coarse solver: ',&
|
||||
& 'Forward-Backward Gauss-Seidel (Hybrid)'
|
||||
write(iout,*) trim(prefix),' Number of sweeps : ',&
|
||||
& pm%sweeps_pre
|
||||
case default
|
||||
write(iout,*) ' Coarse solver: ',&
|
||||
write(iout,*) trim(prefix),' Coarse solver: ',&
|
||||
& amg_fact_names(pm%coarse_solve)
|
||||
end select
|
||||
|
||||
|
||||
end subroutine ml_parms_coarsedescr
|
||||
|
||||
subroutine s_ml_parms_descr(pm,iout,info,coarse)
|
||||
subroutine s_ml_parms_descr(pm,iout,info,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_sml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
logical, intent(in), optional :: coarse
|
||||
class(amg_sml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
|
||||
call pm%amg_ml_parms%descr(iout,info,coarse)
|
||||
if (pm%aggr_prol /= amg_no_smooth_) then
|
||||
write(iout,*) ' Damping omega value :',pm%aggr_omega_val
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
write(iout,*) ' Aggregation threshold:',pm%aggr_thresh
|
||||
|
||||
call pm%amg_ml_parms%descr(iout,info,coarse,prefix=prefix)
|
||||
if (pm%aggr_prol /= amg_no_smooth_) then
|
||||
write(iout,*) trim(prefix),' Damping omega value :',pm%aggr_omega_val
|
||||
end if
|
||||
write(iout,*) trim(prefix),' Aggregation threshold:',pm%aggr_thresh
|
||||
|
||||
return
|
||||
|
||||
end subroutine s_ml_parms_descr
|
||||
|
||||
subroutine d_ml_parms_descr(pm,iout,info,coarse)
|
||||
subroutine d_ml_parms_descr(pm,iout,info,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_dml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
logical, intent(in), optional :: coarse
|
||||
class(amg_dml_parms), intent(in) :: pm
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
|
||||
call pm%amg_ml_parms%descr(iout,info,coarse)
|
||||
if (pm%aggr_prol /= amg_no_smooth_) then
|
||||
write(iout,*) ' Damping omega value :',pm%aggr_omega_val
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
write(iout,*) ' Aggregation threshold:',pm%aggr_thresh
|
||||
|
||||
call pm%amg_ml_parms%descr(iout,info,coarse,prefix=prefix)
|
||||
if (pm%aggr_prol /= amg_no_smooth_) then
|
||||
write(iout,*) trim(prefix),' Damping omega value :',pm%aggr_omega_val
|
||||
end if
|
||||
write(iout,*) trim(prefix),' Aggregation threshold:',pm%aggr_thresh
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ module amg_c_ainv_solver
|
||||
!!$ end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_ainv_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_c_ainv_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_dpk_, amg_c_ainv_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
@@ -208,7 +208,7 @@ module amg_c_ainv_solver
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_c_ainv_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -396,21 +396,23 @@ contains
|
||||
end subroutine c_as_smoother_default
|
||||
|
||||
|
||||
subroutine c_as_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine c_as_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_c_as_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_c_as_smoother_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
logical :: coarse_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -424,16 +426,21 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (.not.coarse_) then
|
||||
write(iout_,*) ' Additive Schwarz with ',&
|
||||
write(iout_,*) trim(prefix_), ' Additive Schwarz with ',&
|
||||
& sm%novr, ' overlap layers.'
|
||||
write(iout_,*) ' Restrictor: ',restrict_names(sm%restr)
|
||||
write(iout_,*) ' Prolongator: ',prolong_names(sm%prol)
|
||||
write(iout_,*) ' Local solver:'
|
||||
write(iout_,*) trim(prefix_), ' Restrictor: ',restrict_names(sm%restr)
|
||||
write(iout_,*) trim(prefix_), ' Prolongator: ',prolong_names(sm%prol)
|
||||
write(iout_,*) trim(prefix_), ' Local solver:'
|
||||
endif
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%descr(info,iout_,coarse=coarse)
|
||||
call sm%sv%descr(info,iout_,coarse=coarse,prefix=prefix)
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
@@ -126,7 +126,7 @@ module amg_c_base_aggregator_mod
|
||||
& psb_c_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
||||
implicit none
|
||||
type(psb_c_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_c_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||
@@ -144,7 +144,7 @@ module amg_c_base_aggregator_mod
|
||||
& psb_c_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
||||
implicit none
|
||||
type(psb_c_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_c_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||
@@ -275,15 +275,22 @@ contains
|
||||
val = .false.
|
||||
end function amg_c_base_aggregator_xt_desc
|
||||
|
||||
subroutine amg_c_base_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_c_base_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_c_base_aggregator_type), intent(in) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ', 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_c_base_aggregator_descr
|
||||
|
||||
@@ -272,7 +272,7 @@ module amg_c_base_smoother_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_base_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_c_base_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: psb_desc_type, psb_cspmat_type, psb_c_base_sparse_mat, &
|
||||
& psb_c_vect_type, psb_c_base_vect_type, psb_spk_, &
|
||||
& amg_c_base_smoother_type, psb_ipk_
|
||||
@@ -281,6 +281,7 @@ module amg_c_base_smoother_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_c_base_smoother_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ module amg_c_base_solver_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_base_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_c_base_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_desc_type, psb_cspmat_type, psb_c_base_sparse_mat, &
|
||||
& psb_c_vect_type, psb_c_base_vect_type, psb_spk_, &
|
||||
& amg_c_base_solver_type, psb_ipk_
|
||||
@@ -281,7 +281,7 @@ module amg_c_base_solver_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_c_base_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -184,16 +184,23 @@ contains
|
||||
val = "Decoupled aggregation"
|
||||
end function amg_c_dec_aggregator_fmt
|
||||
|
||||
subroutine amg_c_dec_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_c_dec_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_c_dec_aggregator_type), intent(in) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Decoupled Aggregator'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ','Decoupled Aggregator'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_c_dec_aggregator_descr
|
||||
|
||||
@@ -219,7 +219,7 @@ contains
|
||||
|
||||
end subroutine c_diag_solver_free
|
||||
|
||||
subroutine c_diag_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_diag_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -228,11 +228,13 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_c_diag_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -240,8 +242,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
|
||||
write(iout_,*) ' Diagonal local solver '
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) trim(prefix_), ' Diagonal local solver '
|
||||
|
||||
return
|
||||
|
||||
@@ -352,7 +359,7 @@ module amg_c_l1_diag_solver
|
||||
|
||||
contains
|
||||
|
||||
subroutine c_l1_diag_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_l1_diag_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -361,11 +368,13 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_c_l1_diag_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -373,8 +382,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
|
||||
write(iout_,*) ' L1 Diagonal solver '
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) trim(prefix_), ' L1 Diagonal solver '
|
||||
|
||||
return
|
||||
|
||||
|
||||
+26
-12
@@ -433,20 +433,22 @@ contains
|
||||
return
|
||||
end subroutine c_gs_solver_free
|
||||
|
||||
subroutine c_gs_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_gs_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_c_gs_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_c_gs_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -455,12 +457,17 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%eps<=dzero) then
|
||||
write(iout_,*) ' Forward Gauss-Seidel iterative solver with ',&
|
||||
write(iout_,*) trim(prefix_), ' Forward Gauss-Seidel iterative solver with ',&
|
||||
& sv%sweeps,' sweeps'
|
||||
else
|
||||
write(iout_,*) ' Forward Gauss-Seidel iterative solver with tolerance',&
|
||||
write(iout_,*) trim(prefix_), ' Forward Gauss-Seidel iterative solver with tolerance',&
|
||||
& sv%eps,' and maxit', sv%sweeps
|
||||
end if
|
||||
|
||||
@@ -526,20 +533,22 @@ contains
|
||||
val = .true.
|
||||
end function c_gs_solver_is_iterative
|
||||
|
||||
subroutine c_bwgs_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_bwgs_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_c_bwgs_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_c_bwgs_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -548,12 +557,17 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%eps<=dzero) then
|
||||
write(iout_,*) ' Backward Gauss-Seidel iterative solver with ',&
|
||||
write(iout_,*) trim(prefix_), ' Backward Gauss-Seidel iterative solver with ',&
|
||||
& sv%sweeps,' sweeps'
|
||||
else
|
||||
write(iout_,*) ' Backward Gauss-Seidel iterative solver with tolerance',&
|
||||
write(iout_,*) trim(prefix_), ' Backward Gauss-Seidel iterative solver with tolerance',&
|
||||
& sv%eps,' and maxit', sv%sweeps
|
||||
end if
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ contains
|
||||
return
|
||||
end subroutine c_id_solver_free
|
||||
|
||||
subroutine c_id_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_id_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -165,12 +165,14 @@ contains
|
||||
class(amg_c_id_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_c_id_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -178,8 +180,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' Identity local solver '
|
||||
write(iout_,*) trim(prefix_), ' Identity local solver '
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ contains
|
||||
return
|
||||
end subroutine c_ilu_solver_free
|
||||
|
||||
subroutine c_ilu_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_ilu_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -414,12 +414,14 @@ contains
|
||||
class(amg_c_ilu_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_c_ilu_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -428,15 +430,20 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' Incomplete factorization solver: ',&
|
||||
write(iout_,*) trim(prefix_), ' Incomplete factorization solver: ',&
|
||||
& amg_fact_names(sv%fact_type)
|
||||
select case(sv%fact_type)
|
||||
case(psb_ilu_n_,psb_milu_n_)
|
||||
write(iout_,*) ' Fill level:',sv%fill_in
|
||||
write(iout_,*) trim(prefix_), ' Fill level:',sv%fill_in
|
||||
case(psb_ilu_t_)
|
||||
write(iout_,*) ' Fill level:',sv%fill_in
|
||||
write(iout_,*) ' Fill threshold :',sv%thresh
|
||||
write(iout_,*) trim(prefix_), ' Fill level:',sv%fill_in
|
||||
write(iout_,*) trim(prefix_), ' Fill threshold :',sv%thresh
|
||||
end select
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
@@ -123,7 +123,7 @@ module amg_c_invk_solver
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_invk_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_c_invk_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_spk_, amg_c_invk_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
@@ -133,7 +133,7 @@ module amg_c_invk_solver
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_c_invk_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -134,16 +134,17 @@ module amg_c_invt_solver
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_invt_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_c_invt_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_spk_, amg_c_invt_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_c_invt_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
end subroutine amg_c_invt_solver_descr
|
||||
end interface
|
||||
|
||||
@@ -219,12 +219,13 @@ module amg_c_jac_smoother
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_jac_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_c_jac_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: amg_c_jac_smoother_type, psb_ipk_
|
||||
class(amg_c_jac_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_c_jac_smoother_descr
|
||||
end interface
|
||||
|
||||
@@ -313,12 +314,13 @@ module amg_c_jac_smoother
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_l1_jac_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_c_l1_jac_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: amg_c_l1_jac_smoother_type, psb_ipk_
|
||||
class(amg_c_l1_jac_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_c_l1_jac_smoother_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ contains
|
||||
val = "KRM solver"
|
||||
end function c_krm_solver_get_fmt
|
||||
|
||||
subroutine c_krm_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_krm_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -444,12 +444,14 @@ contains
|
||||
class(amg_c_krm_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_c_krm_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -458,23 +460,22 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%global) then
|
||||
write(iout_,*) ' Krylov solver (global)'
|
||||
write(iout_,*) trim(prefix_), ' Krylov solver (global)'
|
||||
else
|
||||
write(iout_,*) ' Krylov solver (local) '
|
||||
write(iout_,*) trim(prefix_), ' Krylov solver (local) '
|
||||
end if
|
||||
write(iout_,*) ' method: ',sv%method
|
||||
write(iout_,*) ' kprec: ',sv%kprec
|
||||
if (sv%i_sub_solve > 0) then
|
||||
write(iout_,*) ' sub_solve: ',amg_fact_names(sv%i_sub_solve)
|
||||
else
|
||||
write(iout_,*) ' sub_solve: ',sv%sub_solve
|
||||
end if
|
||||
write(iout_,*) ' itmax: ',sv%itmax
|
||||
write(iout_,*) ' eps: ',sv%eps
|
||||
write(iout_,*) ' fillin: ',sv%fillin
|
||||
|
||||
write(iout_,*) trim(prefix_), ' method: ',sv%method
|
||||
write(iout_,*) trim(prefix_), ' kprec: ',sv%kprec
|
||||
call sv%prec%descr(iout_,info,prefix='KRM : '//prefix_)
|
||||
write(iout_,*) trim(prefix_), ' itmax: ',sv%itmax
|
||||
write(iout_,*) trim(prefix_), ' eps: ',sv%eps
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -313,22 +313,24 @@ subroutine c_mumps_solver_finalize(sv)
|
||||
|
||||
end subroutine c_mumps_solver_finalize
|
||||
|
||||
subroutine c_mumps_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_mumps_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_c_mumps_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer(psb_ipk_) :: me, np
|
||||
character(len=20), parameter :: name='amg_z_mumps_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -337,8 +339,13 @@ subroutine c_mumps_solver_descr(sv,info,iout,coarse)
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' MUMPS Solver. '
|
||||
write(iout_,*) trim(prefix_), ' MUMPS Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -257,7 +257,7 @@ module amg_c_onelev_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity)
|
||||
subroutine amg_c_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity,prefix)
|
||||
import :: psb_cspmat_type, psb_c_vect_type, psb_c_base_vect_type, &
|
||||
& psb_clinmap_type, psb_spk_, amg_c_onelev_type, &
|
||||
& psb_ipk_, psb_epk_, psb_desc_type
|
||||
@@ -268,6 +268,7 @@ module amg_c_onelev_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_c_base_onelev_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -155,15 +155,16 @@ module amg_c_prec_type
|
||||
|
||||
|
||||
interface amg_precdescr
|
||||
subroutine amg_cfile_prec_descr(prec,info,iout,root,verbosity)
|
||||
subroutine amg_cfile_prec_descr(prec,info,iout,root,verbosity,prefix)
|
||||
import :: amg_cprec_type, psb_ipk_
|
||||
implicit none
|
||||
! Arguments
|
||||
class(amg_cprec_type), intent(in) :: prec
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_cprec_type), intent(in) :: prec
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_cfile_prec_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -385,20 +385,22 @@ contains
|
||||
|
||||
end subroutine c_slu_solver_finalize
|
||||
|
||||
subroutine c_slu_solver_descr(sv,info,iout,coarse)
|
||||
subroutine c_slu_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_c_slu_solver_type), intent(in) :: sv
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer :: err_act
|
||||
character(len=20), parameter :: name='amg_c_slu_solver_descr'
|
||||
integer :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -407,8 +409,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' SuperLU Sparse Factorization Solver. '
|
||||
write(iout_,*) trim(prefix_), ' SuperLU Sparse Factorization Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -88,16 +88,25 @@ contains
|
||||
val = "Symmetric Decoupled aggregation"
|
||||
end function amg_c_symdec_aggregator_fmt
|
||||
|
||||
subroutine amg_c_symdec_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_c_symdec_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_c_symdec_aggregator_type), intent(in) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
write(iout,*) 'Decoupled Aggregator locally-symmetrized'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
character(1024) :: prefix_
|
||||
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) trim(prefix_),' ','Decoupled Aggregator locally-symmetrized'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_c_symdec_aggregator_descr
|
||||
|
||||
@@ -198,7 +198,7 @@ module amg_d_ainv_solver
|
||||
!!$ end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_ainv_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_d_ainv_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_dpk_, amg_d_ainv_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
@@ -208,7 +208,7 @@ module amg_d_ainv_solver
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_d_ainv_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -396,21 +396,23 @@ contains
|
||||
end subroutine d_as_smoother_default
|
||||
|
||||
|
||||
subroutine d_as_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine d_as_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_d_as_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_d_as_smoother_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
logical :: coarse_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -424,16 +426,21 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (.not.coarse_) then
|
||||
write(iout_,*) ' Additive Schwarz with ',&
|
||||
write(iout_,*) trim(prefix_), ' Additive Schwarz with ',&
|
||||
& sm%novr, ' overlap layers.'
|
||||
write(iout_,*) ' Restrictor: ',restrict_names(sm%restr)
|
||||
write(iout_,*) ' Prolongator: ',prolong_names(sm%prol)
|
||||
write(iout_,*) ' Local solver:'
|
||||
write(iout_,*) trim(prefix_), ' Restrictor: ',restrict_names(sm%restr)
|
||||
write(iout_,*) trim(prefix_), ' Prolongator: ',prolong_names(sm%prol)
|
||||
write(iout_,*) trim(prefix_), ' Local solver:'
|
||||
endif
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%descr(info,iout_,coarse=coarse)
|
||||
call sm%sv%descr(info,iout_,coarse=coarse,prefix=prefix)
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
@@ -126,7 +126,7 @@ module amg_d_base_aggregator_mod
|
||||
& psb_d_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
||||
implicit none
|
||||
type(psb_d_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_d_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||
@@ -144,7 +144,7 @@ module amg_d_base_aggregator_mod
|
||||
& psb_d_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
||||
implicit none
|
||||
type(psb_d_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_d_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||
@@ -275,15 +275,22 @@ contains
|
||||
val = .false.
|
||||
end function amg_d_base_aggregator_xt_desc
|
||||
|
||||
subroutine amg_d_base_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_d_base_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_d_base_aggregator_type), intent(in) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ', 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_d_base_aggregator_descr
|
||||
|
||||
@@ -272,7 +272,7 @@ module amg_d_base_smoother_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_base_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_d_base_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: psb_desc_type, psb_dspmat_type, psb_d_base_sparse_mat, &
|
||||
& psb_d_vect_type, psb_d_base_vect_type, psb_dpk_, &
|
||||
& amg_d_base_smoother_type, psb_ipk_
|
||||
@@ -281,6 +281,7 @@ module amg_d_base_smoother_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_d_base_smoother_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ module amg_d_base_solver_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_base_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_d_base_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_desc_type, psb_dspmat_type, psb_d_base_sparse_mat, &
|
||||
& psb_d_vect_type, psb_d_base_vect_type, psb_dpk_, &
|
||||
& amg_d_base_solver_type, psb_ipk_
|
||||
@@ -281,7 +281,7 @@ module amg_d_base_solver_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_d_base_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -184,16 +184,23 @@ contains
|
||||
val = "Decoupled aggregation"
|
||||
end function amg_d_dec_aggregator_fmt
|
||||
|
||||
subroutine amg_d_dec_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_d_dec_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_d_dec_aggregator_type), intent(in) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Decoupled Aggregator'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ','Decoupled Aggregator'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_d_dec_aggregator_descr
|
||||
|
||||
@@ -219,7 +219,7 @@ contains
|
||||
|
||||
end subroutine d_diag_solver_free
|
||||
|
||||
subroutine d_diag_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_diag_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -228,11 +228,13 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_d_diag_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -240,8 +242,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
|
||||
write(iout_,*) ' Diagonal local solver '
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) trim(prefix_), ' Diagonal local solver '
|
||||
|
||||
return
|
||||
|
||||
@@ -352,7 +359,7 @@ module amg_d_l1_diag_solver
|
||||
|
||||
contains
|
||||
|
||||
subroutine d_l1_diag_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_l1_diag_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -361,11 +368,13 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_d_l1_diag_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -373,8 +382,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
|
||||
write(iout_,*) ' L1 Diagonal solver '
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) trim(prefix_), ' L1 Diagonal solver '
|
||||
|
||||
return
|
||||
|
||||
|
||||
+26
-12
@@ -433,20 +433,22 @@ contains
|
||||
return
|
||||
end subroutine d_gs_solver_free
|
||||
|
||||
subroutine d_gs_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_gs_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_d_gs_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_d_gs_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -455,12 +457,17 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%eps<=dzero) then
|
||||
write(iout_,*) ' Forward Gauss-Seidel iterative solver with ',&
|
||||
write(iout_,*) trim(prefix_), ' Forward Gauss-Seidel iterative solver with ',&
|
||||
& sv%sweeps,' sweeps'
|
||||
else
|
||||
write(iout_,*) ' Forward Gauss-Seidel iterative solver with tolerance',&
|
||||
write(iout_,*) trim(prefix_), ' Forward Gauss-Seidel iterative solver with tolerance',&
|
||||
& sv%eps,' and maxit', sv%sweeps
|
||||
end if
|
||||
|
||||
@@ -526,20 +533,22 @@ contains
|
||||
val = .true.
|
||||
end function d_gs_solver_is_iterative
|
||||
|
||||
subroutine d_bwgs_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_bwgs_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_d_bwgs_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_d_bwgs_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -548,12 +557,17 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%eps<=dzero) then
|
||||
write(iout_,*) ' Backward Gauss-Seidel iterative solver with ',&
|
||||
write(iout_,*) trim(prefix_), ' Backward Gauss-Seidel iterative solver with ',&
|
||||
& sv%sweeps,' sweeps'
|
||||
else
|
||||
write(iout_,*) ' Backward Gauss-Seidel iterative solver with tolerance',&
|
||||
write(iout_,*) trim(prefix_), ' Backward Gauss-Seidel iterative solver with tolerance',&
|
||||
& sv%eps,' and maxit', sv%sweeps
|
||||
end if
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ contains
|
||||
return
|
||||
end subroutine d_id_solver_free
|
||||
|
||||
subroutine d_id_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_id_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -165,12 +165,14 @@ contains
|
||||
class(amg_d_id_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_d_id_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -178,8 +180,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' Identity local solver '
|
||||
write(iout_,*) trim(prefix_), ' Identity local solver '
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ contains
|
||||
return
|
||||
end subroutine d_ilu_solver_free
|
||||
|
||||
subroutine d_ilu_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_ilu_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -414,12 +414,14 @@ contains
|
||||
class(amg_d_ilu_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_d_ilu_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -428,15 +430,20 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' Incomplete factorization solver: ',&
|
||||
write(iout_,*) trim(prefix_), ' Incomplete factorization solver: ',&
|
||||
& amg_fact_names(sv%fact_type)
|
||||
select case(sv%fact_type)
|
||||
case(psb_ilu_n_,psb_milu_n_)
|
||||
write(iout_,*) ' Fill level:',sv%fill_in
|
||||
write(iout_,*) trim(prefix_), ' Fill level:',sv%fill_in
|
||||
case(psb_ilu_t_)
|
||||
write(iout_,*) ' Fill level:',sv%fill_in
|
||||
write(iout_,*) ' Fill threshold :',sv%thresh
|
||||
write(iout_,*) trim(prefix_), ' Fill level:',sv%fill_in
|
||||
write(iout_,*) trim(prefix_), ' Fill threshold :',sv%thresh
|
||||
end select
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
@@ -123,7 +123,7 @@ module amg_d_invk_solver
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_invk_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_d_invk_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_dpk_, amg_d_invk_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
@@ -133,7 +133,7 @@ module amg_d_invk_solver
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_d_invk_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -134,16 +134,17 @@ module amg_d_invt_solver
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_invt_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_d_invt_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_dpk_, amg_d_invt_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_d_invt_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
end subroutine amg_d_invt_solver_descr
|
||||
end interface
|
||||
|
||||
@@ -219,12 +219,13 @@ module amg_d_jac_smoother
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_jac_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_d_jac_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: amg_d_jac_smoother_type, psb_ipk_
|
||||
class(amg_d_jac_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_d_jac_smoother_descr
|
||||
end interface
|
||||
|
||||
@@ -313,12 +314,13 @@ module amg_d_jac_smoother
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_l1_jac_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_d_l1_jac_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: amg_d_l1_jac_smoother_type, psb_ipk_
|
||||
class(amg_d_l1_jac_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_d_l1_jac_smoother_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ contains
|
||||
val = "KRM solver"
|
||||
end function d_krm_solver_get_fmt
|
||||
|
||||
subroutine d_krm_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_krm_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -444,12 +444,14 @@ contains
|
||||
class(amg_d_krm_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_d_krm_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -458,23 +460,22 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%global) then
|
||||
write(iout_,*) ' Krylov solver (global)'
|
||||
write(iout_,*) trim(prefix_), ' Krylov solver (global)'
|
||||
else
|
||||
write(iout_,*) ' Krylov solver (local) '
|
||||
write(iout_,*) trim(prefix_), ' Krylov solver (local) '
|
||||
end if
|
||||
write(iout_,*) ' method: ',sv%method
|
||||
write(iout_,*) ' kprec: ',sv%kprec
|
||||
if (sv%i_sub_solve > 0) then
|
||||
write(iout_,*) ' sub_solve: ',amg_fact_names(sv%i_sub_solve)
|
||||
else
|
||||
write(iout_,*) ' sub_solve: ',sv%sub_solve
|
||||
end if
|
||||
write(iout_,*) ' itmax: ',sv%itmax
|
||||
write(iout_,*) ' eps: ',sv%eps
|
||||
write(iout_,*) ' fillin: ',sv%fillin
|
||||
|
||||
write(iout_,*) trim(prefix_), ' method: ',sv%method
|
||||
write(iout_,*) trim(prefix_), ' kprec: ',sv%kprec
|
||||
call sv%prec%descr(iout_,info,prefix='KRM : '//prefix_)
|
||||
write(iout_,*) trim(prefix_), ' itmax: ',sv%itmax
|
||||
write(iout_,*) trim(prefix_), ' eps: ',sv%eps
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
+28
-328
@@ -68,7 +68,7 @@
|
||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
! POSSIBILITY OF SUCH DAMAGE.
|
||||
!
|
||||
module dmatchboxp_mod
|
||||
module amg_d_matchboxp_mod
|
||||
|
||||
use iso_c_binding
|
||||
use psb_base_cbind_mod
|
||||
@@ -94,33 +94,25 @@ module dmatchboxp_mod
|
||||
end subroutine dMatchBoxPC
|
||||
end interface MatchBoxPC
|
||||
|
||||
interface i_aggr_assign
|
||||
module procedure i_daggr_assign
|
||||
end interface i_aggr_assign
|
||||
interface amg_i_aggr_assign
|
||||
module procedure amg_i_d_aggr_assign
|
||||
end interface amg_i_aggr_assign
|
||||
|
||||
interface build_matching
|
||||
module procedure dbuild_matching
|
||||
end interface build_matching
|
||||
interface amg_par_build_matching
|
||||
module procedure amg_d_par_build_matching
|
||||
end interface amg_par_build_matching
|
||||
|
||||
interface build_ahat
|
||||
module procedure dbuild_ahat
|
||||
end interface build_ahat
|
||||
interface amg_par_build_ahat
|
||||
module procedure amg_d_par_build_ahat
|
||||
end interface amg_par_build_ahat
|
||||
|
||||
interface psb_gtranspose
|
||||
module procedure psb_dgtranspose
|
||||
end interface psb_gtranspose
|
||||
|
||||
interface psb_htranspose
|
||||
module procedure psb_dhtranspose
|
||||
end interface psb_htranspose
|
||||
|
||||
interface PMatchBox
|
||||
module procedure dPMatchBox
|
||||
end interface PMatchBox
|
||||
interface amg_PMatchBox
|
||||
module procedure amg_d_PMatchBox
|
||||
end interface amg_PMatchBox
|
||||
|
||||
contains
|
||||
|
||||
subroutine dmatchboxp_build_prol(w,a,desc_a,ilaggr,nlaggr,prol,info,&
|
||||
subroutine amg_d_matchboxp_build_prol(w,a,desc_a,ilaggr,nlaggr,prol,info,&
|
||||
& symmetrize,reproducible,display_inp, display_out, print_out)
|
||||
use psb_base_mod
|
||||
use psb_util_mod
|
||||
@@ -213,7 +205,7 @@ contains
|
||||
end if
|
||||
if (do_timings) call psb_toc(idx_phase1)
|
||||
if (do_timings) call psb_tic(idx_bldmtc)
|
||||
call build_matching(w,a,desc_a,mate,info,display_inp=display_inp,symmetrize=symmetrize)
|
||||
call amg_par_build_matching(w,a,desc_a,mate,info,display_inp=display_inp,symmetrize=symmetrize)
|
||||
if (do_timings) call psb_toc(idx_bldmtc)
|
||||
if (debug) write(0,*) iam,' buildprol from buildmatching:',&
|
||||
& info
|
||||
@@ -311,7 +303,7 @@ contains
|
||||
! Should be a symmetric function.
|
||||
!
|
||||
call desc_a%indxmap%qry_halo_owner(idx,iown,info)
|
||||
ip = i_aggr_assign(iam, iown, kg, idxg, wk, widx, nrmagg)
|
||||
ip = amg_i_aggr_assign(iam, iown, kg, idxg, wk, widx, nrmagg)
|
||||
if (iam == ip) then
|
||||
nlaggr(iam) = nlaggr(iam) + 1
|
||||
ilaggr(k) = nlaggr(iam)
|
||||
@@ -513,9 +505,9 @@ contains
|
||||
write(0,*) iam,' : error from Matching: ',info
|
||||
end if
|
||||
|
||||
end subroutine dmatchboxp_build_prol
|
||||
end subroutine amg_d_matchboxp_build_prol
|
||||
|
||||
function i_daggr_assign(iam, iown, kg, idxg, wk, widx, nrmagg) &
|
||||
function amg_i_d_aggr_assign(iam, iown, kg, idxg, wk, widx, nrmagg) &
|
||||
& result(iproc)
|
||||
!
|
||||
! How to break ties? This
|
||||
@@ -557,10 +549,10 @@ contains
|
||||
iproc = iown
|
||||
end if
|
||||
end if
|
||||
end function i_daggr_assign
|
||||
end function amg_i_d_aggr_assign
|
||||
|
||||
|
||||
subroutine dbuild_matching(w,a,desc_a,mate,info,display_inp, symmetrize)
|
||||
subroutine amg_d_par_build_matching(w,a,desc_a,mate,info,display_inp, symmetrize)
|
||||
use psb_base_mod
|
||||
use psb_util_mod
|
||||
use iso_c_binding
|
||||
@@ -609,7 +601,7 @@ contains
|
||||
if (iam == 0) write(0,*)' Into build_ahat:'
|
||||
end if
|
||||
if (do_timings) call psb_tic(idx_bldahat)
|
||||
call build_ahat(w,a,ahatnd,desc_a,info,symmetrize=symmetrize)
|
||||
call amg_par_build_ahat(w,a,ahatnd,desc_a,info,symmetrize=symmetrize)
|
||||
if (do_timings) call psb_toc(idx_bldahat)
|
||||
if (info /= 0) then
|
||||
write(0,*) 'Error from build_ahat ', info
|
||||
@@ -700,7 +692,7 @@ contains
|
||||
!
|
||||
if (debug) write(0,*) iam,' buildmatching into PMatchBox:'
|
||||
if (do_timings) call psb_tic(idx_cmboxp)
|
||||
call PMatchBox(nr,nz,vlptr,vlind,ewght,&
|
||||
call amg_PMatchBox(nr,nz,vlptr,vlind,ewght,&
|
||||
& vnl, mate, iam, np,ictxt,&
|
||||
& msgis,msgas,msgprc,ph0t,ph1t,ph2t,ph1crd,ph2crd,info,display_inp)
|
||||
if (do_timings) call psb_toc(idx_cmboxp)
|
||||
@@ -764,9 +756,9 @@ contains
|
||||
val(1:n) = tmp(1:n)
|
||||
end subroutine fix_order
|
||||
|
||||
end subroutine dbuild_matching
|
||||
end subroutine amg_d_par_build_matching
|
||||
|
||||
subroutine dbuild_ahat(w,a,ahat,desc_a,info,symmetrize)
|
||||
subroutine amg_d_par_build_ahat(w,a,ahat,desc_a,info,symmetrize)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
real(psb_dpk_), intent(in) :: w(:)
|
||||
@@ -1002,301 +994,9 @@ contains
|
||||
end block
|
||||
end if
|
||||
|
||||
end subroutine dbuild_ahat
|
||||
end subroutine amg_d_par_build_ahat
|
||||
|
||||
subroutine psb_dgtranspose(ain,aout,desc_a,info)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_ldspmat_type), intent(in) :: ain
|
||||
type(psb_ldspmat_type), intent(out) :: aout
|
||||
type(psb_desc_type) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
!
|
||||
! BEWARE: This routine works under the assumption
|
||||
! that the same DESC_A works for both A and A^T, which
|
||||
! essentially means that A has a symmetric pattern.
|
||||
!
|
||||
type(psb_ldspmat_type) :: atmp, ahalo, aglb
|
||||
type(psb_ld_coo_sparse_mat) :: tmpcoo
|
||||
type(psb_ld_csr_sparse_mat) :: tmpcsr
|
||||
type(psb_ctxt_type) :: ictxt
|
||||
integer(psb_ipk_) :: me, np
|
||||
integer(psb_lpk_) :: i, j, k, nrow, ncol
|
||||
integer(psb_lpk_), allocatable :: ilv(:)
|
||||
character(len=80) :: aname
|
||||
logical, parameter :: debug=.false., dump=.false., debug_sync=.false.
|
||||
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt,me,np)
|
||||
|
||||
nrow = desc_a%get_local_rows()
|
||||
ncol = desc_a%get_local_cols()
|
||||
if (debug_sync) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'Start gtranspose '
|
||||
end if
|
||||
call ain%cscnv(tmpcsr,info)
|
||||
|
||||
if (debug) then
|
||||
ilv = [(i,i=1,ncol)]
|
||||
call desc_a%l2gip(ilv,info,owned=.false.)
|
||||
write(aname,'(a,i3.3,a)') 'atmp-preh-',me,'.mtx'
|
||||
call ain%print(fname=aname,head='atmp before haloTest ',iv=ilv)
|
||||
end if
|
||||
if (dump) then
|
||||
call ain%cscnv(atmp,info)
|
||||
call psb_gather(aglb,atmp,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'aglob-prehalo.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
!call psb_loc_to_glob(tmpcsr%ja,desc_a,info)
|
||||
call atmp%mv_from(tmpcsr)
|
||||
|
||||
if (debug) then
|
||||
write(aname,'(a,i3.3,a)') 'tmpcsr-',me,'.mtx'
|
||||
call atmp%print(fname=aname,head='tmpcsr ',iv=ilv)
|
||||
!call psb_set_debug_level(9999)
|
||||
end if
|
||||
|
||||
! FIXME THIS NEEDS REWORKING
|
||||
if (debug) write(0,*) me,' Gtranspose into sphalo :',atmp%get_nrows(),atmp%get_ncols()
|
||||
call psb_sphalo(atmp,desc_a,ahalo,info,rowscale=.true.)
|
||||
if (debug) write(0,*) me,' Gtranspose from sphalo :',ahalo%get_nrows(),ahalo%get_ncols()
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=ahalo)
|
||||
|
||||
if (debug) then
|
||||
write(aname,'(a,i3.3,a)') 'ahalo-',me,'.mtx'
|
||||
call ahalo%print(fname=aname,head='ahalo after haloTest ',iv=ilv)
|
||||
write(aname,'(a,i3.3,a)') 'atmp-h-',me,'.mtx'
|
||||
call atmp%print(fname=aname,head='atmp after haloTest ',iv=ilv)
|
||||
end if
|
||||
|
||||
if (info == psb_success_) call ahalo%free()
|
||||
|
||||
call atmp%cp_to(tmpcoo)
|
||||
call tmpcoo%transp()
|
||||
!call psb_glob_to_loc(tmpcoo%ia,desc_a,info,iact='I')
|
||||
if (debug) write(0,*) 'Before cleanup:',tmpcoo%get_nzeros()
|
||||
|
||||
j = 0
|
||||
do k=1, tmpcoo%get_nzeros()
|
||||
if ((tmpcoo%ia(k) > 0).and.(tmpcoo%ja(k)>0)) then
|
||||
j = j+1
|
||||
tmpcoo%ia(j) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(j) = tmpcoo%ja(k)
|
||||
tmpcoo%val(j) = tmpcoo%val(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(j)
|
||||
|
||||
if (debug) write(0,*) 'After cleanup:',tmpcoo%get_nzeros()
|
||||
|
||||
call ahalo%mv_from(tmpcoo)
|
||||
if (dump) then
|
||||
call psb_gather(aglb,ahalo,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'atran-preclip.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
call ahalo%csclip(aout,info,imax=nrow)
|
||||
|
||||
if (debug) write(0,*) 'After clip:',aout%get_nzeros()
|
||||
|
||||
if (debug_sync) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'End gtranspose '
|
||||
end if
|
||||
!call aout%cscnv(info,type='csr')
|
||||
|
||||
if (dump) then
|
||||
write(aname,'(a,i3.3,a)') 'atran-',me,'.mtx'
|
||||
call aout%print(fname=aname,head='atrans ',iv=ilv)
|
||||
call psb_gather(aglb,aout,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'atran.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
end subroutine psb_dgtranspose
|
||||
|
||||
subroutine psb_dhtranspose(ain,aout,desc_a,info)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_ldspmat_type), intent(in) :: ain
|
||||
type(psb_ldspmat_type), intent(out) :: aout
|
||||
type(psb_desc_type) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
!
|
||||
! BEWARE: This routine works under the assumption
|
||||
! that the same DESC_A works for both A and A^T, which
|
||||
! essentially means that A has a symmetric pattern.
|
||||
!
|
||||
type(psb_ldspmat_type) :: atmp, ahalo, aglb
|
||||
type(psb_ld_coo_sparse_mat) :: tmpcoo, tmpc1, tmpc2, tmpch
|
||||
type(psb_ld_csr_sparse_mat) :: tmpcsr
|
||||
integer(psb_ipk_) :: nz1, nz2, nzh, nz
|
||||
type(psb_ctxt_type) :: ictxt
|
||||
integer(psb_ipk_) :: me, np
|
||||
integer(psb_lpk_) :: i, j, k, nrow, ncol, nlz
|
||||
integer(psb_lpk_), allocatable :: ilv(:)
|
||||
character(len=80) :: aname
|
||||
logical, parameter :: debug=.false., dump=.false., debug_sync=.false.
|
||||
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt,me,np)
|
||||
|
||||
nrow = desc_a%get_local_rows()
|
||||
ncol = desc_a%get_local_cols()
|
||||
if (debug_sync) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'Start htranspose '
|
||||
end if
|
||||
call ain%cscnv(tmpcsr,info)
|
||||
|
||||
if (debug) then
|
||||
ilv = [(i,i=1,ncol)]
|
||||
call desc_a%l2gip(ilv,info,owned=.false.)
|
||||
write(aname,'(a,i3.3,a)') 'atmp-preh-',me,'.mtx'
|
||||
call ain%print(fname=aname,head='atmp before haloTest ',iv=ilv)
|
||||
end if
|
||||
if (dump) then
|
||||
call ain%cscnv(atmp,info)
|
||||
call psb_gather(aglb,atmp,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'aglob-prehalo.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
!call psb_loc_to_glob(tmpcsr%ja,desc_a,info)
|
||||
call atmp%mv_from(tmpcsr)
|
||||
|
||||
if (debug) then
|
||||
write(aname,'(a,i3.3,a)') 'tmpcsr-',me,'.mtx'
|
||||
call atmp%print(fname=aname,head='tmpcsr ',iv=ilv)
|
||||
!call psb_set_debug_level(9999)
|
||||
end if
|
||||
|
||||
! FIXME THIS NEEDS REWORKING
|
||||
if (debug) write(0,*) me,' Htranspose into sphalo :',atmp%get_nrows(),atmp%get_ncols()
|
||||
if (.true.) then
|
||||
call psb_sphalo(atmp,desc_a,ahalo,info, outfmt='coo ')
|
||||
call atmp%mv_to(tmpc1)
|
||||
call ahalo%mv_to(tmpch)
|
||||
nz1 = tmpc1%get_nzeros()
|
||||
call psb_loc_to_glob(tmpc1%ia(1:nz1),desc_a,info,iact='I')
|
||||
call psb_loc_to_glob(tmpc1%ja(1:nz1),desc_a,info,iact='I')
|
||||
nzh = tmpch%get_nzeros()
|
||||
call psb_loc_to_glob(tmpch%ia(1:nzh),desc_a,info,iact='I')
|
||||
call psb_loc_to_glob(tmpch%ja(1:nzh),desc_a,info,iact='I')
|
||||
nlz = nz1+nzh
|
||||
call tmpcoo%allocate(ncol,ncol,nlz)
|
||||
tmpcoo%ia(1:nz1) = tmpc1%ia(1:nz1)
|
||||
tmpcoo%ja(1:nz1) = tmpc1%ja(1:nz1)
|
||||
tmpcoo%val(1:nz1) = tmpc1%val(1:nz1)
|
||||
tmpcoo%ia(nz1+1:nz1+nzh) = tmpch%ia(1:nzh)
|
||||
tmpcoo%ja(nz1+1:nz1+nzh) = tmpch%ja(1:nzh)
|
||||
tmpcoo%val(nz1+1:nz1+nzh) = tmpch%val(1:nzh)
|
||||
call tmpcoo%set_nzeros(nlz)
|
||||
call tmpcoo%transp()
|
||||
nz = tmpcoo%get_nzeros()
|
||||
call psb_glob_to_loc(tmpcoo%ia(1:nz),desc_a,info,iact='I')
|
||||
call psb_glob_to_loc(tmpcoo%ja(1:nz),desc_a,info,iact='I')
|
||||
if (.true.) then
|
||||
call tmpcoo%clean_negidx(info)
|
||||
else
|
||||
j = 0
|
||||
do k=1, tmpcoo%get_nzeros()
|
||||
if ((tmpcoo%ia(k) > 0).and.(tmpcoo%ja(k)>0)) then
|
||||
j = j+1
|
||||
tmpcoo%ia(j) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(j) = tmpcoo%ja(k)
|
||||
tmpcoo%val(j) = tmpcoo%val(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(j)
|
||||
end if
|
||||
call ahalo%mv_from(tmpcoo)
|
||||
call ahalo%csclip(aout,info,imax=nrow)
|
||||
|
||||
else
|
||||
call psb_sphalo(atmp,desc_a,ahalo,info, rowscale=.true.)
|
||||
if (debug) write(0,*) me,' Htranspose from sphalo :',ahalo%get_nrows(),ahalo%get_ncols()
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=ahalo)
|
||||
|
||||
if (debug) then
|
||||
write(aname,'(a,i3.3,a)') 'ahalo-',me,'.mtx'
|
||||
call ahalo%print(fname=aname,head='ahalo after haloTest ',iv=ilv)
|
||||
write(aname,'(a,i3.3,a)') 'atmp-h-',me,'.mtx'
|
||||
call atmp%print(fname=aname,head='atmp after haloTest ',iv=ilv)
|
||||
end if
|
||||
|
||||
if (info == psb_success_) call ahalo%free()
|
||||
|
||||
call atmp%cp_to(tmpcoo)
|
||||
call tmpcoo%transp()
|
||||
if (debug) write(0,*) 'Before cleanup:',tmpcoo%get_nzeros()
|
||||
if (.true.) then
|
||||
call tmpcoo%clean_negidx(info)
|
||||
else
|
||||
|
||||
j = 0
|
||||
do k=1, tmpcoo%get_nzeros()
|
||||
if ((tmpcoo%ia(k) > 0).and.(tmpcoo%ja(k)>0)) then
|
||||
j = j+1
|
||||
tmpcoo%ia(j) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(j) = tmpcoo%ja(k)
|
||||
tmpcoo%val(j) = tmpcoo%val(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(j)
|
||||
end if
|
||||
|
||||
if (debug) write(0,*) 'After cleanup:',tmpcoo%get_nzeros()
|
||||
|
||||
call ahalo%mv_from(tmpcoo)
|
||||
if (dump) then
|
||||
call psb_gather(aglb,ahalo,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'atran-preclip.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
call ahalo%csclip(aout,info,imax=nrow)
|
||||
end if
|
||||
|
||||
if (debug) write(0,*) 'After clip:',aout%get_nzeros()
|
||||
|
||||
if (debug_sync) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'End htranspose '
|
||||
end if
|
||||
!call aout%cscnv(info,type='csr')
|
||||
|
||||
if (dump) then
|
||||
write(aname,'(a,i3.3,a)') 'atran-',me,'.mtx'
|
||||
call aout%print(fname=aname,head='atrans ',iv=ilv)
|
||||
call psb_gather(aglb,aout,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'atran.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
end subroutine psb_dhtranspose
|
||||
|
||||
subroutine dPMatchBox(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
subroutine amg_d_PMatchBox(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate, myrank, numprocs, ictxt,&
|
||||
& msgindsent,msgactualsent,msgpercent,&
|
||||
& ph0_time, ph1_time, ph2_time, ph1_card, ph2_card,info,display_inp)
|
||||
@@ -1431,6 +1131,6 @@ contains
|
||||
end if
|
||||
where(mate>=0) mate = mate + 1
|
||||
|
||||
end subroutine dPMatchBox
|
||||
end subroutine amg_d_PMatchBox
|
||||
|
||||
end module dmatchboxp_mod
|
||||
end module amg_d_matchboxp_mod
|
||||
|
||||
@@ -313,22 +313,24 @@ subroutine d_mumps_solver_finalize(sv)
|
||||
|
||||
end subroutine d_mumps_solver_finalize
|
||||
|
||||
subroutine d_mumps_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_mumps_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_d_mumps_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer(psb_ipk_) :: me, np
|
||||
character(len=20), parameter :: name='amg_z_mumps_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -337,8 +339,13 @@ subroutine d_mumps_solver_descr(sv,info,iout,coarse)
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' MUMPS Solver. '
|
||||
write(iout_,*) trim(prefix_), ' MUMPS Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -258,7 +258,7 @@ module amg_d_onelev_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity)
|
||||
subroutine amg_d_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity,prefix)
|
||||
import :: psb_dspmat_type, psb_d_vect_type, psb_d_base_vect_type, &
|
||||
& psb_dlinmap_type, psb_dpk_, amg_d_onelev_type, &
|
||||
& psb_ipk_, psb_epk_, psb_desc_type
|
||||
@@ -269,6 +269,7 @@ module amg_d_onelev_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_d_base_onelev_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
module amg_d_parmatch_aggregator_mod
|
||||
use amg_d_base_aggregator_mod
|
||||
use dmatchboxp_mod
|
||||
use amg_d_matchboxp_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
type, extends(amg_d_base_aggregator_type) :: amg_d_parmatch_aggregator_type
|
||||
end type amg_d_parmatch_aggregator_type
|
||||
@@ -132,8 +132,6 @@ module amg_d_parmatch_aggregator_mod
|
||||
type(psb_dspmat_type), allocatable :: prol, restr
|
||||
type(psb_dspmat_type), allocatable :: ac, base_a, rwa
|
||||
type(psb_desc_type), allocatable :: desc_ac, desc_ax, base_desc, rwdesc
|
||||
integer(psb_ipk_) :: max_csize
|
||||
integer(psb_ipk_) :: max_nlevels
|
||||
logical :: reproducible_matching = .false.
|
||||
logical :: need_symmetrize = .false.
|
||||
logical :: unsmoothed_hierarchy = .true.
|
||||
@@ -143,18 +141,18 @@ module amg_d_parmatch_aggregator_mod
|
||||
procedure, pass(ag) :: mat_asb => amg_d_parmatch_aggregator_mat_asb
|
||||
procedure, pass(ag) :: inner_mat_asb => amg_d_parmatch_aggregator_inner_mat_asb
|
||||
procedure, pass(ag) :: bld_map => amg_d_parmatch_aggregator_bld_map
|
||||
procedure, pass(ag) :: csetc => d_parmatch_aggr_csetc
|
||||
procedure, pass(ag) :: cseti => d_parmatch_aggr_cseti
|
||||
procedure, pass(ag) :: default => d_parmatch_aggr_set_default
|
||||
procedure, pass(ag) :: sizeof => d_parmatch_aggregator_sizeof
|
||||
procedure, pass(ag) :: update_next => d_parmatch_aggregator_update_next
|
||||
procedure, pass(ag) :: bld_wnxt => d_parmatch_bld_wnxt
|
||||
procedure, pass(ag) :: bld_default_w => d_bld_default_w
|
||||
procedure, pass(ag) :: set_c_default_w => d_set_prm_c_default_w
|
||||
procedure, pass(ag) :: descr => d_parmatch_aggregator_descr
|
||||
procedure, pass(ag) :: clone => d_parmatch_aggregator_clone
|
||||
procedure, pass(ag) :: free => d_parmatch_aggregator_free
|
||||
procedure, nopass :: fmt => d_parmatch_aggregator_fmt
|
||||
procedure, pass(ag) :: csetc => amg_d_parmatch_aggr_csetc
|
||||
procedure, pass(ag) :: cseti => amg_d_parmatch_aggr_cseti
|
||||
procedure, pass(ag) :: default => amg_d_parmatch_aggr_set_default
|
||||
procedure, pass(ag) :: sizeof => amg_d_parmatch_aggregator_sizeof
|
||||
procedure, pass(ag) :: update_next => amg_d_parmatch_aggregator_update_next
|
||||
procedure, pass(ag) :: bld_wnxt => amg_d_parmatch_bld_wnxt
|
||||
procedure, pass(ag) :: bld_default_w => amg_d_bld_default_w
|
||||
procedure, pass(ag) :: set_c_default_w => amg_d_set_prm_c_default_w
|
||||
procedure, pass(ag) :: descr => amg_d_parmatch_aggregator_descr
|
||||
procedure, pass(ag) :: clone => amg_d_parmatch_aggregator_clone
|
||||
procedure, pass(ag) :: free => amg_d_parmatch_aggregator_free
|
||||
procedure, nopass :: fmt => amg_d_parmatch_aggregator_fmt
|
||||
procedure, nopass :: xt_desc => amg_d_parmatch_aggregator_xt_desc
|
||||
end type amg_d_parmatch_aggregator_type
|
||||
|
||||
@@ -168,7 +166,7 @@ module amg_d_parmatch_aggregator_mod
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(amg_daggr_data), intent(in) :: ag_data
|
||||
type(psb_dspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_ldspmat_type), intent(out) :: t_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
@@ -235,7 +233,7 @@ module amg_d_parmatch_aggregator_mod
|
||||
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||
implicit none
|
||||
type(psb_dspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
@@ -257,7 +255,7 @@ module amg_d_parmatch_aggregator_mod
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
type(psb_dspmat_type), intent(out) :: op_prol,ac, op_restr
|
||||
type(psb_dspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_parmatch_unsmth_bld
|
||||
@@ -275,7 +273,7 @@ module amg_d_parmatch_aggregator_mod
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
type(psb_dspmat_type), intent(out) :: op_prol,ac, op_restr
|
||||
type(psb_dspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_parmatch_smth_bld
|
||||
@@ -288,11 +286,11 @@ module amg_d_parmatch_aggregator_mod
|
||||
& psb_ldspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_dml_parms, amg_daggr_data
|
||||
implicit none
|
||||
type(psb_dspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
type(psb_dspmat_type), intent(out) :: op_prol,ac, op_restr
|
||||
type(psb_dspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||
type(psb_desc_type), intent(out) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_parmatch_spmm_bld_ov
|
||||
@@ -306,11 +304,11 @@ module amg_d_parmatch_aggregator_mod
|
||||
& psb_d_csr_sparse_mat, psb_ld_csr_sparse_mat
|
||||
implicit none
|
||||
type(psb_d_csr_sparse_mat), intent(inout) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
type(psb_dspmat_type), intent(out) :: op_prol,ac, op_restr
|
||||
type(psb_dspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||
type(psb_desc_type), intent(out) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_parmatch_spmm_bld_inner
|
||||
@@ -320,7 +318,7 @@ module amg_d_parmatch_aggregator_mod
|
||||
|
||||
contains
|
||||
|
||||
subroutine d_bld_default_w(ag,nr)
|
||||
subroutine amg_d_bld_default_w(ag,nr)
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -330,9 +328,9 @@ contains
|
||||
if (info /= psb_success_) return
|
||||
ag%w = done
|
||||
!call ag%set_c_default_w()
|
||||
end subroutine d_bld_default_w
|
||||
end subroutine amg_d_bld_default_w
|
||||
|
||||
subroutine d_set_prm_c_default_w(ag)
|
||||
subroutine amg_d_set_prm_c_default_w(ag)
|
||||
use psb_realloc_mod
|
||||
use iso_c_binding
|
||||
implicit none
|
||||
@@ -342,9 +340,9 @@ contains
|
||||
!write(0,*) 'prm_c_deafult_w '
|
||||
call psb_safe_ab_cpy(ag%w,ag%w_nxt,info)
|
||||
|
||||
end subroutine d_set_prm_c_default_w
|
||||
end subroutine amg_d_set_prm_c_default_w
|
||||
|
||||
subroutine d_parmatch_bld_wnxt(ag,ilaggr,valaggr,nx)
|
||||
subroutine amg_d_parmatch_bld_wnxt(ag,ilaggr,valaggr,nx)
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -358,14 +356,14 @@ contains
|
||||
!write(0,*) 'Executing bld_wnxt ',nx
|
||||
call psb_realloc(nx,ag%w_nxt,info)
|
||||
|
||||
end subroutine d_parmatch_bld_wnxt
|
||||
end subroutine amg_d_parmatch_bld_wnxt
|
||||
|
||||
function d_parmatch_aggregator_fmt() result(val)
|
||||
function amg_d_parmatch_aggregator_fmt() result(val)
|
||||
implicit none
|
||||
character(len=32) :: val
|
||||
|
||||
val = "Parallel Matching aggregation"
|
||||
end function d_parmatch_aggregator_fmt
|
||||
end function amg_d_parmatch_aggregator_fmt
|
||||
|
||||
function amg_d_parmatch_aggregator_xt_desc() result(val)
|
||||
implicit none
|
||||
@@ -374,7 +372,7 @@ contains
|
||||
val = .true.
|
||||
end function amg_d_parmatch_aggregator_xt_desc
|
||||
|
||||
function d_parmatch_aggregator_sizeof(ag) result(val)
|
||||
function amg_d_parmatch_aggregator_sizeof(ag) result(val)
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), intent(in) :: ag
|
||||
@@ -390,23 +388,30 @@ contains
|
||||
if (allocated(ag%base_desc)) val = val + ag%base_desc%sizeof()
|
||||
if (allocated(ag%desc_ax)) val = val + ag%desc_ax%sizeof()
|
||||
|
||||
end function d_parmatch_aggregator_sizeof
|
||||
end function amg_d_parmatch_aggregator_sizeof
|
||||
|
||||
subroutine d_parmatch_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_d_parmatch_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), intent(in) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Parallel Matching Aggregator'
|
||||
write(iout,*) ' Number of matching sweeps: ',ag%n_sweeps
|
||||
write(iout,*) ' Matching algorithm : MatchBoxP (PREIS)'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ','Parallel Matching Aggregator'
|
||||
write(iout,*) trim(prefix_),' ',' Number of matching sweeps: ',ag%n_sweeps
|
||||
write(iout,*) trim(prefix_),' ',' Matching algorithm : MatchBoxP (PREIS)'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine d_parmatch_aggregator_descr
|
||||
end subroutine amg_d_parmatch_aggregator_descr
|
||||
|
||||
function is_legal_malg(alg) result(val)
|
||||
logical :: val
|
||||
@@ -437,7 +442,7 @@ contains
|
||||
end function is_legal_nlevels
|
||||
|
||||
|
||||
subroutine d_parmatch_aggregator_update_next(ag,agnext,info)
|
||||
subroutine amg_d_parmatch_aggregator_update_next(ag,agnext,info)
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -452,10 +457,10 @@ contains
|
||||
& agnext%matching_alg = ag%matching_alg
|
||||
if (.not.is_legal_nsweeps(agnext%n_sweeps))&
|
||||
& agnext%n_sweeps = ag%n_sweeps
|
||||
if (.not.is_legal_csize(agnext%max_csize))&
|
||||
& agnext%max_csize = ag%max_csize
|
||||
if (.not.is_legal_nlevels(agnext%max_nlevels))&
|
||||
& agnext%max_nlevels = ag%max_nlevels
|
||||
!!$ if (.not.is_legal_csize(agnext%max_csize))&
|
||||
!!$ & agnext%max_csize = ag%max_csize
|
||||
!!$ if (.not.is_legal_nlevels(agnext%max_nlevels))&
|
||||
!!$ & agnext%max_nlevels = ag%max_nlevels
|
||||
! Is this going to generate shallow copies/memory leaks/double frees?
|
||||
! To be investigated further.
|
||||
call psb_safe_ab_cpy(ag%w_nxt,agnext%w,info)
|
||||
@@ -470,9 +475,9 @@ contains
|
||||
! What should we do here?
|
||||
end select
|
||||
info = 0
|
||||
end subroutine d_parmatch_aggregator_update_next
|
||||
end subroutine amg_d_parmatch_aggregator_update_next
|
||||
|
||||
subroutine d_parmatch_aggr_csetc(ag,what,val,info,idx)
|
||||
subroutine amg_d_parmatch_aggr_csetc(ag,what,val,info,idx)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -514,9 +519,9 @@ contains
|
||||
! Do nothing
|
||||
end select
|
||||
return
|
||||
end subroutine d_parmatch_aggr_csetc
|
||||
end subroutine amg_d_parmatch_aggr_csetc
|
||||
|
||||
subroutine d_parmatch_aggr_cseti(ag,what,val,info,idx)
|
||||
subroutine amg_d_parmatch_aggr_cseti(ag,what,val,info,idx)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -540,10 +545,6 @@ contains
|
||||
case('AGGR_SIZE')
|
||||
ag%orig_aggr_size = val
|
||||
ag%n_sweeps=max(1,ceiling(log(val*1.0)/log(2.0)))
|
||||
case('PRMC_MAX_CSIZE')
|
||||
ag%max_csize=val
|
||||
case('PRMC_MAX_NLEVELS')
|
||||
ag%max_nlevels=val
|
||||
case('PRMC_W_SIZE')
|
||||
call ag%bld_default_w(val)
|
||||
case('PRMC_REPRODUCIBLE_MATCHING')
|
||||
@@ -556,9 +557,9 @@ contains
|
||||
! Do nothing
|
||||
end select
|
||||
return
|
||||
end subroutine d_parmatch_aggr_cseti
|
||||
end subroutine amg_d_parmatch_aggr_cseti
|
||||
|
||||
subroutine d_parmatch_aggr_set_default(ag)
|
||||
subroutine amg_d_parmatch_aggr_set_default(ag)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -569,8 +570,8 @@ contains
|
||||
ag%matching_alg = 0
|
||||
ag%n_sweeps = 1
|
||||
ag%jacobi_sweeps = 0
|
||||
ag%max_nlevels = 36
|
||||
ag%max_csize = -1
|
||||
!!$ ag%max_nlevels = 36
|
||||
!!$ ag%max_csize = -1
|
||||
!
|
||||
! Apparently BootCMatch works better
|
||||
! by keeping all entries
|
||||
@@ -579,9 +580,9 @@ contains
|
||||
|
||||
return
|
||||
|
||||
end subroutine d_parmatch_aggr_set_default
|
||||
end subroutine amg_d_parmatch_aggr_set_default
|
||||
|
||||
subroutine d_parmatch_aggregator_free(ag,info)
|
||||
subroutine amg_d_parmatch_aggregator_free(ag,info)
|
||||
use iso_c_binding
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
|
||||
@@ -618,9 +619,9 @@ contains
|
||||
call ag%rwdesc%free(info); deallocate(ag%rwdesc,stat=info)
|
||||
end if
|
||||
|
||||
end subroutine d_parmatch_aggregator_free
|
||||
end subroutine amg_d_parmatch_aggregator_free
|
||||
|
||||
subroutine d_parmatch_aggregator_clone(ag,agnext,info)
|
||||
subroutine amg_d_parmatch_aggregator_clone(ag,agnext,info)
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
|
||||
class(amg_d_base_aggregator_type), allocatable, intent(inout) :: agnext
|
||||
@@ -640,7 +641,7 @@ contains
|
||||
! Should never ever get here
|
||||
info = -1
|
||||
end select
|
||||
end subroutine d_parmatch_aggregator_clone
|
||||
end subroutine amg_d_parmatch_aggregator_clone
|
||||
|
||||
subroutine amg_d_parmatch_aggregator_bld_map(ag,desc_a,desc_ac,ilaggr,nlaggr,&
|
||||
& op_restr,op_prol,map,info)
|
||||
|
||||
@@ -155,15 +155,16 @@ module amg_d_prec_type
|
||||
|
||||
|
||||
interface amg_precdescr
|
||||
subroutine amg_dfile_prec_descr(prec,info,iout,root,verbosity)
|
||||
subroutine amg_dfile_prec_descr(prec,info,iout,root,verbosity,prefix)
|
||||
import :: amg_dprec_type, psb_ipk_
|
||||
implicit none
|
||||
! Arguments
|
||||
class(amg_dprec_type), intent(in) :: prec
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_dprec_type), intent(in) :: prec
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_dfile_prec_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -385,20 +385,22 @@ contains
|
||||
|
||||
end subroutine d_slu_solver_finalize
|
||||
|
||||
subroutine d_slu_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_slu_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_d_slu_solver_type), intent(in) :: sv
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer :: err_act
|
||||
character(len=20), parameter :: name='amg_d_slu_solver_descr'
|
||||
integer :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -407,8 +409,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' SuperLU Sparse Factorization Solver. '
|
||||
write(iout_,*) trim(prefix_), ' SuperLU Sparse Factorization Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -52,7 +52,7 @@ module amg_d_sludist_solver
|
||||
use iso_c_binding
|
||||
use amg_d_base_solver_mod
|
||||
|
||||
#if defined(LPK8)
|
||||
#if (!defined(HAVE_SLUDIST_)) || defined(IPK8)
|
||||
|
||||
type, extends(amg_d_base_solver_type) :: amg_d_sludist_solver_type
|
||||
|
||||
@@ -270,10 +270,12 @@ contains
|
||||
! Local variables
|
||||
type(psb_dspmat_type) :: atmp
|
||||
type(psb_d_csr_sparse_mat) :: acsr
|
||||
integer :: n_row,n_col, nrow_a, nztota, nglob, nzt, npr, npc
|
||||
integer :: ifrst, ibcheck
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
integer(psb_lpk_), allocatable :: gia(:), gja(:)
|
||||
integer(psb_lpk_) :: lfrst
|
||||
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nzt, npr, npc
|
||||
integer(psb_ipk_) :: ifrst, ibcheck
|
||||
integer(psb_ipk_) :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='d_sludist_solver_bld', ch_err
|
||||
|
||||
info=psb_success_
|
||||
@@ -293,19 +295,36 @@ contains
|
||||
n_col = desc_a%get_local_cols()
|
||||
nglob = desc_a%get_global_rows()
|
||||
|
||||
call a%cscnv(atmp,info,type='coo')
|
||||
!
|
||||
! Strategy here is as follows: because a call to SLUDIST
|
||||
! as a gobal solver is mostly done at the coarsest level,
|
||||
! even if we start from a problem requiring 8 bytes, chances
|
||||
! are that the global size will be suitable for 4 bytes
|
||||
! anyway, so we hope for the best, and throw an error
|
||||
! if something goes wrong.
|
||||
!
|
||||
if (nglob > huge(1_psb_ipk_)) then
|
||||
write(0,*) me,' ',trim(name),': Error: overflow of local indices '
|
||||
info=psb_err_internal_error_
|
||||
call psb_errpush(info,name)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call a%cscnv(atmp,info,type='csr')
|
||||
! This in case we are dealing with AS
|
||||
call psb_rwextd(n_row,atmp,info,b=b)
|
||||
call atmp%cscnv(info,type='csr',dupl=psb_dupl_add_)
|
||||
call atmp%mv_to(acsr)
|
||||
nrow_a = acsr%get_nrows()
|
||||
nztota = acsr%get_nzeros()
|
||||
call psb_loc_to_glob(ione,lfrst,desc_a,info)
|
||||
|
||||
! Fix the entries to call C-base SuperLU
|
||||
call psb_loc_to_glob(1,ifrst,desc_a,info)
|
||||
call psb_loc_to_glob(nrow_a,ibcheck,desc_a,info)
|
||||
call psb_loc_to_glob(acsr%ja(1:nztota),desc_a,info,iact='I')
|
||||
call psb_realloc(nztota,gja,info)
|
||||
call psb_loc_to_glob(acsr%ja(1:nztota),gja(1:nztota), desc_a, info, iact='I')
|
||||
acsr%ja(1:nztota) = gja(1:nztota)
|
||||
acsr%ja(:) = acsr%ja(:) - 1
|
||||
acsr%irp(:) = acsr%irp(:) - 1
|
||||
ifrst = ifrst - 1
|
||||
ifrst = lfrst - 1
|
||||
info = amg_dsludist_fact(nglob,nrow_a,nztota,ifrst,&
|
||||
& acsr%val,acsr%irp,acsr%ja,sv%lufactors,&
|
||||
& npr,npc)
|
||||
@@ -318,7 +337,6 @@ contains
|
||||
end if
|
||||
|
||||
call acsr%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
@@ -403,15 +421,16 @@ contains
|
||||
|
||||
end subroutine d_sludist_solver_finalize
|
||||
|
||||
subroutine d_sludist_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_sludist_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_d_sludist_solver_type), intent(in) :: sv
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer :: err_act
|
||||
@@ -419,6 +438,7 @@ contains
|
||||
integer :: me, np
|
||||
character(len=20), parameter :: name='amg_d_sludist_solver_descr'
|
||||
integer :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -427,8 +447,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' SuperLU_Dist Sparse Factorization Solver. '
|
||||
write(iout_,*) trim(prefix_), ' SuperLU_Dist Sparse Factorization Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -88,16 +88,25 @@ contains
|
||||
val = "Symmetric Decoupled aggregation"
|
||||
end function amg_d_symdec_aggregator_fmt
|
||||
|
||||
subroutine amg_d_symdec_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_d_symdec_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_d_symdec_aggregator_type), intent(in) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
write(iout,*) 'Decoupled Aggregator locally-symmetrized'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
character(1024) :: prefix_
|
||||
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) trim(prefix_),' ','Decoupled Aggregator locally-symmetrized'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_d_symdec_aggregator_descr
|
||||
|
||||
@@ -390,20 +390,22 @@ contains
|
||||
|
||||
end subroutine d_umf_solver_finalize
|
||||
|
||||
subroutine d_umf_solver_descr(sv,info,iout,coarse)
|
||||
subroutine d_umf_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_d_umf_solver_type), intent(in) :: sv
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer :: err_act
|
||||
character(len=20), parameter :: name='amg_d_umf_solver_descr'
|
||||
integer :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -412,8 +414,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' UMFPACK Sparse Factorization Solver. '
|
||||
write(iout_,*) trim(prefix_), ' UMFPACK Sparse Factorization Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -198,7 +198,7 @@ module amg_s_ainv_solver
|
||||
!!$ end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_ainv_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_s_ainv_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_dpk_, amg_s_ainv_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
@@ -208,7 +208,7 @@ module amg_s_ainv_solver
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_s_ainv_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -396,21 +396,23 @@ contains
|
||||
end subroutine s_as_smoother_default
|
||||
|
||||
|
||||
subroutine s_as_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine s_as_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_s_as_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_s_as_smoother_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
logical :: coarse_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -424,16 +426,21 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (.not.coarse_) then
|
||||
write(iout_,*) ' Additive Schwarz with ',&
|
||||
write(iout_,*) trim(prefix_), ' Additive Schwarz with ',&
|
||||
& sm%novr, ' overlap layers.'
|
||||
write(iout_,*) ' Restrictor: ',restrict_names(sm%restr)
|
||||
write(iout_,*) ' Prolongator: ',prolong_names(sm%prol)
|
||||
write(iout_,*) ' Local solver:'
|
||||
write(iout_,*) trim(prefix_), ' Restrictor: ',restrict_names(sm%restr)
|
||||
write(iout_,*) trim(prefix_), ' Prolongator: ',prolong_names(sm%prol)
|
||||
write(iout_,*) trim(prefix_), ' Local solver:'
|
||||
endif
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%descr(info,iout_,coarse=coarse)
|
||||
call sm%sv%descr(info,iout_,coarse=coarse,prefix=prefix)
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
@@ -126,7 +126,7 @@ module amg_s_base_aggregator_mod
|
||||
& psb_s_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
||||
implicit none
|
||||
type(psb_s_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_s_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||
@@ -144,7 +144,7 @@ module amg_s_base_aggregator_mod
|
||||
& psb_s_coo_sparse_mat, amg_sml_parms, psb_spk_, psb_ipk_, psb_lpk_
|
||||
implicit none
|
||||
type(psb_s_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_s_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||
@@ -275,15 +275,22 @@ contains
|
||||
val = .false.
|
||||
end function amg_s_base_aggregator_xt_desc
|
||||
|
||||
subroutine amg_s_base_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_s_base_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_s_base_aggregator_type), intent(in) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ', 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_s_base_aggregator_descr
|
||||
|
||||
@@ -272,7 +272,7 @@ module amg_s_base_smoother_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_base_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_s_base_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: psb_desc_type, psb_sspmat_type, psb_s_base_sparse_mat, &
|
||||
& psb_s_vect_type, psb_s_base_vect_type, psb_spk_, &
|
||||
& amg_s_base_smoother_type, psb_ipk_
|
||||
@@ -281,6 +281,7 @@ module amg_s_base_smoother_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_s_base_smoother_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ module amg_s_base_solver_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_base_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_s_base_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_desc_type, psb_sspmat_type, psb_s_base_sparse_mat, &
|
||||
& psb_s_vect_type, psb_s_base_vect_type, psb_spk_, &
|
||||
& amg_s_base_solver_type, psb_ipk_
|
||||
@@ -281,7 +281,7 @@ module amg_s_base_solver_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_s_base_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -184,16 +184,23 @@ contains
|
||||
val = "Decoupled aggregation"
|
||||
end function amg_s_dec_aggregator_fmt
|
||||
|
||||
subroutine amg_s_dec_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_s_dec_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_s_dec_aggregator_type), intent(in) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Decoupled Aggregator'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ','Decoupled Aggregator'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_s_dec_aggregator_descr
|
||||
|
||||
@@ -219,7 +219,7 @@ contains
|
||||
|
||||
end subroutine s_diag_solver_free
|
||||
|
||||
subroutine s_diag_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_diag_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -228,11 +228,13 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_s_diag_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -240,8 +242,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
|
||||
write(iout_,*) ' Diagonal local solver '
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) trim(prefix_), ' Diagonal local solver '
|
||||
|
||||
return
|
||||
|
||||
@@ -352,7 +359,7 @@ module amg_s_l1_diag_solver
|
||||
|
||||
contains
|
||||
|
||||
subroutine s_l1_diag_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_l1_diag_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -361,11 +368,13 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_s_l1_diag_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -373,8 +382,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
|
||||
write(iout_,*) ' L1 Diagonal solver '
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) trim(prefix_), ' L1 Diagonal solver '
|
||||
|
||||
return
|
||||
|
||||
|
||||
+26
-12
@@ -433,20 +433,22 @@ contains
|
||||
return
|
||||
end subroutine s_gs_solver_free
|
||||
|
||||
subroutine s_gs_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_gs_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_s_gs_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_s_gs_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -455,12 +457,17 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%eps<=dzero) then
|
||||
write(iout_,*) ' Forward Gauss-Seidel iterative solver with ',&
|
||||
write(iout_,*) trim(prefix_), ' Forward Gauss-Seidel iterative solver with ',&
|
||||
& sv%sweeps,' sweeps'
|
||||
else
|
||||
write(iout_,*) ' Forward Gauss-Seidel iterative solver with tolerance',&
|
||||
write(iout_,*) trim(prefix_), ' Forward Gauss-Seidel iterative solver with tolerance',&
|
||||
& sv%eps,' and maxit', sv%sweeps
|
||||
end if
|
||||
|
||||
@@ -526,20 +533,22 @@ contains
|
||||
val = .true.
|
||||
end function s_gs_solver_is_iterative
|
||||
|
||||
subroutine s_bwgs_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_bwgs_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_s_bwgs_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_s_bwgs_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -548,12 +557,17 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%eps<=dzero) then
|
||||
write(iout_,*) ' Backward Gauss-Seidel iterative solver with ',&
|
||||
write(iout_,*) trim(prefix_), ' Backward Gauss-Seidel iterative solver with ',&
|
||||
& sv%sweeps,' sweeps'
|
||||
else
|
||||
write(iout_,*) ' Backward Gauss-Seidel iterative solver with tolerance',&
|
||||
write(iout_,*) trim(prefix_), ' Backward Gauss-Seidel iterative solver with tolerance',&
|
||||
& sv%eps,' and maxit', sv%sweeps
|
||||
end if
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ contains
|
||||
return
|
||||
end subroutine s_id_solver_free
|
||||
|
||||
subroutine s_id_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_id_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -165,12 +165,14 @@ contains
|
||||
class(amg_s_id_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_s_id_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -178,8 +180,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' Identity local solver '
|
||||
write(iout_,*) trim(prefix_), ' Identity local solver '
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ contains
|
||||
return
|
||||
end subroutine s_ilu_solver_free
|
||||
|
||||
subroutine s_ilu_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_ilu_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -414,12 +414,14 @@ contains
|
||||
class(amg_s_ilu_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_s_ilu_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -428,15 +430,20 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' Incomplete factorization solver: ',&
|
||||
write(iout_,*) trim(prefix_), ' Incomplete factorization solver: ',&
|
||||
& amg_fact_names(sv%fact_type)
|
||||
select case(sv%fact_type)
|
||||
case(psb_ilu_n_,psb_milu_n_)
|
||||
write(iout_,*) ' Fill level:',sv%fill_in
|
||||
write(iout_,*) trim(prefix_), ' Fill level:',sv%fill_in
|
||||
case(psb_ilu_t_)
|
||||
write(iout_,*) ' Fill level:',sv%fill_in
|
||||
write(iout_,*) ' Fill threshold :',sv%thresh
|
||||
write(iout_,*) trim(prefix_), ' Fill level:',sv%fill_in
|
||||
write(iout_,*) trim(prefix_), ' Fill threshold :',sv%thresh
|
||||
end select
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
@@ -123,7 +123,7 @@ module amg_s_invk_solver
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_invk_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_s_invk_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_spk_, amg_s_invk_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
@@ -133,7 +133,7 @@ module amg_s_invk_solver
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_s_invk_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -134,16 +134,17 @@ module amg_s_invt_solver
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_invt_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_s_invt_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_spk_, amg_s_invt_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_s_invt_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
end subroutine amg_s_invt_solver_descr
|
||||
end interface
|
||||
|
||||
@@ -219,12 +219,13 @@ module amg_s_jac_smoother
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_jac_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_s_jac_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: amg_s_jac_smoother_type, psb_ipk_
|
||||
class(amg_s_jac_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_s_jac_smoother_descr
|
||||
end interface
|
||||
|
||||
@@ -313,12 +314,13 @@ module amg_s_jac_smoother
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_l1_jac_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_s_l1_jac_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: amg_s_l1_jac_smoother_type, psb_ipk_
|
||||
class(amg_s_l1_jac_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_s_l1_jac_smoother_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ contains
|
||||
val = "KRM solver"
|
||||
end function s_krm_solver_get_fmt
|
||||
|
||||
subroutine s_krm_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_krm_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -444,12 +444,14 @@ contains
|
||||
class(amg_s_krm_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_s_krm_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -458,23 +460,22 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%global) then
|
||||
write(iout_,*) ' Krylov solver (global)'
|
||||
write(iout_,*) trim(prefix_), ' Krylov solver (global)'
|
||||
else
|
||||
write(iout_,*) ' Krylov solver (local) '
|
||||
write(iout_,*) trim(prefix_), ' Krylov solver (local) '
|
||||
end if
|
||||
write(iout_,*) ' method: ',sv%method
|
||||
write(iout_,*) ' kprec: ',sv%kprec
|
||||
if (sv%i_sub_solve > 0) then
|
||||
write(iout_,*) ' sub_solve: ',amg_fact_names(sv%i_sub_solve)
|
||||
else
|
||||
write(iout_,*) ' sub_solve: ',sv%sub_solve
|
||||
end if
|
||||
write(iout_,*) ' itmax: ',sv%itmax
|
||||
write(iout_,*) ' eps: ',sv%eps
|
||||
write(iout_,*) ' fillin: ',sv%fillin
|
||||
|
||||
write(iout_,*) trim(prefix_), ' method: ',sv%method
|
||||
write(iout_,*) trim(prefix_), ' kprec: ',sv%kprec
|
||||
call sv%prec%descr(iout_,info,prefix='KRM : '//prefix_)
|
||||
write(iout_,*) trim(prefix_), ' itmax: ',sv%itmax
|
||||
write(iout_,*) trim(prefix_), ' eps: ',sv%eps
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
+28
-328
@@ -68,7 +68,7 @@
|
||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
! POSSIBILITY OF SUCH DAMAGE.
|
||||
!
|
||||
module smatchboxp_mod
|
||||
module amg_s_matchboxp_mod
|
||||
|
||||
use iso_c_binding
|
||||
use psb_base_cbind_mod
|
||||
@@ -94,33 +94,25 @@ module smatchboxp_mod
|
||||
end subroutine sMatchBoxPC
|
||||
end interface MatchBoxPC
|
||||
|
||||
interface i_aggr_assign
|
||||
module procedure i_saggr_assign
|
||||
end interface i_aggr_assign
|
||||
interface amg_i_aggr_assign
|
||||
module procedure amg_i_s_aggr_assign
|
||||
end interface amg_i_aggr_assign
|
||||
|
||||
interface build_matching
|
||||
module procedure sbuild_matching
|
||||
end interface build_matching
|
||||
interface amg_par_build_matching
|
||||
module procedure amg_s_par_build_matching
|
||||
end interface amg_par_build_matching
|
||||
|
||||
interface build_ahat
|
||||
module procedure sbuild_ahat
|
||||
end interface build_ahat
|
||||
interface amg_par_build_ahat
|
||||
module procedure amg_s_par_build_ahat
|
||||
end interface amg_par_build_ahat
|
||||
|
||||
interface psb_gtranspose
|
||||
module procedure psb_sgtranspose
|
||||
end interface psb_gtranspose
|
||||
|
||||
interface psb_htranspose
|
||||
module procedure psb_shtranspose
|
||||
end interface psb_htranspose
|
||||
|
||||
interface PMatchBox
|
||||
module procedure sPMatchBox
|
||||
end interface PMatchBox
|
||||
interface amg_PMatchBox
|
||||
module procedure amg_s_PMatchBox
|
||||
end interface amg_PMatchBox
|
||||
|
||||
contains
|
||||
|
||||
subroutine smatchboxp_build_prol(w,a,desc_a,ilaggr,nlaggr,prol,info,&
|
||||
subroutine amg_s_matchboxp_build_prol(w,a,desc_a,ilaggr,nlaggr,prol,info,&
|
||||
& symmetrize,reproducible,display_inp, display_out, print_out)
|
||||
use psb_base_mod
|
||||
use psb_util_mod
|
||||
@@ -213,7 +205,7 @@ contains
|
||||
end if
|
||||
if (do_timings) call psb_toc(idx_phase1)
|
||||
if (do_timings) call psb_tic(idx_bldmtc)
|
||||
call build_matching(w,a,desc_a,mate,info,display_inp=display_inp,symmetrize=symmetrize)
|
||||
call amg_par_build_matching(w,a,desc_a,mate,info,display_inp=display_inp,symmetrize=symmetrize)
|
||||
if (do_timings) call psb_toc(idx_bldmtc)
|
||||
if (debug) write(0,*) iam,' buildprol from buildmatching:',&
|
||||
& info
|
||||
@@ -311,7 +303,7 @@ contains
|
||||
! Should be a symmetric function.
|
||||
!
|
||||
call desc_a%indxmap%qry_halo_owner(idx,iown,info)
|
||||
ip = i_aggr_assign(iam, iown, kg, idxg, wk, widx, nrmagg)
|
||||
ip = amg_i_aggr_assign(iam, iown, kg, idxg, wk, widx, nrmagg)
|
||||
if (iam == ip) then
|
||||
nlaggr(iam) = nlaggr(iam) + 1
|
||||
ilaggr(k) = nlaggr(iam)
|
||||
@@ -513,9 +505,9 @@ contains
|
||||
write(0,*) iam,' : error from Matching: ',info
|
||||
end if
|
||||
|
||||
end subroutine smatchboxp_build_prol
|
||||
end subroutine amg_s_matchboxp_build_prol
|
||||
|
||||
function i_saggr_assign(iam, iown, kg, idxg, wk, widx, nrmagg) &
|
||||
function amg_i_s_aggr_assign(iam, iown, kg, idxg, wk, widx, nrmagg) &
|
||||
& result(iproc)
|
||||
!
|
||||
! How to break ties? This
|
||||
@@ -557,10 +549,10 @@ contains
|
||||
iproc = iown
|
||||
end if
|
||||
end if
|
||||
end function i_saggr_assign
|
||||
end function amg_i_s_aggr_assign
|
||||
|
||||
|
||||
subroutine sbuild_matching(w,a,desc_a,mate,info,display_inp, symmetrize)
|
||||
subroutine amg_s_par_build_matching(w,a,desc_a,mate,info,display_inp, symmetrize)
|
||||
use psb_base_mod
|
||||
use psb_util_mod
|
||||
use iso_c_binding
|
||||
@@ -609,7 +601,7 @@ contains
|
||||
if (iam == 0) write(0,*)' Into build_ahat:'
|
||||
end if
|
||||
if (do_timings) call psb_tic(idx_bldahat)
|
||||
call build_ahat(w,a,ahatnd,desc_a,info,symmetrize=symmetrize)
|
||||
call amg_par_build_ahat(w,a,ahatnd,desc_a,info,symmetrize=symmetrize)
|
||||
if (do_timings) call psb_toc(idx_bldahat)
|
||||
if (info /= 0) then
|
||||
write(0,*) 'Error from build_ahat ', info
|
||||
@@ -700,7 +692,7 @@ contains
|
||||
!
|
||||
if (debug) write(0,*) iam,' buildmatching into PMatchBox:'
|
||||
if (do_timings) call psb_tic(idx_cmboxp)
|
||||
call PMatchBox(nr,nz,vlptr,vlind,ewght,&
|
||||
call amg_PMatchBox(nr,nz,vlptr,vlind,ewght,&
|
||||
& vnl, mate, iam, np,ictxt,&
|
||||
& msgis,msgas,msgprc,ph0t,ph1t,ph2t,ph1crd,ph2crd,info,display_inp)
|
||||
if (do_timings) call psb_toc(idx_cmboxp)
|
||||
@@ -764,9 +756,9 @@ contains
|
||||
val(1:n) = tmp(1:n)
|
||||
end subroutine fix_order
|
||||
|
||||
end subroutine sbuild_matching
|
||||
end subroutine amg_s_par_build_matching
|
||||
|
||||
subroutine sbuild_ahat(w,a,ahat,desc_a,info,symmetrize)
|
||||
subroutine amg_s_par_build_ahat(w,a,ahat,desc_a,info,symmetrize)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
real(psb_spk_), intent(in) :: w(:)
|
||||
@@ -1002,301 +994,9 @@ contains
|
||||
end block
|
||||
end if
|
||||
|
||||
end subroutine sbuild_ahat
|
||||
end subroutine amg_s_par_build_ahat
|
||||
|
||||
subroutine psb_sgtranspose(ain,aout,desc_a,info)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_lsspmat_type), intent(in) :: ain
|
||||
type(psb_lsspmat_type), intent(out) :: aout
|
||||
type(psb_desc_type) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
!
|
||||
! BEWARE: This routine works under the assumption
|
||||
! that the same DESC_A works for both A and A^T, which
|
||||
! essentially means that A has a symmetric pattern.
|
||||
!
|
||||
type(psb_lsspmat_type) :: atmp, ahalo, aglb
|
||||
type(psb_ls_coo_sparse_mat) :: tmpcoo
|
||||
type(psb_ls_csr_sparse_mat) :: tmpcsr
|
||||
type(psb_ctxt_type) :: ictxt
|
||||
integer(psb_ipk_) :: me, np
|
||||
integer(psb_lpk_) :: i, j, k, nrow, ncol
|
||||
integer(psb_lpk_), allocatable :: ilv(:)
|
||||
character(len=80) :: aname
|
||||
logical, parameter :: debug=.false., dump=.false., debug_sync=.false.
|
||||
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt,me,np)
|
||||
|
||||
nrow = desc_a%get_local_rows()
|
||||
ncol = desc_a%get_local_cols()
|
||||
if (debug_sync) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'Start gtranspose '
|
||||
end if
|
||||
call ain%cscnv(tmpcsr,info)
|
||||
|
||||
if (debug) then
|
||||
ilv = [(i,i=1,ncol)]
|
||||
call desc_a%l2gip(ilv,info,owned=.false.)
|
||||
write(aname,'(a,i3.3,a)') 'atmp-preh-',me,'.mtx'
|
||||
call ain%print(fname=aname,head='atmp before haloTest ',iv=ilv)
|
||||
end if
|
||||
if (dump) then
|
||||
call ain%cscnv(atmp,info)
|
||||
call psb_gather(aglb,atmp,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'aglob-prehalo.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
!call psb_loc_to_glob(tmpcsr%ja,desc_a,info)
|
||||
call atmp%mv_from(tmpcsr)
|
||||
|
||||
if (debug) then
|
||||
write(aname,'(a,i3.3,a)') 'tmpcsr-',me,'.mtx'
|
||||
call atmp%print(fname=aname,head='tmpcsr ',iv=ilv)
|
||||
!call psb_set_debug_level(9999)
|
||||
end if
|
||||
|
||||
! FIXME THIS NEEDS REWORKING
|
||||
if (debug) write(0,*) me,' Gtranspose into sphalo :',atmp%get_nrows(),atmp%get_ncols()
|
||||
call psb_sphalo(atmp,desc_a,ahalo,info,rowscale=.true.)
|
||||
if (debug) write(0,*) me,' Gtranspose from sphalo :',ahalo%get_nrows(),ahalo%get_ncols()
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=ahalo)
|
||||
|
||||
if (debug) then
|
||||
write(aname,'(a,i3.3,a)') 'ahalo-',me,'.mtx'
|
||||
call ahalo%print(fname=aname,head='ahalo after haloTest ',iv=ilv)
|
||||
write(aname,'(a,i3.3,a)') 'atmp-h-',me,'.mtx'
|
||||
call atmp%print(fname=aname,head='atmp after haloTest ',iv=ilv)
|
||||
end if
|
||||
|
||||
if (info == psb_success_) call ahalo%free()
|
||||
|
||||
call atmp%cp_to(tmpcoo)
|
||||
call tmpcoo%transp()
|
||||
!call psb_glob_to_loc(tmpcoo%ia,desc_a,info,iact='I')
|
||||
if (debug) write(0,*) 'Before cleanup:',tmpcoo%get_nzeros()
|
||||
|
||||
j = 0
|
||||
do k=1, tmpcoo%get_nzeros()
|
||||
if ((tmpcoo%ia(k) > 0).and.(tmpcoo%ja(k)>0)) then
|
||||
j = j+1
|
||||
tmpcoo%ia(j) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(j) = tmpcoo%ja(k)
|
||||
tmpcoo%val(j) = tmpcoo%val(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(j)
|
||||
|
||||
if (debug) write(0,*) 'After cleanup:',tmpcoo%get_nzeros()
|
||||
|
||||
call ahalo%mv_from(tmpcoo)
|
||||
if (dump) then
|
||||
call psb_gather(aglb,ahalo,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'atran-preclip.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
call ahalo%csclip(aout,info,imax=nrow)
|
||||
|
||||
if (debug) write(0,*) 'After clip:',aout%get_nzeros()
|
||||
|
||||
if (debug_sync) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'End gtranspose '
|
||||
end if
|
||||
!call aout%cscnv(info,type='csr')
|
||||
|
||||
if (dump) then
|
||||
write(aname,'(a,i3.3,a)') 'atran-',me,'.mtx'
|
||||
call aout%print(fname=aname,head='atrans ',iv=ilv)
|
||||
call psb_gather(aglb,aout,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'atran.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
end subroutine psb_sgtranspose
|
||||
|
||||
subroutine psb_shtranspose(ain,aout,desc_a,info)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_lsspmat_type), intent(in) :: ain
|
||||
type(psb_lsspmat_type), intent(out) :: aout
|
||||
type(psb_desc_type) :: desc_a
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
!
|
||||
! BEWARE: This routine works under the assumption
|
||||
! that the same DESC_A works for both A and A^T, which
|
||||
! essentially means that A has a symmetric pattern.
|
||||
!
|
||||
type(psb_lsspmat_type) :: atmp, ahalo, aglb
|
||||
type(psb_ls_coo_sparse_mat) :: tmpcoo, tmpc1, tmpc2, tmpch
|
||||
type(psb_ls_csr_sparse_mat) :: tmpcsr
|
||||
integer(psb_ipk_) :: nz1, nz2, nzh, nz
|
||||
type(psb_ctxt_type) :: ictxt
|
||||
integer(psb_ipk_) :: me, np
|
||||
integer(psb_lpk_) :: i, j, k, nrow, ncol, nlz
|
||||
integer(psb_lpk_), allocatable :: ilv(:)
|
||||
character(len=80) :: aname
|
||||
logical, parameter :: debug=.false., dump=.false., debug_sync=.false.
|
||||
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt,me,np)
|
||||
|
||||
nrow = desc_a%get_local_rows()
|
||||
ncol = desc_a%get_local_cols()
|
||||
if (debug_sync) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'Start htranspose '
|
||||
end if
|
||||
call ain%cscnv(tmpcsr,info)
|
||||
|
||||
if (debug) then
|
||||
ilv = [(i,i=1,ncol)]
|
||||
call desc_a%l2gip(ilv,info,owned=.false.)
|
||||
write(aname,'(a,i3.3,a)') 'atmp-preh-',me,'.mtx'
|
||||
call ain%print(fname=aname,head='atmp before haloTest ',iv=ilv)
|
||||
end if
|
||||
if (dump) then
|
||||
call ain%cscnv(atmp,info)
|
||||
call psb_gather(aglb,atmp,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'aglob-prehalo.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
!call psb_loc_to_glob(tmpcsr%ja,desc_a,info)
|
||||
call atmp%mv_from(tmpcsr)
|
||||
|
||||
if (debug) then
|
||||
write(aname,'(a,i3.3,a)') 'tmpcsr-',me,'.mtx'
|
||||
call atmp%print(fname=aname,head='tmpcsr ',iv=ilv)
|
||||
!call psb_set_debug_level(9999)
|
||||
end if
|
||||
|
||||
! FIXME THIS NEEDS REWORKING
|
||||
if (debug) write(0,*) me,' Htranspose into sphalo :',atmp%get_nrows(),atmp%get_ncols()
|
||||
if (.true.) then
|
||||
call psb_sphalo(atmp,desc_a,ahalo,info, outfmt='coo ')
|
||||
call atmp%mv_to(tmpc1)
|
||||
call ahalo%mv_to(tmpch)
|
||||
nz1 = tmpc1%get_nzeros()
|
||||
call psb_loc_to_glob(tmpc1%ia(1:nz1),desc_a,info,iact='I')
|
||||
call psb_loc_to_glob(tmpc1%ja(1:nz1),desc_a,info,iact='I')
|
||||
nzh = tmpch%get_nzeros()
|
||||
call psb_loc_to_glob(tmpch%ia(1:nzh),desc_a,info,iact='I')
|
||||
call psb_loc_to_glob(tmpch%ja(1:nzh),desc_a,info,iact='I')
|
||||
nlz = nz1+nzh
|
||||
call tmpcoo%allocate(ncol,ncol,nlz)
|
||||
tmpcoo%ia(1:nz1) = tmpc1%ia(1:nz1)
|
||||
tmpcoo%ja(1:nz1) = tmpc1%ja(1:nz1)
|
||||
tmpcoo%val(1:nz1) = tmpc1%val(1:nz1)
|
||||
tmpcoo%ia(nz1+1:nz1+nzh) = tmpch%ia(1:nzh)
|
||||
tmpcoo%ja(nz1+1:nz1+nzh) = tmpch%ja(1:nzh)
|
||||
tmpcoo%val(nz1+1:nz1+nzh) = tmpch%val(1:nzh)
|
||||
call tmpcoo%set_nzeros(nlz)
|
||||
call tmpcoo%transp()
|
||||
nz = tmpcoo%get_nzeros()
|
||||
call psb_glob_to_loc(tmpcoo%ia(1:nz),desc_a,info,iact='I')
|
||||
call psb_glob_to_loc(tmpcoo%ja(1:nz),desc_a,info,iact='I')
|
||||
if (.true.) then
|
||||
call tmpcoo%clean_negidx(info)
|
||||
else
|
||||
j = 0
|
||||
do k=1, tmpcoo%get_nzeros()
|
||||
if ((tmpcoo%ia(k) > 0).and.(tmpcoo%ja(k)>0)) then
|
||||
j = j+1
|
||||
tmpcoo%ia(j) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(j) = tmpcoo%ja(k)
|
||||
tmpcoo%val(j) = tmpcoo%val(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(j)
|
||||
end if
|
||||
call ahalo%mv_from(tmpcoo)
|
||||
call ahalo%csclip(aout,info,imax=nrow)
|
||||
|
||||
else
|
||||
call psb_sphalo(atmp,desc_a,ahalo,info, rowscale=.true.)
|
||||
if (debug) write(0,*) me,' Htranspose from sphalo :',ahalo%get_nrows(),ahalo%get_ncols()
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=ahalo)
|
||||
|
||||
if (debug) then
|
||||
write(aname,'(a,i3.3,a)') 'ahalo-',me,'.mtx'
|
||||
call ahalo%print(fname=aname,head='ahalo after haloTest ',iv=ilv)
|
||||
write(aname,'(a,i3.3,a)') 'atmp-h-',me,'.mtx'
|
||||
call atmp%print(fname=aname,head='atmp after haloTest ',iv=ilv)
|
||||
end if
|
||||
|
||||
if (info == psb_success_) call ahalo%free()
|
||||
|
||||
call atmp%cp_to(tmpcoo)
|
||||
call tmpcoo%transp()
|
||||
if (debug) write(0,*) 'Before cleanup:',tmpcoo%get_nzeros()
|
||||
if (.true.) then
|
||||
call tmpcoo%clean_negidx(info)
|
||||
else
|
||||
|
||||
j = 0
|
||||
do k=1, tmpcoo%get_nzeros()
|
||||
if ((tmpcoo%ia(k) > 0).and.(tmpcoo%ja(k)>0)) then
|
||||
j = j+1
|
||||
tmpcoo%ia(j) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(j) = tmpcoo%ja(k)
|
||||
tmpcoo%val(j) = tmpcoo%val(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(j)
|
||||
end if
|
||||
|
||||
if (debug) write(0,*) 'After cleanup:',tmpcoo%get_nzeros()
|
||||
|
||||
call ahalo%mv_from(tmpcoo)
|
||||
if (dump) then
|
||||
call psb_gather(aglb,ahalo,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'atran-preclip.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
call ahalo%csclip(aout,info,imax=nrow)
|
||||
end if
|
||||
|
||||
if (debug) write(0,*) 'After clip:',aout%get_nzeros()
|
||||
|
||||
if (debug_sync) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'End htranspose '
|
||||
end if
|
||||
!call aout%cscnv(info,type='csr')
|
||||
|
||||
if (dump) then
|
||||
write(aname,'(a,i3.3,a)') 'atran-',me,'.mtx'
|
||||
call aout%print(fname=aname,head='atrans ',iv=ilv)
|
||||
call psb_gather(aglb,aout,desc_a,info)
|
||||
if (me==psb_root_) then
|
||||
write(aname,'(a,i3.3,a)') 'atran.mtx'
|
||||
call aglb%print(fname=aname,head='Test ')
|
||||
end if
|
||||
end if
|
||||
|
||||
end subroutine psb_shtranspose
|
||||
|
||||
subroutine sPMatchBox(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
subroutine amg_s_PMatchBox(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate, myrank, numprocs, ictxt,&
|
||||
& msgindsent,msgactualsent,msgpercent,&
|
||||
& ph0_time, ph1_time, ph2_time, ph1_card, ph2_card,info,display_inp)
|
||||
@@ -1431,6 +1131,6 @@ contains
|
||||
end if
|
||||
where(mate>=0) mate = mate + 1
|
||||
|
||||
end subroutine sPMatchBox
|
||||
end subroutine amg_s_PMatchBox
|
||||
|
||||
end module smatchboxp_mod
|
||||
end module amg_s_matchboxp_mod
|
||||
|
||||
@@ -313,22 +313,24 @@ subroutine s_mumps_solver_finalize(sv)
|
||||
|
||||
end subroutine s_mumps_solver_finalize
|
||||
|
||||
subroutine s_mumps_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_mumps_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_s_mumps_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer(psb_ipk_) :: me, np
|
||||
character(len=20), parameter :: name='amg_z_mumps_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -337,8 +339,13 @@ subroutine s_mumps_solver_descr(sv,info,iout,coarse)
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' MUMPS Solver. '
|
||||
write(iout_,*) trim(prefix_), ' MUMPS Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -258,7 +258,7 @@ module amg_s_onelev_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity)
|
||||
subroutine amg_s_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity,prefix)
|
||||
import :: psb_sspmat_type, psb_s_vect_type, psb_s_base_vect_type, &
|
||||
& psb_slinmap_type, psb_spk_, amg_s_onelev_type, &
|
||||
& psb_ipk_, psb_epk_, psb_desc_type
|
||||
@@ -269,6 +269,7 @@ module amg_s_onelev_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_s_base_onelev_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
module amg_s_parmatch_aggregator_mod
|
||||
use amg_s_base_aggregator_mod
|
||||
use smatchboxp_mod
|
||||
use amg_s_matchboxp_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
type, extends(amg_s_base_aggregator_type) :: amg_s_parmatch_aggregator_type
|
||||
end type amg_s_parmatch_aggregator_type
|
||||
@@ -132,8 +132,6 @@ module amg_s_parmatch_aggregator_mod
|
||||
type(psb_sspmat_type), allocatable :: prol, restr
|
||||
type(psb_sspmat_type), allocatable :: ac, base_a, rwa
|
||||
type(psb_desc_type), allocatable :: desc_ac, desc_ax, base_desc, rwdesc
|
||||
integer(psb_ipk_) :: max_csize
|
||||
integer(psb_ipk_) :: max_nlevels
|
||||
logical :: reproducible_matching = .false.
|
||||
logical :: need_symmetrize = .false.
|
||||
logical :: unsmoothed_hierarchy = .true.
|
||||
@@ -143,18 +141,18 @@ module amg_s_parmatch_aggregator_mod
|
||||
procedure, pass(ag) :: mat_asb => amg_s_parmatch_aggregator_mat_asb
|
||||
procedure, pass(ag) :: inner_mat_asb => amg_s_parmatch_aggregator_inner_mat_asb
|
||||
procedure, pass(ag) :: bld_map => amg_s_parmatch_aggregator_bld_map
|
||||
procedure, pass(ag) :: csetc => s_parmatch_aggr_csetc
|
||||
procedure, pass(ag) :: cseti => s_parmatch_aggr_cseti
|
||||
procedure, pass(ag) :: default => s_parmatch_aggr_set_default
|
||||
procedure, pass(ag) :: sizeof => s_parmatch_aggregator_sizeof
|
||||
procedure, pass(ag) :: update_next => s_parmatch_aggregator_update_next
|
||||
procedure, pass(ag) :: bld_wnxt => s_parmatch_bld_wnxt
|
||||
procedure, pass(ag) :: bld_default_w => s_bld_default_w
|
||||
procedure, pass(ag) :: set_c_default_w => s_set_prm_c_default_w
|
||||
procedure, pass(ag) :: descr => s_parmatch_aggregator_descr
|
||||
procedure, pass(ag) :: clone => s_parmatch_aggregator_clone
|
||||
procedure, pass(ag) :: free => s_parmatch_aggregator_free
|
||||
procedure, nopass :: fmt => s_parmatch_aggregator_fmt
|
||||
procedure, pass(ag) :: csetc => amg_s_parmatch_aggr_csetc
|
||||
procedure, pass(ag) :: cseti => amg_s_parmatch_aggr_cseti
|
||||
procedure, pass(ag) :: default => amg_s_parmatch_aggr_set_default
|
||||
procedure, pass(ag) :: sizeof => amg_s_parmatch_aggregator_sizeof
|
||||
procedure, pass(ag) :: update_next => amg_s_parmatch_aggregator_update_next
|
||||
procedure, pass(ag) :: bld_wnxt => amg_s_parmatch_bld_wnxt
|
||||
procedure, pass(ag) :: bld_default_w => amg_s_bld_default_w
|
||||
procedure, pass(ag) :: set_c_default_w => amg_s_set_prm_c_default_w
|
||||
procedure, pass(ag) :: descr => amg_s_parmatch_aggregator_descr
|
||||
procedure, pass(ag) :: clone => amg_s_parmatch_aggregator_clone
|
||||
procedure, pass(ag) :: free => amg_s_parmatch_aggregator_free
|
||||
procedure, nopass :: fmt => amg_s_parmatch_aggregator_fmt
|
||||
procedure, nopass :: xt_desc => amg_s_parmatch_aggregator_xt_desc
|
||||
end type amg_s_parmatch_aggregator_type
|
||||
|
||||
@@ -168,7 +166,7 @@ module amg_s_parmatch_aggregator_mod
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(amg_saggr_data), intent(in) :: ag_data
|
||||
type(psb_sspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_lsspmat_type), intent(out) :: t_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
@@ -235,7 +233,7 @@ module amg_s_parmatch_aggregator_mod
|
||||
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||
implicit none
|
||||
type(psb_sspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||
@@ -257,7 +255,7 @@ module amg_s_parmatch_aggregator_mod
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||
type(psb_sspmat_type), intent(out) :: op_prol,ac, op_restr
|
||||
type(psb_sspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_parmatch_unsmth_bld
|
||||
@@ -275,7 +273,7 @@ module amg_s_parmatch_aggregator_mod
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||
type(psb_sspmat_type), intent(out) :: op_prol,ac, op_restr
|
||||
type(psb_sspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_parmatch_smth_bld
|
||||
@@ -288,11 +286,11 @@ module amg_s_parmatch_aggregator_mod
|
||||
& psb_lsspmat_type, psb_dpk_, psb_ipk_, psb_lpk_, amg_sml_parms, amg_saggr_data
|
||||
implicit none
|
||||
type(psb_sspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||
type(psb_sspmat_type), intent(out) :: op_prol,ac, op_restr
|
||||
type(psb_sspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||
type(psb_desc_type), intent(out) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_parmatch_spmm_bld_ov
|
||||
@@ -306,11 +304,11 @@ module amg_s_parmatch_aggregator_mod
|
||||
& psb_s_csr_sparse_mat, psb_ls_csr_sparse_mat
|
||||
implicit none
|
||||
type(psb_s_csr_sparse_mat), intent(inout) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||
type(psb_sspmat_type), intent(out) :: op_prol,ac, op_restr
|
||||
type(psb_sspmat_type), intent(inout) :: op_prol,ac, op_restr
|
||||
type(psb_desc_type), intent(out) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_parmatch_spmm_bld_inner
|
||||
@@ -320,7 +318,7 @@ module amg_s_parmatch_aggregator_mod
|
||||
|
||||
contains
|
||||
|
||||
subroutine s_bld_default_w(ag,nr)
|
||||
subroutine amg_s_bld_default_w(ag,nr)
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -330,9 +328,9 @@ contains
|
||||
if (info /= psb_success_) return
|
||||
ag%w = done
|
||||
!call ag%set_c_default_w()
|
||||
end subroutine s_bld_default_w
|
||||
end subroutine amg_s_bld_default_w
|
||||
|
||||
subroutine s_set_prm_c_default_w(ag)
|
||||
subroutine amg_s_set_prm_c_default_w(ag)
|
||||
use psb_realloc_mod
|
||||
use iso_c_binding
|
||||
implicit none
|
||||
@@ -342,9 +340,9 @@ contains
|
||||
!write(0,*) 'prm_c_deafult_w '
|
||||
call psb_safe_ab_cpy(ag%w,ag%w_nxt,info)
|
||||
|
||||
end subroutine s_set_prm_c_default_w
|
||||
end subroutine amg_s_set_prm_c_default_w
|
||||
|
||||
subroutine s_parmatch_bld_wnxt(ag,ilaggr,valaggr,nx)
|
||||
subroutine amg_s_parmatch_bld_wnxt(ag,ilaggr,valaggr,nx)
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -358,14 +356,14 @@ contains
|
||||
!write(0,*) 'Executing bld_wnxt ',nx
|
||||
call psb_realloc(nx,ag%w_nxt,info)
|
||||
|
||||
end subroutine s_parmatch_bld_wnxt
|
||||
end subroutine amg_s_parmatch_bld_wnxt
|
||||
|
||||
function s_parmatch_aggregator_fmt() result(val)
|
||||
function amg_s_parmatch_aggregator_fmt() result(val)
|
||||
implicit none
|
||||
character(len=32) :: val
|
||||
|
||||
val = "Parallel Matching aggregation"
|
||||
end function s_parmatch_aggregator_fmt
|
||||
end function amg_s_parmatch_aggregator_fmt
|
||||
|
||||
function amg_s_parmatch_aggregator_xt_desc() result(val)
|
||||
implicit none
|
||||
@@ -374,7 +372,7 @@ contains
|
||||
val = .true.
|
||||
end function amg_s_parmatch_aggregator_xt_desc
|
||||
|
||||
function s_parmatch_aggregator_sizeof(ag) result(val)
|
||||
function amg_s_parmatch_aggregator_sizeof(ag) result(val)
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), intent(in) :: ag
|
||||
@@ -390,23 +388,30 @@ contains
|
||||
if (allocated(ag%base_desc)) val = val + ag%base_desc%sizeof()
|
||||
if (allocated(ag%desc_ax)) val = val + ag%desc_ax%sizeof()
|
||||
|
||||
end function s_parmatch_aggregator_sizeof
|
||||
end function amg_s_parmatch_aggregator_sizeof
|
||||
|
||||
subroutine s_parmatch_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_s_parmatch_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), intent(in) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Parallel Matching Aggregator'
|
||||
write(iout,*) ' Number of matching sweeps: ',ag%n_sweeps
|
||||
write(iout,*) ' Matching algorithm : MatchBoxP (PREIS)'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ','Parallel Matching Aggregator'
|
||||
write(iout,*) trim(prefix_),' ',' Number of matching sweeps: ',ag%n_sweeps
|
||||
write(iout,*) trim(prefix_),' ',' Matching algorithm : MatchBoxP (PREIS)'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine s_parmatch_aggregator_descr
|
||||
end subroutine amg_s_parmatch_aggregator_descr
|
||||
|
||||
function is_legal_malg(alg) result(val)
|
||||
logical :: val
|
||||
@@ -437,7 +442,7 @@ contains
|
||||
end function is_legal_nlevels
|
||||
|
||||
|
||||
subroutine s_parmatch_aggregator_update_next(ag,agnext,info)
|
||||
subroutine amg_s_parmatch_aggregator_update_next(ag,agnext,info)
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -452,10 +457,10 @@ contains
|
||||
& agnext%matching_alg = ag%matching_alg
|
||||
if (.not.is_legal_nsweeps(agnext%n_sweeps))&
|
||||
& agnext%n_sweeps = ag%n_sweeps
|
||||
if (.not.is_legal_csize(agnext%max_csize))&
|
||||
& agnext%max_csize = ag%max_csize
|
||||
if (.not.is_legal_nlevels(agnext%max_nlevels))&
|
||||
& agnext%max_nlevels = ag%max_nlevels
|
||||
!!$ if (.not.is_legal_csize(agnext%max_csize))&
|
||||
!!$ & agnext%max_csize = ag%max_csize
|
||||
!!$ if (.not.is_legal_nlevels(agnext%max_nlevels))&
|
||||
!!$ & agnext%max_nlevels = ag%max_nlevels
|
||||
! Is this going to generate shallow copies/memory leaks/double frees?
|
||||
! To be investigated further.
|
||||
call psb_safe_ab_cpy(ag%w_nxt,agnext%w,info)
|
||||
@@ -470,9 +475,9 @@ contains
|
||||
! What should we do here?
|
||||
end select
|
||||
info = 0
|
||||
end subroutine s_parmatch_aggregator_update_next
|
||||
end subroutine amg_s_parmatch_aggregator_update_next
|
||||
|
||||
subroutine s_parmatch_aggr_csetc(ag,what,val,info,idx)
|
||||
subroutine amg_s_parmatch_aggr_csetc(ag,what,val,info,idx)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -514,9 +519,9 @@ contains
|
||||
! Do nothing
|
||||
end select
|
||||
return
|
||||
end subroutine s_parmatch_aggr_csetc
|
||||
end subroutine amg_s_parmatch_aggr_csetc
|
||||
|
||||
subroutine s_parmatch_aggr_cseti(ag,what,val,info,idx)
|
||||
subroutine amg_s_parmatch_aggr_cseti(ag,what,val,info,idx)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -540,10 +545,6 @@ contains
|
||||
case('AGGR_SIZE')
|
||||
ag%orig_aggr_size = val
|
||||
ag%n_sweeps=max(1,ceiling(log(val*1.0)/log(2.0)))
|
||||
case('PRMC_MAX_CSIZE')
|
||||
ag%max_csize=val
|
||||
case('PRMC_MAX_NLEVELS')
|
||||
ag%max_nlevels=val
|
||||
case('PRMC_W_SIZE')
|
||||
call ag%bld_default_w(val)
|
||||
case('PRMC_REPRODUCIBLE_MATCHING')
|
||||
@@ -556,9 +557,9 @@ contains
|
||||
! Do nothing
|
||||
end select
|
||||
return
|
||||
end subroutine s_parmatch_aggr_cseti
|
||||
end subroutine amg_s_parmatch_aggr_cseti
|
||||
|
||||
subroutine s_parmatch_aggr_set_default(ag)
|
||||
subroutine amg_s_parmatch_aggr_set_default(ag)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -569,8 +570,8 @@ contains
|
||||
ag%matching_alg = 0
|
||||
ag%n_sweeps = 1
|
||||
ag%jacobi_sweeps = 0
|
||||
ag%max_nlevels = 36
|
||||
ag%max_csize = -1
|
||||
!!$ ag%max_nlevels = 36
|
||||
!!$ ag%max_csize = -1
|
||||
!
|
||||
! Apparently BootCMatch works better
|
||||
! by keeping all entries
|
||||
@@ -579,9 +580,9 @@ contains
|
||||
|
||||
return
|
||||
|
||||
end subroutine s_parmatch_aggr_set_default
|
||||
end subroutine amg_s_parmatch_aggr_set_default
|
||||
|
||||
subroutine s_parmatch_aggregator_free(ag,info)
|
||||
subroutine amg_s_parmatch_aggregator_free(ag,info)
|
||||
use iso_c_binding
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
|
||||
@@ -618,9 +619,9 @@ contains
|
||||
call ag%rwdesc%free(info); deallocate(ag%rwdesc,stat=info)
|
||||
end if
|
||||
|
||||
end subroutine s_parmatch_aggregator_free
|
||||
end subroutine amg_s_parmatch_aggregator_free
|
||||
|
||||
subroutine s_parmatch_aggregator_clone(ag,agnext,info)
|
||||
subroutine amg_s_parmatch_aggregator_clone(ag,agnext,info)
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
|
||||
class(amg_s_base_aggregator_type), allocatable, intent(inout) :: agnext
|
||||
@@ -640,7 +641,7 @@ contains
|
||||
! Should never ever get here
|
||||
info = -1
|
||||
end select
|
||||
end subroutine s_parmatch_aggregator_clone
|
||||
end subroutine amg_s_parmatch_aggregator_clone
|
||||
|
||||
subroutine amg_s_parmatch_aggregator_bld_map(ag,desc_a,desc_ac,ilaggr,nlaggr,&
|
||||
& op_restr,op_prol,map,info)
|
||||
|
||||
@@ -155,15 +155,16 @@ module amg_s_prec_type
|
||||
|
||||
|
||||
interface amg_precdescr
|
||||
subroutine amg_sfile_prec_descr(prec,info,iout,root,verbosity)
|
||||
subroutine amg_sfile_prec_descr(prec,info,iout,root,verbosity,prefix)
|
||||
import :: amg_sprec_type, psb_ipk_
|
||||
implicit none
|
||||
! Arguments
|
||||
class(amg_sprec_type), intent(in) :: prec
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_sprec_type), intent(in) :: prec
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_sfile_prec_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -385,20 +385,22 @@ contains
|
||||
|
||||
end subroutine s_slu_solver_finalize
|
||||
|
||||
subroutine s_slu_solver_descr(sv,info,iout,coarse)
|
||||
subroutine s_slu_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_s_slu_solver_type), intent(in) :: sv
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer :: err_act
|
||||
character(len=20), parameter :: name='amg_s_slu_solver_descr'
|
||||
integer :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -407,8 +409,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' SuperLU Sparse Factorization Solver. '
|
||||
write(iout_,*) trim(prefix_), ' SuperLU Sparse Factorization Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -88,16 +88,25 @@ contains
|
||||
val = "Symmetric Decoupled aggregation"
|
||||
end function amg_s_symdec_aggregator_fmt
|
||||
|
||||
subroutine amg_s_symdec_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_s_symdec_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_s_symdec_aggregator_type), intent(in) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
write(iout,*) 'Decoupled Aggregator locally-symmetrized'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
character(1024) :: prefix_
|
||||
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) trim(prefix_),' ','Decoupled Aggregator locally-symmetrized'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_s_symdec_aggregator_descr
|
||||
|
||||
@@ -198,7 +198,7 @@ module amg_z_ainv_solver
|
||||
!!$ end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_ainv_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_z_ainv_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_dpk_, amg_z_ainv_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
@@ -208,7 +208,7 @@ module amg_z_ainv_solver
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_z_ainv_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -396,21 +396,23 @@ contains
|
||||
end subroutine z_as_smoother_default
|
||||
|
||||
|
||||
subroutine z_as_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine z_as_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_z_as_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_z_as_smoother_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
logical :: coarse_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -424,16 +426,21 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (.not.coarse_) then
|
||||
write(iout_,*) ' Additive Schwarz with ',&
|
||||
write(iout_,*) trim(prefix_), ' Additive Schwarz with ',&
|
||||
& sm%novr, ' overlap layers.'
|
||||
write(iout_,*) ' Restrictor: ',restrict_names(sm%restr)
|
||||
write(iout_,*) ' Prolongator: ',prolong_names(sm%prol)
|
||||
write(iout_,*) ' Local solver:'
|
||||
write(iout_,*) trim(prefix_), ' Restrictor: ',restrict_names(sm%restr)
|
||||
write(iout_,*) trim(prefix_), ' Prolongator: ',prolong_names(sm%prol)
|
||||
write(iout_,*) trim(prefix_), ' Local solver:'
|
||||
endif
|
||||
if (allocated(sm%sv)) then
|
||||
call sm%sv%descr(info,iout_,coarse=coarse)
|
||||
call sm%sv%descr(info,iout_,coarse=coarse,prefix=prefix)
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
@@ -126,7 +126,7 @@ module amg_z_base_aggregator_mod
|
||||
& psb_z_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
||||
implicit none
|
||||
type(psb_z_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_z_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||
@@ -144,7 +144,7 @@ module amg_z_base_aggregator_mod
|
||||
& psb_z_coo_sparse_mat, amg_dml_parms, psb_dpk_, psb_ipk_, psb_lpk_
|
||||
implicit none
|
||||
type(psb_z_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_z_coo_sparse_mat), intent(inout) :: coo_prol, coo_restr
|
||||
@@ -275,15 +275,22 @@ contains
|
||||
val = .false.
|
||||
end function amg_z_base_aggregator_xt_desc
|
||||
|
||||
subroutine amg_z_base_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_z_base_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_z_base_aggregator_type), intent(in) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ', 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_z_base_aggregator_descr
|
||||
|
||||
@@ -272,7 +272,7 @@ module amg_z_base_smoother_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_base_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_z_base_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: psb_desc_type, psb_zspmat_type, psb_z_base_sparse_mat, &
|
||||
& psb_z_vect_type, psb_z_base_vect_type, psb_dpk_, &
|
||||
& amg_z_base_smoother_type, psb_ipk_
|
||||
@@ -281,6 +281,7 @@ module amg_z_base_smoother_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_z_base_smoother_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ module amg_z_base_solver_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_base_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_z_base_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_desc_type, psb_zspmat_type, psb_z_base_sparse_mat, &
|
||||
& psb_z_vect_type, psb_z_base_vect_type, psb_dpk_, &
|
||||
& amg_z_base_solver_type, psb_ipk_
|
||||
@@ -281,7 +281,7 @@ module amg_z_base_solver_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_z_base_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -184,16 +184,23 @@ contains
|
||||
val = "Decoupled aggregation"
|
||||
end function amg_z_dec_aggregator_fmt
|
||||
|
||||
subroutine amg_z_dec_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_z_dec_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_z_dec_aggregator_type), intent(in) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) 'Decoupled Aggregator'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
write(iout,*) trim(prefix_),' ','Decoupled Aggregator'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_z_dec_aggregator_descr
|
||||
|
||||
@@ -219,7 +219,7 @@ contains
|
||||
|
||||
end subroutine z_diag_solver_free
|
||||
|
||||
subroutine z_diag_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_diag_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -228,11 +228,13 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_z_diag_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -240,8 +242,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
|
||||
write(iout_,*) ' Diagonal local solver '
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) trim(prefix_), ' Diagonal local solver '
|
||||
|
||||
return
|
||||
|
||||
@@ -352,7 +359,7 @@ module amg_z_l1_diag_solver
|
||||
|
||||
contains
|
||||
|
||||
subroutine z_l1_diag_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_l1_diag_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -361,11 +368,13 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_z_l1_diag_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -373,8 +382,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
|
||||
write(iout_,*) ' L1 Diagonal solver '
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) trim(prefix_), ' L1 Diagonal solver '
|
||||
|
||||
return
|
||||
|
||||
|
||||
+26
-12
@@ -433,20 +433,22 @@ contains
|
||||
return
|
||||
end subroutine z_gs_solver_free
|
||||
|
||||
subroutine z_gs_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_gs_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_z_gs_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_z_gs_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -455,12 +457,17 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%eps<=dzero) then
|
||||
write(iout_,*) ' Forward Gauss-Seidel iterative solver with ',&
|
||||
write(iout_,*) trim(prefix_), ' Forward Gauss-Seidel iterative solver with ',&
|
||||
& sv%sweeps,' sweeps'
|
||||
else
|
||||
write(iout_,*) ' Forward Gauss-Seidel iterative solver with tolerance',&
|
||||
write(iout_,*) trim(prefix_), ' Forward Gauss-Seidel iterative solver with tolerance',&
|
||||
& sv%eps,' and maxit', sv%sweeps
|
||||
end if
|
||||
|
||||
@@ -526,20 +533,22 @@ contains
|
||||
val = .true.
|
||||
end function z_gs_solver_is_iterative
|
||||
|
||||
subroutine z_bwgs_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_bwgs_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_z_bwgs_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_z_bwgs_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -548,12 +557,17 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%eps<=dzero) then
|
||||
write(iout_,*) ' Backward Gauss-Seidel iterative solver with ',&
|
||||
write(iout_,*) trim(prefix_), ' Backward Gauss-Seidel iterative solver with ',&
|
||||
& sv%sweeps,' sweeps'
|
||||
else
|
||||
write(iout_,*) ' Backward Gauss-Seidel iterative solver with tolerance',&
|
||||
write(iout_,*) trim(prefix_), ' Backward Gauss-Seidel iterative solver with tolerance',&
|
||||
& sv%eps,' and maxit', sv%sweeps
|
||||
end if
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ contains
|
||||
return
|
||||
end subroutine z_id_solver_free
|
||||
|
||||
subroutine z_id_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_id_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -165,12 +165,14 @@ contains
|
||||
class(amg_z_id_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_z_id_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(iout)) then
|
||||
@@ -178,8 +180,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' Identity local solver '
|
||||
write(iout_,*) trim(prefix_), ' Identity local solver '
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ contains
|
||||
return
|
||||
end subroutine z_ilu_solver_free
|
||||
|
||||
subroutine z_ilu_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_ilu_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -414,12 +414,14 @@ contains
|
||||
class(amg_z_ilu_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_z_ilu_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -428,15 +430,20 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' Incomplete factorization solver: ',&
|
||||
write(iout_,*) trim(prefix_), ' Incomplete factorization solver: ',&
|
||||
& amg_fact_names(sv%fact_type)
|
||||
select case(sv%fact_type)
|
||||
case(psb_ilu_n_,psb_milu_n_)
|
||||
write(iout_,*) ' Fill level:',sv%fill_in
|
||||
write(iout_,*) trim(prefix_), ' Fill level:',sv%fill_in
|
||||
case(psb_ilu_t_)
|
||||
write(iout_,*) ' Fill level:',sv%fill_in
|
||||
write(iout_,*) ' Fill threshold :',sv%thresh
|
||||
write(iout_,*) trim(prefix_), ' Fill level:',sv%fill_in
|
||||
write(iout_,*) trim(prefix_), ' Fill threshold :',sv%thresh
|
||||
end select
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
@@ -123,7 +123,7 @@ module amg_z_invk_solver
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_invk_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_z_invk_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_dpk_, amg_z_invk_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
@@ -133,7 +133,7 @@ module amg_z_invk_solver
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_z_invk_solver_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -134,16 +134,17 @@ module amg_z_invt_solver
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_invt_solver_descr(sv,info,iout,coarse)
|
||||
subroutine amg_z_invt_solver_descr(sv,info,iout,coarse,prefix)
|
||||
import :: psb_dpk_, amg_z_invt_solver_type, psb_ipk_
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_z_invt_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
end subroutine amg_z_invt_solver_descr
|
||||
end interface
|
||||
|
||||
@@ -219,12 +219,13 @@ module amg_z_jac_smoother
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_jac_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_z_jac_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: amg_z_jac_smoother_type, psb_ipk_
|
||||
class(amg_z_jac_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_z_jac_smoother_descr
|
||||
end interface
|
||||
|
||||
@@ -313,12 +314,13 @@ module amg_z_jac_smoother
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_l1_jac_smoother_descr(sm,info,iout,coarse)
|
||||
subroutine amg_z_l1_jac_smoother_descr(sm,info,iout,coarse,prefix)
|
||||
import :: amg_z_l1_jac_smoother_type, psb_ipk_
|
||||
class(amg_z_l1_jac_smoother_type), intent(in) :: sm
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_z_l1_jac_smoother_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ contains
|
||||
val = "KRM solver"
|
||||
end function z_krm_solver_get_fmt
|
||||
|
||||
subroutine z_krm_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_krm_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
@@ -444,12 +444,14 @@ contains
|
||||
class(amg_z_krm_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20), parameter :: name='amg_z_krm_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -458,23 +460,22 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
if (sv%global) then
|
||||
write(iout_,*) ' Krylov solver (global)'
|
||||
write(iout_,*) trim(prefix_), ' Krylov solver (global)'
|
||||
else
|
||||
write(iout_,*) ' Krylov solver (local) '
|
||||
write(iout_,*) trim(prefix_), ' Krylov solver (local) '
|
||||
end if
|
||||
write(iout_,*) ' method: ',sv%method
|
||||
write(iout_,*) ' kprec: ',sv%kprec
|
||||
if (sv%i_sub_solve > 0) then
|
||||
write(iout_,*) ' sub_solve: ',amg_fact_names(sv%i_sub_solve)
|
||||
else
|
||||
write(iout_,*) ' sub_solve: ',sv%sub_solve
|
||||
end if
|
||||
write(iout_,*) ' itmax: ',sv%itmax
|
||||
write(iout_,*) ' eps: ',sv%eps
|
||||
write(iout_,*) ' fillin: ',sv%fillin
|
||||
|
||||
write(iout_,*) trim(prefix_), ' method: ',sv%method
|
||||
write(iout_,*) trim(prefix_), ' kprec: ',sv%kprec
|
||||
call sv%prec%descr(iout_,info,prefix='KRM : '//prefix_)
|
||||
write(iout_,*) trim(prefix_), ' itmax: ',sv%itmax
|
||||
write(iout_,*) trim(prefix_), ' eps: ',sv%eps
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -313,22 +313,24 @@ subroutine z_mumps_solver_finalize(sv)
|
||||
|
||||
end subroutine z_mumps_solver_finalize
|
||||
|
||||
subroutine z_mumps_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_mumps_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_z_mumps_solver_type), intent(in) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: err_act
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer(psb_ipk_) :: me, np
|
||||
character(len=20), parameter :: name='amg_z_mumps_solver_descr'
|
||||
integer(psb_ipk_) :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -337,8 +339,13 @@ subroutine z_mumps_solver_descr(sv,info,iout,coarse)
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' MUMPS Solver. '
|
||||
write(iout_,*) trim(prefix_), ' MUMPS Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -257,7 +257,7 @@ module amg_z_onelev_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity)
|
||||
subroutine amg_z_base_onelev_descr(lv,il,nl,ilmin,info,iout, verbosity,prefix)
|
||||
import :: psb_zspmat_type, psb_z_vect_type, psb_z_base_vect_type, &
|
||||
& psb_zlinmap_type, psb_dpk_, amg_z_onelev_type, &
|
||||
& psb_ipk_, psb_epk_, psb_desc_type
|
||||
@@ -268,6 +268,7 @@ module amg_z_onelev_mod
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_z_base_onelev_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -155,15 +155,16 @@ module amg_z_prec_type
|
||||
|
||||
|
||||
interface amg_precdescr
|
||||
subroutine amg_zfile_prec_descr(prec,info,iout,root,verbosity)
|
||||
subroutine amg_zfile_prec_descr(prec,info,iout,root,verbosity,prefix)
|
||||
import :: amg_zprec_type, psb_ipk_
|
||||
implicit none
|
||||
! Arguments
|
||||
class(amg_zprec_type), intent(in) :: prec
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_zprec_type), intent(in) :: prec
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: iout
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
integer(psb_ipk_), intent(in), optional :: verbosity
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
end subroutine amg_zfile_prec_descr
|
||||
end interface
|
||||
|
||||
|
||||
@@ -385,20 +385,22 @@ contains
|
||||
|
||||
end subroutine z_slu_solver_finalize
|
||||
|
||||
subroutine z_slu_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_slu_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_z_slu_solver_type), intent(in) :: sv
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer :: err_act
|
||||
character(len=20), parameter :: name='amg_z_slu_solver_descr'
|
||||
integer :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -407,8 +409,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' SuperLU Sparse Factorization Solver. '
|
||||
write(iout_,*) trim(prefix_), ' SuperLU Sparse Factorization Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -52,7 +52,7 @@ module amg_z_sludist_solver
|
||||
use iso_c_binding
|
||||
use amg_z_base_solver_mod
|
||||
|
||||
#if defined(LPK8)
|
||||
#if (!defined(HAVE_SLUDIST_)) || defined(IPK8)
|
||||
|
||||
type, extends(amg_z_base_solver_type) :: amg_z_sludist_solver_type
|
||||
|
||||
@@ -270,10 +270,12 @@ contains
|
||||
! Local variables
|
||||
type(psb_zspmat_type) :: atmp
|
||||
type(psb_z_csr_sparse_mat) :: acsr
|
||||
integer :: n_row,n_col, nrow_a, nztota, nglob, nzt, npr, npc
|
||||
integer :: ifrst, ibcheck
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
integer(psb_lpk_), allocatable :: gia(:), gja(:)
|
||||
integer(psb_lpk_) :: lfrst
|
||||
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota, nglob, nzt, npr, npc
|
||||
integer(psb_ipk_) :: ifrst, ibcheck
|
||||
integer(psb_ipk_) :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='z_sludist_solver_bld', ch_err
|
||||
|
||||
info=psb_success_
|
||||
@@ -293,19 +295,36 @@ contains
|
||||
n_col = desc_a%get_local_cols()
|
||||
nglob = desc_a%get_global_rows()
|
||||
|
||||
call a%cscnv(atmp,info,type='coo')
|
||||
!
|
||||
! Strategy here is as follows: because a call to SLUDIST
|
||||
! as a gobal solver is mostly done at the coarsest level,
|
||||
! even if we start from a problem requiring 8 bytes, chances
|
||||
! are that the global size will be suitable for 4 bytes
|
||||
! anyway, so we hope for the best, and throw an error
|
||||
! if something goes wrong.
|
||||
!
|
||||
if (nglob > huge(1_psb_ipk_)) then
|
||||
write(0,*) me,' ',trim(name),': Error: overflow of local indices '
|
||||
info=psb_err_internal_error_
|
||||
call psb_errpush(info,name)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call a%cscnv(atmp,info,type='csr')
|
||||
! This in case we are dealing with AS
|
||||
call psb_rwextd(n_row,atmp,info,b=b)
|
||||
call atmp%cscnv(info,type='csr',dupl=psb_dupl_add_)
|
||||
call atmp%mv_to(acsr)
|
||||
nrow_a = acsr%get_nrows()
|
||||
nztota = acsr%get_nzeros()
|
||||
call psb_loc_to_glob(ione,lfrst,desc_a,info)
|
||||
|
||||
! Fix the entries to call C-base SuperLU
|
||||
call psb_loc_to_glob(1,ifrst,desc_a,info)
|
||||
call psb_loc_to_glob(nrow_a,ibcheck,desc_a,info)
|
||||
call psb_loc_to_glob(acsr%ja(1:nztota),desc_a,info,iact='I')
|
||||
call psb_realloc(nztota,gja,info)
|
||||
call psb_loc_to_glob(acsr%ja(1:nztota),gja(1:nztota), desc_a, info, iact='I')
|
||||
acsr%ja(1:nztota) = gja(1:nztota)
|
||||
acsr%ja(:) = acsr%ja(:) - 1
|
||||
acsr%irp(:) = acsr%irp(:) - 1
|
||||
ifrst = ifrst - 1
|
||||
ifrst = lfrst - 1
|
||||
info = amg_zsludist_fact(nglob,nrow_a,nztota,ifrst,&
|
||||
& acsr%val,acsr%irp,acsr%ja,sv%lufactors,&
|
||||
& npr,npc)
|
||||
@@ -318,7 +337,6 @@ contains
|
||||
end if
|
||||
|
||||
call acsr%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
@@ -403,15 +421,16 @@ contains
|
||||
|
||||
end subroutine z_sludist_solver_finalize
|
||||
|
||||
subroutine z_sludist_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_sludist_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_z_sludist_solver_type), intent(in) :: sv
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer :: err_act
|
||||
@@ -419,6 +438,7 @@ contains
|
||||
integer :: me, np
|
||||
character(len=20), parameter :: name='amg_z_sludist_solver_descr'
|
||||
integer :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -427,8 +447,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' SuperLU_Dist Sparse Factorization Solver. '
|
||||
write(iout_,*) trim(prefix_), ' SuperLU_Dist Sparse Factorization Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -88,16 +88,25 @@ contains
|
||||
val = "Symmetric Decoupled aggregation"
|
||||
end function amg_z_symdec_aggregator_fmt
|
||||
|
||||
subroutine amg_z_symdec_aggregator_descr(ag,parms,iout,info)
|
||||
subroutine amg_z_symdec_aggregator_descr(ag,parms,iout,info,prefix)
|
||||
implicit none
|
||||
class(amg_z_symdec_aggregator_type), intent(in) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
write(iout,*) 'Decoupled Aggregator locally-symmetrized'
|
||||
write(iout,*) 'Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info)
|
||||
character(1024) :: prefix_
|
||||
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout,*) trim(prefix_),' ','Decoupled Aggregator locally-symmetrized'
|
||||
write(iout,*) trim(prefix_),' ','Aggregator object type: ',ag%fmt()
|
||||
call parms%mldescr(iout,info,prefix=prefix)
|
||||
|
||||
return
|
||||
end subroutine amg_z_symdec_aggregator_descr
|
||||
|
||||
@@ -390,20 +390,22 @@ contains
|
||||
|
||||
end subroutine z_umf_solver_finalize
|
||||
|
||||
subroutine z_umf_solver_descr(sv,info,iout,coarse)
|
||||
subroutine z_umf_solver_descr(sv,info,iout,coarse,prefix)
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
class(amg_z_umf_solver_type), intent(in) :: sv
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: iout
|
||||
logical, intent(in), optional :: coarse
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
! Local variables
|
||||
integer :: err_act
|
||||
character(len=20), parameter :: name='amg_z_umf_solver_descr'
|
||||
integer :: iout_
|
||||
character(1024) :: prefix_
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
@@ -412,8 +414,13 @@ contains
|
||||
else
|
||||
iout_ = psb_out_unit
|
||||
endif
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
prefix_ = ""
|
||||
end if
|
||||
|
||||
write(iout_,*) ' UMFPACK Sparse Factorization Solver. '
|
||||
write(iout_,*) trim(prefix_), ' UMFPACK Sparse Factorization Solver. '
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -83,8 +83,8 @@ subroutine amg_c_dec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
class(amg_c_dec_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(amg_saggr_data), intent(in) :: ag_data
|
||||
type(psb_cspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_cspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_lcspmat_type), intent(out) :: t_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -86,8 +86,8 @@ subroutine amg_c_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
class(amg_c_symdec_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(amg_saggr_data), intent(in) :: ag_data
|
||||
type(psb_cspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_cspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_lcspmat_type), intent(out) :: op_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
!
|
||||
!
|
||||
subroutine amg_caggrmat_minnrg_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
& ac,desc_ac,op_prol,op_restr,info)
|
||||
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
use amg_c_inner_mod, amg_protect_name => amg_caggrmat_minnrg_bld
|
||||
@@ -117,8 +117,8 @@ subroutine amg_caggrmat_minnrg_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_lcspmat_type), intent(inout) :: op_prol
|
||||
type(psb_lcspmat_type), intent(out) :: ac,op_restr
|
||||
type(psb_lcspmat_type), intent(inout) :: t_prol
|
||||
type(psb_cspmat_type), intent(inout) :: op_prol, ac,op_restr
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -171,6 +171,8 @@ subroutine amg_caggrmat_minnrg_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
|
||||
filter_mat = (parms%aggr_filter == amg_filter_mat_)
|
||||
|
||||
!NEEDS TO BE REWORKED !!
|
||||
|
||||
! naggr: number of local aggregates
|
||||
! nrow: local rows.
|
||||
!
|
||||
@@ -183,361 +185,361 @@ subroutine amg_caggrmat_minnrg_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
! Get the diagonal D
|
||||
adiag = a%get_diag(info)
|
||||
if (info == psb_success_) &
|
||||
& call psb_realloc(ncol,adiag,info)
|
||||
if (info == psb_success_) &
|
||||
& call psb_halo(adiag,desc_a,info)
|
||||
if (info == psb_success_) call a%cp_to_l(la)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_getdiag')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
do i=1,size(adiag)
|
||||
if (adiag(i) /= czero) then
|
||||
adinv(i) = cone / adiag(i)
|
||||
else
|
||||
adinv(i) = cone
|
||||
end if
|
||||
end do
|
||||
|
||||
|
||||
|
||||
! 1. Allocate Ptilde in sparse matrix form
|
||||
call op_prol%mv_to(tmpcoo)
|
||||
call ptilde%mv_from(tmpcoo)
|
||||
call ptilde%cscnv(info,type='csr')
|
||||
|
||||
if (info == psb_success_) call la%cscnv(am3,info,type='csr',dupl=psb_dupl_add_)
|
||||
if (info == psb_success_) call la%cscnv(da,info,type='csr',dupl=psb_dupl_add_)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='spcnv')
|
||||
goto 9999
|
||||
end if
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& ' Initial copies done.'
|
||||
|
||||
call da%scal(adinv,info)
|
||||
|
||||
call psb_spspmm(da,ptilde,dap,info)
|
||||
|
||||
if(info /= psb_success_) then
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='spspmm 1')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call dap%clone(atmp,info)
|
||||
|
||||
call psb_sphalo(atmp,desc_a,am4,info,&
|
||||
& colcnv=.false.,rowscale=.true.,outfmt='CSR ')
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=am4)
|
||||
if (info == psb_success_) call am4%free()
|
||||
|
||||
call psb_spspmm(da,atmp,dadap,info)
|
||||
call atmp%free()
|
||||
|
||||
! !$ write(0,*) 'Columns of AP',psb_sp_get_ncols(ap)
|
||||
! !$ write(0,*) 'Columns of ADAP',psb_sp_get_ncols(adap)
|
||||
call dap%mv_to(csc_dap)
|
||||
call dadap%mv_to(csc_dadap)
|
||||
|
||||
call csc_mat_col_prod(csc_dap,csc_dadap,omp,info)
|
||||
call csc_mat_col_prod(csc_dadap,csc_dadap,oden,info)
|
||||
call psb_sum(ctxt,omp)
|
||||
call psb_sum(ctxt,oden)
|
||||
! !$ write(0,*) trim(name),' OMP :',omp
|
||||
! !$ write(0,*) trim(name),' ODEN:',oden
|
||||
|
||||
omp = omp/oden
|
||||
|
||||
! !$ write(0,*) 'Check on output prolongator ',omp(1:min(size(omp),10))
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done NUMBMM 1'
|
||||
|
||||
call am3%mv_to(acsr3)
|
||||
! Compute omega_int
|
||||
ommx = czero
|
||||
do i=1, ncol
|
||||
if (ilaggr(i) >0) then
|
||||
omi(i) = omp(ilaggr(i))
|
||||
else
|
||||
omi(i) = czero
|
||||
end if
|
||||
if(abs(omi(i)) .gt. abs(ommx)) ommx = omi(i)
|
||||
end do
|
||||
! Compute omega_fine
|
||||
do i=1, nrow
|
||||
omf(i) = ommx
|
||||
do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
||||
if(abs(omi(acsr3%ja(j))) .lt. abs(omf(i))) omf(i)=omi(acsr3%ja(j))
|
||||
end do
|
||||
!!$ if(min(real(omf(i)),aimag(omf(i))) < szero) omf(i) = czero
|
||||
if(psb_minreal(omf(i)) < szero) omf(i) = czero
|
||||
end do
|
||||
|
||||
omf(1:nrow) = omf(1:nrow) * adinv(1:nrow)
|
||||
|
||||
if (filter_mat) then
|
||||
!
|
||||
! Build the filtered matrix Af from A
|
||||
!
|
||||
call la%cscnv(acsrf,info,dupl=psb_dupl_add_)
|
||||
|
||||
do i=1,nrow
|
||||
tmp = czero
|
||||
jd = -1
|
||||
do j=acsrf%irp(i),acsrf%irp(i+1)-1
|
||||
if (acsrf%ja(j) == i) jd = j
|
||||
if (abs(acsrf%val(j)) < theta*sqrt(abs(adiag(i)*adiag(acsrf%ja(j))))) then
|
||||
tmp=tmp+acsrf%val(j)
|
||||
acsrf%val(j)=czero
|
||||
endif
|
||||
enddo
|
||||
if (jd == -1) then
|
||||
write(0,*) 'Wrong input: we need the diagonal!!!!', i
|
||||
else
|
||||
acsrf%val(jd)=acsrf%val(jd)-tmp
|
||||
end if
|
||||
enddo
|
||||
! Take out zeroed terms
|
||||
call acsrf%clean_zeros(info)
|
||||
|
||||
!
|
||||
! Build the smoothed prolongator using the filtered matrix
|
||||
!
|
||||
do i=1,acsrf%get_nrows()
|
||||
do j=acsrf%irp(i),acsrf%irp(i+1)-1
|
||||
if (acsrf%ja(j) == i) then
|
||||
acsrf%val(j) = cone - omf(i)*acsrf%val(j)
|
||||
else
|
||||
acsrf%val(j) = - omf(i)*acsrf%val(j)
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done gather, going for SYMBMM 1'
|
||||
|
||||
call af%mv_from(acsrf)
|
||||
!
|
||||
! op_prol = (I-w*D*Af)Ptilde
|
||||
! Doing it this way means to consider diag(Af_i)
|
||||
!
|
||||
!
|
||||
call psb_spspmm(af,ptilde,op_prol,info)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done SPSPMM 1'
|
||||
else
|
||||
!
|
||||
! Build the smoothed prolongator using the original matrix
|
||||
!
|
||||
do i=1,acsr3%get_nrows()
|
||||
do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
||||
if (acsr3%ja(j) == i) then
|
||||
acsr3%val(j) = cone - omf(i)*acsr3%val(j)
|
||||
else
|
||||
acsr3%val(j) = - omf(i)*acsr3%val(j)
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
|
||||
call am3%mv_from(acsr3)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done gather, going for SYMBMM 1'
|
||||
!
|
||||
!
|
||||
! op_prol = (I-w*D*A)Ptilde
|
||||
!
|
||||
!
|
||||
call psb_spspmm(am3,ptilde,op_prol,info)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done NUMBMM 1'
|
||||
|
||||
end if
|
||||
|
||||
|
||||
!
|
||||
! Ok, let's start over with the restrictor
|
||||
!
|
||||
call ptilde%transc(rtilde)
|
||||
call la%cscnv(atmp,info,type='csr')
|
||||
call psb_sphalo(atmp,desc_a,am4,info,&
|
||||
& colcnv=.true.,rowscale=.true.)
|
||||
nrt = am4%get_nrows()
|
||||
call am4%csclip(atmp2,info,lone,nrt,lone,ncol)
|
||||
call atmp2%cscnv(info,type='CSR')
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=atmp2)
|
||||
call am4%free()
|
||||
call atmp2%free()
|
||||
|
||||
! This is to compute the transpose. It ONLY works if the
|
||||
! original A has a symmetric pattern.
|
||||
call atmp%transc(atmp2)
|
||||
call atmp2%csclip(dat,info,lone,nrow,lone,ncol)
|
||||
call dat%cscnv(info,type='csr')
|
||||
call dat%scal(adinv,info)
|
||||
|
||||
! Now for the product.
|
||||
call psb_spspmm(dat,ptilde,datp,info)
|
||||
|
||||
call datp%clone(atmp2,info)
|
||||
call psb_sphalo(atmp2,desc_a,am4,info,&
|
||||
& colcnv=.false.,rowscale=.true.,outfmt='CSR ')
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp2,info,b=am4)
|
||||
if (info == psb_success_) call am4%free()
|
||||
|
||||
|
||||
call psb_symbmm(dat,atmp2,datdatp,info)
|
||||
call psb_numbmm(dat,atmp2,datdatp)
|
||||
call atmp2%free()
|
||||
|
||||
call datp%mv_to(csc_datp)
|
||||
call datdatp%mv_to(csc_datdatp)
|
||||
|
||||
call csc_mat_col_prod(csc_datp,csc_datdatp,omp,info)
|
||||
call csc_mat_col_prod(csc_datdatp,csc_datdatp,oden,info)
|
||||
call psb_sum(ctxt,omp)
|
||||
call psb_sum(ctxt,oden)
|
||||
|
||||
|
||||
! !$ write(debug_unit,*) trim(name),' OMP_R :',omp
|
||||
! ! $ write(debug_unit,*) trim(name),' ODEN_R:',oden
|
||||
omp = omp/oden
|
||||
! !$ write(0,*) 'Check on output restrictor',omp(1:min(size(omp),10))
|
||||
! Compute omega_int
|
||||
ommx = czero
|
||||
do i=1, ncol
|
||||
if (ilaggr(i) >0) then
|
||||
omi(i) = omp(ilaggr(i))
|
||||
else
|
||||
omi(i) = czero
|
||||
end if
|
||||
if(abs(omi(i)) .gt. abs(ommx)) ommx = omi(i)
|
||||
end do
|
||||
! Compute omega_fine
|
||||
! Going over the columns of atmp means going over the rows
|
||||
! of A^T. Hopefully ;-)
|
||||
call atmp%cp_to(acsc)
|
||||
|
||||
do i=1, nrow
|
||||
omf(i) = ommx
|
||||
do j= acsc%icp(i),acsc%icp(i+1)-1
|
||||
if(abs(omi(acsc%ia(j))) .lt. abs(omf(i))) omf(i)=omi(acsc%ia(j))
|
||||
end do
|
||||
!!$ if(min(real(omf(i)),aimag(omf(i))) < szero) omf(i) = czero
|
||||
if(psb_minreal(omf(i)) < szero) omf(i) = czero
|
||||
end do
|
||||
omf(1:nrow) = omf(1:nrow)*adinv(1:nrow)
|
||||
call psb_halo(omf,desc_a,info)
|
||||
call acsc%free()
|
||||
|
||||
|
||||
call atmp%mv_to(acsr1)
|
||||
|
||||
do i=1,acsr1%get_nrows()
|
||||
do j=acsr1%irp(i),acsr1%irp(i+1)-1
|
||||
if (acsr1%ja(j) == i) then
|
||||
acsr1%val(j) = cone - acsr1%val(j)*omf(acsr1%ja(j))
|
||||
else
|
||||
acsr1%val(j) = - acsr1%val(j)*omf(acsr1%ja(j))
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
call atmp%mv_from(acsr1)
|
||||
|
||||
call rtilde%mv_to(tmpcoo)
|
||||
nzl = tmpcoo%get_nzeros()
|
||||
i=0
|
||||
do k=1, nzl
|
||||
if ((naggrm1 < tmpcoo%ia(k)) .and. (tmpcoo%ia(k) <= naggrp1)) then
|
||||
i = i+1
|
||||
tmpcoo%val(i) = tmpcoo%val(k)
|
||||
tmpcoo%ia(i) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(i) = tmpcoo%ja(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(i)
|
||||
call rtilde%mv_from(tmpcoo)
|
||||
call rtilde%cscnv(info,type='csr')
|
||||
|
||||
call psb_spspmm(rtilde,atmp,op_restr,info)
|
||||
|
||||
!
|
||||
! Now we have to gather the halo of op_prol, and add it to itself
|
||||
! to multiply it by A,
|
||||
!
|
||||
call op_prol%clone(tmp_prol,info)
|
||||
if (info == psb_success_) call psb_sphalo(tmp_prol,desc_a,am4,info,&
|
||||
& colcnv=.false.,rowscale=.true.)
|
||||
if (info == psb_success_) call psb_rwextd(ncol,tmp_prol,info,b=am4)
|
||||
if (info == psb_success_) call am4%free()
|
||||
|
||||
if(info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,name,a_err='Halo of op_prol')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
!
|
||||
! Now we have to fix this. The only rows of B that are correct
|
||||
! are those corresponding to "local" aggregates, i.e. indices in ilaggr(:)
|
||||
!
|
||||
call op_restr%mv_to(tmpcoo)
|
||||
|
||||
nzl = tmpcoo%get_nzeros()
|
||||
i=0
|
||||
do k=1, nzl
|
||||
if ((naggrm1 < tmpcoo%ia(k)) .and. (tmpcoo%ia(k) <= naggrp1)) then
|
||||
i = i+1
|
||||
tmpcoo%val(i) = tmpcoo%val(k)
|
||||
tmpcoo%ia(i) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(i) = tmpcoo%ja(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(i)
|
||||
call op_restr%mv_from(tmpcoo)
|
||||
call op_restr%cscnv(info,type='csr')
|
||||
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'starting sphalo/ rwxtd'
|
||||
|
||||
call psb_spspmm(la,tmp_prol,am3,info)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done SPSPMM 2'
|
||||
|
||||
call psb_sphalo(am3,desc_a,am4,info,&
|
||||
& colcnv=.false.,rowscale=.true.)
|
||||
if (info == psb_success_) call psb_rwextd(ncol,am3,info,b=am4)
|
||||
if (info == psb_success_) call am4%free()
|
||||
|
||||
if(info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,name,&
|
||||
& a_err='Extend am3')
|
||||
goto 9999
|
||||
end if
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done sphalo/ rwxtd'
|
||||
|
||||
call psb_spspmm(op_restr,am3,ac,info)
|
||||
if (info == psb_success_) call am3%free()
|
||||
if (info == psb_success_) call ac%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,name,&
|
||||
&a_err='Build ac = op_restr x am3')
|
||||
goto 9999
|
||||
end if
|
||||
!!$ ! Get the diagonal D
|
||||
!!$ adiag = a%get_diag(info)
|
||||
!!$ if (info == psb_success_) &
|
||||
!!$ & call psb_realloc(ncol,adiag,info)
|
||||
!!$ if (info == psb_success_) &
|
||||
!!$ & call psb_halo(adiag,desc_a,info)
|
||||
!!$ if (info == psb_success_) call a%cp_to_l(la)
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_getdiag')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ do i=1,size(adiag)
|
||||
!!$ if (adiag(i) /= czero) then
|
||||
!!$ adinv(i) = cone / adiag(i)
|
||||
!!$ else
|
||||
!!$ adinv(i) = cone
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$
|
||||
!!$
|
||||
!!$
|
||||
!!$ ! 1. Allocate Ptilde in sparse matrix form
|
||||
!!$ call op_prol%mv_to(tmpcoo)
|
||||
!!$ call ptilde%mv_from(tmpcoo)
|
||||
!!$ call ptilde%cscnv(info,type='csr')
|
||||
!!$
|
||||
!!$ if (info == psb_success_) call la%cscnv(am3,info,type='csr',dupl=psb_dupl_add_)
|
||||
!!$ if (info == psb_success_) call la%cscnv(da,info,type='csr',dupl=psb_dupl_add_)
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_from_subroutine_,name,a_err='spcnv')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & ' Initial copies done.'
|
||||
!!$
|
||||
!!$ call da%scal(adinv,info)
|
||||
!!$
|
||||
!!$ call psb_spspmm(da,ptilde,dap,info)
|
||||
!!$
|
||||
!!$ if(info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_from_subroutine_,name,a_err='spspmm 1')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ call dap%clone(atmp,info)
|
||||
!!$
|
||||
!!$ call psb_sphalo(atmp,desc_a,am4,info,&
|
||||
!!$ & colcnv=.false.,rowscale=.true.,outfmt='CSR ')
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=am4)
|
||||
!!$ if (info == psb_success_) call am4%free()
|
||||
!!$
|
||||
!!$ call psb_spspmm(da,atmp,dadap,info)
|
||||
!!$ call atmp%free()
|
||||
!!$
|
||||
!!$ ! !$ write(0,*) 'Columns of AP',psb_sp_get_ncols(ap)
|
||||
!!$ ! !$ write(0,*) 'Columns of ADAP',psb_sp_get_ncols(adap)
|
||||
!!$ call dap%mv_to(csc_dap)
|
||||
!!$ call dadap%mv_to(csc_dadap)
|
||||
!!$
|
||||
!!$ call csc_mat_col_prod(csc_dap,csc_dadap,omp,info)
|
||||
!!$ call csc_mat_col_prod(csc_dadap,csc_dadap,oden,info)
|
||||
!!$ call psb_sum(ctxt,omp)
|
||||
!!$ call psb_sum(ctxt,oden)
|
||||
!!$ ! !$ write(0,*) trim(name),' OMP :',omp
|
||||
!!$ ! !$ write(0,*) trim(name),' ODEN:',oden
|
||||
!!$
|
||||
!!$ omp = omp/oden
|
||||
!!$
|
||||
!!$ ! !$ write(0,*) 'Check on output prolongator ',omp(1:min(size(omp),10))
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done NUMBMM 1'
|
||||
!!$
|
||||
!!$ call am3%mv_to(acsr3)
|
||||
!!$ ! Compute omega_int
|
||||
!!$ ommx = czero
|
||||
!!$ do i=1, ncol
|
||||
!!$ if (ilaggr(i) >0) then
|
||||
!!$ omi(i) = omp(ilaggr(i))
|
||||
!!$ else
|
||||
!!$ omi(i) = czero
|
||||
!!$ end if
|
||||
!!$ if(abs(omi(i)) .gt. abs(ommx)) ommx = omi(i)
|
||||
!!$ end do
|
||||
!!$ ! Compute omega_fine
|
||||
!!$ do i=1, nrow
|
||||
!!$ omf(i) = ommx
|
||||
!!$ do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
||||
!!$ if(abs(omi(acsr3%ja(j))) .lt. abs(omf(i))) omf(i)=omi(acsr3%ja(j))
|
||||
!!$ end do
|
||||
!!$ ! ! if(min(real(omf(i)),aimag(omf(i))) < szero) omf(i) = czero
|
||||
!!$ if(psb_minreal(omf(i)) < szero) omf(i) = czero
|
||||
!!$ end do
|
||||
!!$
|
||||
!!$ omf(1:nrow) = omf(1:nrow) * adinv(1:nrow)
|
||||
!!$
|
||||
!!$ if (filter_mat) then
|
||||
!!$ !
|
||||
!!$ ! Build the filtered matrix Af from A
|
||||
!!$ !
|
||||
!!$ call la%cscnv(acsrf,info,dupl=psb_dupl_add_)
|
||||
!!$
|
||||
!!$ do i=1,nrow
|
||||
!!$ tmp = czero
|
||||
!!$ jd = -1
|
||||
!!$ do j=acsrf%irp(i),acsrf%irp(i+1)-1
|
||||
!!$ if (acsrf%ja(j) == i) jd = j
|
||||
!!$ if (abs(acsrf%val(j)) < theta*sqrt(abs(adiag(i)*adiag(acsrf%ja(j))))) then
|
||||
!!$ tmp=tmp+acsrf%val(j)
|
||||
!!$ acsrf%val(j)=czero
|
||||
!!$ endif
|
||||
!!$ enddo
|
||||
!!$ if (jd == -1) then
|
||||
!!$ write(0,*) 'Wrong input: we need the diagonal!!!!', i
|
||||
!!$ else
|
||||
!!$ acsrf%val(jd)=acsrf%val(jd)-tmp
|
||||
!!$ end if
|
||||
!!$ enddo
|
||||
!!$ ! Take out zeroed terms
|
||||
!!$ call acsrf%clean_zeros(info)
|
||||
!!$
|
||||
!!$ !
|
||||
!!$ ! Build the smoothed prolongator using the filtered matrix
|
||||
!!$ !
|
||||
!!$ do i=1,acsrf%get_nrows()
|
||||
!!$ do j=acsrf%irp(i),acsrf%irp(i+1)-1
|
||||
!!$ if (acsrf%ja(j) == i) then
|
||||
!!$ acsrf%val(j) = cone - omf(i)*acsrf%val(j)
|
||||
!!$ else
|
||||
!!$ acsrf%val(j) = - omf(i)*acsrf%val(j)
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ end do
|
||||
!!$
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done gather, going for SYMBMM 1'
|
||||
!!$
|
||||
!!$ call af%mv_from(acsrf)
|
||||
!!$ !
|
||||
!!$ ! op_prol = (I-w*D*Af)Ptilde
|
||||
!!$ ! Doing it this way means to consider diag(Af_i)
|
||||
!!$ !
|
||||
!!$ !
|
||||
!!$ call psb_spspmm(af,ptilde,op_prol,info)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done SPSPMM 1'
|
||||
!!$ else
|
||||
!!$ !
|
||||
!!$ ! Build the smoothed prolongator using the original matrix
|
||||
!!$ !
|
||||
!!$ do i=1,acsr3%get_nrows()
|
||||
!!$ do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
||||
!!$ if (acsr3%ja(j) == i) then
|
||||
!!$ acsr3%val(j) = cone - omf(i)*acsr3%val(j)
|
||||
!!$ else
|
||||
!!$ acsr3%val(j) = - omf(i)*acsr3%val(j)
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ end do
|
||||
!!$
|
||||
!!$ call am3%mv_from(acsr3)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done gather, going for SYMBMM 1'
|
||||
!!$ !
|
||||
!!$ !
|
||||
!!$ ! op_prol = (I-w*D*A)Ptilde
|
||||
!!$ !
|
||||
!!$ !
|
||||
!!$ call psb_spspmm(am3,ptilde,op_prol,info)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done NUMBMM 1'
|
||||
!!$
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$
|
||||
!!$ !
|
||||
!!$ ! Ok, let's start over with the restrictor
|
||||
!!$ !
|
||||
!!$ call ptilde%transc(rtilde)
|
||||
!!$ call la%cscnv(atmp,info,type='csr')
|
||||
!!$ call psb_sphalo(atmp,desc_a,am4,info,&
|
||||
!!$ & colcnv=.true.,rowscale=.true.)
|
||||
!!$ nrt = am4%get_nrows()
|
||||
!!$ call am4%csclip(atmp2,info,lone,nrt,lone,ncol)
|
||||
!!$ call atmp2%cscnv(info,type='CSR')
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=atmp2)
|
||||
!!$ call am4%free()
|
||||
!!$ call atmp2%free()
|
||||
!!$
|
||||
!!$ ! This is to compute the transpose. It ONLY works if the
|
||||
!!$ ! original A has a symmetric pattern.
|
||||
!!$ call atmp%transc(atmp2)
|
||||
!!$ call atmp2%csclip(dat,info,lone,nrow,lone,ncol)
|
||||
!!$ call dat%cscnv(info,type='csr')
|
||||
!!$ call dat%scal(adinv,info)
|
||||
!!$
|
||||
!!$ ! Now for the product.
|
||||
!!$ call psb_spspmm(dat,ptilde,datp,info)
|
||||
!!$
|
||||
!!$ call datp%clone(atmp2,info)
|
||||
!!$ call psb_sphalo(atmp2,desc_a,am4,info,&
|
||||
!!$ & colcnv=.false.,rowscale=.true.,outfmt='CSR ')
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,atmp2,info,b=am4)
|
||||
!!$ if (info == psb_success_) call am4%free()
|
||||
!!$
|
||||
!!$
|
||||
!!$ call psb_symbmm(dat,atmp2,datdatp,info)
|
||||
!!$ call psb_numbmm(dat,atmp2,datdatp)
|
||||
!!$ call atmp2%free()
|
||||
!!$
|
||||
!!$ call datp%mv_to(csc_datp)
|
||||
!!$ call datdatp%mv_to(csc_datdatp)
|
||||
!!$
|
||||
!!$ call csc_mat_col_prod(csc_datp,csc_datdatp,omp,info)
|
||||
!!$ call csc_mat_col_prod(csc_datdatp,csc_datdatp,oden,info)
|
||||
!!$ call psb_sum(ctxt,omp)
|
||||
!!$ call psb_sum(ctxt,oden)
|
||||
!!$
|
||||
!!$
|
||||
!!$ ! !$ write(debug_unit,*) trim(name),' OMP_R :',omp
|
||||
!!$ ! ! $ write(debug_unit,*) trim(name),' ODEN_R:',oden
|
||||
!!$ omp = omp/oden
|
||||
!!$ ! !$ write(0,*) 'Check on output restrictor',omp(1:min(size(omp),10))
|
||||
!!$ ! Compute omega_int
|
||||
!!$ ommx = czero
|
||||
!!$ do i=1, ncol
|
||||
!!$ if (ilaggr(i) >0) then
|
||||
!!$ omi(i) = omp(ilaggr(i))
|
||||
!!$ else
|
||||
!!$ omi(i) = czero
|
||||
!!$ end if
|
||||
!!$ if(abs(omi(i)) .gt. abs(ommx)) ommx = omi(i)
|
||||
!!$ end do
|
||||
!!$ ! Compute omega_fine
|
||||
!!$ ! Going over the columns of atmp means going over the rows
|
||||
!!$ ! of A^T. Hopefully ;-)
|
||||
!!$ call atmp%cp_to(acsc)
|
||||
!!$
|
||||
!!$ do i=1, nrow
|
||||
!!$ omf(i) = ommx
|
||||
!!$ do j= acsc%icp(i),acsc%icp(i+1)-1
|
||||
!!$ if(abs(omi(acsc%ia(j))) .lt. abs(omf(i))) omf(i)=omi(acsc%ia(j))
|
||||
!!$ end do
|
||||
!!$ ! ! if(min(real(omf(i)),aimag(omf(i))) < szero) omf(i) = czero
|
||||
!!$ if(psb_minreal(omf(i)) < szero) omf(i) = czero
|
||||
!!$ end do
|
||||
!!$ omf(1:nrow) = omf(1:nrow)*adinv(1:nrow)
|
||||
!!$ call psb_halo(omf,desc_a,info)
|
||||
!!$ call acsc%free()
|
||||
!!$
|
||||
!!$
|
||||
!!$ call atmp%mv_to(acsr1)
|
||||
!!$
|
||||
!!$ do i=1,acsr1%get_nrows()
|
||||
!!$ do j=acsr1%irp(i),acsr1%irp(i+1)-1
|
||||
!!$ if (acsr1%ja(j) == i) then
|
||||
!!$ acsr1%val(j) = cone - acsr1%val(j)*omf(acsr1%ja(j))
|
||||
!!$ else
|
||||
!!$ acsr1%val(j) = - acsr1%val(j)*omf(acsr1%ja(j))
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ end do
|
||||
!!$ call atmp%mv_from(acsr1)
|
||||
!!$
|
||||
!!$ call rtilde%mv_to(tmpcoo)
|
||||
!!$ nzl = tmpcoo%get_nzeros()
|
||||
!!$ i=0
|
||||
!!$ do k=1, nzl
|
||||
!!$ if ((naggrm1 < tmpcoo%ia(k)) .and. (tmpcoo%ia(k) <= naggrp1)) then
|
||||
!!$ i = i+1
|
||||
!!$ tmpcoo%val(i) = tmpcoo%val(k)
|
||||
!!$ tmpcoo%ia(i) = tmpcoo%ia(k)
|
||||
!!$ tmpcoo%ja(i) = tmpcoo%ja(k)
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ call tmpcoo%set_nzeros(i)
|
||||
!!$ call rtilde%mv_from(tmpcoo)
|
||||
!!$ call rtilde%cscnv(info,type='csr')
|
||||
!!$
|
||||
!!$ call psb_spspmm(rtilde,atmp,op_restr,info)
|
||||
!!$
|
||||
!!$ !
|
||||
!!$ ! Now we have to gather the halo of op_prol, and add it to itself
|
||||
!!$ ! to multiply it by A,
|
||||
!!$ !
|
||||
!!$ call op_prol%clone(tmp_prol,info)
|
||||
!!$ if (info == psb_success_) call psb_sphalo(tmp_prol,desc_a,am4,info,&
|
||||
!!$ & colcnv=.false.,rowscale=.true.)
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,tmp_prol,info,b=am4)
|
||||
!!$ if (info == psb_success_) call am4%free()
|
||||
!!$
|
||||
!!$ if(info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,name,a_err='Halo of op_prol')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ !
|
||||
!!$ ! Now we have to fix this. The only rows of B that are correct
|
||||
!!$ ! are those corresponding to "local" aggregates, i.e. indices in ilaggr(:)
|
||||
!!$ !
|
||||
!!$ call op_restr%mv_to(tmpcoo)
|
||||
!!$
|
||||
!!$ nzl = tmpcoo%get_nzeros()
|
||||
!!$ i=0
|
||||
!!$ do k=1, nzl
|
||||
!!$ if ((naggrm1 < tmpcoo%ia(k)) .and. (tmpcoo%ia(k) <= naggrp1)) then
|
||||
!!$ i = i+1
|
||||
!!$ tmpcoo%val(i) = tmpcoo%val(k)
|
||||
!!$ tmpcoo%ia(i) = tmpcoo%ia(k)
|
||||
!!$ tmpcoo%ja(i) = tmpcoo%ja(k)
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ call tmpcoo%set_nzeros(i)
|
||||
!!$ call op_restr%mv_from(tmpcoo)
|
||||
!!$ call op_restr%cscnv(info,type='csr')
|
||||
!!$
|
||||
!!$
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'starting sphalo/ rwxtd'
|
||||
!!$
|
||||
!!$ call psb_spspmm(la,tmp_prol,am3,info)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done SPSPMM 2'
|
||||
!!$
|
||||
!!$ call psb_sphalo(am3,desc_a,am4,info,&
|
||||
!!$ & colcnv=.false.,rowscale=.true.)
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,am3,info,b=am4)
|
||||
!!$ if (info == psb_success_) call am4%free()
|
||||
!!$
|
||||
!!$ if(info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,name,&
|
||||
!!$ & a_err='Extend am3')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done sphalo/ rwxtd'
|
||||
!!$
|
||||
!!$ call psb_spspmm(op_restr,am3,ac,info)
|
||||
!!$ if (info == psb_success_) call am3%free()
|
||||
!!$ if (info == psb_success_) call ac%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,name,&
|
||||
!!$ &a_err='Build ac = op_restr x am3')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ subroutine amg_caggrmat_smth_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_cspmat_type), intent(out) :: op_prol,ac,op_restr
|
||||
type(psb_cspmat_type), intent(inout) :: op_prol,ac,op_restr
|
||||
type(psb_lcspmat_type), intent(inout) :: t_prol
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -83,8 +83,8 @@ subroutine amg_d_dec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
class(amg_d_dec_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(amg_daggr_data), intent(in) :: ag_data
|
||||
type(psb_dspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_dspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_ldspmat_type), intent(out) :: t_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -48,7 +48,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
use amg_base_prec_type
|
||||
use amg_d_inner_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_build_tprol
|
||||
#endif
|
||||
@@ -58,7 +58,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(amg_daggr_data), intent(in) :: ag_data
|
||||
type(psb_dspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_ldspmat_type), intent(out) :: t_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
@@ -68,7 +68,8 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
real(psb_dpk_), allocatable :: tmpw(:), tmpwnxt(:)
|
||||
integer(psb_lpk_), allocatable :: ixaggr(:), nxaggr(:), tlaggr(:), ivr(:)
|
||||
type(psb_dspmat_type) :: a_tmp
|
||||
integer(c_int) :: match_algorithm, n_sweeps, max_csize, max_nlevels
|
||||
integer(psb_ipk_) :: match_algorithm, n_sweeps
|
||||
integer(psb_lpk_) :: target_csize
|
||||
character(len=40) :: name, ch_err
|
||||
character(len=80) :: fname, prefix_
|
||||
type(psb_ctxt_type) :: ictxt
|
||||
@@ -128,27 +129,22 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
write(debug_unit, *) 'Warning: AGGR_SIZE reset to value ',2**n_sweeps
|
||||
end if
|
||||
end if
|
||||
if (ag%max_csize > 0) then
|
||||
max_csize = ag%max_csize
|
||||
if (ag_data%target_coarse_size > 0) then
|
||||
target_csize = ag_data%target_coarse_size
|
||||
else
|
||||
max_csize = ag_data%min_coarse_size
|
||||
end if
|
||||
if (ag%max_nlevels > 0) then
|
||||
max_nlevels = ag%max_nlevels
|
||||
else
|
||||
max_nlevels = ag_data%max_levs
|
||||
target_csize = ag_data%min_coarse_size
|
||||
end if
|
||||
if (.true.) then
|
||||
block
|
||||
integer(psb_ipk_) :: ipv(2)
|
||||
ipv(1) = max_csize
|
||||
ipv(1) = target_csize
|
||||
ipv(2) = n_sweeps
|
||||
call psb_bcast(ictxt,ipv)
|
||||
max_csize = ipv(1)
|
||||
target_csize = ipv(1)
|
||||
n_sweeps = ipv(2)
|
||||
end block
|
||||
else
|
||||
call psb_bcast(ictxt,max_csize)
|
||||
call psb_bcast(ictxt,target_csize)
|
||||
call psb_bcast(ictxt,n_sweeps)
|
||||
end if
|
||||
if (n_sweeps /= ag%n_sweeps) then
|
||||
@@ -156,7 +152,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
end if
|
||||
!!$ if (me==0) write(0,*) 'Matching sweeps: ',n_sweeps
|
||||
n_sweeps = max(1,n_sweeps)
|
||||
if (debug) write(0,*) me,' Copies, with n_sweeps: ',n_sweeps,max_csize
|
||||
if (debug) write(0,*) me,' Copies, with n_sweeps: ',n_sweeps,target_csize
|
||||
if (ag%unsmoothed_hierarchy.and.allocated(ag%base_a)) then
|
||||
call ag%base_a%cp_to(acsr)
|
||||
if (ag%do_clean_zeros) call acsr%clean_zeros(info)
|
||||
@@ -242,7 +238,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
|
||||
if (debug) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'N_sweeps ',n_sweeps,nr,desc_acv(0)%is_ok(),max_csize
|
||||
if (me == 0) write(0,*) 'N_sweeps ',n_sweeps,nr,desc_acv(0)%is_ok(),target_csize
|
||||
end if
|
||||
|
||||
!
|
||||
@@ -264,7 +260,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
!
|
||||
if (debug) write(0,*) me,' Into matchbox_build_prol ',info
|
||||
if (do_timings) call psb_tic(idx_mboxp)
|
||||
call dmatchboxp_build_prol(tmpw,acv(i-1),desc_acv(i-1),ixaggr,nxaggr,tmp_prol,info,&
|
||||
call amg_d_matchboxp_build_prol(tmpw,acv(i-1),desc_acv(i-1),ixaggr,nxaggr,tmp_prol,info,&
|
||||
& symmetrize=ag%need_symmetrize,reproducible=ag%reproducible_matching)
|
||||
if (do_timings) call psb_toc(idx_mboxp)
|
||||
if (debug) write(0,*) me,' Out from matchbox_build_prol ',info
|
||||
@@ -300,11 +296,11 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
|
||||
if (debug) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me==0) write(0,*) me,trim(name),' Done mat_asb:',i,sum(nxaggr),max_csize,info
|
||||
if (me==0) write(0,*) me,trim(name),' Done mat_asb:',i,sum(nxaggr),target_csize,info
|
||||
csz = sum(nxaggr)
|
||||
call psb_bcast(ictxt,csz)
|
||||
if (csz /= sum(nxaggr)) write(0,*) me,trim(name),' Mismatch matasb',&
|
||||
& csz,sum(nxaggr),max_csize
|
||||
& csz,sum(nxaggr),target_csize
|
||||
end if
|
||||
if (psb_errstatus_fatal()) write(0,*)me,trim(name),'Error fatal on entry to tmpwnxt 2'
|
||||
|
||||
@@ -342,10 +338,10 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
call move_alloc(tmpwnxt,tmpw)
|
||||
if (debug) then
|
||||
if (csz /= sum(nlaggr)) write(0,*) me,trim(name),' Mismatch 2 matasb',&
|
||||
& csz,sum(nlaggr),max_csize, info
|
||||
& csz,sum(nlaggr),target_csize, info
|
||||
end if
|
||||
call acv(i-1)%free()
|
||||
if ((sum(nlaggr) <= max_csize).or.(any(nlaggr==0))) then
|
||||
if ((sum(nlaggr) <= target_csize).or.(any(nlaggr==0))) then
|
||||
x_sweeps = i
|
||||
exit sweeps_loop
|
||||
end if
|
||||
|
||||
@@ -122,7 +122,7 @@ subroutine amg_d_parmatch_smth_bld(ag,a,desc_a,ilaggr,nlaggr,parms,&
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
type(psb_dspmat_type), intent(out) :: op_prol,ac,op_restr
|
||||
type(psb_dspmat_type), intent(inout) :: op_prol,ac,op_restr
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ subroutine amg_d_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
|
||||
! Arguments
|
||||
type(psb_dspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
|
||||
@@ -108,11 +108,11 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
|
||||
|
||||
! Arguments
|
||||
type(psb_d_csr_sparse_mat), intent(inout) :: a_csr
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
type(psb_dspmat_type), intent(out) :: ac, op_prol, op_restr
|
||||
type(psb_dspmat_type), intent(inout) :: ac, op_prol, op_restr
|
||||
type(psb_desc_type), intent(out) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ subroutine amg_d_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
|
||||
! Arguments
|
||||
type(psb_dspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
|
||||
@@ -86,8 +86,8 @@ subroutine amg_d_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
class(amg_d_symdec_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(amg_daggr_data), intent(in) :: ag_data
|
||||
type(psb_dspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_dspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_ldspmat_type), intent(out) :: op_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
!
|
||||
!
|
||||
subroutine amg_daggrmat_minnrg_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
& ac,desc_ac,op_prol,op_restr,info)
|
||||
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
use amg_d_inner_mod, amg_protect_name => amg_daggrmat_minnrg_bld
|
||||
@@ -117,8 +117,8 @@ subroutine amg_daggrmat_minnrg_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_ldspmat_type), intent(inout) :: op_prol
|
||||
type(psb_ldspmat_type), intent(out) :: ac,op_restr
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
type(psb_dspmat_type), intent(inout) :: op_prol, ac,op_restr
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -171,6 +171,8 @@ subroutine amg_daggrmat_minnrg_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
|
||||
filter_mat = (parms%aggr_filter == amg_filter_mat_)
|
||||
|
||||
!NEEDS TO BE REWORKED !!
|
||||
|
||||
! naggr: number of local aggregates
|
||||
! nrow: local rows.
|
||||
!
|
||||
@@ -183,361 +185,361 @@ subroutine amg_daggrmat_minnrg_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
! Get the diagonal D
|
||||
adiag = a%get_diag(info)
|
||||
if (info == psb_success_) &
|
||||
& call psb_realloc(ncol,adiag,info)
|
||||
if (info == psb_success_) &
|
||||
& call psb_halo(adiag,desc_a,info)
|
||||
if (info == psb_success_) call a%cp_to_l(la)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_getdiag')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
do i=1,size(adiag)
|
||||
if (adiag(i) /= dzero) then
|
||||
adinv(i) = done / adiag(i)
|
||||
else
|
||||
adinv(i) = done
|
||||
end if
|
||||
end do
|
||||
|
||||
|
||||
|
||||
! 1. Allocate Ptilde in sparse matrix form
|
||||
call op_prol%mv_to(tmpcoo)
|
||||
call ptilde%mv_from(tmpcoo)
|
||||
call ptilde%cscnv(info,type='csr')
|
||||
|
||||
if (info == psb_success_) call la%cscnv(am3,info,type='csr',dupl=psb_dupl_add_)
|
||||
if (info == psb_success_) call la%cscnv(da,info,type='csr',dupl=psb_dupl_add_)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='spcnv')
|
||||
goto 9999
|
||||
end if
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& ' Initial copies done.'
|
||||
|
||||
call da%scal(adinv,info)
|
||||
|
||||
call psb_spspmm(da,ptilde,dap,info)
|
||||
|
||||
if(info /= psb_success_) then
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='spspmm 1')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call dap%clone(atmp,info)
|
||||
|
||||
call psb_sphalo(atmp,desc_a,am4,info,&
|
||||
& colcnv=.false.,rowscale=.true.,outfmt='CSR ')
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=am4)
|
||||
if (info == psb_success_) call am4%free()
|
||||
|
||||
call psb_spspmm(da,atmp,dadap,info)
|
||||
call atmp%free()
|
||||
|
||||
! !$ write(0,*) 'Columns of AP',psb_sp_get_ncols(ap)
|
||||
! !$ write(0,*) 'Columns of ADAP',psb_sp_get_ncols(adap)
|
||||
call dap%mv_to(csc_dap)
|
||||
call dadap%mv_to(csc_dadap)
|
||||
|
||||
call csc_mat_col_prod(csc_dap,csc_dadap,omp,info)
|
||||
call csc_mat_col_prod(csc_dadap,csc_dadap,oden,info)
|
||||
call psb_sum(ctxt,omp)
|
||||
call psb_sum(ctxt,oden)
|
||||
! !$ write(0,*) trim(name),' OMP :',omp
|
||||
! !$ write(0,*) trim(name),' ODEN:',oden
|
||||
|
||||
omp = omp/oden
|
||||
|
||||
! !$ write(0,*) 'Check on output prolongator ',omp(1:min(size(omp),10))
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done NUMBMM 1'
|
||||
|
||||
call am3%mv_to(acsr3)
|
||||
! Compute omega_int
|
||||
ommx = dzero
|
||||
do i=1, ncol
|
||||
if (ilaggr(i) >0) then
|
||||
omi(i) = omp(ilaggr(i))
|
||||
else
|
||||
omi(i) = dzero
|
||||
end if
|
||||
if(abs(omi(i)) .gt. abs(ommx)) ommx = omi(i)
|
||||
end do
|
||||
! Compute omega_fine
|
||||
do i=1, nrow
|
||||
omf(i) = ommx
|
||||
do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
||||
if(abs(omi(acsr3%ja(j))) .lt. abs(omf(i))) omf(i)=omi(acsr3%ja(j))
|
||||
end do
|
||||
!!$ if(min(real(omf(i)),aimag(omf(i))) < dzero) omf(i) = dzero
|
||||
if(psb_minreal(omf(i)) < dzero) omf(i) = dzero
|
||||
end do
|
||||
|
||||
omf(1:nrow) = omf(1:nrow) * adinv(1:nrow)
|
||||
|
||||
if (filter_mat) then
|
||||
!
|
||||
! Build the filtered matrix Af from A
|
||||
!
|
||||
call la%cscnv(acsrf,info,dupl=psb_dupl_add_)
|
||||
|
||||
do i=1,nrow
|
||||
tmp = dzero
|
||||
jd = -1
|
||||
do j=acsrf%irp(i),acsrf%irp(i+1)-1
|
||||
if (acsrf%ja(j) == i) jd = j
|
||||
if (abs(acsrf%val(j)) < theta*sqrt(abs(adiag(i)*adiag(acsrf%ja(j))))) then
|
||||
tmp=tmp+acsrf%val(j)
|
||||
acsrf%val(j)=dzero
|
||||
endif
|
||||
enddo
|
||||
if (jd == -1) then
|
||||
write(0,*) 'Wrong input: we need the diagonal!!!!', i
|
||||
else
|
||||
acsrf%val(jd)=acsrf%val(jd)-tmp
|
||||
end if
|
||||
enddo
|
||||
! Take out zeroed terms
|
||||
call acsrf%clean_zeros(info)
|
||||
|
||||
!
|
||||
! Build the smoothed prolongator using the filtered matrix
|
||||
!
|
||||
do i=1,acsrf%get_nrows()
|
||||
do j=acsrf%irp(i),acsrf%irp(i+1)-1
|
||||
if (acsrf%ja(j) == i) then
|
||||
acsrf%val(j) = done - omf(i)*acsrf%val(j)
|
||||
else
|
||||
acsrf%val(j) = - omf(i)*acsrf%val(j)
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done gather, going for SYMBMM 1'
|
||||
|
||||
call af%mv_from(acsrf)
|
||||
!
|
||||
! op_prol = (I-w*D*Af)Ptilde
|
||||
! Doing it this way means to consider diag(Af_i)
|
||||
!
|
||||
!
|
||||
call psb_spspmm(af,ptilde,op_prol,info)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done SPSPMM 1'
|
||||
else
|
||||
!
|
||||
! Build the smoothed prolongator using the original matrix
|
||||
!
|
||||
do i=1,acsr3%get_nrows()
|
||||
do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
||||
if (acsr3%ja(j) == i) then
|
||||
acsr3%val(j) = done - omf(i)*acsr3%val(j)
|
||||
else
|
||||
acsr3%val(j) = - omf(i)*acsr3%val(j)
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
|
||||
call am3%mv_from(acsr3)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done gather, going for SYMBMM 1'
|
||||
!
|
||||
!
|
||||
! op_prol = (I-w*D*A)Ptilde
|
||||
!
|
||||
!
|
||||
call psb_spspmm(am3,ptilde,op_prol,info)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done NUMBMM 1'
|
||||
|
||||
end if
|
||||
|
||||
|
||||
!
|
||||
! Ok, let's start over with the restrictor
|
||||
!
|
||||
call ptilde%transc(rtilde)
|
||||
call la%cscnv(atmp,info,type='csr')
|
||||
call psb_sphalo(atmp,desc_a,am4,info,&
|
||||
& colcnv=.true.,rowscale=.true.)
|
||||
nrt = am4%get_nrows()
|
||||
call am4%csclip(atmp2,info,lone,nrt,lone,ncol)
|
||||
call atmp2%cscnv(info,type='CSR')
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=atmp2)
|
||||
call am4%free()
|
||||
call atmp2%free()
|
||||
|
||||
! This is to compute the transpose. It ONLY works if the
|
||||
! original A has a symmetric pattern.
|
||||
call atmp%transc(atmp2)
|
||||
call atmp2%csclip(dat,info,lone,nrow,lone,ncol)
|
||||
call dat%cscnv(info,type='csr')
|
||||
call dat%scal(adinv,info)
|
||||
|
||||
! Now for the product.
|
||||
call psb_spspmm(dat,ptilde,datp,info)
|
||||
|
||||
call datp%clone(atmp2,info)
|
||||
call psb_sphalo(atmp2,desc_a,am4,info,&
|
||||
& colcnv=.false.,rowscale=.true.,outfmt='CSR ')
|
||||
if (info == psb_success_) call psb_rwextd(ncol,atmp2,info,b=am4)
|
||||
if (info == psb_success_) call am4%free()
|
||||
|
||||
|
||||
call psb_symbmm(dat,atmp2,datdatp,info)
|
||||
call psb_numbmm(dat,atmp2,datdatp)
|
||||
call atmp2%free()
|
||||
|
||||
call datp%mv_to(csc_datp)
|
||||
call datdatp%mv_to(csc_datdatp)
|
||||
|
||||
call csc_mat_col_prod(csc_datp,csc_datdatp,omp,info)
|
||||
call csc_mat_col_prod(csc_datdatp,csc_datdatp,oden,info)
|
||||
call psb_sum(ctxt,omp)
|
||||
call psb_sum(ctxt,oden)
|
||||
|
||||
|
||||
! !$ write(debug_unit,*) trim(name),' OMP_R :',omp
|
||||
! ! $ write(debug_unit,*) trim(name),' ODEN_R:',oden
|
||||
omp = omp/oden
|
||||
! !$ write(0,*) 'Check on output restrictor',omp(1:min(size(omp),10))
|
||||
! Compute omega_int
|
||||
ommx = dzero
|
||||
do i=1, ncol
|
||||
if (ilaggr(i) >0) then
|
||||
omi(i) = omp(ilaggr(i))
|
||||
else
|
||||
omi(i) = dzero
|
||||
end if
|
||||
if(abs(omi(i)) .gt. abs(ommx)) ommx = omi(i)
|
||||
end do
|
||||
! Compute omega_fine
|
||||
! Going over the columns of atmp means going over the rows
|
||||
! of A^T. Hopefully ;-)
|
||||
call atmp%cp_to(acsc)
|
||||
|
||||
do i=1, nrow
|
||||
omf(i) = ommx
|
||||
do j= acsc%icp(i),acsc%icp(i+1)-1
|
||||
if(abs(omi(acsc%ia(j))) .lt. abs(omf(i))) omf(i)=omi(acsc%ia(j))
|
||||
end do
|
||||
!!$ if(min(real(omf(i)),aimag(omf(i))) < dzero) omf(i) = dzero
|
||||
if(psb_minreal(omf(i)) < dzero) omf(i) = dzero
|
||||
end do
|
||||
omf(1:nrow) = omf(1:nrow)*adinv(1:nrow)
|
||||
call psb_halo(omf,desc_a,info)
|
||||
call acsc%free()
|
||||
|
||||
|
||||
call atmp%mv_to(acsr1)
|
||||
|
||||
do i=1,acsr1%get_nrows()
|
||||
do j=acsr1%irp(i),acsr1%irp(i+1)-1
|
||||
if (acsr1%ja(j) == i) then
|
||||
acsr1%val(j) = done - acsr1%val(j)*omf(acsr1%ja(j))
|
||||
else
|
||||
acsr1%val(j) = - acsr1%val(j)*omf(acsr1%ja(j))
|
||||
end if
|
||||
end do
|
||||
end do
|
||||
call atmp%mv_from(acsr1)
|
||||
|
||||
call rtilde%mv_to(tmpcoo)
|
||||
nzl = tmpcoo%get_nzeros()
|
||||
i=0
|
||||
do k=1, nzl
|
||||
if ((naggrm1 < tmpcoo%ia(k)) .and. (tmpcoo%ia(k) <= naggrp1)) then
|
||||
i = i+1
|
||||
tmpcoo%val(i) = tmpcoo%val(k)
|
||||
tmpcoo%ia(i) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(i) = tmpcoo%ja(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(i)
|
||||
call rtilde%mv_from(tmpcoo)
|
||||
call rtilde%cscnv(info,type='csr')
|
||||
|
||||
call psb_spspmm(rtilde,atmp,op_restr,info)
|
||||
|
||||
!
|
||||
! Now we have to gather the halo of op_prol, and add it to itself
|
||||
! to multiply it by A,
|
||||
!
|
||||
call op_prol%clone(tmp_prol,info)
|
||||
if (info == psb_success_) call psb_sphalo(tmp_prol,desc_a,am4,info,&
|
||||
& colcnv=.false.,rowscale=.true.)
|
||||
if (info == psb_success_) call psb_rwextd(ncol,tmp_prol,info,b=am4)
|
||||
if (info == psb_success_) call am4%free()
|
||||
|
||||
if(info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,name,a_err='Halo of op_prol')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
!
|
||||
! Now we have to fix this. The only rows of B that are correct
|
||||
! are those corresponding to "local" aggregates, i.e. indices in ilaggr(:)
|
||||
!
|
||||
call op_restr%mv_to(tmpcoo)
|
||||
|
||||
nzl = tmpcoo%get_nzeros()
|
||||
i=0
|
||||
do k=1, nzl
|
||||
if ((naggrm1 < tmpcoo%ia(k)) .and. (tmpcoo%ia(k) <= naggrp1)) then
|
||||
i = i+1
|
||||
tmpcoo%val(i) = tmpcoo%val(k)
|
||||
tmpcoo%ia(i) = tmpcoo%ia(k)
|
||||
tmpcoo%ja(i) = tmpcoo%ja(k)
|
||||
end if
|
||||
end do
|
||||
call tmpcoo%set_nzeros(i)
|
||||
call op_restr%mv_from(tmpcoo)
|
||||
call op_restr%cscnv(info,type='csr')
|
||||
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'starting sphalo/ rwxtd'
|
||||
|
||||
call psb_spspmm(la,tmp_prol,am3,info)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done SPSPMM 2'
|
||||
|
||||
call psb_sphalo(am3,desc_a,am4,info,&
|
||||
& colcnv=.false.,rowscale=.true.)
|
||||
if (info == psb_success_) call psb_rwextd(ncol,am3,info,b=am4)
|
||||
if (info == psb_success_) call am4%free()
|
||||
|
||||
if(info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,name,&
|
||||
& a_err='Extend am3')
|
||||
goto 9999
|
||||
end if
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done sphalo/ rwxtd'
|
||||
|
||||
call psb_spspmm(op_restr,am3,ac,info)
|
||||
if (info == psb_success_) call am3%free()
|
||||
if (info == psb_success_) call ac%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,name,&
|
||||
&a_err='Build ac = op_restr x am3')
|
||||
goto 9999
|
||||
end if
|
||||
!!$ ! Get the diagonal D
|
||||
!!$ adiag = a%get_diag(info)
|
||||
!!$ if (info == psb_success_) &
|
||||
!!$ & call psb_realloc(ncol,adiag,info)
|
||||
!!$ if (info == psb_success_) &
|
||||
!!$ & call psb_halo(adiag,desc_a,info)
|
||||
!!$ if (info == psb_success_) call a%cp_to_l(la)
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_getdiag')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ do i=1,size(adiag)
|
||||
!!$ if (adiag(i) /= dzero) then
|
||||
!!$ adinv(i) = done / adiag(i)
|
||||
!!$ else
|
||||
!!$ adinv(i) = done
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$
|
||||
!!$
|
||||
!!$
|
||||
!!$ ! 1. Allocate Ptilde in sparse matrix form
|
||||
!!$ call op_prol%mv_to(tmpcoo)
|
||||
!!$ call ptilde%mv_from(tmpcoo)
|
||||
!!$ call ptilde%cscnv(info,type='csr')
|
||||
!!$
|
||||
!!$ if (info == psb_success_) call la%cscnv(am3,info,type='csr',dupl=psb_dupl_add_)
|
||||
!!$ if (info == psb_success_) call la%cscnv(da,info,type='csr',dupl=psb_dupl_add_)
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_from_subroutine_,name,a_err='spcnv')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & ' Initial copies done.'
|
||||
!!$
|
||||
!!$ call da%scal(adinv,info)
|
||||
!!$
|
||||
!!$ call psb_spspmm(da,ptilde,dap,info)
|
||||
!!$
|
||||
!!$ if(info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_from_subroutine_,name,a_err='spspmm 1')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ call dap%clone(atmp,info)
|
||||
!!$
|
||||
!!$ call psb_sphalo(atmp,desc_a,am4,info,&
|
||||
!!$ & colcnv=.false.,rowscale=.true.,outfmt='CSR ')
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=am4)
|
||||
!!$ if (info == psb_success_) call am4%free()
|
||||
!!$
|
||||
!!$ call psb_spspmm(da,atmp,dadap,info)
|
||||
!!$ call atmp%free()
|
||||
!!$
|
||||
!!$ ! !$ write(0,*) 'Columns of AP',psb_sp_get_ncols(ap)
|
||||
!!$ ! !$ write(0,*) 'Columns of ADAP',psb_sp_get_ncols(adap)
|
||||
!!$ call dap%mv_to(csc_dap)
|
||||
!!$ call dadap%mv_to(csc_dadap)
|
||||
!!$
|
||||
!!$ call csc_mat_col_prod(csc_dap,csc_dadap,omp,info)
|
||||
!!$ call csc_mat_col_prod(csc_dadap,csc_dadap,oden,info)
|
||||
!!$ call psb_sum(ctxt,omp)
|
||||
!!$ call psb_sum(ctxt,oden)
|
||||
!!$ ! !$ write(0,*) trim(name),' OMP :',omp
|
||||
!!$ ! !$ write(0,*) trim(name),' ODEN:',oden
|
||||
!!$
|
||||
!!$ omp = omp/oden
|
||||
!!$
|
||||
!!$ ! !$ write(0,*) 'Check on output prolongator ',omp(1:min(size(omp),10))
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done NUMBMM 1'
|
||||
!!$
|
||||
!!$ call am3%mv_to(acsr3)
|
||||
!!$ ! Compute omega_int
|
||||
!!$ ommx = dzero
|
||||
!!$ do i=1, ncol
|
||||
!!$ if (ilaggr(i) >0) then
|
||||
!!$ omi(i) = omp(ilaggr(i))
|
||||
!!$ else
|
||||
!!$ omi(i) = dzero
|
||||
!!$ end if
|
||||
!!$ if(abs(omi(i)) .gt. abs(ommx)) ommx = omi(i)
|
||||
!!$ end do
|
||||
!!$ ! Compute omega_fine
|
||||
!!$ do i=1, nrow
|
||||
!!$ omf(i) = ommx
|
||||
!!$ do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
||||
!!$ if(abs(omi(acsr3%ja(j))) .lt. abs(omf(i))) omf(i)=omi(acsr3%ja(j))
|
||||
!!$ end do
|
||||
!!$ ! ! if(min(real(omf(i)),aimag(omf(i))) < dzero) omf(i) = dzero
|
||||
!!$ if(psb_minreal(omf(i)) < dzero) omf(i) = dzero
|
||||
!!$ end do
|
||||
!!$
|
||||
!!$ omf(1:nrow) = omf(1:nrow) * adinv(1:nrow)
|
||||
!!$
|
||||
!!$ if (filter_mat) then
|
||||
!!$ !
|
||||
!!$ ! Build the filtered matrix Af from A
|
||||
!!$ !
|
||||
!!$ call la%cscnv(acsrf,info,dupl=psb_dupl_add_)
|
||||
!!$
|
||||
!!$ do i=1,nrow
|
||||
!!$ tmp = dzero
|
||||
!!$ jd = -1
|
||||
!!$ do j=acsrf%irp(i),acsrf%irp(i+1)-1
|
||||
!!$ if (acsrf%ja(j) == i) jd = j
|
||||
!!$ if (abs(acsrf%val(j)) < theta*sqrt(abs(adiag(i)*adiag(acsrf%ja(j))))) then
|
||||
!!$ tmp=tmp+acsrf%val(j)
|
||||
!!$ acsrf%val(j)=dzero
|
||||
!!$ endif
|
||||
!!$ enddo
|
||||
!!$ if (jd == -1) then
|
||||
!!$ write(0,*) 'Wrong input: we need the diagonal!!!!', i
|
||||
!!$ else
|
||||
!!$ acsrf%val(jd)=acsrf%val(jd)-tmp
|
||||
!!$ end if
|
||||
!!$ enddo
|
||||
!!$ ! Take out zeroed terms
|
||||
!!$ call acsrf%clean_zeros(info)
|
||||
!!$
|
||||
!!$ !
|
||||
!!$ ! Build the smoothed prolongator using the filtered matrix
|
||||
!!$ !
|
||||
!!$ do i=1,acsrf%get_nrows()
|
||||
!!$ do j=acsrf%irp(i),acsrf%irp(i+1)-1
|
||||
!!$ if (acsrf%ja(j) == i) then
|
||||
!!$ acsrf%val(j) = done - omf(i)*acsrf%val(j)
|
||||
!!$ else
|
||||
!!$ acsrf%val(j) = - omf(i)*acsrf%val(j)
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ end do
|
||||
!!$
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done gather, going for SYMBMM 1'
|
||||
!!$
|
||||
!!$ call af%mv_from(acsrf)
|
||||
!!$ !
|
||||
!!$ ! op_prol = (I-w*D*Af)Ptilde
|
||||
!!$ ! Doing it this way means to consider diag(Af_i)
|
||||
!!$ !
|
||||
!!$ !
|
||||
!!$ call psb_spspmm(af,ptilde,op_prol,info)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done SPSPMM 1'
|
||||
!!$ else
|
||||
!!$ !
|
||||
!!$ ! Build the smoothed prolongator using the original matrix
|
||||
!!$ !
|
||||
!!$ do i=1,acsr3%get_nrows()
|
||||
!!$ do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
||||
!!$ if (acsr3%ja(j) == i) then
|
||||
!!$ acsr3%val(j) = done - omf(i)*acsr3%val(j)
|
||||
!!$ else
|
||||
!!$ acsr3%val(j) = - omf(i)*acsr3%val(j)
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ end do
|
||||
!!$
|
||||
!!$ call am3%mv_from(acsr3)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done gather, going for SYMBMM 1'
|
||||
!!$ !
|
||||
!!$ !
|
||||
!!$ ! op_prol = (I-w*D*A)Ptilde
|
||||
!!$ !
|
||||
!!$ !
|
||||
!!$ call psb_spspmm(am3,ptilde,op_prol,info)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done NUMBMM 1'
|
||||
!!$
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$
|
||||
!!$ !
|
||||
!!$ ! Ok, let's start over with the restrictor
|
||||
!!$ !
|
||||
!!$ call ptilde%transc(rtilde)
|
||||
!!$ call la%cscnv(atmp,info,type='csr')
|
||||
!!$ call psb_sphalo(atmp,desc_a,am4,info,&
|
||||
!!$ & colcnv=.true.,rowscale=.true.)
|
||||
!!$ nrt = am4%get_nrows()
|
||||
!!$ call am4%csclip(atmp2,info,lone,nrt,lone,ncol)
|
||||
!!$ call atmp2%cscnv(info,type='CSR')
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,atmp,info,b=atmp2)
|
||||
!!$ call am4%free()
|
||||
!!$ call atmp2%free()
|
||||
!!$
|
||||
!!$ ! This is to compute the transpose. It ONLY works if the
|
||||
!!$ ! original A has a symmetric pattern.
|
||||
!!$ call atmp%transc(atmp2)
|
||||
!!$ call atmp2%csclip(dat,info,lone,nrow,lone,ncol)
|
||||
!!$ call dat%cscnv(info,type='csr')
|
||||
!!$ call dat%scal(adinv,info)
|
||||
!!$
|
||||
!!$ ! Now for the product.
|
||||
!!$ call psb_spspmm(dat,ptilde,datp,info)
|
||||
!!$
|
||||
!!$ call datp%clone(atmp2,info)
|
||||
!!$ call psb_sphalo(atmp2,desc_a,am4,info,&
|
||||
!!$ & colcnv=.false.,rowscale=.true.,outfmt='CSR ')
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,atmp2,info,b=am4)
|
||||
!!$ if (info == psb_success_) call am4%free()
|
||||
!!$
|
||||
!!$
|
||||
!!$ call psb_symbmm(dat,atmp2,datdatp,info)
|
||||
!!$ call psb_numbmm(dat,atmp2,datdatp)
|
||||
!!$ call atmp2%free()
|
||||
!!$
|
||||
!!$ call datp%mv_to(csc_datp)
|
||||
!!$ call datdatp%mv_to(csc_datdatp)
|
||||
!!$
|
||||
!!$ call csc_mat_col_prod(csc_datp,csc_datdatp,omp,info)
|
||||
!!$ call csc_mat_col_prod(csc_datdatp,csc_datdatp,oden,info)
|
||||
!!$ call psb_sum(ctxt,omp)
|
||||
!!$ call psb_sum(ctxt,oden)
|
||||
!!$
|
||||
!!$
|
||||
!!$ ! !$ write(debug_unit,*) trim(name),' OMP_R :',omp
|
||||
!!$ ! ! $ write(debug_unit,*) trim(name),' ODEN_R:',oden
|
||||
!!$ omp = omp/oden
|
||||
!!$ ! !$ write(0,*) 'Check on output restrictor',omp(1:min(size(omp),10))
|
||||
!!$ ! Compute omega_int
|
||||
!!$ ommx = dzero
|
||||
!!$ do i=1, ncol
|
||||
!!$ if (ilaggr(i) >0) then
|
||||
!!$ omi(i) = omp(ilaggr(i))
|
||||
!!$ else
|
||||
!!$ omi(i) = dzero
|
||||
!!$ end if
|
||||
!!$ if(abs(omi(i)) .gt. abs(ommx)) ommx = omi(i)
|
||||
!!$ end do
|
||||
!!$ ! Compute omega_fine
|
||||
!!$ ! Going over the columns of atmp means going over the rows
|
||||
!!$ ! of A^T. Hopefully ;-)
|
||||
!!$ call atmp%cp_to(acsc)
|
||||
!!$
|
||||
!!$ do i=1, nrow
|
||||
!!$ omf(i) = ommx
|
||||
!!$ do j= acsc%icp(i),acsc%icp(i+1)-1
|
||||
!!$ if(abs(omi(acsc%ia(j))) .lt. abs(omf(i))) omf(i)=omi(acsc%ia(j))
|
||||
!!$ end do
|
||||
!!$ ! ! if(min(real(omf(i)),aimag(omf(i))) < dzero) omf(i) = dzero
|
||||
!!$ if(psb_minreal(omf(i)) < dzero) omf(i) = dzero
|
||||
!!$ end do
|
||||
!!$ omf(1:nrow) = omf(1:nrow)*adinv(1:nrow)
|
||||
!!$ call psb_halo(omf,desc_a,info)
|
||||
!!$ call acsc%free()
|
||||
!!$
|
||||
!!$
|
||||
!!$ call atmp%mv_to(acsr1)
|
||||
!!$
|
||||
!!$ do i=1,acsr1%get_nrows()
|
||||
!!$ do j=acsr1%irp(i),acsr1%irp(i+1)-1
|
||||
!!$ if (acsr1%ja(j) == i) then
|
||||
!!$ acsr1%val(j) = done - acsr1%val(j)*omf(acsr1%ja(j))
|
||||
!!$ else
|
||||
!!$ acsr1%val(j) = - acsr1%val(j)*omf(acsr1%ja(j))
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ end do
|
||||
!!$ call atmp%mv_from(acsr1)
|
||||
!!$
|
||||
!!$ call rtilde%mv_to(tmpcoo)
|
||||
!!$ nzl = tmpcoo%get_nzeros()
|
||||
!!$ i=0
|
||||
!!$ do k=1, nzl
|
||||
!!$ if ((naggrm1 < tmpcoo%ia(k)) .and. (tmpcoo%ia(k) <= naggrp1)) then
|
||||
!!$ i = i+1
|
||||
!!$ tmpcoo%val(i) = tmpcoo%val(k)
|
||||
!!$ tmpcoo%ia(i) = tmpcoo%ia(k)
|
||||
!!$ tmpcoo%ja(i) = tmpcoo%ja(k)
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ call tmpcoo%set_nzeros(i)
|
||||
!!$ call rtilde%mv_from(tmpcoo)
|
||||
!!$ call rtilde%cscnv(info,type='csr')
|
||||
!!$
|
||||
!!$ call psb_spspmm(rtilde,atmp,op_restr,info)
|
||||
!!$
|
||||
!!$ !
|
||||
!!$ ! Now we have to gather the halo of op_prol, and add it to itself
|
||||
!!$ ! to multiply it by A,
|
||||
!!$ !
|
||||
!!$ call op_prol%clone(tmp_prol,info)
|
||||
!!$ if (info == psb_success_) call psb_sphalo(tmp_prol,desc_a,am4,info,&
|
||||
!!$ & colcnv=.false.,rowscale=.true.)
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,tmp_prol,info,b=am4)
|
||||
!!$ if (info == psb_success_) call am4%free()
|
||||
!!$
|
||||
!!$ if(info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,name,a_err='Halo of op_prol')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ !
|
||||
!!$ ! Now we have to fix this. The only rows of B that are correct
|
||||
!!$ ! are those corresponding to "local" aggregates, i.e. indices in ilaggr(:)
|
||||
!!$ !
|
||||
!!$ call op_restr%mv_to(tmpcoo)
|
||||
!!$
|
||||
!!$ nzl = tmpcoo%get_nzeros()
|
||||
!!$ i=0
|
||||
!!$ do k=1, nzl
|
||||
!!$ if ((naggrm1 < tmpcoo%ia(k)) .and. (tmpcoo%ia(k) <= naggrp1)) then
|
||||
!!$ i = i+1
|
||||
!!$ tmpcoo%val(i) = tmpcoo%val(k)
|
||||
!!$ tmpcoo%ia(i) = tmpcoo%ia(k)
|
||||
!!$ tmpcoo%ja(i) = tmpcoo%ja(k)
|
||||
!!$ end if
|
||||
!!$ end do
|
||||
!!$ call tmpcoo%set_nzeros(i)
|
||||
!!$ call op_restr%mv_from(tmpcoo)
|
||||
!!$ call op_restr%cscnv(info,type='csr')
|
||||
!!$
|
||||
!!$
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'starting sphalo/ rwxtd'
|
||||
!!$
|
||||
!!$ call psb_spspmm(la,tmp_prol,am3,info)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done SPSPMM 2'
|
||||
!!$
|
||||
!!$ call psb_sphalo(am3,desc_a,am4,info,&
|
||||
!!$ & colcnv=.false.,rowscale=.true.)
|
||||
!!$ if (info == psb_success_) call psb_rwextd(ncol,am3,info,b=am4)
|
||||
!!$ if (info == psb_success_) call am4%free()
|
||||
!!$
|
||||
!!$ if(info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,name,&
|
||||
!!$ & a_err='Extend am3')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),&
|
||||
!!$ & 'Done sphalo/ rwxtd'
|
||||
!!$
|
||||
!!$ call psb_spspmm(op_restr,am3,ac,info)
|
||||
!!$ if (info == psb_success_) call am3%free()
|
||||
!!$ if (info == psb_success_) call ac%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,name,&
|
||||
!!$ &a_err='Build ac = op_restr x am3')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ subroutine amg_daggrmat_smth_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), intent(inout) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_dspmat_type), intent(out) :: op_prol,ac,op_restr
|
||||
type(psb_dspmat_type), intent(inout) :: op_prol,ac,op_restr
|
||||
type(psb_ldspmat_type), intent(inout) :: t_prol
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -83,8 +83,8 @@ subroutine amg_s_dec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
class(amg_s_dec_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(amg_saggr_data), intent(in) :: ag_data
|
||||
type(psb_sspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_sspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_lsspmat_type), intent(out) :: t_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -48,7 +48,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
use amg_base_prec_type
|
||||
use amg_s_inner_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_s_parmatch_aggregator_mod
|
||||
use amg_s_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_build_tprol
|
||||
#endif
|
||||
@@ -58,7 +58,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(amg_saggr_data), intent(in) :: ag_data
|
||||
type(psb_sspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_lsspmat_type), intent(out) :: t_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
@@ -68,7 +68,8 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
real(psb_spk_), allocatable :: tmpw(:), tmpwnxt(:)
|
||||
integer(psb_lpk_), allocatable :: ixaggr(:), nxaggr(:), tlaggr(:), ivr(:)
|
||||
type(psb_sspmat_type) :: a_tmp
|
||||
integer(c_int) :: match_algorithm, n_sweeps, max_csize, max_nlevels
|
||||
integer(psb_ipk_) :: match_algorithm, n_sweeps
|
||||
integer(psb_lpk_) :: target_csize
|
||||
character(len=40) :: name, ch_err
|
||||
character(len=80) :: fname, prefix_
|
||||
type(psb_ctxt_type) :: ictxt
|
||||
@@ -128,27 +129,22 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
write(debug_unit, *) 'Warning: AGGR_SIZE reset to value ',2**n_sweeps
|
||||
end if
|
||||
end if
|
||||
if (ag%max_csize > 0) then
|
||||
max_csize = ag%max_csize
|
||||
if (ag_data%target_coarse_size > 0) then
|
||||
target_csize = ag_data%target_coarse_size
|
||||
else
|
||||
max_csize = ag_data%min_coarse_size
|
||||
end if
|
||||
if (ag%max_nlevels > 0) then
|
||||
max_nlevels = ag%max_nlevels
|
||||
else
|
||||
max_nlevels = ag_data%max_levs
|
||||
target_csize = ag_data%min_coarse_size
|
||||
end if
|
||||
if (.true.) then
|
||||
block
|
||||
integer(psb_ipk_) :: ipv(2)
|
||||
ipv(1) = max_csize
|
||||
ipv(1) = target_csize
|
||||
ipv(2) = n_sweeps
|
||||
call psb_bcast(ictxt,ipv)
|
||||
max_csize = ipv(1)
|
||||
target_csize = ipv(1)
|
||||
n_sweeps = ipv(2)
|
||||
end block
|
||||
else
|
||||
call psb_bcast(ictxt,max_csize)
|
||||
call psb_bcast(ictxt,target_csize)
|
||||
call psb_bcast(ictxt,n_sweeps)
|
||||
end if
|
||||
if (n_sweeps /= ag%n_sweeps) then
|
||||
@@ -156,7 +152,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
end if
|
||||
!!$ if (me==0) write(0,*) 'Matching sweeps: ',n_sweeps
|
||||
n_sweeps = max(1,n_sweeps)
|
||||
if (debug) write(0,*) me,' Copies, with n_sweeps: ',n_sweeps,max_csize
|
||||
if (debug) write(0,*) me,' Copies, with n_sweeps: ',n_sweeps,target_csize
|
||||
if (ag%unsmoothed_hierarchy.and.allocated(ag%base_a)) then
|
||||
call ag%base_a%cp_to(acsr)
|
||||
if (ag%do_clean_zeros) call acsr%clean_zeros(info)
|
||||
@@ -242,7 +238,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
|
||||
if (debug) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*) 'N_sweeps ',n_sweeps,nr,desc_acv(0)%is_ok(),max_csize
|
||||
if (me == 0) write(0,*) 'N_sweeps ',n_sweeps,nr,desc_acv(0)%is_ok(),target_csize
|
||||
end if
|
||||
|
||||
!
|
||||
@@ -264,7 +260,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
!
|
||||
if (debug) write(0,*) me,' Into matchbox_build_prol ',info
|
||||
if (do_timings) call psb_tic(idx_mboxp)
|
||||
call smatchboxp_build_prol(tmpw,acv(i-1),desc_acv(i-1),ixaggr,nxaggr,tmp_prol,info,&
|
||||
call amg_s_matchboxp_build_prol(tmpw,acv(i-1),desc_acv(i-1),ixaggr,nxaggr,tmp_prol,info,&
|
||||
& symmetrize=ag%need_symmetrize,reproducible=ag%reproducible_matching)
|
||||
if (do_timings) call psb_toc(idx_mboxp)
|
||||
if (debug) write(0,*) me,' Out from matchbox_build_prol ',info
|
||||
@@ -300,11 +296,11 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
|
||||
if (debug) then
|
||||
call psb_barrier(ictxt)
|
||||
if (me==0) write(0,*) me,trim(name),' Done mat_asb:',i,sum(nxaggr),max_csize,info
|
||||
if (me==0) write(0,*) me,trim(name),' Done mat_asb:',i,sum(nxaggr),target_csize,info
|
||||
csz = sum(nxaggr)
|
||||
call psb_bcast(ictxt,csz)
|
||||
if (csz /= sum(nxaggr)) write(0,*) me,trim(name),' Mismatch matasb',&
|
||||
& csz,sum(nxaggr),max_csize
|
||||
& csz,sum(nxaggr),target_csize
|
||||
end if
|
||||
if (psb_errstatus_fatal()) write(0,*)me,trim(name),'Error fatal on entry to tmpwnxt 2'
|
||||
|
||||
@@ -342,10 +338,10 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
call move_alloc(tmpwnxt,tmpw)
|
||||
if (debug) then
|
||||
if (csz /= sum(nlaggr)) write(0,*) me,trim(name),' Mismatch 2 matasb',&
|
||||
& csz,sum(nlaggr),max_csize, info
|
||||
& csz,sum(nlaggr),target_csize, info
|
||||
end if
|
||||
call acv(i-1)%free()
|
||||
if ((sum(nlaggr) <= max_csize).or.(any(nlaggr==0))) then
|
||||
if ((sum(nlaggr) <= target_csize).or.(any(nlaggr==0))) then
|
||||
x_sweeps = i
|
||||
exit sweeps_loop
|
||||
end if
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user