Started review of internal documentation, long overdue.

stopcriterion
Salvatore Filippone 6 years ago
parent 8e732d41ad
commit 84c58cb290

@ -37,14 +37,7 @@
! !
! !
! The aggregator object hosts the aggregation method for building ! The aggregator object hosts the aggregation method for building
! the multilevel hierarchy. The basic version is the ! the multilevel hierarchy.
! decoupled aggregation algorithm presented in
!
! M. Brezina and P. Vanek, A black-box iterative solver based on a
! two-level Schwarz method, Computing, 63 (1999), 233-263.
! P. D'Ambra, D. di Serafino and S. Filippone, On the development of
! PSBLAS-based parallel two-level Schwarz preconditioners, Appl. Num. Math.
! 57 (2007), 1181-1196.
! !
module mld_c_base_aggregator_mod module mld_c_base_aggregator_mod
@ -54,44 +47,36 @@ module mld_c_base_aggregator_mod
& psb_ipk_, psb_long_int_k_, psb_desc_type, psb_i_base_vect_type, & & psb_ipk_, psb_long_int_k_, psb_desc_type, psb_i_base_vect_type, &
& psb_erractionsave, psb_error_handler, psb_success_ & psb_erractionsave, psb_error_handler, psb_success_
! !
! sm - class(mld_T_base_smoother_type), allocatable
! The current level preconditioner (aka smoother).
! parms - type(mld_RTml_parms)
! The parameters defining the multilevel strategy.
! ac - The local part of the current-level matrix, built by
! coarsening the previous-level matrix.
! desc_ac - type(psb_desc_type).
! The communication descriptor associated to the matrix
! stored in ac.
! base_a - type(psb_Tspmat_type), pointer.
! Pointer (really a pointer!) to the local part of the current
! matrix (so we have a unified treatment of residuals).
! We need this to avoid passing explicitly the current matrix
! to the routine which applies the preconditioner.
! base_desc - type(psb_desc_type), pointer.
! Pointer to the communication descriptor associated to the
! matrix pointed by base_a.
! map - Stores the maps (restriction and prolongation) between the
! vector spaces associated to the index spaces of the previous
! and current levels.
!
! Methods:
! Most methods follow the encapsulation hierarchy: they take whatever action
! is appropriate for the current object, then call the corresponding method for
! the contained object.
! As an example: the descr() method prints out a description of the
! level. It starts by invoking the descr() method of the parms object,
! then calls the descr() method of the smoother object.
! !
! descr - Prints a description of the object.
! default - Set default values
! dump - Dump to file object contents
! set - Sets various parameters; when a request is unknown
! it is passed to the smoother object for further processing.
! check - Sanity checks.
! sizeof - Total memory occupation in bytes
! get_nzeros - Number of nonzeros
! !
!> \class mld_c_base_aggregator_type
!!
!! It is the data type containing the basic interface definition for
!! building a multigrid hierarchy by aggregation. The base object has no attributes,
!! it is intended to be essentially an abstract type.
!!
!!
!! type mld_c_base_aggregator_type
!! end type
!!
!!
!! Methods:
!!
!! bld_tprol - Build a tentative prolongator
!!
!! mat_asb - Build the final prolongator/restrictor and the
!! coarse matrix ac
!!
!! update_next - Transfer information to the next level; default is
!! to do nothing, i.e. aggregators at different
!! levels are independent.
!!
!! default - Apply defaults
!! set_aggr_type - For aggregator that have internal options.
!! fmt - Return a short string description
!! descr - Print a more detailed description
!!
!! cseti, csetr, csetc - Set internal parameters, if any
! !
type mld_c_base_aggregator_type type mld_c_base_aggregator_type
@ -233,6 +218,27 @@ contains
return return
end subroutine mld_c_base_aggregator_set_aggr_type end subroutine mld_c_base_aggregator_set_aggr_type
!
!> Function bld_tprol:
!! \memberof mld_c_base_aggregator_type
!! \brief Build a tentative prolongator.
!! The routine will map the local matrix entries to aggregates.
!! The mapping is store in ILAGGR; for each local row index I,
!! ILAGGR(I) contains the index of the aggregate to which index I
!! will contribute, in global numbering.
!! Many aggregation produce a binary tentative prolongators, but some
!! do not, hence we also need the OP_PROL output.
!!
!! \param ag The input aggregator object
!! \param parms The auxiliary parameters object
!! \param a The local matrix part
!! \param desc_a The descriptor
!! \param ilaggr Output aggregation map
!! \param nlaggr Sizes of ilaggr on all processes
!! \param op_prol The tentative prolongator operator
!! \param info Return code
!!
!
subroutine mld_c_base_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info) subroutine mld_c_base_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
use psb_base_mod use psb_base_mod
implicit none implicit none
@ -262,7 +268,25 @@ contains
end subroutine mld_c_base_aggregator_build_tprol end subroutine mld_c_base_aggregator_build_tprol
!
!> Function mat_asb
!! \memberof mld_c_base_aggregator_type
!! \brief Build prolongator/restrictor/coarse matrix.
!!
!!
!! \param ag The input aggregator object
!! \param parms The auxiliary parameters object
!! \param a The local matrix part
!! \param desc_a The descriptor
!! \param ilaggr Aggregation map
!! \param nlaggr Sizes of ilaggr on all processes
!! \param ac On output the coarse matrix
!! \param op_prol On input, the tentative prolongator operator, on output
!! the final prolongator
!! \param op_restr On output, the restrictor operator;
!! in many cases it is the transpose of the prolongator.
!! \param info Return code
!!
subroutine mld_c_base_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,& subroutine mld_c_base_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,&
& op_prol,op_restr,info) & op_prol,op_restr,info)
use psb_base_mod use psb_base_mod

