|
|
@ -61,11 +61,6 @@
|
|
|
|
! 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_zprecset.
|
|
|
|
! through mld_cprecinit and mld_zprecset.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! This routine can also build A_C according to a "bizarre" aggregation algorithm,
|
|
|
|
|
|
|
|
! using a "naive" prolongator proposed by the authors of MLD2P4. However, this
|
|
|
|
|
|
|
|
! prolongator still requires a deep analysis and testing and its use is not
|
|
|
|
|
|
|
|
! recommended.
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! The coarse-level matrix A_C is distributed among the parallel processes or
|
|
|
|
! 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,
|
|
|
|
! replicated on each of them, according to the value of p%parms%coarse_mat,
|
|
|
|
! specified by the user through mld_cprecinit and mld_zprecset.
|
|
|
|
! specified by the user through mld_cprecinit and mld_zprecset.
|
|
|
@ -116,20 +111,19 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
integer, intent(inout) :: ilaggr(:), nlaggr(:)
|
|
|
|
integer, intent(inout) :: ilaggr(:), nlaggr(:)
|
|
|
|
type(mld_c_onelev_type), intent(inout), target :: p
|
|
|
|
type(mld_c_onelev_type), intent(inout), target :: p
|
|
|
|
integer, intent(out) :: info
|
|
|
|
integer, intent(out) :: info
|
|
|
|
|
|
|
|
type(psb_cspmat_type) :: op_prol, op_restr, b
|
|
|
|
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
! Local variables
|
|
|
|
type(psb_cspmat_type) :: b
|
|
|
|
integer :: nrow, nglob, ncol, ntaggr, ip, ndx,&
|
|
|
|
integer, allocatable :: nzbr(:), idisp(:)
|
|
|
|
|
|
|
|
integer :: nrow, nglob, ncol, ntaggr, nzac, ip, ndx,&
|
|
|
|
|
|
|
|
& naggr, nzl,naggrm1,naggrp1, i, j, k, jd, icolF, nrw
|
|
|
|
& naggr, nzl,naggrm1,naggrp1, i, j, k, jd, icolF, nrw
|
|
|
|
integer ::ictxt, np, me, err_act
|
|
|
|
integer ::ictxt, np, me, err_act
|
|
|
|
character(len=20) :: name
|
|
|
|
character(len=20) :: name
|
|
|
|
type(psb_cspmat_type) :: am1,am2, am3, am4
|
|
|
|
type(psb_cspmat_type) :: am3, am4
|
|
|
|
type(psb_c_coo_sparse_mat) :: acoo, acoof, bcoo
|
|
|
|
type(psb_c_coo_sparse_mat) :: acoo, acoof, bcoo
|
|
|
|
type(psb_c_csr_sparse_mat) :: acsr1, acsr2, acsr3, acsrf, ptilde
|
|
|
|
type(psb_c_csr_sparse_mat) :: acsr1, acsr2, acsr3, acsrf, ptilde
|
|
|
|
complex(psb_spk_), allocatable :: adiag(:)
|
|
|
|
complex(psb_spk_), allocatable :: adiag(:)
|
|
|
|
integer(psb_ipk_) :: ierr(5)
|
|
|
|
integer(psb_ipk_) :: ierr(5)
|
|
|
|
logical :: ml_global_nmb, filter_mat
|
|
|
|
logical :: filter_mat
|
|
|
|
integer :: debug_level, debug_unit
|
|
|
|
integer :: debug_level, debug_unit
|
|
|
|
integer, parameter :: ncmax=16
|
|
|
|
integer, parameter :: ncmax=16
|
|
|
|
real(psb_spk_) :: anorm, omega, tmp, dg, theta
|
|
|
|
real(psb_spk_) :: anorm, omega, tmp, dg, theta
|
|
|
@ -155,22 +149,10 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
naggr = nlaggr(me+1)
|
|
|
|
naggr = nlaggr(me+1)
|
|
|
|
ntaggr = sum(nlaggr)
|
|
|
|
ntaggr = sum(nlaggr)
|
|
|
|
|
|
|
|
|
|
|
|
allocate(nzbr(np), idisp(np),stat=info)
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
info=psb_err_alloc_request_; ierr(1)=2*np;
|
|
|
|
|
|
|
|
call psb_errpush(info,name,i_err=ierr,a_err='integer')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
naggrm1 = sum(nlaggr(1:me))
|
|
|
|
naggrm1 = sum(nlaggr(1:me))
|
|
|
|
naggrp1 = sum(nlaggr(1:me+1))
|
|
|
|
naggrp1 = sum(nlaggr(1:me+1))
|
|
|
|
ml_global_nmb = ( (p%parms%aggr_kind == mld_smooth_prol_).or.&
|
|
|
|
|
|
|
|
& ( (p%parms%aggr_kind == mld_biz_prol_).and.&
|
|
|
|
|
|
|
|
& (p%parms%coarse_mat == mld_repl_mat_)) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
filter_mat = (p%parms%aggr_filter == mld_filter_mat_)
|
|
|
|
filter_mat = (p%parms%aggr_filter == mld_filter_mat_)
|
|
|
|
|
|
|
|
|
|
|
|
if (ml_global_nmb) then
|
|
|
|
|
|
|
|
ilaggr(1:nrow) = ilaggr(1:nrow) + naggrm1
|
|
|
|
ilaggr(1:nrow) = ilaggr(1:nrow) + naggrm1
|
|
|
|
call psb_halo(ilaggr,desc_a,info)
|
|
|
|
call psb_halo(ilaggr,desc_a,info)
|
|
|
|
|
|
|
|
|
|
|
@ -178,7 +160,6 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_halo')
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_halo')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! naggr: number of local aggregates
|
|
|
|
! naggr: number of local aggregates
|
|
|
|
! nrow: local rows.
|
|
|
|
! nrow: local rows.
|
|
|
@ -202,7 +183,6 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
! 1. Allocate Ptilde in sparse matrix form
|
|
|
|
! 1. Allocate Ptilde in sparse matrix form
|
|
|
|
if (ml_global_nmb) then
|
|
|
|
|
|
|
|
call acoo%allocate(ncol,ntaggr,ncol)
|
|
|
|
call acoo%allocate(ncol,ntaggr,ncol)
|
|
|
|
do i=1,ncol
|
|
|
|
do i=1,ncol
|
|
|
|
acoo%val(i) = cone
|
|
|
|
acoo%val(i) = cone
|
|
|
@ -210,15 +190,6 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
acoo%ja(i) = ilaggr(i)
|
|
|
|
acoo%ja(i) = ilaggr(i)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
call acoo%set_nzeros(ncol)
|
|
|
|
call acoo%set_nzeros(ncol)
|
|
|
|
else
|
|
|
|
|
|
|
|
call acoo%allocate(ncol,naggr,ncol)
|
|
|
|
|
|
|
|
do i=1,nrow
|
|
|
|
|
|
|
|
acoo%val(i) = cone
|
|
|
|
|
|
|
|
acoo%ia(i) = i
|
|
|
|
|
|
|
|
acoo%ja(i) = ilaggr(i)
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
call acoo%set_nzeros(nrow)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
call acoo%set_dupl(psb_dupl_add_)
|
|
|
|
call acoo%set_dupl(psb_dupl_add_)
|
|
|
|
|
|
|
|
|
|
|
|
call ptilde%mv_from_coo(acoo,info)
|
|
|
|
call ptilde%mv_from_coo(acoo,info)
|
|
|
@ -285,35 +256,7 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
|
|
|
|
|
|
|
|
if (p%parms%aggr_eig == mld_max_norm_) then
|
|
|
|
if (p%parms%aggr_eig == mld_max_norm_) then
|
|
|
|
|
|
|
|
|
|
|
|
if (p%parms%aggr_kind == mld_biz_prol_) then
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
! This only works with CSR
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
anorm = szero
|
|
|
|
|
|
|
|
dg = sone
|
|
|
|
|
|
|
|
nrw = acsr3%get_nrows()
|
|
|
|
|
|
|
|
do i=1, nrw
|
|
|
|
|
|
|
|
tmp = szero
|
|
|
|
|
|
|
|
do j=acsr3%irp(i),acsr3%irp(i+1)-1
|
|
|
|
|
|
|
|
if (acsr3%ja(j) <= nrw) then
|
|
|
|
|
|
|
|
tmp = tmp + abs(acsr3%val(j))
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (acsr3%ja(j) == i ) then
|
|
|
|
|
|
|
|
dg = abs(acsr3%val(j))
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
anorm = max(anorm,tmp/dg)
|
|
|
|
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_amx(ictxt,anorm)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
anorm = acsr3%csnmi()
|
|
|
|
anorm = acsr3%csnmi()
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Invalid AM3 storage format')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
omega = 4.d0/(3.d0*anorm)
|
|
|
|
omega = 4.d0/(3.d0*anorm)
|
|
|
|
p%parms%aggr_omega_val = omega
|
|
|
|
p%parms%aggr_omega_val = omega
|
|
|
|
|
|
|
|
|
|
|
@ -409,38 +352,33 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
call ptilde%free()
|
|
|
|
call ptilde%free()
|
|
|
|
call acsr1%set_dupl(psb_dupl_add_)
|
|
|
|
call acsr1%set_dupl(psb_dupl_add_)
|
|
|
|
|
|
|
|
|
|
|
|
call am1%mv_from(acsr1)
|
|
|
|
call op_prol%mv_from(acsr1)
|
|
|
|
if (ml_global_nmb) then
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Now we have to gather the halo of am1, 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(am1,desc_a,am4,info,&
|
|
|
|
call psb_sphalo(op_prol,desc_a,am4,info,&
|
|
|
|
& colcnv=.false.,rowscale=.true.)
|
|
|
|
& colcnv=.false.,rowscale=.true.)
|
|
|
|
if (info == psb_success_) call psb_rwextd(ncol,am1,info,b=am4)
|
|
|
|
if (info == psb_success_) call psb_rwextd(ncol,op_prol,info,b=am4)
|
|
|
|
if (info == psb_success_) call am4%free()
|
|
|
|
if (info == psb_success_) call am4%free()
|
|
|
|
else
|
|
|
|
|
|
|
|
call psb_rwextd(ncol,am1,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Halo of am1')
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Halo of op_prol')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
call psb_symbmm(a,am1,am3,info)
|
|
|
|
call psb_symbmm(a,op_prol,am3,info)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='symbmm 2')
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='symbmm 2')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
call psb_numbmm(a,am1,am3)
|
|
|
|
call psb_numbmm(a,op_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',p%parms%aggr_kind, mld_smooth_prol_
|
|
|
|
& 'Done NUMBMM 2',p%parms%aggr_kind, mld_smooth_prol_
|
|
|
|
|
|
|
|
|
|
|
|
if (p%parms%aggr_kind == mld_smooth_prol_) then
|
|
|
|
call op_prol%transp(op_restr)
|
|
|
|
call am1%transp(am2)
|
|
|
|
call op_restr%mv_to(acoo)
|
|
|
|
call am2%mv_to(acoo)
|
|
|
|
|
|
|
|
nzl = acoo%get_nzeros()
|
|
|
|
nzl = acoo%get_nzeros()
|
|
|
|
i=0
|
|
|
|
i=0
|
|
|
|
!
|
|
|
|
!
|
|
|
@ -457,28 +395,21 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
call acoo%set_nzeros(i)
|
|
|
|
call acoo%set_nzeros(i)
|
|
|
|
call acoo%trim()
|
|
|
|
call acoo%trim()
|
|
|
|
call am2%mv_from(acoo)
|
|
|
|
call op_restr%mv_from(acoo)
|
|
|
|
call am2%cscnv(info,type='csr',dupl=psb_dupl_add_)
|
|
|
|
call op_restr%cscnv(info,type='csr',dupl=psb_dupl_add_)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='spcnv am2')
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='spcnv op_restr')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
else
|
|
|
|
|
|
|
|
call am1%transp(am2)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
if (debug_level >= psb_debug_outer_) &
|
|
|
|
if (debug_level >= psb_debug_outer_) &
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& 'starting sphalo/ rwxtd'
|
|
|
|
& 'starting sphalo/ rwxtd'
|
|
|
|
|
|
|
|
|
|
|
|
if (p%parms%aggr_kind == mld_smooth_prol_) then
|
|
|
|
! op_restr = ((i-wDA)Ptilde)^T
|
|
|
|
! am2 = ((i-wDA)Ptilde)^T
|
|
|
|
|
|
|
|
call psb_sphalo(am3,desc_a,am4,info,&
|
|
|
|
call psb_sphalo(am3,desc_a,am4,info,&
|
|
|
|
& colcnv=.false.,rowscale=.true.)
|
|
|
|
& colcnv=.false.,rowscale=.true.)
|
|
|
|
if (info == psb_success_) call psb_rwextd(ncol,am3,info,b=am4)
|
|
|
|
if (info == psb_success_) call psb_rwextd(ncol,am3,info,b=am4)
|
|
|
|
if (info == psb_success_) call am4%free()
|
|
|
|
if (info == psb_success_) call am4%free()
|
|
|
|
else if (p%parms%aggr_kind == mld_biz_prol_) then
|
|
|
|
|
|
|
|
call psb_rwextd(ncol,am3,info)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Extend am3')
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Extend am3')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
@ -488,27 +419,22 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
if (debug_level >= psb_debug_outer_) &
|
|
|
|
if (debug_level >= psb_debug_outer_) &
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& 'starting symbmm 3'
|
|
|
|
& 'starting symbmm 3'
|
|
|
|
call psb_symbmm(am2,am3,b,info)
|
|
|
|
call psb_symbmm(op_restr,am3,b,info)
|
|
|
|
if (info == psb_success_) call psb_numbmm(am2,am3,b)
|
|
|
|
if (info == psb_success_) call psb_numbmm(op_restr,am3,b)
|
|
|
|
if (info == psb_success_) call am3%free()
|
|
|
|
if (info == psb_success_) call am3%free()
|
|
|
|
if (info == psb_success_) call b%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
|
|
|
if (info == psb_success_) call b%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Build b = am2 x am3')
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Build b = op_restr x am3')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select case(p%parms%aggr_kind)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case(mld_smooth_prol_)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select case(p%parms%coarse_mat)
|
|
|
|
select case(p%parms%coarse_mat)
|
|
|
|
|
|
|
|
|
|
|
|
case(mld_distr_mat_)
|
|
|
|
case(mld_distr_mat_)
|
|
|
|
|
|
|
|
|
|
|
|
nzac = b%get_nzeros()
|
|
|
|
nzl = b%get_nzeros()
|
|
|
|
nzl = nzac
|
|
|
|
|
|
|
|
call b%mv_to(bcoo)
|
|
|
|
call b%mv_to(bcoo)
|
|
|
|
|
|
|
|
|
|
|
|
if (info == psb_success_) call psb_cdall(ictxt,p%desc_ac,info,nl=nlaggr(me+1))
|
|
|
|
if (info == psb_success_) call psb_cdall(ictxt,p%desc_ac,info,nl=nlaggr(me+1))
|
|
|
@ -530,38 +456,37 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
call p%ac%set_ncols(p%desc_ac%get_local_cols())
|
|
|
|
call p%ac%set_ncols(p%desc_ac%get_local_cols())
|
|
|
|
call p%ac%set_asb()
|
|
|
|
call p%ac%set_asb()
|
|
|
|
|
|
|
|
|
|
|
|
if (info == psb_success_) deallocate(nzbr,idisp,stat=info)
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_sp_free')
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_sp_free')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
if (np>1) then
|
|
|
|
if (np>1) then
|
|
|
|
call am1%mv_to(acsr1)
|
|
|
|
call op_prol%mv_to(acsr1)
|
|
|
|
nzl = acsr1%get_nzeros()
|
|
|
|
nzl = acsr1%get_nzeros()
|
|
|
|
call psb_glob_to_loc(acsr1%ja(1:nzl),p%desc_ac,info,'I')
|
|
|
|
call psb_glob_to_loc(acsr1%ja(1:nzl),p%desc_ac,info,'I')
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_glob_to_loc')
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_glob_to_loc')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
call am1%mv_from(acsr1)
|
|
|
|
call op_prol%mv_from(acsr1)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
call am1%set_ncols(p%desc_ac%get_local_cols())
|
|
|
|
call op_prol%set_ncols(p%desc_ac%get_local_cols())
|
|
|
|
|
|
|
|
|
|
|
|
if (np>1) then
|
|
|
|
if (np>1) then
|
|
|
|
call am2%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
|
|
|
call op_restr%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
|
|
|
call am2%mv_to(acoo)
|
|
|
|
call op_restr%mv_to(acoo)
|
|
|
|
nzl = acoo%get_nzeros()
|
|
|
|
nzl = acoo%get_nzeros()
|
|
|
|
if (info == psb_success_) call psb_glob_to_loc(acoo%ia(1:nzl),p%desc_ac,info,'I')
|
|
|
|
if (info == psb_success_) call psb_glob_to_loc(acoo%ia(1:nzl),p%desc_ac,info,'I')
|
|
|
|
call acoo%set_dupl(psb_dupl_add_)
|
|
|
|
call acoo%set_dupl(psb_dupl_add_)
|
|
|
|
if (info == psb_success_) call am2%mv_from(acoo)
|
|
|
|
if (info == psb_success_) call op_restr%mv_from(acoo)
|
|
|
|
if (info == psb_success_) call am2%cscnv(info,type='csr')
|
|
|
|
if (info == psb_success_) call op_restr%cscnv(info,type='csr')
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Converting am2 to local')
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Converting op_restr to local')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
call am2%set_nrows(p%desc_ac%get_local_cols())
|
|
|
|
call op_restr%set_nrows(p%desc_ac%get_local_cols())
|
|
|
|
|
|
|
|
|
|
|
|
if (debug_level >= psb_debug_outer_) &
|
|
|
|
if (debug_level >= psb_debug_outer_) &
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
|
& write(debug_unit,*) me,' ',trim(name),&
|
|
|
@ -577,73 +502,12 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) goto 9999
|
|
|
|
if (info /= psb_success_) goto 9999
|
|
|
|
|
|
|
|
|
|
|
|
deallocate(nzbr,idisp,stat=info)
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
info = psb_err_alloc_dealloc_
|
|
|
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
case default
|
|
|
|
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
|
|
|
|
call psb_errpush(info,name,a_err='invalid mld_coarse_mat_')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case(mld_biz_prol_)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
select case(p%parms%coarse_mat)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case(mld_distr_mat_)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call psb_move_alloc(b,p%ac,info)
|
|
|
|
|
|
|
|
if (info == psb_success_) call psb_cdall(ictxt,p%desc_ac,info,nl=naggr)
|
|
|
|
|
|
|
|
if (info == psb_success_) call psb_cdasb(p%desc_ac,info)
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='Build desc_ac, ac')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case(mld_repl_mat_)
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
!
|
|
|
|
|
|
|
|
call psb_cdall(ictxt,p%desc_ac,info,mg=ntaggr,repl=.true.)
|
|
|
|
|
|
|
|
if (info == psb_success_) call psb_cdasb(p%desc_ac,info)
|
|
|
|
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='psb_cdall')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
call psb_gather(p%ac,b,p%desc_ac,info,dupl=psb_dupl_add_,keeploc=.false.)
|
|
|
|
|
|
|
|
if(info /= psb_success_) goto 9999
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deallocate(nzbr,idisp,stat=info)
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
info = psb_err_alloc_dealloc_
|
|
|
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
case default
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
call psb_errpush(info,name,a_err='invalid mld_coarse_mat_')
|
|
|
|
call psb_errpush(info,name,a_err='invalid mld_coarse_mat_')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end select
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
|
|
deallocate(nzbr,idisp,stat=info)
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
info = psb_err_alloc_dealloc_
|
|
|
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case default
|
|
|
|
|
|
|
|
info = psb_err_internal_error_
|
|
|
|
|
|
|
|
call psb_errpush(info,name,a_err='invalid mld_smooth_prol_')
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
call p%ac%cscnv(info,type='csr',dupl=psb_dupl_add_)
|
|
|
|
call p%ac%cscnv(info,type='csr',dupl=psb_dupl_add_)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='spcnv')
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='spcnv')
|
|
|
@ -652,14 +516,14 @@ subroutine mld_caggrmat_smth_asb(a,desc_a,ilaggr,nlaggr,p,info)
|
|
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! Copy the prolongation/restriction matrices into the descriptor map.
|
|
|
|
! Copy the prolongation/restriction matrices into the descriptor map.
|
|
|
|
! am2 => PR^T i.e. restriction operator
|
|
|
|
! op_restr => PR^T i.e. restriction operator
|
|
|
|
! am1 => PR i.e. prolongation operator
|
|
|
|
! op_prol => PR i.e. prolongation operator
|
|
|
|
!
|
|
|
|
!
|
|
|
|
|
|
|
|
|
|
|
|
p%map = psb_linmap(psb_map_aggr_,desc_a,&
|
|
|
|
p%map = psb_linmap(psb_map_aggr_,desc_a,&
|
|
|
|
& p%desc_ac,am2,am1,ilaggr,nlaggr)
|
|
|
|
& p%desc_ac,op_restr,op_prol,ilaggr,nlaggr)
|
|
|
|
if (info == psb_success_) call am1%free()
|
|
|
|
if (info == psb_success_) call op_prol%free()
|
|
|
|
if (info == psb_success_) call am2%free()
|
|
|
|
if (info == psb_success_) call op_restr%free()
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_Free')
|
|
|
|
call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_Free')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|