|
|
@ -60,22 +60,19 @@
|
|
|
|
! radius of D^(-1)A, to be used in the computation of omega, is provided,
|
|
|
|
! radius of D^(-1)A, to be used in the computation of omega, is provided,
|
|
|
|
! according to the value of p%parms%aggr_omega_alg, specified by the user
|
|
|
|
! according to the value of p%parms%aggr_omega_alg, specified by the user
|
|
|
|
! through mld_cprecinit and mld_cprecset.
|
|
|
|
! through mld_cprecinit and mld_cprecset.
|
|
|
|
|
|
|
|
! 4. Minimum energy aggregation: ADD REFERENCE.
|
|
|
|
|
|
|
|
! On output from this routine the entries of AC, op_prol, op_restr
|
|
|
|
|
|
|
|
! are still in "global numbering" mode; this is fixed in the calling routine
|
|
|
|
|
|
|
|
! mld_c_lev_aggrmat_asb.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine can also build A_C according to a "bizarre" aggregation algorithm,
|
|
|
|
! For more details see
|
|
|
|
! using a "naive" prolongator proposed by the authors of MLD2P4. However, this
|
|
|
|
! M. Brezina and P. Vanek, A black-box iterative solver based on a two-level
|
|
|
|
! prolongator still requires a deep analysis and testing and its use is not
|
|
|
|
! Schwarz method, Computing, 63 (1999), 233-263.
|
|
|
|
! recommended.
|
|
|
|
! 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.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! The coarse-level matrix A_C is distributed among the parallel processes or
|
|
|
|
|
|
|
|
! replicated on each of them, according to the value of p%parms%coarse_mat,
|
|
|
|
|
|
|
|
! specified by the user through mld_cprecinit and mld_zprecset.
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! For more details see
|
|
|
|
|
|
|
|
! 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.
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Arguments:
|
|
|
|
! Arguments:
|
|
|
|
! a - type(psb_cspmat_type), input.
|
|
|
|
! a - type(psb_cspmat_type), input.
|
|
|
@ -87,17 +84,31 @@
|
|
|
|
! The 'one-level' data structure that will contain the local
|
|
|
|
! The 'one-level' data structure that will contain the local
|
|
|
|
! part of the matrix to be built as well as the information
|
|
|
|
! part of the matrix to be built as well as the information
|
|
|
|
! concerning the prolongator and its transpose.
|
|
|
|
! concerning the prolongator and its transpose.
|
|
|
|
! ilaggr - integer, dimension(:), allocatable.
|
|
|
|
! parms - type(mld_sml_parms), input
|
|
|
|
|
|
|
|
! Parameters controlling the choice of algorithm
|
|
|
|
|
|
|
|
! ac - type(psb_cspmat_type), output
|
|
|
|
|
|
|
|
! The coarse matrix on output
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! ilaggr - integer, dimension(:), input
|
|
|
|
! The mapping between the row indices of the coarse-level
|
|
|
|
! The mapping between the row indices of the coarse-level
|
|
|
|
! matrix and the row indices of the fine-level matrix.
|
|
|
|
! matrix and the row indices of the fine-level matrix.
|
|
|
|
! ilaggr(i)=j means that node i in the adjacency graph
|
|
|
|
! ilaggr(i)=j means that node i in the adjacency graph
|
|
|
|
! of the fine-level matrix is mapped onto node j in the
|
|
|
|
! of the fine-level matrix is mapped onto node j in the
|
|
|
|
! adjacency graph of the coarse-level matrix.
|
|
|
|
! adjacency graph of the coarse-level matrix. Note that the indices
|
|
|
|
! nlaggr - integer, dimension(:), allocatable.
|
|
|
|
! are assumed to be shifted so as to make sure the ranges on
|
|
|
|
|
|
|
|
! the various processes do not overlap.
|
|
|
|
|
|
|
|
! nlaggr - integer, dimension(:) input
|
|
|
|
! nlaggr(i) contains the aggregates held by process i.
|
|
|
|
! nlaggr(i) contains the aggregates held by process i.
|
|
|
|
|
|
|
|
! op_prol - type(psb_cspmat_type), input/output
|
|
|
|
|
|
|
|
! The tentative prolongator on input, the computed prolongator on output
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! op_restr - type(psb_cspmat_type), output
|
|
|
|
|
|
|
|
! The restrictor operator; normally, it is the transpose of the prolongator.
|
|
|
|
|
|
|
|
!
|
|
|
|
! info - integer, output.
|
|
|
|
! info - integer, output.
|
|
|
|
! Error code.
|
|
|
|
! Error code.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
|
|
|
|
!
|
|
|
|
subroutine mld_caggrmat_minnrg_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_restr,info)
|
|
|
|
subroutine mld_caggrmat_minnrg_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_restr,info)
|
|
|
|
use psb_base_mod
|
|
|
|
use psb_base_mod
|
|
|
|
use mld_c_inner_mod, mld_protect_name => mld_caggrmat_minnrg_asb
|
|
|
|
use mld_c_inner_mod, mld_protect_name => mld_caggrmat_minnrg_asb
|
|
|
@ -121,7 +132,7 @@ subroutine mld_caggrmat_minnrg_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re
|
|
|
|
character(len=20) :: name
|
|
|
|
character(len=20) :: name
|
|
|
|
type(psb_cspmat_type) :: af, ptilde, rtilde, atran, atp, atdatp
|
|
|
|
type(psb_cspmat_type) :: af, ptilde, rtilde, atran, atp, atdatp
|
|
|
|
type(psb_cspmat_type) :: am3,am4, ap, adap,atmp,rada, ra, atmp2, dap, dadap, da
|
|
|
|
type(psb_cspmat_type) :: am3,am4, ap, adap,atmp,rada, ra, atmp2, dap, dadap, da
|
|
|
|
type(psb_cspmat_type) :: dat, datp, datdatp, atmp3
|
|
|
|
type(psb_cspmat_type) :: dat, datp, datdatp, atmp3, tmp_prol
|
|
|
|
type(psb_c_coo_sparse_mat) :: tmpcoo
|
|
|
|
type(psb_c_coo_sparse_mat) :: tmpcoo
|
|
|
|
type(psb_c_csr_sparse_mat) :: acsr1, acsr2, acsr3, acsr, acsrf
|
|
|
|
type(psb_c_csr_sparse_mat) :: acsr1, acsr2, acsr3, acsr, acsrf
|
|
|
|
type(psb_c_csc_sparse_mat) :: csc_dap, csc_dadap, csc_datp, csc_datdatp, acsc
|
|
|
|
type(psb_c_csc_sparse_mat) :: csc_dap, csc_dadap, csc_datp, csc_datdatp, acsc
|
|
|
@ -484,9 +495,10 @@ subroutine mld_caggrmat_minnrg_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re
|
|
|
|
! Now we have to gather the halo of op_prol, and add it to itself
|
|
|
|
! Now we have to gather the halo of op_prol, and add it to itself
|
|
|
|
! to multiply it by A,
|
|
|
|
! to multiply it by A,
|
|
|
|
!
|
|
|
|
!
|
|
|
|
call psb_sphalo(op_prol,desc_a,am4,info,&
|
|
|
|
call op_prol%clone(tmp_prol,info)
|
|
|
|
|
|
|
|
if (info == psb_success_) call psb_sphalo(tmp_prol,desc_a,am4,info,&
|
|
|
|
& colcnv=.false.,rowscale=.true.)
|
|
|
|
& colcnv=.false.,rowscale=.true.)
|
|
|
|
if (info == psb_success_) call psb_rwextd(ncol,op_prol,info,b=am4)
|
|
|
|
if (info == psb_success_) call psb_rwextd(ncol,tmp_prol,info,b=am4)
|
|
|
|
if (info == psb_success_) call am4%free()
|
|
|
|
if (info == psb_success_) call am4%free()
|
|
|
|
|
|
|
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
@ -519,13 +531,13 @@ subroutine mld_caggrmat_minnrg_asb(a,desc_a,ilaggr,nlaggr,parms,ac,op_prol,op_re
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& 'starting sphalo/ rwxtd'
|
|
|
|
& 'starting sphalo/ rwxtd'
|
|
|
|
|
|
|
|
|
|
|
|
call psb_symbmm(a,op_prol,am3,info)
|
|
|
|
call psb_symbmm(a,tmp_prol,am3,info)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,&
|
|
|
|
& a_err='symbmm 2')
|
|
|
|
& a_err='symbmm 2')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
call psb_numbmm(a,op_prol,am3)
|
|
|
|
call psb_numbmm(a,tmp_prol,am3)
|
|
|
|
if (debug_level >= psb_debug_outer_) &
|
|
|
|
if (debug_level >= psb_debug_outer_) &
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& 'Done NUMBMM 2'
|
|
|
|
& 'Done NUMBMM 2'
|
|
|
|