@ -62,35 +62,48 @@ module mld_c_onelev_mod
& psb_erractionsave, psb_error_handler & psb_erractionsave, psb_error_handler
! !
! !
! Type: mld_Tonelev_type. ! Type: mld_conelev_type.
! !
! It is the data type containing the necessary items for the current ! It is the data type containing the necessary items for the current
! level (essentially, the smoother, the current-level matrix ! level (essentially, the smoother, the current-level matrix
! and the restriction and prolongation operators). ! and the restriction and prolongation operators).
! !
! type mld_Tonelev_type ! type mld_conelev_type
! class(mld_T_base_smoother_type), allocatable :: sm ! class(mld_c_base_smoother_type), allocatable :: sm, sm2a
! type(mld_RTml_parms) :: parms ! class(mld_c_base_smoother_type), pointer :: sm2 => null()
! type(psb_Tspmat_type) :: ac ! class(mld_cmlprec_wrk_type), allocatable :: wrk
! type(psb_Tesc_type) :: desc_ac ! class(mld_c_base_aggregator_type), allocatable :: aggr
! type(psb_Tspmat_type), pointer :: base_a => null() ! type(mld_sml_parms) :: parms
! type(psb_Tesc_type), pointer :: base_desc => null() ! type(psb_cspmat_type) :: ac
! type(psb_Tlinmap_type) :: map ! type(psb_cesc_type) :: desc_ac
! end type mld_Tonelev_type ! type(psb_cspmat_type), pointer :: base_a => null()
! type(psb_desc_type), pointer :: base_desc => null()
! type(psb_clinmap_type) :: map
! end type mld_conelev_type
! !
! Note that psb_Tpk denotes the kind of the real data type to be chosen ! Note that s denotes the kind of the real data type to be chosen
! according to single/double precision version of MLD2P4. ! according to single/double precision version of MLD2P4.
! !
! sm - class(mld_T_base_smoother_type), allocatable ! sm,sm2a - class(mld_c_base_smoother_type), allocatable
! The current level preconditioner (aka smoother). ! The current level pre- and post-smooother.
! parms - type(mld_RTml_parms) ! sm2 - class(mld_c_base_smoother_type), pointer
! The current level post-smooother; if sm2a is allocated
! explicitly, then sm2 => sm2a, otherwise sm2 => sm.
! wrk - class(mld_cmlprec_wrk_type), allocatable
! Workspace for application of preconditioner; may be
! pre-allocated to save time in the application within a
! Krylov solver.
! aggr - class(mld_c_base_aggregator_type), allocatable
! The aggregator object: holds the algorithmic choices and
! (possibly) additional data for building the aggregation.
! parms - type(mld_sml_parms)
! The parameters defining the multilevel strategy. ! The parameters defining the multilevel strategy.
! ac - The local part of the current-level matrix, built by ! ac - The local part of the current-level matrix, built by
! coarsening the previous-level matrix. ! coarsening the previous-level matrix.
! desc_ac - type(psb_desc_type). ! desc_ac - type(psb_desc_type).
! The communication descriptor associated to the matrix ! The communication descriptor associated to the matrix
! stored in ac. ! stored in ac.
! base_a - type(psb_Tspmat_type), pointer. ! base_a - type(psb_cspmat_type), pointer.
! Pointer (really a pointer!) to the local part of the current ! Pointer (really a pointer!) to the local part of the current
! matrix (so we have a unified treatment of residuals). ! matrix (so we have a unified treatment of residuals).
! We need this to avoid passing explicitly the current matrix ! We need this to avoid passing explicitly the current matrix
@ -119,6 +132,10 @@ module mld_c_onelev_mod
! sizeof - Total memory occupation in bytes ! sizeof - Total memory occupation in bytes
! get_nzeros - Number of nonzeros ! get_nzeros - Number of nonzeros
! get_wrksz - How many workspace vector does apply_vect need ! get_wrksz - How many workspace vector does apply_vect need
! allocate_wrk - Allocate auxiliary workspace
! free_wrk - Free auxiliary workspace
! bld_tprol - Invoke the aggr method to build the tentative prolongator
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
! !
! !
type mld_cmlprec_wrk_type type mld_cmlprec_wrk_type

@ -37,14 +37,7 @@
! !
! !
! The aggregator object hosts the aggregation method for building ! The aggregator object hosts the aggregation method for building
! the multilevel hierarchy. The basic version is the ! the multilevel hierarchy.
! decoupled aggregation algorithm presented in
!
! M. Brezina and P. Vanek, A black-box iterative solver based on a
! two-level Schwarz method, Computing, 63 (1999), 233-263.
! P. D'Ambra, D. di Serafino and S. Filippone, On the development of
! PSBLAS-based parallel two-level Schwarz preconditioners, Appl. Num. Math.
! 57 (2007), 1181-1196.
! !
module mld_d_base_aggregator_mod module mld_d_base_aggregator_mod
@ -54,44 +47,36 @@ module mld_d_base_aggregator_mod
& psb_ipk_, psb_long_int_k_, psb_desc_type, psb_i_base_vect_type, & & psb_ipk_, psb_long_int_k_, psb_desc_type, psb_i_base_vect_type, &
& psb_erractionsave, psb_error_handler, psb_success_ & psb_erractionsave, psb_error_handler, psb_success_
! !
! sm - class(mld_T_base_smoother_type), allocatable
! The current level preconditioner (aka smoother).
! parms - type(mld_RTml_parms)
! The parameters defining the multilevel strategy.
! ac - The local part of the current-level matrix, built by
! coarsening the previous-level matrix.
! desc_ac - type(psb_desc_type).
! The communication descriptor associated to the matrix
! stored in ac.
! base_a - type(psb_Tspmat_type), pointer.
! Pointer (really a pointer!) to the local part of the current
! matrix (so we have a unified treatment of residuals).
! We need this to avoid passing explicitly the current matrix
! to the routine which applies the preconditioner.
! base_desc - type(psb_desc_type), pointer.
! Pointer to the communication descriptor associated to the
! matrix pointed by base_a.
! map - Stores the maps (restriction and prolongation) between the
! vector spaces associated to the index spaces of the previous
! and current levels.
!
! Methods:
! Most methods follow the encapsulation hierarchy: they take whatever action
! is appropriate for the current object, then call the corresponding method for
! the contained object.
! As an example: the descr() method prints out a description of the
! level. It starts by invoking the descr() method of the parms object,
! then calls the descr() method of the smoother object.
! !
! descr - Prints a description of the object.
! default - Set default values
! dump - Dump to file object contents
! set - Sets various parameters; when a request is unknown
! it is passed to the smoother object for further processing.
! check - Sanity checks.
! sizeof - Total memory occupation in bytes
! get_nzeros - Number of nonzeros
! !
!> \class mld_d_base_aggregator_type
!!
!! It is the data type containing the basic interface definition for
!! building a multigrid hierarchy by aggregation. The base object has no attributes,
!! it is intended to be essentially an abstract type.
!!
!!
!! type mld_d_base_aggregator_type
!! end type
!!
!!
!! Methods:
!!
!! bld_tprol - Build a tentative prolongator
!!
!! mat_asb - Build the final prolongator/restrictor and the
!! coarse matrix ac
!!
!! update_next - Transfer information to the next level; default is
!! to do nothing, i.e. aggregators at different
!! levels are independent.
!!
!! default - Apply defaults
!! set_aggr_type - For aggregator that have internal options.
!! fmt - Return a short string description
!! descr - Print a more detailed description
!!
!! cseti, csetr, csetc - Set internal parameters, if any
! !
type mld_d_base_aggregator_type type mld_d_base_aggregator_type
@ -233,6 +218,27 @@ contains
return return
end subroutine mld_d_base_aggregator_set_aggr_type end subroutine mld_d_base_aggregator_set_aggr_type
!
!> Function bld_tprol:
!! \memberof mld_d_base_aggregator_type
!! \brief Build a tentative prolongator.
!! The routine will map the local matrix entries to aggregates.
!! The mapping is store in ILAGGR; for each local row index I,
!! ILAGGR(I) contains the index of the aggregate to which index I
!! will contribute, in global numbering.
!! Many aggregation produce a binary tentative prolongators, but some
!! do not, hence we also need the OP_PROL output.
!!
!! \param ag The input aggregator object
!! \param parms The auxiliary parameters object
!! \param a The local matrix part
!! \param desc_a The descriptor
!! \param ilaggr Output aggregation map
!! \param nlaggr Sizes of ilaggr on all processes
!! \param op_prol The tentative prolongator operator
!! \param info Return code
!!
!
subroutine mld_d_base_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info) subroutine mld_d_base_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
use psb_base_mod use psb_base_mod
implicit none implicit none
@ -262,7 +268,25 @@ contains
end subroutine mld_d_base_aggregator_build_tprol end subroutine mld_d_base_aggregator_build_tprol
!
!> Function mat_asb
!! \memberof mld_d_base_aggregator_type
!! \brief Build prolongator/restrictor/coarse matrix.
!!
!!
!! \param ag The input aggregator object
!! \param parms The auxiliary parameters object
!! \param a The local matrix part
!! \param desc_a The descriptor
!! \param ilaggr Aggregation map
!! \param nlaggr Sizes of ilaggr on all processes
!! \param ac On output the coarse matrix
!! \param op_prol On input, the tentative prolongator operator, on output
!! the final prolongator
!! \param op_restr On output, the restrictor operator;
!! in many cases it is the transpose of the prolongator.
!! \param info Return code
!!
subroutine mld_d_base_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,& subroutine mld_d_base_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,&
& op_prol,op_restr,info) & op_prol,op_restr,info)
use psb_base_mod use psb_base_mod

@ -62,35 +62,48 @@ module mld_d_onelev_mod
& psb_erractionsave, psb_error_handler & psb_erractionsave, psb_error_handler
! !
! !
! Type: mld_Tonelev_type. ! Type: mld_donelev_type.
! !
! It is the data type containing the necessary items for the current ! It is the data type containing the necessary items for the current
! level (essentially, the smoother, the current-level matrix ! level (essentially, the smoother, the current-level matrix
! and the restriction and prolongation operators). ! and the restriction and prolongation operators).
! !
! type mld_Tonelev_type ! type mld_donelev_type
! class(mld_T_base_smoother_type), allocatable :: sm ! class(mld_d_base_smoother_type), allocatable :: sm, sm2a
! type(mld_RTml_parms) :: parms ! class(mld_d_base_smoother_type), pointer :: sm2 => null()
! type(psb_Tspmat_type) :: ac ! class(mld_dmlprec_wrk_type), allocatable :: wrk
! type(psb_Tesc_type) :: desc_ac ! class(mld_d_base_aggregator_type), allocatable :: aggr
! type(psb_Tspmat_type), pointer :: base_a => null() ! type(mld_dml_parms) :: parms
! type(psb_Tesc_type), pointer :: base_desc => null() ! type(psb_dspmat_type) :: ac
! type(psb_Tlinmap_type) :: map ! type(psb_desc_type) :: desc_ac
! end type mld_Tonelev_type ! type(psb_dspmat_type), pointer :: base_a => null()
! type(psb_desc_type), pointer :: base_desc => null()
! type(psb_dlinmap_type) :: map
! end type mld_donelev_type
! !
! Note that psb_Tpk denotes the kind of the real data type to be chosen ! Note that d denotes the kind of the real data type to be chosen
! according to single/double precision version of MLD2P4. ! according to single/double precision version of MLD2P4.
! !
! sm - class(mld_T_base_smoother_type), allocatable ! sm,sm2a - class(mld_d_base_smoother_type), allocatable
! The current level preconditioner (aka smoother). ! The current level pre- and post-smooother.
! parms - type(mld_RTml_parms) ! sm2 - class(mld_d_base_smoother_type), pointer
! The current level post-smooother; if sm2a is allocated
! explicitly, then sm2 => sm2a, otherwise sm2 => sm.
! wrk - class(mld_dmlprec_wrk_type), allocatable
! Workspace for application of preconditioner; may be
! pre-allocated to save time in the application within a
! Krylov solver.
! aggr - class(mld_d_base_aggregator_type), allocatable
! The aggregator object: holds the algorithmic choices and
! (possibly) additional data for building the aggregation.
! parms - type(mld_dml_parms)
! The parameters defining the multilevel strategy. ! The parameters defining the multilevel strategy.
! ac - The local part of the current-level matrix, built by ! ac - The local part of the current-level matrix, built by
! coarsening the previous-level matrix. ! coarsening the previous-level matrix.
! desc_ac - type(psb_desc_type). ! desc_ac - type(psb_desc_type).
! The communication descriptor associated to the matrix ! The communication descriptor associated to the matrix
! stored in ac. ! stored in ac.
! base_a - type(psb_Tspmat_type), pointer. ! base_a - type(psb_dspmat_type), pointer.
! Pointer (really a pointer!) to the local part of the current ! Pointer (really a pointer!) to the local part of the current
! matrix (so we have a unified treatment of residuals). ! matrix (so we have a unified treatment of residuals).
! We need this to avoid passing explicitly the current matrix ! We need this to avoid passing explicitly the current matrix
@ -119,6 +132,10 @@ module mld_d_onelev_mod
! sizeof - Total memory occupation in bytes ! sizeof - Total memory occupation in bytes
! get_nzeros - Number of nonzeros ! get_nzeros - Number of nonzeros
! get_wrksz - How many workspace vector does apply_vect need ! get_wrksz - How many workspace vector does apply_vect need
! allocate_wrk - Allocate auxiliary workspace
! free_wrk - Free auxiliary workspace
! bld_tprol - Invoke the aggr method to build the tentative prolongator
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
! !
! !
type mld_dmlprec_wrk_type type mld_dmlprec_wrk_type

@ -37,14 +37,7 @@
! !
! !
! The aggregator object hosts the aggregation method for building ! The aggregator object hosts the aggregation method for building
! the multilevel hierarchy. The basic version is the ! the multilevel hierarchy.
! decoupled aggregation algorithm presented in
!
! M. Brezina and P. Vanek, A black-box iterative solver based on a
! two-level Schwarz method, Computing, 63 (1999), 233-263.
! P. D'Ambra, D. di Serafino and S. Filippone, On the development of
! PSBLAS-based parallel two-level Schwarz preconditioners, Appl. Num. Math.
! 57 (2007), 1181-1196.
! !
module mld_s_base_aggregator_mod module mld_s_base_aggregator_mod
@ -54,44 +47,36 @@ module mld_s_base_aggregator_mod
& psb_ipk_, psb_long_int_k_, psb_desc_type, psb_i_base_vect_type, & & psb_ipk_, psb_long_int_k_, psb_desc_type, psb_i_base_vect_type, &
& psb_erractionsave, psb_error_handler, psb_success_ & psb_erractionsave, psb_error_handler, psb_success_
! !
! sm - class(mld_T_base_smoother_type), allocatable
! The current level preconditioner (aka smoother).
! parms - type(mld_RTml_parms)
! The parameters defining the multilevel strategy.
! ac - The local part of the current-level matrix, built by
! coarsening the previous-level matrix.
! desc_ac - type(psb_desc_type).
! The communication descriptor associated to the matrix
! stored in ac.
! base_a - type(psb_Tspmat_type), pointer.
! Pointer (really a pointer!) to the local part of the current
! matrix (so we have a unified treatment of residuals).
! We need this to avoid passing explicitly the current matrix
! to the routine which applies the preconditioner.
! base_desc - type(psb_desc_type), pointer.
! Pointer to the communication descriptor associated to the
! matrix pointed by base_a.
! map - Stores the maps (restriction and prolongation) between the
! vector spaces associated to the index spaces of the previous
! and current levels.
!
! Methods:
! Most methods follow the encapsulation hierarchy: they take whatever action
! is appropriate for the current object, then call the corresponding method for
! the contained object.
! As an example: the descr() method prints out a description of the
! level. It starts by invoking the descr() method of the parms object,
! then calls the descr() method of the smoother object.
! !
! descr - Prints a description of the object.
! default - Set default values
! dump - Dump to file object contents
! set - Sets various parameters; when a request is unknown
! it is passed to the smoother object for further processing.
! check - Sanity checks.
! sizeof - Total memory occupation in bytes
! get_nzeros - Number of nonzeros
! !
!> \class mld_s_base_aggregator_type
!!
!! It is the data type containing the basic interface definition for
!! building a multigrid hierarchy by aggregation. The base object has no attributes,
!! it is intended to be essentially an abstract type.
!!
!!
!! type mld_s_base_aggregator_type
!! end type
!!
!!
!! Methods:
!!
!! bld_tprol - Build a tentative prolongator
!!
!! mat_asb - Build the final prolongator/restrictor and the
!! coarse matrix ac
!!
!! update_next - Transfer information to the next level; default is
!! to do nothing, i.e. aggregators at different
!! levels are independent.
!!
!! default - Apply defaults
!! set_aggr_type - For aggregator that have internal options.
!! fmt - Return a short string description
!! descr - Print a more detailed description
!!
!! cseti, csetr, csetc - Set internal parameters, if any
! !
type mld_s_base_aggregator_type type mld_s_base_aggregator_type
@ -233,6 +218,27 @@ contains
return return
end subroutine mld_s_base_aggregator_set_aggr_type end subroutine mld_s_base_aggregator_set_aggr_type
!
!> Function bld_tprol:
!! \memberof mld_s_base_aggregator_type
!! \brief Build a tentative prolongator.
!! The routine will map the local matrix entries to aggregates.
!! The mapping is store in ILAGGR; for each local row index I,
!! ILAGGR(I) contains the index of the aggregate to which index I
!! will contribute, in global numbering.
!! Many aggregation produce a binary tentative prolongators, but some
!! do not, hence we also need the OP_PROL output.
!!
!! \param ag The input aggregator object
!! \param parms The auxiliary parameters object
!! \param a The local matrix part
!! \param desc_a The descriptor
!! \param ilaggr Output aggregation map
!! \param nlaggr Sizes of ilaggr on all processes
!! \param op_prol The tentative prolongator operator
!! \param info Return code
!!
!
subroutine mld_s_base_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info) subroutine mld_s_base_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
use psb_base_mod use psb_base_mod
implicit none implicit none
@ -262,7 +268,25 @@ contains
end subroutine mld_s_base_aggregator_build_tprol end subroutine mld_s_base_aggregator_build_tprol
!
!> Function mat_asb
!! \memberof mld_s_base_aggregator_type
!! \brief Build prolongator/restrictor/coarse matrix.
!!
!!
!! \param ag The input aggregator object
!! \param parms The auxiliary parameters object
!! \param a The local matrix part
!! \param desc_a The descriptor
!! \param ilaggr Aggregation map
!! \param nlaggr Sizes of ilaggr on all processes
!! \param ac On output the coarse matrix
!! \param op_prol On input, the tentative prolongator operator, on output
!! the final prolongator
!! \param op_restr On output, the restrictor operator;
!! in many cases it is the transpose of the prolongator.
!! \param info Return code
!!
subroutine mld_s_base_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,& subroutine mld_s_base_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,&
& op_prol,op_restr,info) & op_prol,op_restr,info)
use psb_base_mod use psb_base_mod

@ -62,35 +62,48 @@ module mld_s_onelev_mod
& psb_erractionsave, psb_error_handler & psb_erractionsave, psb_error_handler
! !
! !
! Type: mld_Tonelev_type. ! Type: mld_sonelev_type.
! !
! It is the data type containing the necessary items for the current ! It is the data type containing the necessary items for the current
! level (essentially, the smoother, the current-level matrix ! level (essentially, the smoother, the current-level matrix
! and the restriction and prolongation operators). ! and the restriction and prolongation operators).
! !
! type mld_Tonelev_type ! type mld_sonelev_type
! class(mld_T_base_smoother_type), allocatable :: sm ! class(mld_s_base_smoother_type), allocatable :: sm, sm2a
! type(mld_RTml_parms) :: parms ! class(mld_s_base_smoother_type), pointer :: sm2 => null()
! type(psb_Tspmat_type) :: ac ! class(mld_smlprec_wrk_type), allocatable :: wrk
! type(psb_Tesc_type) :: desc_ac ! class(mld_s_base_aggregator_type), allocatable :: aggr
! type(psb_Tspmat_type), pointer :: base_a => null() ! type(mld_sml_parms) :: parms
! type(psb_Tesc_type), pointer :: base_desc => null() ! type(psb_sspmat_type) :: ac
! type(psb_Tlinmap_type) :: map ! type(psb_sesc_type) :: desc_ac
! end type mld_Tonelev_type ! type(psb_sspmat_type), pointer :: base_a => null()
! type(psb_desc_type), pointer :: base_desc => null()
! type(psb_slinmap_type) :: map
! end type mld_sonelev_type
! !
! Note that psb_Tpk denotes the kind of the real data type to be chosen ! Note that s denotes the kind of the real data type to be chosen
! according to single/double precision version of MLD2P4. ! according to single/double precision version of MLD2P4.
! !
! sm - class(mld_T_base_smoother_type), allocatable ! sm,sm2a - class(mld_s_base_smoother_type), allocatable
! The current level preconditioner (aka smoother). ! The current level pre- and post-smooother.
! parms - type(mld_RTml_parms) ! sm2 - class(mld_s_base_smoother_type), pointer
! The current level post-smooother; if sm2a is allocated
! explicitly, then sm2 => sm2a, otherwise sm2 => sm.
! wrk - class(mld_smlprec_wrk_type), allocatable
! Workspace for application of preconditioner; may be
! pre-allocated to save time in the application within a
! Krylov solver.
! aggr - class(mld_s_base_aggregator_type), allocatable
! The aggregator object: holds the algorithmic choices and
! (possibly) additional data for building the aggregation.
! parms - type(mld_sml_parms)
! The parameters defining the multilevel strategy. ! The parameters defining the multilevel strategy.
! ac - The local part of the current-level matrix, built by ! ac - The local part of the current-level matrix, built by
! coarsening the previous-level matrix. ! coarsening the previous-level matrix.
! desc_ac - type(psb_desc_type). ! desc_ac - type(psb_desc_type).
! The communication descriptor associated to the matrix ! The communication descriptor associated to the matrix
! stored in ac. ! stored in ac.
! base_a - type(psb_Tspmat_type), pointer. ! base_a - type(psb_sspmat_type), pointer.
! Pointer (really a pointer!) to the local part of the current ! Pointer (really a pointer!) to the local part of the current
! matrix (so we have a unified treatment of residuals). ! matrix (so we have a unified treatment of residuals).
! We need this to avoid passing explicitly the current matrix ! We need this to avoid passing explicitly the current matrix
@ -119,6 +132,10 @@ module mld_s_onelev_mod
! sizeof - Total memory occupation in bytes ! sizeof - Total memory occupation in bytes
! get_nzeros - Number of nonzeros ! get_nzeros - Number of nonzeros
! get_wrksz - How many workspace vector does apply_vect need ! get_wrksz - How many workspace vector does apply_vect need
! allocate_wrk - Allocate auxiliary workspace
! free_wrk - Free auxiliary workspace
! bld_tprol - Invoke the aggr method to build the tentative prolongator
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
! !
! !
type mld_smlprec_wrk_type type mld_smlprec_wrk_type

@ -37,14 +37,7 @@
! !
! !
! The aggregator object hosts the aggregation method for building ! The aggregator object hosts the aggregation method for building
! the multilevel hierarchy. The basic version is the ! the multilevel hierarchy.
! decoupled aggregation algorithm presented in
!
! M. Brezina and P. Vanek, A black-box iterative solver based on a
! two-level Schwarz method, Computing, 63 (1999), 233-263.
! P. D'Ambra, D. di Serafino and S. Filippone, On the development of
! PSBLAS-based parallel two-level Schwarz preconditioners, Appl. Num. Math.
! 57 (2007), 1181-1196.
! !
module mld_z_base_aggregator_mod module mld_z_base_aggregator_mod
@ -54,44 +47,36 @@ module mld_z_base_aggregator_mod
& psb_ipk_, psb_long_int_k_, psb_desc_type, psb_i_base_vect_type, & & psb_ipk_, psb_long_int_k_, psb_desc_type, psb_i_base_vect_type, &
& psb_erractionsave, psb_error_handler, psb_success_ & psb_erractionsave, psb_error_handler, psb_success_
! !
! sm - class(mld_T_base_smoother_type), allocatable
! The current level preconditioner (aka smoother).
! parms - type(mld_RTml_parms)
! The parameters defining the multilevel strategy.
! ac - The local part of the current-level matrix, built by
! coarsening the previous-level matrix.
! desc_ac - type(psb_desc_type).
! The communication descriptor associated to the matrix
! stored in ac.
! base_a - type(psb_Tspmat_type), pointer.
! Pointer (really a pointer!) to the local part of the current
! matrix (so we have a unified treatment of residuals).
! We need this to avoid passing explicitly the current matrix
! to the routine which applies the preconditioner.
! base_desc - type(psb_desc_type), pointer.
! Pointer to the communication descriptor associated to the
! matrix pointed by base_a.
! map - Stores the maps (restriction and prolongation) between the
! vector spaces associated to the index spaces of the previous
! and current levels.
!
! Methods:
! Most methods follow the encapsulation hierarchy: they take whatever action
! is appropriate for the current object, then call the corresponding method for
! the contained object.
! As an example: the descr() method prints out a description of the
! level. It starts by invoking the descr() method of the parms object,
! then calls the descr() method of the smoother object.
! !
! descr - Prints a description of the object.
! default - Set default values
! dump - Dump to file object contents
! set - Sets various parameters; when a request is unknown
! it is passed to the smoother object for further processing.
! check - Sanity checks.
! sizeof - Total memory occupation in bytes
! get_nzeros - Number of nonzeros
! !
!> \class mld_z_base_aggregator_type
!!
!! It is the data type containing the basic interface definition for
!! building a multigrid hierarchy by aggregation. The base object has no attributes,
!! it is intended to be essentially an abstract type.
!!
!!
!! type mld_z_base_aggregator_type
!! end type
!!
!!
!! Methods:
!!
!! bld_tprol - Build a tentative prolongator
!!
!! mat_asb - Build the final prolongator/restrictor and the
!! coarse matrix ac
!!
!! update_next - Transfer information to the next level; default is
!! to do nothing, i.e. aggregators at different
!! levels are independent.
!!
!! default - Apply defaults
!! set_aggr_type - For aggregator that have internal options.
!! fmt - Return a short string description
!! descr - Print a more detailed description
!!
!! cseti, csetr, csetc - Set internal parameters, if any
! !
type mld_z_base_aggregator_type type mld_z_base_aggregator_type
@ -233,6 +218,27 @@ contains
return return
end subroutine mld_z_base_aggregator_set_aggr_type end subroutine mld_z_base_aggregator_set_aggr_type
!
!> Function bld_tprol:
!! \memberof mld_z_base_aggregator_type
!! \brief Build a tentative prolongator.
!! The routine will map the local matrix entries to aggregates.
!! The mapping is store in ILAGGR; for each local row index I,
!! ILAGGR(I) contains the index of the aggregate to which index I
!! will contribute, in global numbering.
!! Many aggregation produce a binary tentative prolongators, but some
!! do not, hence we also need the OP_PROL output.
!!
!! \param ag The input aggregator object
!! \param parms The auxiliary parameters object
!! \param a The local matrix part
!! \param desc_a The descriptor
!! \param ilaggr Output aggregation map
!! \param nlaggr Sizes of ilaggr on all processes
!! \param op_prol The tentative prolongator operator
!! \param info Return code
!!
!
subroutine mld_z_base_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info) subroutine mld_z_base_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
use psb_base_mod use psb_base_mod
implicit none implicit none
@ -262,7 +268,25 @@ contains
end subroutine mld_z_base_aggregator_build_tprol end subroutine mld_z_base_aggregator_build_tprol
!
!> Function mat_asb
!! \memberof mld_z_base_aggregator_type
!! \brief Build prolongator/restrictor/coarse matrix.
!!
!!
!! \param ag The input aggregator object
!! \param parms The auxiliary parameters object
!! \param a The local matrix part
!! \param desc_a The descriptor
!! \param ilaggr Aggregation map
!! \param nlaggr Sizes of ilaggr on all processes
!! \param ac On output the coarse matrix
!! \param op_prol On input, the tentative prolongator operator, on output
!! the final prolongator
!! \param op_restr On output, the restrictor operator;
!! in many cases it is the transpose of the prolongator.
!! \param info Return code
!!
subroutine mld_z_base_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,& subroutine mld_z_base_aggregator_mat_asb(ag,parms,a,desc_a,ilaggr,nlaggr,ac,&
& op_prol,op_restr,info) & op_prol,op_restr,info)
use psb_base_mod use psb_base_mod

@ -62,35 +62,48 @@ module mld_z_onelev_mod
& psb_erractionsave, psb_error_handler & psb_erractionsave, psb_error_handler
! !
! !
! Type: mld_Tonelev_type. ! Type: mld_zonelev_type.
! !
! It is the data type containing the necessary items for the current ! It is the data type containing the necessary items for the current
! level (essentially, the smoother, the current-level matrix ! level (essentially, the smoother, the current-level matrix
! and the restriction and prolongation operators). ! and the restriction and prolongation operators).
! !
! type mld_Tonelev_type ! type mld_zonelev_type
! class(mld_T_base_smoother_type), allocatable :: sm ! class(mld_z_base_smoother_type), allocatable :: sm, sm2a
! type(mld_RTml_parms) :: parms ! class(mld_z_base_smoother_type), pointer :: sm2 => null()
! type(psb_Tspmat_type) :: ac ! class(mld_zmlprec_wrk_type), allocatable :: wrk
! type(psb_Tesc_type) :: desc_ac ! class(mld_z_base_aggregator_type), allocatable :: aggr
! type(psb_Tspmat_type), pointer :: base_a => null() ! type(mld_dml_parms) :: parms
! type(psb_Tesc_type), pointer :: base_desc => null() ! type(psb_zspmat_type) :: ac
! type(psb_Tlinmap_type) :: map ! type(psb_zesc_type) :: desc_ac
! end type mld_Tonelev_type ! type(psb_zspmat_type), pointer :: base_a => null()
! type(psb_desc_type), pointer :: base_desc => null()
! type(psb_zlinmap_type) :: map
! end type mld_zonelev_type
! !
! Note that psb_Tpk denotes the kind of the real data type to be chosen ! Note that d denotes the kind of the real data type to be chosen
! according to single/double precision version of MLD2P4. ! according to single/double precision version of MLD2P4.
! !
! sm - class(mld_T_base_smoother_type), allocatable ! sm,sm2a - class(mld_z_base_smoother_type), allocatable
! The current level preconditioner (aka smoother). ! The current level pre- and post-smooother.
! parms - type(mld_RTml_parms) ! sm2 - class(mld_z_base_smoother_type), pointer
! The current level post-smooother; if sm2a is allocated
! explicitly, then sm2 => sm2a, otherwise sm2 => sm.
! wrk - class(mld_zmlprec_wrk_type), allocatable
! Workspace for application of preconditioner; may be
! pre-allocated to save time in the application within a
! Krylov solver.
! aggr - class(mld_z_base_aggregator_type), allocatable
! The aggregator object: holds the algorithmic choices and
! (possibly) additional data for building the aggregation.
! parms - type(mld_dml_parms)
! The parameters defining the multilevel strategy. ! The parameters defining the multilevel strategy.
! ac - The local part of the current-level matrix, built by ! ac - The local part of the current-level matrix, built by
! coarsening the previous-level matrix. ! coarsening the previous-level matrix.
! desc_ac - type(psb_desc_type). ! desc_ac - type(psb_desc_type).
! The communication descriptor associated to the matrix ! The communication descriptor associated to the matrix
! stored in ac. ! stored in ac.
! base_a - type(psb_Tspmat_type), pointer. ! base_a - type(psb_zspmat_type), pointer.
! Pointer (really a pointer!) to the local part of the current ! Pointer (really a pointer!) to the local part of the current
! matrix (so we have a unified treatment of residuals). ! matrix (so we have a unified treatment of residuals).
! We need this to avoid passing explicitly the current matrix ! We need this to avoid passing explicitly the current matrix
@ -119,6 +132,10 @@ module mld_z_onelev_mod
! sizeof - Total memory occupation in bytes ! sizeof - Total memory occupation in bytes
! get_nzeros - Number of nonzeros ! get_nzeros - Number of nonzeros
! get_wrksz - How many workspace vector does apply_vect need ! get_wrksz - How many workspace vector does apply_vect need
! allocate_wrk - Allocate auxiliary workspace
! free_wrk - Free auxiliary workspace
! bld_tprol - Invoke the aggr method to build the tentative prolongator
! mat_asb - Build the final (possibly smoothed) prolongator and coarse matrix.
! !
! !
type mld_zmlprec_wrk_type type mld_zmlprec_wrk_type

Loading…
Cancel
Save