mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-06 22:55:12 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbed340405 | ||
|
|
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 | ||
|
|
51a9d16975 | ||
|
|
a04f7b4cf0 | ||
|
|
b387308455 | ||
|
|
aba9b29717 | ||
|
|
94ca610bff | ||
|
|
2542c0fda4 | ||
|
|
8482067b52 | ||
|
|
7319dab30f | ||
|
|
4bbba3ebd7 | ||
|
|
988021ff24 | ||
|
|
4e177ce926 | ||
|
|
1fa94d0372 | ||
|
|
0fcbdd74cd | ||
|
|
ba854379e4 | ||
|
|
a6cbd64e65 | ||
|
|
5c589dbf30 | ||
|
|
10e9c53e54 | ||
|
|
0332920a63 | ||
|
|
9b9dfbd198 | ||
|
|
5909e541b0 | ||
|
|
941ca6568a | ||
|
|
39a9c4e4ed | ||
|
|
41b4373494 | ||
|
|
4bf009a1ab |
@@ -81,10 +81,10 @@ module amg_base_prec_type
|
||||
!
|
||||
! Version numbers
|
||||
!
|
||||
character(len=*), parameter :: amg_version_string_ = "1.0.0"
|
||||
character(len=*), parameter :: amg_version_string_ = "1.0.1"
|
||||
integer(psb_ipk_), parameter :: amg_version_major_ = 1
|
||||
integer(psb_ipk_), parameter :: amg_version_minor_ = 0
|
||||
integer(psb_ipk_), parameter :: amg_patchlevel_ = 0
|
||||
integer(psb_ipk_), parameter :: amg_patchlevel_ = 1
|
||||
|
||||
type amg_ml_parms
|
||||
integer(psb_ipk_) :: sweeps_pre, sweeps_post
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+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
|
||||
|
||||
@@ -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,9 +388,9 @@ 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)
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), intent(in) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
@@ -406,7 +404,7 @@ contains
|
||||
call parms%mldescr(iout,info)
|
||||
|
||||
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 +435,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 +450,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 +468,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 +512,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 +538,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 +550,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 +563,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 +573,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 +612,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 +634,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)
|
||||
|
||||
@@ -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,11 +270,13 @@ 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
|
||||
integer(psb_lpk_), allocatable :: gia(:), gja(:)
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='d_sludist_solver_bld', ch_err
|
||||
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_
|
||||
call psb_erractionsave(err_act)
|
||||
@@ -293,19 +295,37 @@ 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 +338,6 @@ contains
|
||||
end if
|
||||
|
||||
call acsr%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
|
||||
@@ -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
|
||||
|
||||
+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
|
||||
|
||||
@@ -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,9 +388,9 @@ 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)
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), intent(in) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
@@ -406,7 +404,7 @@ contains
|
||||
call parms%mldescr(iout,info)
|
||||
|
||||
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 +435,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 +450,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 +468,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 +512,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 +538,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 +550,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 +563,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 +573,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 +612,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 +634,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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,11 +270,13 @@ 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
|
||||
integer(psb_lpk_), allocatable :: gia(:), gja(:)
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='z_sludist_solver_bld', ch_err
|
||||
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_
|
||||
call psb_erractionsave(err_act)
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -122,7 +122,7 @@ subroutine amg_s_parmatch_smth_bld(ag,a,desc_a,ilaggr,nlaggr,parms,&
|
||||
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
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ subroutine amg_s_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
|
||||
! Arguments
|
||||
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
|
||||
|
||||
@@ -108,11 +108,11 @@ subroutine amg_s_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
|
||||
|
||||
! Arguments
|
||||
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) :: ilaggr(:), nlaggr(:)
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||
type(psb_sspmat_type), intent(out) :: ac, op_prol, op_restr
|
||||
type(psb_sspmat_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_s_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
|
||||
! Arguments
|
||||
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
|
||||
|
||||
@@ -86,8 +86,8 @@ subroutine amg_s_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
class(amg_s_symdec_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) :: op_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
!
|
||||
!
|
||||
subroutine amg_saggrmat_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_s_inner_mod, amg_protect_name => amg_saggrmat_minnrg_bld
|
||||
@@ -117,8 +117,8 @@ subroutine amg_saggrmat_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_lsspmat_type), intent(inout) :: op_prol
|
||||
type(psb_lsspmat_type), intent(out) :: ac,op_restr
|
||||
type(psb_lsspmat_type), intent(inout) :: t_prol
|
||||
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
|
||||
|
||||
@@ -171,6 +171,8 @@ subroutine amg_saggrmat_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_saggrmat_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) /= szero) then
|
||||
adinv(i) = sone / adiag(i)
|
||||
else
|
||||
adinv(i) = sone
|
||||
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 = szero
|
||||
do i=1, ncol
|
||||
if (ilaggr(i) >0) then
|
||||
omi(i) = omp(ilaggr(i))
|
||||
else
|
||||
omi(i) = szero
|
||||
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) = szero
|
||||
if(psb_minreal(omf(i)) < szero) omf(i) = szero
|
||||
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 = szero
|
||||
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)=szero
|
||||
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) = sone - 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) = sone - 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 = szero
|
||||
do i=1, ncol
|
||||
if (ilaggr(i) >0) then
|
||||
omi(i) = omp(ilaggr(i))
|
||||
else
|
||||
omi(i) = szero
|
||||
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) = szero
|
||||
if(psb_minreal(omf(i)) < szero) omf(i) = szero
|
||||
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) = sone - 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) /= szero) then
|
||||
!!$ adinv(i) = sone / adiag(i)
|
||||
!!$ else
|
||||
!!$ adinv(i) = sone
|
||||
!!$ 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 = szero
|
||||
!!$ do i=1, ncol
|
||||
!!$ if (ilaggr(i) >0) then
|
||||
!!$ omi(i) = omp(ilaggr(i))
|
||||
!!$ else
|
||||
!!$ omi(i) = szero
|
||||
!!$ 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) = szero
|
||||
!!$ if(psb_minreal(omf(i)) < szero) omf(i) = szero
|
||||
!!$ 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 = szero
|
||||
!!$ 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)=szero
|
||||
!!$ 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) = sone - 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) = sone - 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 = szero
|
||||
!!$ do i=1, ncol
|
||||
!!$ if (ilaggr(i) >0) then
|
||||
!!$ omi(i) = omp(ilaggr(i))
|
||||
!!$ else
|
||||
!!$ omi(i) = szero
|
||||
!!$ 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) = szero
|
||||
!!$ if(psb_minreal(omf(i)) < szero) omf(i) = szero
|
||||
!!$ 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) = sone - 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_saggrmat_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_sspmat_type), intent(out) :: op_prol,ac,op_restr
|
||||
type(psb_sspmat_type), intent(inout) :: op_prol,ac,op_restr
|
||||
type(psb_lsspmat_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_z_dec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
class(amg_z_dec_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(amg_daggr_data), intent(in) :: ag_data
|
||||
type(psb_zspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_zspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_lzspmat_type), intent(out) :: t_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -86,8 +86,8 @@ subroutine amg_z_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
class(amg_z_symdec_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(amg_daggr_data), intent(in) :: ag_data
|
||||
type(psb_zspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
type(psb_zspmat_type), intent(inout) :: a
|
||||
type(psb_desc_type), intent(inout) :: desc_a
|
||||
integer(psb_lpk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_lzspmat_type), intent(out) :: op_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
!
|
||||
!
|
||||
subroutine amg_zaggrmat_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_z_inner_mod, amg_protect_name => amg_zaggrmat_minnrg_bld
|
||||
@@ -117,8 +117,8 @@ subroutine amg_zaggrmat_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_lzspmat_type), intent(inout) :: op_prol
|
||||
type(psb_lzspmat_type), intent(out) :: ac,op_restr
|
||||
type(psb_lzspmat_type), intent(inout) :: t_prol
|
||||
type(psb_zspmat_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_zaggrmat_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_zaggrmat_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) /= zzero) then
|
||||
adinv(i) = zone / adiag(i)
|
||||
else
|
||||
adinv(i) = zone
|
||||
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 = zzero
|
||||
do i=1, ncol
|
||||
if (ilaggr(i) >0) then
|
||||
omi(i) = omp(ilaggr(i))
|
||||
else
|
||||
omi(i) = zzero
|
||||
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) = zzero
|
||||
if(psb_minreal(omf(i)) < dzero) omf(i) = zzero
|
||||
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 = zzero
|
||||
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)=zzero
|
||||
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) = zone - 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) = zone - 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 = zzero
|
||||
do i=1, ncol
|
||||
if (ilaggr(i) >0) then
|
||||
omi(i) = omp(ilaggr(i))
|
||||
else
|
||||
omi(i) = zzero
|
||||
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) = zzero
|
||||
if(psb_minreal(omf(i)) < dzero) omf(i) = zzero
|
||||
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) = zone - 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) /= zzero) then
|
||||
!!$ adinv(i) = zone / adiag(i)
|
||||
!!$ else
|
||||
!!$ adinv(i) = zone
|
||||
!!$ 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 = zzero
|
||||
!!$ do i=1, ncol
|
||||
!!$ if (ilaggr(i) >0) then
|
||||
!!$ omi(i) = omp(ilaggr(i))
|
||||
!!$ else
|
||||
!!$ omi(i) = zzero
|
||||
!!$ 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) = zzero
|
||||
!!$ if(psb_minreal(omf(i)) < dzero) omf(i) = zzero
|
||||
!!$ 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 = zzero
|
||||
!!$ 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)=zzero
|
||||
!!$ 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) = zone - 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) = zone - 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 = zzero
|
||||
!!$ do i=1, ncol
|
||||
!!$ if (ilaggr(i) >0) then
|
||||
!!$ omi(i) = omp(ilaggr(i))
|
||||
!!$ else
|
||||
!!$ omi(i) = zzero
|
||||
!!$ 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) = zzero
|
||||
!!$ if(psb_minreal(omf(i)) < dzero) omf(i) = zzero
|
||||
!!$ 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) = zone - 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_zaggrmat_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_zspmat_type), intent(out) :: op_prol,ac,op_restr
|
||||
type(psb_zspmat_type), intent(inout) :: op_prol,ac,op_restr
|
||||
type(psb_lzspmat_type), intent(inout) :: t_prol
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
@@ -571,7 +571,6 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
|
||||
type(amg_c_krm_solver_type) :: krm_slv
|
||||
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
|
||||
call p%precv(nlev_)%set(krm_slv,info)
|
||||
call p%precv(nlev_)%default()
|
||||
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
|
||||
end block
|
||||
end select
|
||||
@@ -729,7 +728,6 @@ subroutine amg_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
|
||||
type(amg_c_krm_solver_type) :: krm_slv
|
||||
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
|
||||
call p%precv(nlev_)%set(krm_slv,info)
|
||||
call p%precv(nlev_)%default()
|
||||
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
|
||||
end block
|
||||
end select
|
||||
|
||||
@@ -45,7 +45,7 @@ subroutine amg_cprecsetsm(p,val,info,ilev,ilmax,pos)
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
class(amg_cprec_type), intent(inout) :: p
|
||||
class(amg_cprec_type), target, intent(inout):: p
|
||||
class(amg_c_base_smoother_type), intent(in) :: val
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
|
||||
|
||||
@@ -599,7 +599,6 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
|
||||
type(amg_d_krm_solver_type) :: krm_slv
|
||||
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
|
||||
call p%precv(nlev_)%set(krm_slv,info)
|
||||
call p%precv(nlev_)%default()
|
||||
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
|
||||
end block
|
||||
end select
|
||||
@@ -773,7 +772,6 @@ subroutine amg_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
|
||||
type(amg_d_krm_solver_type) :: krm_slv
|
||||
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
|
||||
call p%precv(nlev_)%set(krm_slv,info)
|
||||
call p%precv(nlev_)%default()
|
||||
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
|
||||
end block
|
||||
end select
|
||||
|
||||
@@ -45,7 +45,7 @@ subroutine amg_dprecsetsm(p,val,info,ilev,ilmax,pos)
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
class(amg_dprec_type), intent(inout) :: p
|
||||
class(amg_dprec_type), target, intent(inout):: p
|
||||
class(amg_d_base_smoother_type), intent(in) :: val
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
|
||||
|
||||
@@ -94,7 +94,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#define HANDLE_SIZE 8
|
||||
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
typedef struct {
|
||||
SuperMatrix *A;
|
||||
dLUstruct_t *LUstruct;
|
||||
@@ -135,7 +135,7 @@ int amg_dsludist_fact(int n, int nl, int nnzl, int ffstr,
|
||||
SuperMatrix *A;
|
||||
NRformat_loc *Astore;
|
||||
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
dScalePermstruct_t *ScalePermstruct;
|
||||
dLUstruct_t *LUstruct;
|
||||
dSOLVEstruct_t SOLVEstruct;
|
||||
@@ -148,9 +148,9 @@ int amg_dsludist_fact(int n, int nl, int nnzl, int ffstr,
|
||||
int i, panel_size, permc_spec, relax, info;
|
||||
trans_t trans;
|
||||
double drop_tol = 0.0, b[1], berr[1];
|
||||
#if defined(SLUD_VERSION_63) || defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
|
||||
#if (SLUD_VERSION_>=50)
|
||||
superlu_dist_options_t options;
|
||||
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
||||
#elif (SLUD_VERSION_>=30)
|
||||
superlu_options_t options;
|
||||
#else
|
||||
choke_on_me;
|
||||
@@ -174,7 +174,7 @@ int amg_dsludist_fact(int n, int nl, int nnzl, int ffstr,
|
||||
SLU_NR_loc, SLU_D, SLU_GE);
|
||||
|
||||
/* Initialize ScalePermstruct and LUstruct. */
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
ScalePermstruct = (dScalePermstruct_t *) SUPERLU_MALLOC(sizeof(dScalePermstruct_t));
|
||||
LUstruct = (dLUstruct_t *) SUPERLU_MALLOC(sizeof(dLUstruct_t));
|
||||
dScalePermstructInit(n,n, ScalePermstruct);
|
||||
@@ -183,11 +183,11 @@ int amg_dsludist_fact(int n, int nl, int nnzl, int ffstr,
|
||||
LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t));
|
||||
ScalePermstructInit(n,n, ScalePermstruct);
|
||||
#endif
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
dLUstructInit(n, LUstruct);
|
||||
#elif defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5) || defined(SLUD_VERSION_6)
|
||||
#elif (SLUD_VERSION_>=40)
|
||||
LUstructInit(n, LUstruct);
|
||||
#elif defined(SLUD_VERSION_3)
|
||||
#elif (SLUD_VERSION_>=30)
|
||||
LUstructInit(n,n, LUstruct);
|
||||
#else
|
||||
choke_on_me;
|
||||
@@ -245,7 +245,7 @@ int amg_dsludist_solve(int itrans, int n, int nrhs,
|
||||
*/
|
||||
#ifdef Have_SLUDist_
|
||||
SuperMatrix *A;
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
dScalePermstruct_t *ScalePermstruct;
|
||||
dLUstruct_t *LUstruct;
|
||||
dSOLVEstruct_t SOLVEstruct;
|
||||
@@ -259,9 +259,9 @@ int amg_dsludist_solve(int itrans, int n, int nrhs,
|
||||
trans_t trans;
|
||||
double drop_tol = 0.0;
|
||||
double *berr;
|
||||
#if defined(SLUD_VERSION_63) || defined(SLUD_VERSION_6) ||defined(SLUD_VERSION_5)
|
||||
#if (SLUD_VERSION_>=50)
|
||||
superlu_dist_options_t options;
|
||||
#elif defined(SLUD_VERSION_4)|| defined(SLUD_VERSION_3)
|
||||
#elif (SLUD_VERSION_>=30)
|
||||
superlu_options_t options;
|
||||
#else
|
||||
choke_on_me;
|
||||
@@ -331,7 +331,7 @@ int amg_dsludist_free(void *f_factors)
|
||||
*/
|
||||
#ifdef Have_SLUDist_
|
||||
SuperMatrix *A;
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
dScalePermstruct_t *ScalePermstruct;
|
||||
dLUstruct_t *LUstruct;
|
||||
dSOLVEstruct_t SOLVEstruct;
|
||||
@@ -345,9 +345,9 @@ int amg_dsludist_free(void *f_factors)
|
||||
trans_t trans;
|
||||
double drop_tol = 0.0;
|
||||
double *berr;
|
||||
#if defined(SLUD_VERSION_63)||defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
|
||||
#if (SLUD_VERSION_>=50)
|
||||
superlu_dist_options_t options;
|
||||
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
||||
#elif (SLUD_VERSION_>=30)
|
||||
superlu_options_t options;
|
||||
#else
|
||||
choke_on_me;
|
||||
@@ -368,7 +368,7 @@ int amg_dsludist_free(void *f_factors)
|
||||
// we either have a leak or a segfault here.
|
||||
// To be investigated further.
|
||||
//Destroy_CompRowLoc_Matrix_dist(A);
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
dScalePermstructFree(ScalePermstruct);
|
||||
dLUstructFree(LUstruct);
|
||||
#else
|
||||
|
||||
@@ -571,7 +571,6 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
|
||||
type(amg_s_krm_solver_type) :: krm_slv
|
||||
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
|
||||
call p%precv(nlev_)%set(krm_slv,info)
|
||||
call p%precv(nlev_)%default()
|
||||
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
|
||||
end block
|
||||
end select
|
||||
@@ -729,7 +728,6 @@ subroutine amg_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
|
||||
type(amg_s_krm_solver_type) :: krm_slv
|
||||
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
|
||||
call p%precv(nlev_)%set(krm_slv,info)
|
||||
call p%precv(nlev_)%default()
|
||||
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
|
||||
end block
|
||||
end select
|
||||
|
||||
@@ -45,7 +45,7 @@ subroutine amg_sprecsetsm(p,val,info,ilev,ilmax,pos)
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
class(amg_sprec_type), intent(inout) :: p
|
||||
class(amg_sprec_type), target, intent(inout):: p
|
||||
class(amg_s_base_smoother_type), intent(in) :: val
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
|
||||
|
||||
@@ -599,7 +599,6 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
|
||||
type(amg_z_krm_solver_type) :: krm_slv
|
||||
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
|
||||
call p%precv(nlev_)%set(krm_slv,info)
|
||||
call p%precv(nlev_)%default()
|
||||
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
|
||||
end block
|
||||
end select
|
||||
@@ -773,7 +772,6 @@ subroutine amg_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
|
||||
type(amg_z_krm_solver_type) :: krm_slv
|
||||
call p%precv(nlev_)%set('SMOOTHER_TYPE',amg_krm_,info,pos=pos)
|
||||
call p%precv(nlev_)%set(krm_slv,info)
|
||||
call p%precv(nlev_)%default()
|
||||
call p%precv(nlev_)%set('COARSE_MAT',amg_distr_mat_,info,pos=pos)
|
||||
end block
|
||||
end select
|
||||
|
||||
@@ -45,7 +45,7 @@ subroutine amg_zprecsetsm(p,val,info,ilev,ilmax,pos)
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
class(amg_zprec_type), intent(inout) :: p
|
||||
class(amg_zprec_type), target, intent(inout):: p
|
||||
class(amg_z_base_smoother_type), intent(in) :: val
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
|
||||
|
||||
@@ -94,7 +94,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#define HANDLE_SIZE 8
|
||||
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
typedef struct {
|
||||
SuperMatrix *A;
|
||||
zLUstruct_t *LUstruct;
|
||||
@@ -142,7 +142,7 @@ int amg_zsludist_fact(int n, int nl, int nnzl, int ffstr,
|
||||
SuperMatrix *A;
|
||||
NRformat_loc *Astore;
|
||||
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
zScalePermstruct_t *ScalePermstruct;
|
||||
zLUstruct_t *LUstruct;
|
||||
zSOLVEstruct_t SOLVEstruct;
|
||||
@@ -155,9 +155,9 @@ int amg_zsludist_fact(int n, int nl, int nnzl, int ffstr,
|
||||
int i, panel_size, permc_spec, relax, info;
|
||||
trans_t trans;
|
||||
double drop_tol = 0.0,berr[1];
|
||||
#if defined(SLUD_VERSION_63) || defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
|
||||
#if (SLUD_VERSION_>=50)
|
||||
superlu_dist_options_t options;
|
||||
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
||||
#elif (SLUD_VERSION_>=30)
|
||||
superlu_options_t options;
|
||||
#else
|
||||
choke_on_me;
|
||||
@@ -181,7 +181,7 @@ int amg_zsludist_fact(int n, int nl, int nnzl, int ffstr,
|
||||
SLU_NR_loc, SLU_Z, SLU_GE);
|
||||
|
||||
/* Initialize ScalePermstruct and LUstruct. */
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
ScalePermstruct = (zScalePermstruct_t *) SUPERLU_MALLOC(sizeof(zScalePermstruct_t));
|
||||
LUstruct = (zLUstruct_t *) SUPERLU_MALLOC(sizeof(zLUstruct_t));
|
||||
zScalePermstructInit(n,n, ScalePermstruct);
|
||||
@@ -190,11 +190,11 @@ int amg_zsludist_fact(int n, int nl, int nnzl, int ffstr,
|
||||
LUstruct = (LUstruct_t *) SUPERLU_MALLOC(sizeof(LUstruct_t));
|
||||
ScalePermstructInit(n,n, ScalePermstruct);
|
||||
#endif
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
zLUstructInit(n, LUstruct);
|
||||
#elif defined(SLUD_VERSION_4) || defined(SLUD_VERSION_5) || defined(SLUD_VERSION_6)
|
||||
#elif (SLUD_VERSION_>=40)
|
||||
LUstructInit(n, LUstruct);
|
||||
#elif defined(SLUD_VERSION_3)
|
||||
#elif (SLUD_VERSION_>=30)
|
||||
LUstructInit(n,n, LUstruct);
|
||||
#else
|
||||
choke_on_me;
|
||||
@@ -257,7 +257,7 @@ int amg_zsludist_solve(int itrans, int n, int nrhs,
|
||||
*/
|
||||
#ifdef Have_SLUDist_
|
||||
SuperMatrix *A;
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
zScalePermstruct_t *ScalePermstruct;
|
||||
zLUstruct_t *LUstruct;
|
||||
zSOLVEstruct_t SOLVEstruct;
|
||||
@@ -271,9 +271,9 @@ int amg_zsludist_solve(int itrans, int n, int nrhs,
|
||||
trans_t trans;
|
||||
double drop_tol = 0.0;
|
||||
double *berr;
|
||||
#if defined(SLUD_VERSION_63) || defined(SLUD_VERSION_6) ||defined(SLUD_VERSION_5)
|
||||
#if (SLUD_VERSION_>=50)
|
||||
superlu_dist_options_t options;
|
||||
#elif defined(SLUD_VERSION_4)|| defined(SLUD_VERSION_3)
|
||||
#elif (SLUD_VERSION_>=30)
|
||||
superlu_options_t options;
|
||||
#else
|
||||
choke_on_me;
|
||||
@@ -343,7 +343,7 @@ int amg_zsludist_free(void *f_factors)
|
||||
*/
|
||||
#ifdef Have_SLUDist_
|
||||
SuperMatrix *A;
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
zScalePermstruct_t *ScalePermstruct;
|
||||
zLUstruct_t *LUstruct;
|
||||
zSOLVEstruct_t SOLVEstruct;
|
||||
@@ -357,9 +357,9 @@ int amg_zsludist_free(void *f_factors)
|
||||
trans_t trans;
|
||||
double drop_tol = 0.0;
|
||||
double *berr;
|
||||
#if defined(SLUD_VERSION_63)||defined(SLUD_VERSION_6)||defined(SLUD_VERSION_5)
|
||||
#if (SLUD_VERSION_>=50)
|
||||
superlu_dist_options_t options;
|
||||
#elif defined(SLUD_VERSION_4)||defined(SLUD_VERSION_3)
|
||||
#elif (SLUD_VERSION_>=30)
|
||||
superlu_options_t options;
|
||||
#else
|
||||
choke_on_me;
|
||||
@@ -380,7 +380,7 @@ int amg_zsludist_free(void *f_factors)
|
||||
// we either have a leak or a segfault here.
|
||||
// To be investigated further.
|
||||
//Destroy_CompRowLoc_Matrix_dist(A);
|
||||
#if defined(SLUD_VERSION_63)
|
||||
#if (SLUD_VERSION_>=63)
|
||||
zScalePermstructFree(ScalePermstruct);
|
||||
zLUstructFree(LUstruct);
|
||||
#else
|
||||
|
||||
@@ -83,6 +83,8 @@ subroutine amg_c_base_onelev_descr(lv,il,nl,ilmin,info,iout,verbosity)
|
||||
write(iout_,*)
|
||||
if (il == ilmin) then
|
||||
call lv%parms%mlcycledsc(iout_,info)
|
||||
end if
|
||||
if (((ilmin==1).and.(il==2)).or.((ilmin>1).and.(il==ilmin))) then
|
||||
if (allocated(lv%aggr)) then
|
||||
call lv%aggr%descr(lv%parms,iout_,info)
|
||||
else
|
||||
|
||||
@@ -101,7 +101,13 @@ subroutine amg_c_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
|
||||
if (global_num_) then
|
||||
if (level >= 2) then
|
||||
if (level == 1) then
|
||||
if (ac_) then
|
||||
ivr = lv%base_desc%get_global_indices(owned=.false.)
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%base_a%print(fname,head=head,iv=ivr)
|
||||
end if
|
||||
else if (level >= 2) then
|
||||
if (ac_) then
|
||||
ivr = lv%desc_ac%get_global_indices(owned=.false.)
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
@@ -126,7 +132,12 @@ subroutine amg_c_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
end if
|
||||
else
|
||||
if (level >= 2) then
|
||||
if (level == 1) then
|
||||
if (ac_) then
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%base_a%print(fname,head=head)
|
||||
end if
|
||||
else if (level >= 2) then
|
||||
if (ac_) then
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%ac%print(fname,head=head)
|
||||
@@ -146,16 +157,7 @@ subroutine amg_c_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
end if
|
||||
|
||||
if (level >= 2) then
|
||||
if (allocated(lv%sm)) then
|
||||
call lv%sm%dump(lv%desc_ac,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)
|
||||
end if
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%dump(lv%desc_ac,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm2a",global_num=global_num)
|
||||
end if
|
||||
else
|
||||
if (level >= 1) then
|
||||
if (allocated(lv%sm)) then
|
||||
call lv%sm%dump(lv%base_desc,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)
|
||||
|
||||
@@ -83,6 +83,8 @@ subroutine amg_d_base_onelev_descr(lv,il,nl,ilmin,info,iout,verbosity)
|
||||
write(iout_,*)
|
||||
if (il == ilmin) then
|
||||
call lv%parms%mlcycledsc(iout_,info)
|
||||
end if
|
||||
if (((ilmin==1).and.(il==2)).or.((ilmin>1).and.(il==ilmin))) then
|
||||
if (allocated(lv%aggr)) then
|
||||
call lv%aggr%descr(lv%parms,iout_,info)
|
||||
else
|
||||
|
||||
@@ -101,7 +101,13 @@ subroutine amg_d_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
|
||||
if (global_num_) then
|
||||
if (level >= 2) then
|
||||
if (level == 1) then
|
||||
if (ac_) then
|
||||
ivr = lv%base_desc%get_global_indices(owned=.false.)
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%base_a%print(fname,head=head,iv=ivr)
|
||||
end if
|
||||
else if (level >= 2) then
|
||||
if (ac_) then
|
||||
ivr = lv%desc_ac%get_global_indices(owned=.false.)
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
@@ -126,7 +132,12 @@ subroutine amg_d_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
end if
|
||||
else
|
||||
if (level >= 2) then
|
||||
if (level == 1) then
|
||||
if (ac_) then
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%base_a%print(fname,head=head)
|
||||
end if
|
||||
else if (level >= 2) then
|
||||
if (ac_) then
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%ac%print(fname,head=head)
|
||||
@@ -146,16 +157,7 @@ subroutine amg_d_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
end if
|
||||
|
||||
if (level >= 2) then
|
||||
if (allocated(lv%sm)) then
|
||||
call lv%sm%dump(lv%desc_ac,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)
|
||||
end if
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%dump(lv%desc_ac,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm2a",global_num=global_num)
|
||||
end if
|
||||
else
|
||||
if (level >= 1) then
|
||||
if (allocated(lv%sm)) then
|
||||
call lv%sm%dump(lv%base_desc,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)
|
||||
|
||||
@@ -83,6 +83,8 @@ subroutine amg_s_base_onelev_descr(lv,il,nl,ilmin,info,iout,verbosity)
|
||||
write(iout_,*)
|
||||
if (il == ilmin) then
|
||||
call lv%parms%mlcycledsc(iout_,info)
|
||||
end if
|
||||
if (((ilmin==1).and.(il==2)).or.((ilmin>1).and.(il==ilmin))) then
|
||||
if (allocated(lv%aggr)) then
|
||||
call lv%aggr%descr(lv%parms,iout_,info)
|
||||
else
|
||||
|
||||
@@ -101,7 +101,13 @@ subroutine amg_s_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
|
||||
if (global_num_) then
|
||||
if (level >= 2) then
|
||||
if (level == 1) then
|
||||
if (ac_) then
|
||||
ivr = lv%base_desc%get_global_indices(owned=.false.)
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%base_a%print(fname,head=head,iv=ivr)
|
||||
end if
|
||||
else if (level >= 2) then
|
||||
if (ac_) then
|
||||
ivr = lv%desc_ac%get_global_indices(owned=.false.)
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
@@ -126,7 +132,12 @@ subroutine amg_s_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
end if
|
||||
else
|
||||
if (level >= 2) then
|
||||
if (level == 1) then
|
||||
if (ac_) then
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%base_a%print(fname,head=head)
|
||||
end if
|
||||
else if (level >= 2) then
|
||||
if (ac_) then
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%ac%print(fname,head=head)
|
||||
@@ -146,16 +157,7 @@ subroutine amg_s_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
end if
|
||||
|
||||
if (level >= 2) then
|
||||
if (allocated(lv%sm)) then
|
||||
call lv%sm%dump(lv%desc_ac,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)
|
||||
end if
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%dump(lv%desc_ac,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm2a",global_num=global_num)
|
||||
end if
|
||||
else
|
||||
if (level >= 1) then
|
||||
if (allocated(lv%sm)) then
|
||||
call lv%sm%dump(lv%base_desc,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)
|
||||
|
||||
@@ -83,6 +83,8 @@ subroutine amg_z_base_onelev_descr(lv,il,nl,ilmin,info,iout,verbosity)
|
||||
write(iout_,*)
|
||||
if (il == ilmin) then
|
||||
call lv%parms%mlcycledsc(iout_,info)
|
||||
end if
|
||||
if (((ilmin==1).and.(il==2)).or.((ilmin>1).and.(il==ilmin))) then
|
||||
if (allocated(lv%aggr)) then
|
||||
call lv%aggr%descr(lv%parms,iout_,info)
|
||||
else
|
||||
|
||||
@@ -101,7 +101,13 @@ subroutine amg_z_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
|
||||
if (global_num_) then
|
||||
if (level >= 2) then
|
||||
if (level == 1) then
|
||||
if (ac_) then
|
||||
ivr = lv%base_desc%get_global_indices(owned=.false.)
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%base_a%print(fname,head=head,iv=ivr)
|
||||
end if
|
||||
else if (level >= 2) then
|
||||
if (ac_) then
|
||||
ivr = lv%desc_ac%get_global_indices(owned=.false.)
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
@@ -126,7 +132,12 @@ subroutine amg_z_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
end if
|
||||
else
|
||||
if (level >= 2) then
|
||||
if (level == 1) then
|
||||
if (ac_) then
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%base_a%print(fname,head=head)
|
||||
end if
|
||||
else if (level >= 2) then
|
||||
if (ac_) then
|
||||
write(fname(lname+1:),'(a,i3.3,a)')'_l',level,'_ac.mtx'
|
||||
call lv%ac%print(fname,head=head)
|
||||
@@ -146,16 +157,7 @@ subroutine amg_z_base_onelev_dump(lv,level,info,prefix,head,ac,rp,&
|
||||
end if
|
||||
end if
|
||||
|
||||
if (level >= 2) then
|
||||
if (allocated(lv%sm)) then
|
||||
call lv%sm%dump(lv%desc_ac,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)
|
||||
end if
|
||||
if (allocated(lv%sm2a)) then
|
||||
call lv%sm2a%dump(lv%desc_ac,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm2a",global_num=global_num)
|
||||
end if
|
||||
else
|
||||
if (level >= 1) then
|
||||
if (allocated(lv%sm)) then
|
||||
call lv%sm%dump(lv%base_desc,level,info,smoother=smoother, &
|
||||
& solver=solver,prefix=trim(prefix_)//"_sm",global_num=global_num)
|
||||
|
||||
@@ -61,6 +61,7 @@ subroutine amg_c_as_smoother_free(sm,info)
|
||||
end if
|
||||
end if
|
||||
call sm%nd%free()
|
||||
call sm%desc_data%free(info)
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -61,6 +61,7 @@ subroutine amg_d_as_smoother_free(sm,info)
|
||||
end if
|
||||
end if
|
||||
call sm%nd%free()
|
||||
call sm%desc_data%free(info)
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -61,6 +61,7 @@ subroutine amg_s_as_smoother_free(sm,info)
|
||||
end if
|
||||
end if
|
||||
call sm%nd%free()
|
||||
call sm%desc_data%free(info)
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -61,6 +61,7 @@ subroutine amg_z_as_smoother_free(sm,info)
|
||||
end if
|
||||
end if
|
||||
call sm%nd%free()
|
||||
call sm%desc_data%free(info)
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -42,7 +42,7 @@ subroutine amg_c_base_solver_csetr(sv,what,val,info,idx)
|
||||
Implicit None
|
||||
! Arguments
|
||||
class(amg_c_base_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(in) :: what
|
||||
character(len=*), intent(in) :: what
|
||||
real(psb_spk_), intent(in) :: val
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: idx
|
||||
|
||||
@@ -44,7 +44,7 @@ subroutine amg_c_bwgs_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
! Arguments
|
||||
type(psb_cspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(in) :: desc_a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_c_bwgs_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_cspmat_type), intent(in), target, optional :: b
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
! This is the implementation file corresponding to amg_c_krm_solver_mod.
|
||||
!
|
||||
!
|
||||
subroutine amg_c_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold)
|
||||
subroutine amg_c_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
use amg_c_krm_solver, amg_protect_name => amg_c_krm_solver_bld
|
||||
@@ -85,13 +85,14 @@ subroutine amg_c_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold)
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_cspmat_type), intent(inout), target :: a
|
||||
type(psb_cspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_c_krm_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_cspmat_type), intent(in), target, optional :: b
|
||||
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota
|
||||
integer(psb_lpk_) :: lnr
|
||||
|
||||
@@ -42,7 +42,7 @@ subroutine amg_d_base_solver_csetr(sv,what,val,info,idx)
|
||||
Implicit None
|
||||
! Arguments
|
||||
class(amg_d_base_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(in) :: what
|
||||
character(len=*), intent(in) :: what
|
||||
real(psb_dpk_), intent(in) :: val
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: idx
|
||||
|
||||
@@ -44,7 +44,7 @@ subroutine amg_d_bwgs_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
! Arguments
|
||||
type(psb_dspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(in) :: desc_a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_d_bwgs_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_dspmat_type), intent(in), target, optional :: b
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
! This is the implementation file corresponding to amg_d_krm_solver_mod.
|
||||
!
|
||||
!
|
||||
subroutine amg_d_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold)
|
||||
subroutine amg_d_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
use amg_d_krm_solver, amg_protect_name => amg_d_krm_solver_bld
|
||||
@@ -85,13 +85,14 @@ subroutine amg_d_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold)
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_dspmat_type), intent(inout), target :: a
|
||||
type(psb_dspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_d_krm_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_dspmat_type), intent(in), target, optional :: b
|
||||
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota
|
||||
integer(psb_lpk_) :: lnr
|
||||
|
||||
@@ -42,7 +42,7 @@ subroutine amg_s_base_solver_csetr(sv,what,val,info,idx)
|
||||
Implicit None
|
||||
! Arguments
|
||||
class(amg_s_base_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(in) :: what
|
||||
character(len=*), intent(in) :: what
|
||||
real(psb_spk_), intent(in) :: val
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: idx
|
||||
|
||||
@@ -44,7 +44,7 @@ subroutine amg_s_bwgs_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
! Arguments
|
||||
type(psb_sspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(in) :: desc_a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_s_bwgs_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_sspmat_type), intent(in), target, optional :: b
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
! This is the implementation file corresponding to amg_s_krm_solver_mod.
|
||||
!
|
||||
!
|
||||
subroutine amg_s_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold)
|
||||
subroutine amg_s_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
use amg_s_krm_solver, amg_protect_name => amg_s_krm_solver_bld
|
||||
@@ -85,13 +85,14 @@ subroutine amg_s_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold)
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_sspmat_type), intent(inout), target :: a
|
||||
type(psb_sspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_s_krm_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_sspmat_type), intent(in), target, optional :: b
|
||||
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota
|
||||
integer(psb_lpk_) :: lnr
|
||||
|
||||
@@ -42,7 +42,7 @@ subroutine amg_z_base_solver_csetr(sv,what,val,info,idx)
|
||||
Implicit None
|
||||
! Arguments
|
||||
class(amg_z_base_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(in) :: what
|
||||
character(len=*), intent(in) :: what
|
||||
real(psb_dpk_), intent(in) :: val
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), intent(in), optional :: idx
|
||||
|
||||
@@ -44,7 +44,7 @@ subroutine amg_z_bwgs_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
! Arguments
|
||||
type(psb_zspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(in) :: desc_a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_z_bwgs_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_zspmat_type), intent(in), target, optional :: b
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
! This is the implementation file corresponding to amg_z_krm_solver_mod.
|
||||
!
|
||||
!
|
||||
subroutine amg_z_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold)
|
||||
subroutine amg_z_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
use amg_z_krm_solver, amg_protect_name => amg_z_krm_solver_bld
|
||||
@@ -85,13 +85,14 @@ subroutine amg_z_krm_solver_bld(a,desc_a,sv,info,b,amold,vmold)
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_zspmat_type), intent(inout), target :: a
|
||||
type(psb_zspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_z_krm_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_zspmat_type), intent(in), target, optional :: b
|
||||
class(psb_z_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_z_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
integer(psb_ipk_) :: n_row,n_col, nrow_a, nztota
|
||||
integer(psb_lpk_) :: lnr
|
||||
|
||||
+3
-1
@@ -852,6 +852,7 @@ if test "x$pac_sludist_header_ok" == "xyes" ; then
|
||||
dnl Maybe lib?
|
||||
SLUDIST_LIBS="$amg4psblas_cv_superludist -L$amg4psblas_cv_superludistdir/lib";
|
||||
LIBS="$SLUDIST_LIBS -lm $save_LIBS";
|
||||
AC_MSG_CHECKING([for superlu_malloc_dist in $SLUDIST_LIBS])
|
||||
AC_TRY_LINK_FUNC(superlu_malloc_dist,
|
||||
[amg4psblas_cv_have_superludist=yes;pac_sludist_lib_ok=yes;],
|
||||
[amg4psblas_cv_have_superludist=no;pac_sludist_lib_ok=no;
|
||||
@@ -861,12 +862,13 @@ if test "x$pac_sludist_header_ok" == "xyes" ; then
|
||||
dnl Maybe lib64?
|
||||
SLUDIST_LIBS="$amg4psblas_cv_superludist -L$amg4psblas_cv_superludistdir/lib64";
|
||||
LIBS="$SLUDIST_LIBS -lm $save_LIBS";
|
||||
AC_MSG_CHECKING([for superlu_malloc_dist in $SLUDIST_LIBS])
|
||||
AC_TRY_LINK_FUNC(superlu_malloc_dist,
|
||||
[amg4psblas_cv_have_superludist=yes;pac_sludist_lib_ok=yes;],
|
||||
[amg4psblas_cv_have_superludist=no;pac_sludist_lib_ok=no;
|
||||
SLUDIST_LIBS="";SLUDIST_INCLUDES=""])
|
||||
fi
|
||||
AC_MSG_RESULT($pac_sludist_lib_ok)
|
||||
AC_MSG_RESULT([$pac_sludist_lib_ok $SLUDIST_LIBS])
|
||||
fi
|
||||
|
||||
if test "x$pac_sludist_lib_ok" == "xyes" ; then
|
||||
|
||||
+97
-8
@@ -133,6 +133,9 @@ FCFLAGS="$save_FCFLAGS";
|
||||
save_CFLAGS="$CFLAGS";
|
||||
AC_PROG_CC([cc xlc pgcc icc gcc ])
|
||||
CFLAGS="$save_CFLAGS";
|
||||
save_CXXFLAGS="$CXXFLAGS";
|
||||
AC_PROG_CXX([CC xlc++ icpc g++])
|
||||
CXXFLAGS="$save_CXXFLAGS";
|
||||
dnl AC_PROG_CXX
|
||||
|
||||
dnl AC_PROG_F90 doesn't exist, at the time of writing this !
|
||||
@@ -158,6 +161,16 @@ if eval "$FC -qversion 2>&1 | grep XL 2>/dev/null" ; then
|
||||
# since (as far as it is known to us) -WF, is not used in earlier versions.
|
||||
# More problems could be undocumented yet.
|
||||
fi
|
||||
|
||||
if test "X$CC" == "X" ; then
|
||||
AC_MSG_ERROR([Problem : No C compiler specified nor found!])
|
||||
fi
|
||||
AC_PROG_CC_STDC()
|
||||
if test "x$ac_cv_prog_cc_stdc" == "xno" ; then
|
||||
AC_MSG_ERROR([Problem : Need a C99 compiler ! ])
|
||||
else
|
||||
C99OPT="$ac_cv_prog_cc_stdc";
|
||||
fi
|
||||
###############################################################################
|
||||
# Suitable MPI compilers detection
|
||||
###############################################################################
|
||||
@@ -171,6 +184,7 @@ if test x"$pac_cv_serial_mpi" == x"yes" ; then
|
||||
FAKEMPI="fakempi.o";
|
||||
MPIFC="$FC";
|
||||
MPICC="$CC";
|
||||
MPICXX="$CXX";
|
||||
CXXDEFINES="-DSERIAL_MPI $CXXDEFINES";
|
||||
|
||||
else
|
||||
@@ -190,9 +204,17 @@ if test "X$MPIFC" = "X" ; then
|
||||
fi
|
||||
|
||||
ACX_MPI([], [AC_MSG_ERROR([[Cannot find any suitable MPI implementation for Fortran]])])
|
||||
AC_LANG([C++])
|
||||
if test "X$MPICXX" = "X" ; then
|
||||
# This is our MPICC compiler preference: it will override ACX_MPI's first try.
|
||||
AC_CHECK_PROGS([MPICXX],[mpxlc++ mpiicpc mpicxx])
|
||||
fi
|
||||
ACX_MPI([], [AC_MSG_ERROR([[Cannot find any suitable MPI implementation for C++]])])
|
||||
AC_LANG([Fortran])
|
||||
|
||||
FC="$MPIFC" ;
|
||||
CC="$MPICC";
|
||||
CXX="$MPICXX";
|
||||
fi
|
||||
|
||||
AC_LANG([C])
|
||||
@@ -217,10 +239,12 @@ fi
|
||||
|
||||
dnl NOTE : no spaces before the comma, and no brackets before the second argument!
|
||||
PAC_ARG_WITH_FLAGS(ccopt,CCOPT)
|
||||
PAC_ARG_WITH_FLAGS(cxxopt,CXXOPT)
|
||||
PAC_ARG_WITH_FLAGS(fcopt,FCOPT)
|
||||
PAC_ARG_WITH_LIBS
|
||||
PAC_ARG_WITH_FLAGS(clibs,CLIBS)
|
||||
PAC_ARG_WITH_FLAGS(flibs,FLIBS)
|
||||
PAC_ARG_WITH_FLAGS(cxxlibs,CXXLIBS)
|
||||
|
||||
dnl candidates for removal:
|
||||
PAC_ARG_WITH_FLAGS(library-path,LIBRARYPATH)
|
||||
@@ -230,6 +254,20 @@ PAC_ARG_WITH_FLAGS(module-path,MODULE_PATH)
|
||||
# we just gave the user the chance to append values to these variables
|
||||
PAC_ARG_WITH_EXTRA_LIBS
|
||||
|
||||
# Check if we need extra libs (e.g. for OpenMPI)
|
||||
AC_MSG_CHECKING([Extra mpicxx libs?])
|
||||
xtrlibs=`mpicxx --showme:link 2>/dev/null`;
|
||||
if (( $? == 0 ))
|
||||
then
|
||||
EXTRA_LIBS="$EXTRA_LIBS $xtrlibs";
|
||||
AC_MSG_RESULT([$xtrlibs])
|
||||
else
|
||||
AC_MSG_RESULT([none])
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Sanity checks, although redundant (useful when debugging this configure.ac)!
|
||||
###############################################################################
|
||||
@@ -395,6 +433,36 @@ if test "X$CCOPT" == "X" ; then
|
||||
fi
|
||||
fi
|
||||
#CFLAGS="${CCOPT}"
|
||||
if test "X$CXXOPT" == "X" ; then
|
||||
CXXOPT="$CXXFLAGS";
|
||||
fi
|
||||
if test "X$CXXOPT" == "X" ; then
|
||||
if test "X$psblas_cv_fc" == "Xgcc" ; then
|
||||
# note that no space should be placed around the equality symbol in assignements
|
||||
# Note : 'native' is valid _only_ on GCC/x86 (32/64 bits)
|
||||
CXXOPT="-g -O3 $CXXOPT"
|
||||
|
||||
elif test "X$psblas_cv_fc" == X"xlf" ; then
|
||||
# XL compiler : consider using -qarch=auto
|
||||
CXXOPT="-O3 -qarch=auto $CXXOPT"
|
||||
elif test "X$psblas_cv_fc" == X"ifc" ; then
|
||||
# other compilers ..
|
||||
CXXOPT="-O3 $CXXOPT"
|
||||
elif test "X$psblas_cv_fc" == X"pg" ; then
|
||||
# other compilers ..
|
||||
CXXCOPT="-fast $CXXOPT"
|
||||
# NOTE : PG & Sun use -fast instead -O3
|
||||
elif test "X$psblas_cv_fc" == X"sun" ; then
|
||||
# other compilers ..
|
||||
CXXOPT="-fast $CXXOPT"
|
||||
elif test "X$psblas_cv_fc" == X"cray" ; then
|
||||
CXXOPT="-O3 $CXXOPT"
|
||||
MPICXX="CC"
|
||||
else
|
||||
CXXOPT="-g -O3 $CXXOPT"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Honor FCFLAGS if they were specified explicitly, but --with-fcopt take precedence
|
||||
if test "X$FCOPT" == "X" ; then
|
||||
@@ -443,7 +511,8 @@ fi
|
||||
##############################################################################
|
||||
FC=${FC}
|
||||
CC=${CC}
|
||||
MPCC=${MPICC}
|
||||
CXX=${CXX}
|
||||
CCOPT="$CCOPT $C99OPT"
|
||||
|
||||
|
||||
##############################################################################
|
||||
@@ -478,6 +547,30 @@ fi
|
||||
if test "X$FLINK" == "X" ; then
|
||||
FLINK=${MPF90}
|
||||
fi
|
||||
# Custom test : do we have a module or include for MPI Fortran interface?
|
||||
if test x"$pac_cv_serial_mpi" == x"yes" ; then
|
||||
FDEFINES="$psblas_cv_define_prepend-DSERIAL_MPI $psblas_cv_define_prepend-DMPI_MOD $FDEFINES";
|
||||
else
|
||||
PAC_FORTRAN_CHECK_HAVE_MPI_MOD_F08()
|
||||
if test x"$pac_cv_mpi_f08" == x"yes" ; then
|
||||
dnl FDEFINES="$psblas_cv_define_prepend-DMPI_MOD_F08 $FDEFINES";
|
||||
FDEFINES="$psblas_cv_define_prepend-DMPI_MOD $FDEFINES";
|
||||
else
|
||||
PAC_FORTRAN_CHECK_HAVE_MPI_MOD(
|
||||
[FDEFINES="$psblas_cv_define_prepend-DMPI_MOD $FDEFINES"],
|
||||
[FDEFINES="$psblas_cv_define_prepend-DMPI_H $FDEFINES"])
|
||||
fi
|
||||
fi
|
||||
|
||||
FLINK="$MPIFC"
|
||||
PAC_ARG_OPENMP()
|
||||
if test x"$pac_cv_openmp" == x"yes" ; then
|
||||
FDEFINES="$psblas_cv_define_prepend-DOPENMP $FDEFINES";
|
||||
CDEFINES="-DOPENMP $CDEFINES";
|
||||
FCOPT="$FCOPT $pac_cv_openmp_fcopt";
|
||||
CCOPT="$CCOPT $pac_cv_openmp_ccopt";
|
||||
FLINK="$FLINK $pac_cv_openmp_fcopt";
|
||||
fi
|
||||
|
||||
PAC_FORTRAN_HAVE_PSBLAS([AC_MSG_RESULT([yes.])],
|
||||
[AC_MSG_ERROR([no. Could not find working version of PSBLAS.])])
|
||||
@@ -693,14 +786,10 @@ fi
|
||||
PAC_CHECK_SUPERLUDIST()
|
||||
|
||||
if test "x$amg4psblas_cv_have_superludist" == "xyes" ; then
|
||||
pac_sludist_version="$amg4psblas_cv_superludist_major";
|
||||
if (($amg4psblas_cv_superludist_major==6)); then
|
||||
if (($amg4psblas_cv_superludist_minor>=3)); then
|
||||
pac_sludist_version="63";
|
||||
fi
|
||||
fi
|
||||
pac_sludist_version="$amg4psblas_cv_superludist_major$amg4psblas_cv_superludist_minor";
|
||||
AC_MSG_NOTICE([Configuring with SuperLU_DIST version flag $pac_sludist_version])
|
||||
SLUDIST_FLAGS=""
|
||||
SLUDIST_FLAGS="-DHave_SLUDist_ -DSLUD_VERSION_$pac_sludist_version $SLUDIST_INCLUDES"
|
||||
SLUDIST_FLAGS="-DHave_SLUDist_ -DSLUD_VERSION_="$pac_sludist_version" $SLUDIST_INCLUDES"
|
||||
FDEFINES="$amg_cv_define_prepend-DHAVE_SLUDIST_ $FDEFINES"
|
||||
else
|
||||
SLUDIST_FLAGS=""
|
||||
|
||||
+64
-11
@@ -753,6 +753,7 @@ infodir
|
||||
docdir
|
||||
oldincludedir
|
||||
includedir
|
||||
runstatedir
|
||||
localstatedir
|
||||
sharedstatedir
|
||||
sysconfdir
|
||||
@@ -877,6 +878,7 @@ datadir='${datarootdir}'
|
||||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
runstatedir='${localstatedir}/run'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
@@ -1129,6 +1131,15 @@ do
|
||||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||
| --run | --ru | --r)
|
||||
ac_prev=runstatedir ;;
|
||||
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||
| --run=* | --ru=* | --r=*)
|
||||
runstatedir=$ac_optarg ;;
|
||||
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
@@ -1266,7 +1277,7 @@ fi
|
||||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||
libdir localedir mandir
|
||||
libdir localedir mandir runstatedir
|
||||
do
|
||||
eval ac_val=\$$ac_var
|
||||
# Remove trailing slashes.
|
||||
@@ -1419,6 +1430,7 @@ Fine tuning of the installation directories:
|
||||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||
--includedir=DIR C header files [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||
@@ -8087,6 +8099,44 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for Fortran ISO_C_BINDING module" >&5
|
||||
$as_echo_n "checking support for Fortran ISO_C_BINDING module... " >&6; }
|
||||
ac_ext=${ac_fc_srcext-f}
|
||||
ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
|
||||
ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
|
||||
|
||||
ac_exeext=''
|
||||
ac_ext='f90'
|
||||
ac_fc=${MPIFC-$FC};
|
||||
cat > conftest.$ac_ext <<_ACEOF
|
||||
|
||||
program conftest
|
||||
use iso_c_binding
|
||||
end program conftest
|
||||
_ACEOF
|
||||
if ac_fn_fc_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
:
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
as_fn_error $? "Sorry, cannot build PSBLAS without support for ISO_C_BINDING.
|
||||
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.8." "$LINENO" 5
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for ISO_FORTRAN_ENV" >&5
|
||||
$as_echo_n "checking support for ISO_FORTRAN_ENV... " >&6; }
|
||||
ac_ext=${ac_fc_srcext-f}
|
||||
@@ -10706,6 +10756,8 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
if test "x$pac_sludist_lib_ok" == "xno" ; then
|
||||
SLUDIST_LIBS="$amg4psblas_cv_superludist -L$amg4psblas_cv_superludistdir/lib";
|
||||
LIBS="$SLUDIST_LIBS -lm $save_LIBS";
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_malloc_dist in $SLUDIST_LIBS" >&5
|
||||
$as_echo_n "checking for superlu_malloc_dist in $SLUDIST_LIBS... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
@@ -10736,6 +10788,8 @@ rm -f core conftest.err conftest.$ac_objext \
|
||||
if test "x$pac_sludist_lib_ok" == "xno" ; then
|
||||
SLUDIST_LIBS="$amg4psblas_cv_superludist -L$amg4psblas_cv_superludistdir/lib64";
|
||||
LIBS="$SLUDIST_LIBS -lm $save_LIBS";
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for superlu_malloc_dist in $SLUDIST_LIBS" >&5
|
||||
$as_echo_n "checking for superlu_malloc_dist in $SLUDIST_LIBS... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
@@ -10763,8 +10817,8 @@ fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_sludist_lib_ok" >&5
|
||||
$as_echo "$pac_sludist_lib_ok" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pac_sludist_lib_ok $SLUDIST_LIBS" >&5
|
||||
$as_echo "$pac_sludist_lib_ok $SLUDIST_LIBS" >&6; }
|
||||
fi
|
||||
|
||||
if test "x$pac_sludist_lib_ok" == "xyes" ; then
|
||||
@@ -10906,14 +10960,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
if test "x$amg4psblas_cv_have_superludist" == "xyes" ; then
|
||||
pac_sludist_version="$amg4psblas_cv_superludist_major";
|
||||
if (($amg4psblas_cv_superludist_major==6)); then
|
||||
if (($amg4psblas_cv_superludist_minor>=3)); then
|
||||
pac_sludist_version="63";
|
||||
fi
|
||||
fi
|
||||
pac_sludist_version="$amg4psblas_cv_superludist_major$amg4psblas_cv_superludist_minor";
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring with SuperLU_DIST version flag $pac_sludist_version" >&5
|
||||
$as_echo "$as_me: Configuring with SuperLU_DIST version flag $pac_sludist_version" >&6;}
|
||||
SLUDIST_FLAGS=""
|
||||
SLUDIST_FLAGS="-DHave_SLUDist_ -DSLUD_VERSION_$pac_sludist_version $SLUDIST_INCLUDES"
|
||||
SLUDIST_FLAGS="-DHave_SLUDist_ -DSLUD_VERSION_="$pac_sludist_version" $SLUDIST_INCLUDES"
|
||||
FDEFINES="$amg_cv_define_prepend-DHAVE_SLUDIST_ $FDEFINES"
|
||||
else
|
||||
SLUDIST_FLAGS=""
|
||||
@@ -12275,7 +12326,9 @@ $as_echo X/"$am_mf" |
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error $? "Something went wrong bootstrapping makefile fragments
|
||||
for automatic dependency tracking. Try re-running configure with the
|
||||
for automatic dependency tracking. If GNU make was not used, consider
|
||||
re-running the configure script with MAKE=\"gmake\" (or whatever is
|
||||
necessary). You can also try re-running configure with the
|
||||
'--disable-dependency-tracking' option to at least be able to build
|
||||
the package (albeit without support for automatic dependency tracking).
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
|
||||
+9
-7
@@ -673,6 +673,12 @@ PAC_FORTRAN_TEST_VOLATILE(
|
||||
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for VOLATILE])]
|
||||
)
|
||||
|
||||
PAC_FORTRAN_TEST_ISO_C_BIND(
|
||||
[],
|
||||
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for ISO_C_BINDING.
|
||||
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.8.])]
|
||||
)
|
||||
|
||||
PAC_FORTRAN_TEST_ISO_FORTRAN_ENV(
|
||||
[],
|
||||
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for ISO_FORTRAN_ENV])]
|
||||
@@ -856,14 +862,10 @@ fi
|
||||
PAC_CHECK_SUPERLUDIST()
|
||||
|
||||
if test "x$amg4psblas_cv_have_superludist" == "xyes" ; then
|
||||
pac_sludist_version="$amg4psblas_cv_superludist_major";
|
||||
if (($amg4psblas_cv_superludist_major==6)); then
|
||||
if (($amg4psblas_cv_superludist_minor>=3)); then
|
||||
pac_sludist_version="63";
|
||||
fi
|
||||
fi
|
||||
pac_sludist_version="$amg4psblas_cv_superludist_major$amg4psblas_cv_superludist_minor";
|
||||
AC_MSG_NOTICE([Configuring with SuperLU_DIST version flag $pac_sludist_version])
|
||||
SLUDIST_FLAGS=""
|
||||
SLUDIST_FLAGS="-DHave_SLUDist_ -DSLUD_VERSION_$pac_sludist_version $SLUDIST_INCLUDES"
|
||||
SLUDIST_FLAGS="-DHave_SLUDist_ -DSLUD_VERSION_="$pac_sludist_version" $SLUDIST_INCLUDES"
|
||||
FDEFINES="$amg_cv_define_prepend-DHAVE_SLUDIST_ $FDEFINES"
|
||||
else
|
||||
SLUDIST_FLAGS=""
|
||||
|
||||
Binary file not shown.
+19
-19
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 678--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 685--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu11.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -34,8 +34,8 @@ class="cmr-12">Method hierarchy</span><span
|
||||
class="cmr-12">_build</span></h4>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 680--><p class="noindent" >
|
||||
<!--l. 681--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 687--><p class="noindent" >
|
||||
<!--l. 688--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -49,7 +49,7 @@ class="cmtt-12">,</span><span
|
||||
class="cmtt-12">info</span><span
|
||||
class="cmtt-12">)</span><br />
|
||||
</div>
|
||||
<!--l. 684--><p class="noindent" ><span
|
||||
<!--l. 691--><p class="noindent" ><span
|
||||
class="cmr-12">This method builds the hierarchy of matrices and restriction/prolongation operators for</span>
|
||||
<span
|
||||
class="cmr-12">the multilevel preconditioner </span><span class="lstinline"></span><span
|
||||
@@ -61,7 +61,7 @@ class="cmtt-12">init</span> <span
|
||||
class="cmr-12">and </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">set</span><span
|
||||
class="cmr-12">.</span>
|
||||
<!--l. 689--><p class="noindent" ><span
|
||||
<!--l. 696--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-11" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -69,9 +69,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-11-1"><col
|
||||
id="TBL-11-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-11-1-"><td style="white-space:normal; text-align:left;" id="TBL-11-1-1"
|
||||
class="td11"><!--l. 692--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 699--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">a</span> </td><td style="white-space:normal; text-align:left;" id="TBL-11-1-2"
|
||||
class="td11"><!--l. 692--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 699--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">type</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -86,8 +86,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-11-2-"><td style="white-space:normal; text-align:left;" id="TBL-11-2-1"
|
||||
class="td11"><!--l. 693--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-11-2-2"
|
||||
class="td11"><!--l. 693--><p class="noindent" ><span
|
||||
class="td11"><!--l. 700--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-11-2-2"
|
||||
class="td11"><!--l. 700--><p class="noindent" ><span
|
||||
class="cmr-12">The sparse matrix structure containing the local part of the matrix</span>
|
||||
<span
|
||||
class="cmr-12">to be preconditioned. Note that </span><span
|
||||
@@ -107,9 +107,9 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-11-3-"><td style="white-space:normal; text-align:left;" id="TBL-11-3-1"
|
||||
class="td11"><!--l. 698--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 705--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">desc_a</span></td><td style="white-space:normal; text-align:left;" id="TBL-11-3-2"
|
||||
class="td11"><!--l. 698--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 705--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">type</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_desc_type</span><span
|
||||
@@ -122,8 +122,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-11-4-"><td style="white-space:normal; text-align:left;" id="TBL-11-4-1"
|
||||
class="td11"><!--l. 699--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-11-4-2"
|
||||
class="td11"><!--l. 699--><p class="noindent" ><span
|
||||
class="td11"><!--l. 706--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-11-4-2"
|
||||
class="td11"><!--l. 706--><p class="noindent" ><span
|
||||
class="cmr-12">The communication descriptor of </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">a</span><span
|
||||
class="cmr-12">. See the PSBLAS User’s Guide</span>
|
||||
@@ -136,9 +136,9 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-11-5-"><td style="white-space:normal; text-align:left;" id="TBL-11-5-1"
|
||||
class="td11"><!--l. 701--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 708--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-11-5-2"
|
||||
class="td11"><!--l. 701--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 708--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -149,8 +149,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-11-6-"><td style="white-space:normal; text-align:left;" id="TBL-11-6-1"
|
||||
class="td11"><!--l. 702--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-11-6-2"
|
||||
class="td11"><!--l. 702--><p class="noindent" ><span
|
||||
class="td11"><!--l. 709--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-11-6-2"
|
||||
class="td11"><!--l. 709--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -165,7 +165,7 @@ class="td11"> </td> </tr></table></div>
|
||||
|
||||
|
||||
|
||||
<!--l. 708--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 715--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu11.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -182,6 +182,6 @@ class="cmr-12">] [</span><a
|
||||
href="userhtmlse5.html#userhtmlsu10.html" ><span
|
||||
class="cmr-12">up</span></a><span
|
||||
class="cmr-12">] </span></p></div>
|
||||
<!--l. 708--><p class="indent" > <a
|
||||
<!--l. 715--><p class="indent" > <a
|
||||
id="tailuserhtmlsu10.html"></a>
|
||||
</body></html>
|
||||
|
||||
+31
-31
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 708--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 715--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu12.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -34,8 +34,8 @@ class="cmr-12">Method smoothers</span><span
|
||||
class="cmr-12">_build</span></h4>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 711--><p class="noindent" >
|
||||
<!--l. 712--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 718--><p class="noindent" >
|
||||
<!--l. 719--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -57,7 +57,7 @@ class="cmtt-12">,</span><span
|
||||
class="cmtt-12">imold</span><span
|
||||
class="cmtt-12">])</span><br />
|
||||
</div>
|
||||
<!--l. 715--><p class="noindent" ><span
|
||||
<!--l. 722--><p class="noindent" ><span
|
||||
class="cmr-12">This method builds the smoothers and the coarsest-level solvers for the multilevel</span>
|
||||
<span
|
||||
class="cmr-12">preconditioner </span><span class="lstinline"></span><span
|
||||
@@ -75,7 +75,7 @@ class="cmr-12"> </span><a
|
||||
href="userhtmlsu10.html#x20-190005.3"><span
|
||||
class="cmr-12">5.3</span><!--tex4ht:ref: sec:hier_bld --></a><span
|
||||
class="cmr-12">).</span>
|
||||
<!--l. 722--><p class="noindent" ><span
|
||||
<!--l. 729--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-12" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -83,9 +83,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-12-1"><col
|
||||
id="TBL-12-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-1-"><td style="white-space:normal; text-align:left;" id="TBL-12-1-1"
|
||||
class="td11"><!--l. 725--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 732--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">a</span> </td><td style="white-space:normal; text-align:left;" id="TBL-12-1-2"
|
||||
class="td11"><!--l. 725--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 732--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">type</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -100,8 +100,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-2-"><td style="white-space:normal; text-align:left;" id="TBL-12-2-1"
|
||||
class="td11"><!--l. 726--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-2-2"
|
||||
class="td11"><!--l. 726--><p class="noindent" ><span
|
||||
class="td11"><!--l. 733--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-2-2"
|
||||
class="td11"><!--l. 733--><p class="noindent" ><span
|
||||
class="cmr-12">The sparse matrix structure containing the local part of the matrix</span>
|
||||
<span
|
||||
class="cmr-12">to be preconditioned. Note that </span><span
|
||||
@@ -121,9 +121,9 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-3-"><td style="white-space:normal; text-align:left;" id="TBL-12-3-1"
|
||||
class="td11"><!--l. 730--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 737--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">desc_a</span></td><td style="white-space:normal; text-align:left;" id="TBL-12-3-2"
|
||||
class="td11"><!--l. 730--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 737--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">type</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_desc_type</span><span
|
||||
@@ -136,8 +136,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-4-"><td style="white-space:normal; text-align:left;" id="TBL-12-4-1"
|
||||
class="td11"><!--l. 731--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-4-2"
|
||||
class="td11"><!--l. 731--><p class="noindent" ><span
|
||||
class="td11"><!--l. 738--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-4-2"
|
||||
class="td11"><!--l. 738--><p class="noindent" ><span
|
||||
class="cmr-12">The communication descriptor of </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">a</span><span
|
||||
class="cmr-12">. See the PSBLAS User’s Guide</span>
|
||||
@@ -150,9 +150,9 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-5-"><td style="white-space:normal; text-align:left;" id="TBL-12-5-1"
|
||||
class="td11"><!--l. 733--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 740--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-12-5-2"
|
||||
class="td11"><!--l. 733--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 740--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -163,8 +163,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-6-"><td style="white-space:normal; text-align:left;" id="TBL-12-6-1"
|
||||
class="td11"><!--l. 734--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-6-2"
|
||||
class="td11"><!--l. 734--><p class="noindent" ><span
|
||||
class="td11"><!--l. 741--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-6-2"
|
||||
class="td11"><!--l. 741--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -172,9 +172,9 @@ class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
|
||||
class="cmr-12">for details.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-7-"><td style="white-space:normal; text-align:left;" id="TBL-12-7-1"
|
||||
class="td11"><!--l. 735--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 742--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">amold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-12-7-2"
|
||||
class="td11"><!--l. 735--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 742--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">class</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -191,8 +191,8 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-8-"><td style="white-space:normal; text-align:left;" id="TBL-12-8-1"
|
||||
class="td11"><!--l. 736--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-8-2"
|
||||
class="td11"><!--l. 736--><p class="noindent" ><span
|
||||
class="td11"><!--l. 743--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-8-2"
|
||||
class="td11"><!--l. 743--><p class="noindent" ><span
|
||||
class="cmr-12">The desired dynamic type for internal matrix components; this</span>
|
||||
<span
|
||||
class="cmr-12">allows e.g. running on GPUs; it needs not be the same on all</span>
|
||||
@@ -205,9 +205,9 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-9-"><td style="white-space:normal; text-align:left;" id="TBL-12-9-1"
|
||||
class="td11"><!--l. 740--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 747--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">vmold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-12-9-2"
|
||||
class="td11"><!--l. 740--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 747--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">class</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -224,16 +224,16 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-10-"><td style="white-space:normal; text-align:left;" id="TBL-12-10-1"
|
||||
class="td11"><!--l. 741--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-10-2"
|
||||
class="td11"><!--l. 741--><p class="noindent" ><span
|
||||
class="td11"><!--l. 748--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-10-2"
|
||||
class="td11"><!--l. 748--><p class="noindent" ><span
|
||||
class="cmr-12">The desired dynamic type for internal vector components; this</span>
|
||||
<span
|
||||
class="cmr-12">allows e.g. running on GPUs.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-11-"><td style="white-space:normal; text-align:left;" id="TBL-12-11-1"
|
||||
class="td11"><!--l. 743--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 750--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">imold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-12-11-2"
|
||||
class="td11"><!--l. 743--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 750--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">class</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_i_base_vect_type</span><span
|
||||
@@ -248,8 +248,8 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-12-12-"><td style="white-space:normal; text-align:left;" id="TBL-12-12-1"
|
||||
class="td11"><!--l. 744--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-12-2"
|
||||
class="td11"><!--l. 744--><p class="noindent" ><span
|
||||
class="td11"><!--l. 751--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-12-12-2"
|
||||
class="td11"><!--l. 751--><p class="noindent" ><span
|
||||
class="cmr-12">The desired dynamic type for internal integer vector components;</span>
|
||||
<span
|
||||
class="cmr-12">this allows e.g. running on GPUs.</span> </td>
|
||||
@@ -262,7 +262,7 @@ class="td11"> </td> </tr></table></div>
|
||||
|
||||
|
||||
|
||||
<!--l. 750--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 757--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu12.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -279,6 +279,6 @@ class="cmr-12">] [</span><a
|
||||
href="userhtmlse5.html#userhtmlsu11.html" ><span
|
||||
class="cmr-12">up</span></a><span
|
||||
class="cmr-12">] </span></p></div>
|
||||
<!--l. 750--><p class="indent" > <a
|
||||
<!--l. 757--><p class="indent" > <a
|
||||
id="tailuserhtmlsu11.html"></a>
|
||||
</body></html>
|
||||
|
||||
+32
-32
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 750--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 757--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu13.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -33,8 +33,8 @@ class="cmr-12">5.5 </span></span> <a
|
||||
class="cmr-12">Method build</span></h4>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 752--><p class="noindent" >
|
||||
<!--l. 753--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 759--><p class="noindent" >
|
||||
<!--l. 760--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -54,7 +54,7 @@ class="cmtt-12">,</span><span
|
||||
class="cmtt-12">imold</span><span
|
||||
class="cmtt-12">])</span><br />
|
||||
</div>
|
||||
<!--l. 756--><p class="noindent" ><span
|
||||
<!--l. 763--><p class="noindent" ><span
|
||||
class="cmr-12">This method builds the preconditioner </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">p</span> <span
|
||||
class="cmr-12">according to the requirements made by the</span>
|
||||
@@ -83,7 +83,7 @@ class="cmtt-12">smoothers_build</span><span
|
||||
class="cmr-12">, whose nomenclature would however be somewhat unnatural when</span>
|
||||
<span
|
||||
class="cmr-12">dealing with simple one-level preconditioners.</span>
|
||||
<!--l. 766--><p class="noindent" ><span
|
||||
<!--l. 773--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-13" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -91,9 +91,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-13-1"><col
|
||||
id="TBL-13-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-1-"><td style="white-space:normal; text-align:left;" id="TBL-13-1-1"
|
||||
class="td11"><!--l. 769--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 776--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">a</span> </td><td style="white-space:normal; text-align:left;" id="TBL-13-1-2"
|
||||
class="td11"><!--l. 769--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 776--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">type</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -108,8 +108,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-2-"><td style="white-space:normal; text-align:left;" id="TBL-13-2-1"
|
||||
class="td11"><!--l. 770--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-2-2"
|
||||
class="td11"><!--l. 770--><p class="noindent" ><span
|
||||
class="td11"><!--l. 777--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-2-2"
|
||||
class="td11"><!--l. 777--><p class="noindent" ><span
|
||||
class="cmr-12">The sparse matrix structure containing the local part of the matrix</span>
|
||||
<span
|
||||
class="cmr-12">to be preconditioned. Note that </span><span
|
||||
@@ -129,9 +129,9 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-3-"><td style="white-space:normal; text-align:left;" id="TBL-13-3-1"
|
||||
class="td11"><!--l. 774--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 781--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">desc_a</span></td><td style="white-space:normal; text-align:left;" id="TBL-13-3-2"
|
||||
class="td11"><!--l. 774--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 781--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">type</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_desc_type</span><span
|
||||
@@ -144,8 +144,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-4-"><td style="white-space:normal; text-align:left;" id="TBL-13-4-1"
|
||||
class="td11"><!--l. 775--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-4-2"
|
||||
class="td11"><!--l. 775--><p class="noindent" ><span
|
||||
class="td11"><!--l. 782--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-4-2"
|
||||
class="td11"><!--l. 782--><p class="noindent" ><span
|
||||
class="cmr-12">The communication descriptor of </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">a</span><span
|
||||
class="cmr-12">. See the PSBLAS User’s Guide</span>
|
||||
@@ -158,9 +158,9 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-5-"><td style="white-space:normal; text-align:left;" id="TBL-13-5-1"
|
||||
class="td11"><!--l. 777--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 784--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-13-5-2"
|
||||
class="td11"><!--l. 777--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 784--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -171,8 +171,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-6-"><td style="white-space:normal; text-align:left;" id="TBL-13-6-1"
|
||||
class="td11"><!--l. 778--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-6-2"
|
||||
class="td11"><!--l. 778--><p class="noindent" ><span
|
||||
class="td11"><!--l. 785--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-6-2"
|
||||
class="td11"><!--l. 785--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -180,9 +180,9 @@ class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
|
||||
class="cmr-12">for details.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-7-"><td style="white-space:normal; text-align:left;" id="TBL-13-7-1"
|
||||
class="td11"><!--l. 779--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 786--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">amold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-13-7-2"
|
||||
class="td11"><!--l. 779--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 786--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">class</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -199,8 +199,8 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-8-"><td style="white-space:normal; text-align:left;" id="TBL-13-8-1"
|
||||
class="td11"><!--l. 780--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-8-2"
|
||||
class="td11"><!--l. 780--><p class="noindent" ><span
|
||||
class="td11"><!--l. 787--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-8-2"
|
||||
class="td11"><!--l. 787--><p class="noindent" ><span
|
||||
class="cmr-12">The desired dynamic type for internal matrix components; this</span>
|
||||
<span
|
||||
class="cmr-12">allows e.g. running on GPUs; it needs not be the same on all</span>
|
||||
@@ -213,9 +213,9 @@ class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-9-"><td style="white-space:normal; text-align:left;" id="TBL-13-9-1"
|
||||
class="td11"><!--l. 784--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 791--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">vmold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-13-9-2"
|
||||
class="td11"><!--l. 784--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 791--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">class</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -232,16 +232,16 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-10-"><td style="white-space:normal; text-align:left;" id="TBL-13-10-1"
|
||||
class="td11"><!--l. 785--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-10-2"
|
||||
class="td11"><!--l. 785--><p class="noindent" ><span
|
||||
class="td11"><!--l. 792--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-10-2"
|
||||
class="td11"><!--l. 792--><p class="noindent" ><span
|
||||
class="cmr-12">The desired dynamic type for internal vector components; this</span>
|
||||
<span
|
||||
class="cmr-12">allows e.g. running on GPUs.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-11-"><td style="white-space:normal; text-align:left;" id="TBL-13-11-1"
|
||||
class="td11"><!--l. 787--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 794--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">imold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-13-11-2"
|
||||
class="td11"><!--l. 787--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 794--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">class</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_i_base_vect_type</span><span
|
||||
@@ -256,15 +256,15 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-12-"><td style="white-space:normal; text-align:left;" id="TBL-13-12-1"
|
||||
class="td11"><!--l. 788--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-12-2"
|
||||
class="td11"><!--l. 788--><p class="noindent" ><span
|
||||
class="td11"><!--l. 795--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-13-12-2"
|
||||
class="td11"><!--l. 795--><p class="noindent" ><span
|
||||
class="cmr-12">The desired dynamic type for internal integer vector components;</span>
|
||||
<span
|
||||
class="cmr-12">this allows e.g. running on GPUs.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-13-13-"><td style="white-space:normal; text-align:left;" id="TBL-13-13-1"
|
||||
class="td11"> </td> </tr></table></div>
|
||||
<!--l. 793--><p class="noindent" ><span
|
||||
<!--l. 800--><p class="noindent" ><span
|
||||
class="cmr-12">The method can be used to build multilevel preconditioners too.</span>
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ class="cmr-12">The method can be used to build multilevel preconditioners too.</
|
||||
|
||||
|
||||
|
||||
<!--l. 798--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 805--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu13.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -289,6 +289,6 @@ class="cmr-12">] [</span><a
|
||||
href="userhtmlse5.html#userhtmlsu12.html" ><span
|
||||
class="cmr-12">up</span></a><span
|
||||
class="cmr-12">] </span></p></div>
|
||||
<!--l. 798--><p class="indent" > <a
|
||||
<!--l. 805--><p class="indent" > <a
|
||||
id="tailuserhtmlsu12.html"></a>
|
||||
</body></html>
|
||||
|
||||
+31
-31
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 798--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 805--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu14.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -33,8 +33,8 @@ class="cmr-12">5.6 </span></span> <a
|
||||
class="cmr-12">Method apply</span></h4>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 800--><p class="noindent" >
|
||||
<!--l. 801--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 807--><p class="noindent" >
|
||||
<!--l. 808--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -55,7 +55,7 @@ class="cmtt-12">,</span><span
|
||||
class="cmtt-12">work</span><span
|
||||
class="cmtt-12">])</span><br />
|
||||
</div>
|
||||
<!--l. 804--><p class="noindent" ><span
|
||||
<!--l. 811--><p class="noindent" ><span
|
||||
class="cmr-12">This method computes </span><span
|
||||
class="cmmi-12">y </span><span
|
||||
class="cmr-12">= </span><span
|
||||
@@ -89,7 +89,7 @@ class="cmtt-12">psb_krylov</span> <span
|
||||
class="cmr-12">and hence it is</span>
|
||||
<span
|
||||
class="cmr-12">completely transparent to the user.</span>
|
||||
<!--l. 813--><p class="noindent" ><span
|
||||
<!--l. 820--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-14" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -97,9 +97,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-14-1"><col
|
||||
id="TBL-14-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-1-"><td style="white-space:normal; text-align:left;" id="TBL-14-1-1"
|
||||
class="td11"><!--l. 816--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 823--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">x</span> </td><td style="white-space:normal; text-align:left;" id="TBL-14-1-2"
|
||||
class="td11"><!--l. 816--><p class="noindent" ><span
|
||||
class="td11"><!--l. 823--><p class="noindent" ><span
|
||||
class="cmti-12">type</span><span class="lstinline"></span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">kind_parameter</span><span
|
||||
@@ -107,8 +107,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">, dimension(:), intent(in)—.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-2-"><td style="white-space:normal; text-align:left;" id="TBL-14-2-1"
|
||||
class="td11"><!--l. 817--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-2-2"
|
||||
class="td11"><!--l. 817--><p class="noindent" ><span
|
||||
class="td11"><!--l. 824--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-2-2"
|
||||
class="td11"><!--l. 824--><p class="noindent" ><span
|
||||
class="cmr-12">The local part of the vector </span><span
|
||||
class="cmmi-12">x</span><span
|
||||
class="cmr-12">. Note that </span><span
|
||||
@@ -126,9 +126,9 @@ class="cmr-12">, single/double</span>
|
||||
class="cmr-12">precision version of AMG4PSBLAS under use.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-3-"><td style="white-space:normal; text-align:left;" id="TBL-14-3-1"
|
||||
class="td11"><!--l. 820--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 827--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">y</span> </td><td style="white-space:normal; text-align:left;" id="TBL-14-3-2"
|
||||
class="td11"><!--l. 820--><p class="noindent" ><span
|
||||
class="td11"><!--l. 827--><p class="noindent" ><span
|
||||
class="cmti-12">type</span><span class="lstinline"></span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">kind_parameter</span><span
|
||||
@@ -136,8 +136,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">, dimension(:), intent(out)—.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-4-"><td style="white-space:normal; text-align:left;" id="TBL-14-4-1"
|
||||
class="td11"><!--l. 821--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-4-2"
|
||||
class="td11"><!--l. 821--><p class="noindent" ><span
|
||||
class="td11"><!--l. 828--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-4-2"
|
||||
class="td11"><!--l. 828--><p class="noindent" ><span
|
||||
class="cmr-12">The local part of the vector </span><span
|
||||
class="cmmi-12">y</span><span
|
||||
class="cmr-12">. Note that </span><span
|
||||
@@ -155,9 +155,9 @@ class="cmr-12">, single/double</span>
|
||||
class="cmr-12">precision version of AMG4PSBLAS under use.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-5-"><td style="white-space:normal; text-align:left;" id="TBL-14-5-1"
|
||||
class="td11"><!--l. 824--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 831--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">desc_a</span></td><td style="white-space:normal; text-align:left;" id="TBL-14-5-2"
|
||||
class="td11"><!--l. 824--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 831--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">type</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_desc_type</span><span
|
||||
@@ -170,16 +170,16 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-6-"><td style="white-space:normal; text-align:left;" id="TBL-14-6-1"
|
||||
class="td11"><!--l. 825--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-6-2"
|
||||
class="td11"><!--l. 825--><p class="noindent" ><span
|
||||
class="td11"><!--l. 832--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-6-2"
|
||||
class="td11"><!--l. 832--><p class="noindent" ><span
|
||||
class="cmr-12">The communication descriptor associated to the matrix to be</span>
|
||||
<span
|
||||
class="cmr-12">preconditioned.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-7-"><td style="white-space:normal; text-align:left;" id="TBL-14-7-1"
|
||||
class="td11"><!--l. 827--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 834--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-14-7-2"
|
||||
class="td11"><!--l. 827--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 834--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -190,8 +190,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-8-"><td style="white-space:normal; text-align:left;" id="TBL-14-8-1"
|
||||
class="td11"><!--l. 828--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-8-2"
|
||||
class="td11"><!--l. 828--><p class="noindent" ><span
|
||||
class="td11"><!--l. 835--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-8-2"
|
||||
class="td11"><!--l. 835--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -199,9 +199,9 @@ class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
|
||||
class="cmr-12">for details.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-9-"><td style="white-space:normal; text-align:left;" id="TBL-14-9-1"
|
||||
class="td11"><!--l. 829--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 836--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">trans</span> </td><td style="white-space:normal; text-align:left;" id="TBL-14-9-2"
|
||||
class="td11"><!--l. 829--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 836--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">character</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">len</span><span
|
||||
@@ -216,8 +216,8 @@ class="cmtt-12">in</span><span
|
||||
class="cmtt-12">).</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-10-"><td style="white-space:normal; text-align:left;" id="TBL-14-10-1"
|
||||
class="td11"><!--l. 830--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-10-2"
|
||||
class="td11"><!--l. 830--><p class="noindent" ><span
|
||||
class="td11"><!--l. 837--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-10-2"
|
||||
class="td11"><!--l. 837--><p class="noindent" ><span
|
||||
class="cmr-12">If </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">trans</span> <span
|
||||
class="cmr-12">= </span><span class="lstinline"></span><span
|
||||
@@ -291,9 +291,9 @@ class="cmr-8">1</span></sup><span
|
||||
class="cmr-12">).</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-11-"><td style="white-space:normal; text-align:left;" id="TBL-14-11-1"
|
||||
class="td11"><!--l. 834--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 841--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">work</span> </td><td style="white-space:normal; text-align:left;" id="TBL-14-11-2"
|
||||
class="td11"><!--l. 834--><p class="noindent" ><span
|
||||
class="td11"><!--l. 841--><p class="noindent" ><span
|
||||
class="cmti-12">type</span><span class="lstinline"></span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">kind_parameter</span><span
|
||||
@@ -301,8 +301,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">, dimension(:), optional, target—.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-14-12-"><td style="white-space:normal; text-align:left;" id="TBL-14-12-1"
|
||||
class="td11"><!--l. 835--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-12-2"
|
||||
class="td11"><!--l. 835--><p class="noindent" ><span
|
||||
class="td11"><!--l. 842--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-14-12-2"
|
||||
class="td11"><!--l. 842--><p class="noindent" ><span
|
||||
class="cmr-12">Workspace. Its size should be at least </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">4</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -339,7 +339,7 @@ class="td11"> </td> </tr></table></div>
|
||||
|
||||
|
||||
|
||||
<!--l. 844--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 851--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu14.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -356,6 +356,6 @@ class="cmr-12">] [</span><a
|
||||
href="userhtmlse5.html#userhtmlsu13.html" ><span
|
||||
class="cmr-12">up</span></a><span
|
||||
class="cmr-12">] </span></p></div>
|
||||
<!--l. 844--><p class="indent" > <a
|
||||
<!--l. 851--><p class="indent" > <a
|
||||
id="tailuserhtmlsu13.html"></a>
|
||||
</body></html>
|
||||
|
||||
+11
-11
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 844--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 851--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu15.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -33,8 +33,8 @@ class="cmr-12">5.7 </span></span> <a
|
||||
class="cmr-12">Method free</span></h4>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 846--><p class="noindent" >
|
||||
<!--l. 847--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 853--><p class="noindent" >
|
||||
<!--l. 854--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -46,11 +46,11 @@ class="cmtt-12">,</span><span
|
||||
class="cmtt-12">info</span><span
|
||||
class="cmtt-12">)</span><br />
|
||||
</div>
|
||||
<!--l. 850--><p class="noindent" ><span
|
||||
<!--l. 857--><p class="noindent" ><span
|
||||
class="cmr-12">This method deallocates the preconditioner data structure </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">p</span><span
|
||||
class="cmr-12">.</span>
|
||||
<!--l. 853--><p class="noindent" ><span
|
||||
<!--l. 860--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-15" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -58,9 +58,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-15-1"><col
|
||||
id="TBL-15-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-15-1-"><td style="white-space:normal; text-align:left;" id="TBL-15-1-1"
|
||||
class="td11"><!--l. 856--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 863--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-15-1-2"
|
||||
class="td11"><!--l. 856--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 863--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -71,8 +71,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-15-2-"><td style="white-space:normal; text-align:left;" id="TBL-15-2-1"
|
||||
class="td11"><!--l. 857--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-15-2-2"
|
||||
class="td11"><!--l. 857--><p class="noindent" ><span
|
||||
class="td11"><!--l. 864--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-15-2-2"
|
||||
class="td11"><!--l. 864--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -89,7 +89,7 @@ class="td11"> </td> </tr></table></div>
|
||||
|
||||
|
||||
|
||||
<!--l. 863--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 870--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu15.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -106,6 +106,6 @@ class="cmr-12">] [</span><a
|
||||
href="userhtmlse5.html#userhtmlsu14.html" ><span
|
||||
class="cmr-12">up</span></a><span
|
||||
class="cmr-12">] </span></p></div>
|
||||
<!--l. 863--><p class="indent" > <a
|
||||
<!--l. 870--><p class="indent" > <a
|
||||
id="tailuserhtmlsu14.html"></a>
|
||||
</body></html>
|
||||
|
||||
+23
-23
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 863--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 870--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu16.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -33,8 +33,8 @@ class="cmr-12">5.8 </span></span> <a
|
||||
class="cmr-12">Method descr</span></h4>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 865--><p class="noindent" >
|
||||
<!--l. 866--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 872--><p class="noindent" >
|
||||
<!--l. 873--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -54,7 +54,7 @@ class="cmtt-12"> </span><span
|
||||
class="cmtt-12">verbosity</span><span
|
||||
class="cmtt-12">])</span><br />
|
||||
</div>
|
||||
<!--l. 869--><p class="noindent" ><span
|
||||
<!--l. 876--><p class="noindent" ><span
|
||||
class="cmr-12">This method prints a description of the preconditioner </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">p</span> <span
|
||||
class="cmr-12">to the standard output or to a</span>
|
||||
@@ -68,7 +68,7 @@ class="cmtt-12">build</span><span
|
||||
class="cmr-12">, have</span>
|
||||
<span
|
||||
class="cmr-12">been called.</span>
|
||||
<!--l. 874--><p class="noindent" ><span
|
||||
<!--l. 881--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-16" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -76,9 +76,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-16-1"><col
|
||||
id="TBL-16-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-16-1-"><td style="white-space:normal; text-align:left;" id="TBL-16-1-1"
|
||||
class="td11"><!--l. 877--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 884--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-16-1-2"
|
||||
class="td11"><!--l. 877--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 884--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -89,8 +89,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-16-2-"><td style="white-space:normal; text-align:left;" id="TBL-16-2-1"
|
||||
class="td11"><!--l. 878--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-16-2-2"
|
||||
class="td11"><!--l. 878--><p class="noindent" ><span
|
||||
class="td11"><!--l. 885--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-16-2-2"
|
||||
class="td11"><!--l. 885--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -98,9 +98,9 @@ class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
|
||||
class="cmr-12">for details.</span></td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-16-3-"><td style="white-space:normal; text-align:left;" id="TBL-16-3-1"
|
||||
class="td11"><!--l. 879--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 886--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">iout</span> </td><td style="white-space:normal; text-align:left;" id="TBL-16-3-2"
|
||||
class="td11"><!--l. 879--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 886--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -113,16 +113,16 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-16-4-"><td style="white-space:normal; text-align:left;" id="TBL-16-4-1"
|
||||
class="td11"><!--l. 880--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-16-4-2"
|
||||
class="td11"><!--l. 880--><p class="noindent" ><span
|
||||
class="td11"><!--l. 887--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-16-4-2"
|
||||
class="td11"><!--l. 887--><p class="noindent" ><span
|
||||
class="cmr-12">The id of the file where the preconditioner description will be</span>
|
||||
<span
|
||||
class="cmr-12">printed; the default is the standard output.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-16-5-"><td style="white-space:normal; text-align:left;" id="TBL-16-5-1"
|
||||
class="td11"><!--l. 882--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 889--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">root</span> </td><td style="white-space:normal; text-align:left;" id="TBL-16-5-2"
|
||||
class="td11"><!--l. 882--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 889--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -135,8 +135,8 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-16-6-"><td style="white-space:normal; text-align:left;" id="TBL-16-6-1"
|
||||
class="td11"><!--l. 883--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-16-6-2"
|
||||
class="td11"><!--l. 883--><p class="noindent" ><span
|
||||
class="td11"><!--l. 890--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-16-6-2"
|
||||
class="td11"><!--l. 890--><p class="noindent" ><span
|
||||
class="cmr-12">The id of the process where the preconditioner description</span>
|
||||
<span
|
||||
class="cmr-12">will be printed; the default is </span><span class="lstinline"></span><span
|
||||
@@ -144,9 +144,9 @@ class="cmtt-12">psb_root_</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-16-7-"><td style="white-space:normal; text-align:left;" id="TBL-16-7-1"
|
||||
class="td11"><!--l. 885--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 892--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">verbosity</span> </td><td style="white-space:normal; text-align:left;" id="TBL-16-7-2"
|
||||
class="td11"><!--l. 885--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 892--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -159,8 +159,8 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-16-8-"><td style="white-space:normal; text-align:left;" id="TBL-16-8-1"
|
||||
class="td11"><!--l. 886--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-16-8-2"
|
||||
class="td11"><!--l. 886--><p class="noindent" ><span
|
||||
class="td11"><!--l. 893--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-16-8-2"
|
||||
class="td11"><!--l. 893--><p class="noindent" ><span
|
||||
class="cmr-12">The verbosity level of the description. Default value is 0. For</span>
|
||||
<span
|
||||
class="cmr-12">values higher than 0, it prints out further information, e.g., for</span>
|
||||
@@ -174,7 +174,7 @@ class="td11"> </td> </tr></table></div>
|
||||
|
||||
|
||||
|
||||
<!--l. 893--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 900--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu16.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -191,6 +191,6 @@ class="cmr-12">] [</span><a
|
||||
href="userhtmlse5.html#userhtmlsu15.html" ><span
|
||||
class="cmr-12">up</span></a><span
|
||||
class="cmr-12">] </span></p></div>
|
||||
<!--l. 893--><p class="indent" > <a
|
||||
<!--l. 900--><p class="indent" > <a
|
||||
id="tailuserhtmlsu15.html"></a>
|
||||
</body></html>
|
||||
|
||||
+57
-57
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 893--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 900--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu15.html" ><span
|
||||
class="cmr-12">prev</span></a><span
|
||||
@@ -28,19 +28,19 @@ class="cmr-12">] </span></p></div>
|
||||
class="cmr-12">5.9 </span></span> <a
|
||||
id="x26-250005.9"></a><span
|
||||
class="cmr-12">Auxiliary Methods</span></h4>
|
||||
<!--l. 894--><p class="noindent" ><span
|
||||
<!--l. 901--><p class="noindent" ><span
|
||||
class="cmr-12">Various functionalities are implemented as additional methods of the preconditioner</span>
|
||||
<span
|
||||
class="cmr-12">object.</span>
|
||||
<!--l. 897--><p class="noindent" >
|
||||
<!--l. 904--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark"><span
|
||||
class="cmr-12">5.9.1 </span></span> <a
|
||||
id="x26-260005.9.1"></a><span
|
||||
class="cmr-12">Method: dump</span></h5>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 899--><p class="noindent" >
|
||||
<!--l. 900--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 906--><p class="noindent" >
|
||||
<!--l. 907--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -68,9 +68,9 @@ class="cmtt-12">,</span><span
|
||||
class="cmtt-12">global_num</span><span
|
||||
class="cmtt-12">])</span><br />
|
||||
</div>
|
||||
<!--l. 903--><p class="noindent" ><span
|
||||
<!--l. 910--><p class="noindent" ><span
|
||||
class="cmr-12">Dump on file.</span>
|
||||
<!--l. 906--><p class="noindent" ><span
|
||||
<!--l. 913--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-17" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -78,9 +78,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-17-1"><col
|
||||
id="TBL-17-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-17-1-"><td style="white-space:normal; text-align:left;" id="TBL-17-1-1"
|
||||
class="td11"><!--l. 909--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 916--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-17-1-2"
|
||||
class="td11"><!--l. 909--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 916--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -91,8 +91,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-17-2-"><td style="white-space:normal; text-align:left;" id="TBL-17-2-1"
|
||||
class="td11"><!--l. 910--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-17-2-2"
|
||||
class="td11"><!--l. 910--><p class="noindent" ><span
|
||||
class="td11"><!--l. 917--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-17-2-2"
|
||||
class="td11"><!--l. 917--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -100,9 +100,9 @@ class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
|
||||
class="cmr-12">for details.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-17-3-"><td style="white-space:normal; text-align:left;" id="TBL-17-3-1"
|
||||
class="td11"><!--l. 911--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 918--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">amold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-17-3-2"
|
||||
class="td11"><!--l. 911--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 918--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">class</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -119,8 +119,8 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-17-4-"><td style="white-space:normal; text-align:left;" id="TBL-17-4-1"
|
||||
class="td11"><!--l. 912--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-17-4-2"
|
||||
class="td11"><!--l. 912--><p class="noindent" ><span
|
||||
class="td11"><!--l. 919--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-17-4-2"
|
||||
class="td11"><!--l. 919--><p class="noindent" ><span
|
||||
class="cmr-12">The desired dynamic type for internal matrix components; this</span>
|
||||
<span
|
||||
class="cmr-12">allows e.g. running on GPUs; it needs not be the same on all</span>
|
||||
@@ -134,15 +134,15 @@ class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-17-5-"><td style="white-space:normal; text-align:left;" id="TBL-17-5-1"
|
||||
class="td11"> </td> </tr></table></div>
|
||||
<!--l. 919--><p class="noindent" >
|
||||
<!--l. 926--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark"><span
|
||||
class="cmr-12">5.9.2 </span></span> <a
|
||||
id="x26-270005.9.2"></a><span
|
||||
class="cmr-12">Method: clone</span></h5>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 921--><p class="noindent" >
|
||||
<!--l. 922--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 928--><p class="noindent" >
|
||||
<!--l. 929--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -157,9 +157,9 @@ class="cmtt-12">)</span><br />
|
||||
|
||||
|
||||
|
||||
<!--l. 925--><p class="noindent" ><span
|
||||
<!--l. 932--><p class="noindent" ><span
|
||||
class="cmr-12">Create a (deep) copy of the preconditioner object.</span>
|
||||
<!--l. 928--><p class="noindent" ><span
|
||||
<!--l. 935--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-18" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -167,9 +167,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-18-1"><col
|
||||
id="TBL-18-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-18-1-"><td style="white-space:normal; text-align:left;" id="TBL-18-1-1"
|
||||
class="td11"><!--l. 931--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 938--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">pout</span> </td><td style="white-space:normal; text-align:left;" id="TBL-18-1-2"
|
||||
class="td11"><!--l. 931--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 938--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">type</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">amg_</span><span
|
||||
@@ -184,8 +184,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-18-2-"><td style="white-space:normal; text-align:left;" id="TBL-18-2-1"
|
||||
class="td11"><!--l. 932--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-18-2-2"
|
||||
class="td11"><!--l. 932--><p class="noindent" ><span
|
||||
class="td11"><!--l. 939--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-18-2-2"
|
||||
class="td11"><!--l. 939--><p class="noindent" ><span
|
||||
class="cmr-12">The copy of the preconditioner data structure. Note that </span><span
|
||||
class="cmti-12">x </span><span
|
||||
class="cmr-12">must</span>
|
||||
@@ -199,9 +199,9 @@ class="cmr-12">, single/double precision</span>
|
||||
class="cmr-12">version of AMG4PSBLAS under use.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-18-3-"><td style="white-space:normal; text-align:left;" id="TBL-18-3-1"
|
||||
class="td11"><!--l. 935--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 942--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-18-3-2"
|
||||
class="td11"><!--l. 935--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 942--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -212,8 +212,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-18-4-"><td style="white-space:normal; text-align:left;" id="TBL-18-4-1"
|
||||
class="td11"><!--l. 936--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-18-4-2"
|
||||
class="td11"><!--l. 936--><p class="noindent" ><span
|
||||
class="td11"><!--l. 943--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-18-4-2"
|
||||
class="td11"><!--l. 943--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -222,15 +222,15 @@ class="cmr-12">for details.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-18-5-"><td style="white-space:normal; text-align:left;" id="TBL-18-5-1"
|
||||
class="td11"> </td> </tr></table></div>
|
||||
<!--l. 941--><p class="noindent" >
|
||||
<!--l. 948--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark"><span
|
||||
class="cmr-12">5.9.3 </span></span> <a
|
||||
id="x26-280005.9.3"></a><span
|
||||
class="cmr-12">Method: sizeof</span></h5>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 943--><p class="noindent" >
|
||||
<!--l. 944--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 950--><p class="noindent" >
|
||||
<!--l. 951--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">sz</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">=</span><span
|
||||
@@ -248,9 +248,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-19-1"><col
|
||||
id="TBL-19-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-19-1-"><td style="white-space:normal; text-align:left;" id="TBL-19-1-1"
|
||||
class="td11"><!--l. 948--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 955--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">global</span> </td> <td style="white-space:normal; text-align:left;" id="TBL-19-1-2"
|
||||
class="td11"><!--l. 948--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 955--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">logical</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -258,8 +258,8 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-19-2-"><td style="white-space:normal; text-align:left;" id="TBL-19-2-1"
|
||||
class="td11"><!--l. 949--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-19-2-2"
|
||||
class="td11"><!--l. 949--><p class="noindent" ><span
|
||||
class="td11"><!--l. 956--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-19-2-2"
|
||||
class="td11"><!--l. 956--><p class="noindent" ><span
|
||||
class="cmr-12">Whether the global or local preconditioner memory occupation is</span>
|
||||
<span
|
||||
class="cmr-12">desired. Default: </span><span class="lstinline"></span><span
|
||||
@@ -272,7 +272,7 @@ class="cmr-12">.</span> </td
|
||||
class="td11"> </td> </tr></table>
|
||||
</div> <span
|
||||
class="cmr-12">Return memory footprint in bytes.</span>
|
||||
<!--l. 956--><p class="noindent" >
|
||||
<!--l. 963--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark"><span
|
||||
class="cmr-12">5.9.4 </span></span> <a
|
||||
id="x26-290005.9.4"></a><span
|
||||
@@ -280,8 +280,8 @@ class="cmr-12">Method: allocate</span><span
|
||||
class="cmr-12">_wrk</span></h5>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 958--><p class="noindent" >
|
||||
<!--l. 959--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 965--><p class="noindent" >
|
||||
<!--l. 966--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -294,7 +294,7 @@ class="cmtt-12"> </span><span
|
||||
class="cmtt-12">vmold</span><span
|
||||
class="cmtt-12">])</span><br />
|
||||
</div>
|
||||
<!--l. 962--><p class="noindent" ><span
|
||||
<!--l. 969--><p class="noindent" ><span
|
||||
class="cmr-12">Allocate internal work vectors. Each application of the preconditioner uses a number of</span>
|
||||
<span
|
||||
class="cmr-12">work vectors which are allocated internally as necessary; therefore allocation and</span>
|
||||
@@ -326,7 +326,7 @@ class="cmr-12">argument to the </span><span class="lstinline"></span><span
|
||||
class="cmtt-12">apply</span>
|
||||
<span
|
||||
class="cmr-12">method.</span>
|
||||
<!--l. 978--><p class="noindent" ><span
|
||||
<!--l. 985--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-20" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -334,9 +334,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-20-1"><col
|
||||
id="TBL-20-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-20-1-"><td style="white-space:normal; text-align:left;" id="TBL-20-1-1"
|
||||
class="td11"><!--l. 981--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 988--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-20-1-2"
|
||||
class="td11"><!--l. 981--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 988--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -347,8 +347,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-20-2-"><td style="white-space:normal; text-align:left;" id="TBL-20-2-1"
|
||||
class="td11"><!--l. 982--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-20-2-2"
|
||||
class="td11"><!--l. 982--><p class="noindent" ><span
|
||||
class="td11"><!--l. 989--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-20-2-2"
|
||||
class="td11"><!--l. 989--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
@@ -356,9 +356,9 @@ class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
|
||||
class="cmr-12">for details.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-20-3-"><td style="white-space:normal; text-align:left;" id="TBL-20-3-1"
|
||||
class="td11"><!--l. 983--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 990--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">vmold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-20-3-2"
|
||||
class="td11"><!--l. 983--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 990--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">class</span><span
|
||||
class="cmtt-12">(</span><span
|
||||
class="cmtt-12">psb_</span><span
|
||||
@@ -375,15 +375,15 @@ class="cmtt-12">optional</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-20-4-"><td style="white-space:normal; text-align:left;" id="TBL-20-4-1"
|
||||
class="td11"><!--l. 984--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-20-4-2"
|
||||
class="td11"><!--l. 984--><p class="noindent" ><span
|
||||
class="td11"><!--l. 991--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-20-4-2"
|
||||
class="td11"><!--l. 991--><p class="noindent" ><span
|
||||
class="cmr-12">The desired dynamic type for internal vector components; this</span>
|
||||
<span
|
||||
class="cmr-12">allows e.g. running on GPUs.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-20-5-"><td style="white-space:normal; text-align:left;" id="TBL-20-5-1"
|
||||
class="td11"> </td> </tr></table></div>
|
||||
<!--l. 990--><p class="noindent" >
|
||||
<!--l. 997--><p class="noindent" >
|
||||
<h5 class="subsubsectionHead"><span class="titlemark"><span
|
||||
class="cmr-12">5.9.5 </span></span> <a
|
||||
id="x26-300005.9.5"></a><span
|
||||
@@ -391,8 +391,8 @@ class="cmr-12">Method: free</span><span
|
||||
class="cmr-12">_wrk</span></h5>
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 992--><p class="noindent" >
|
||||
<!--l. 993--><p class="noindent" ><span class="lstinline"></span><span
|
||||
<!--l. 999--><p class="noindent" >
|
||||
<!--l. 1000--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">call</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
class="cmtt-12">p</span><span
|
||||
@@ -402,9 +402,9 @@ class="cmtt-12">(</span><span
|
||||
class="cmtt-12">info</span><span
|
||||
class="cmtt-12">)</span><br />
|
||||
</div>
|
||||
<!--l. 996--><p class="noindent" ><span
|
||||
<!--l. 1003--><p class="noindent" ><span
|
||||
class="cmr-12">Deallocate internal work vectors.</span>
|
||||
<!--l. 999--><p class="noindent" ><span
|
||||
<!--l. 1006--><p class="noindent" ><span
|
||||
class="cmbx-12">Arguments</span>
|
||||
<div class="tabular"> <table id="TBL-21" class="tabular"
|
||||
cellspacing="0" cellpadding="0"
|
||||
@@ -412,9 +412,9 @@ cellspacing="0" cellpadding="0"
|
||||
id="TBL-21-1"><col
|
||||
id="TBL-21-2"></colgroup><tr
|
||||
style="vertical-align:baseline;" id="TBL-21-1-"><td style="white-space:normal; text-align:left;" id="TBL-21-1-1"
|
||||
class="td11"><!--l. 1002--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 1009--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-21-1-2"
|
||||
class="td11"><!--l. 1002--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="td11"><!--l. 1009--><p class="noindent" ><span class="lstinline"></span><span
|
||||
class="cmtt-12">integer</span><span
|
||||
class="cmtt-12">,</span><span
|
||||
class="cmtt-12"> </span><span
|
||||
@@ -425,8 +425,8 @@ class="cmtt-12">)</span><span
|
||||
class="cmr-12">.</span> </td>
|
||||
</tr><tr
|
||||
style="vertical-align:baseline;" id="TBL-21-2-"><td style="white-space:normal; text-align:left;" id="TBL-21-2-1"
|
||||
class="td11"><!--l. 1003--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-21-2-2"
|
||||
class="td11"><!--l. 1003--><p class="noindent" ><span
|
||||
class="td11"><!--l. 1010--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-21-2-2"
|
||||
class="td11"><!--l. 1010--><p class="noindent" ><span
|
||||
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlse7.html#x28-320007"><span
|
||||
|
||||
@@ -4228,9 +4228,9 @@ class="cmtt-12">github</span><span
|
||||
class="cmtt-12">.</span><span
|
||||
class="cmtt-12">com</span><span
|
||||
class="cmtt-12">/</span><span
|
||||
class="cmtt-12">sfilippone</span><span
|
||||
class="cmtt-12">psctoolkit</span><span
|
||||
class="cmtt-12">/</span><span
|
||||
class="cmtt-12">amg4psblas</span><span
|
||||
class="cmtt-12">psctoolkit</span><span
|
||||
class="cmtt-12">/</span><span
|
||||
class="cmtt-12">issues</span><span
|
||||
class="cmtt-12">>.</span>
|
||||
|
||||
@@ -36,8 +36,8 @@ class="cmr-12">If you find any bugs in our codes, please report them through our
|
||||
<span
|
||||
class="cmr-12">on</span><br
|
||||
class="newline" /> <a
|
||||
href="https://github.com/psctoolkit/amg4psblas/issues" class="url" ><span
|
||||
class="cmtt-12">https://github.com/psctoolkit/amg4psblas/issues</span></a><br
|
||||
href="https://github.com/psctoolkit/psctoolkit/issues" class="url" ><span
|
||||
class="cmtt-12">https://github.com/psctoolkit/psctoolkit/issues</span></a><br
|
||||
class="newline" />
|
||||
<!--l. 195--><p class="indent" > <span
|
||||
class="cmr-12">To enable us to track the bug, please provide a log from the failing application, the</span>
|
||||
|
||||
+19
-18
@@ -29,40 +29,41 @@ class="cmr-12">3.5 </span></span> <a
|
||||
id="x13-120003.5"></a><span
|
||||
class="cmr-12">Example and test programs</span></h4>
|
||||
<!--l. 200--><p class="noindent" ><span
|
||||
class="cmr-12">The package contains the </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">examples</span></span></span> <span
|
||||
class="cmr-12">and </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">tests</span></span></span> <span
|
||||
class="cmr-12">directories; both of them are</span>
|
||||
<span
|
||||
class="cmr-12">further divided into </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmr-12">The package contains a </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">samples</span></span></span> <span
|
||||
class="cmr-12">directory, divided in two subdirs </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">simple</span></span></span> <span
|
||||
class="cmr-12">and</span>
|
||||
<span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">advanced</span></span></span><span
|
||||
class="cmr-12">; both of them are further divided into </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">fileread</span></span></span> <span
|
||||
class="cmr-12">and </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">pdegen</span></span></span> <span
|
||||
class="cmr-12">subdirectories. Their purpose is as</span>
|
||||
class="cmr-12">subdirectories.</span>
|
||||
<span
|
||||
class="cmr-12">follows:</span>
|
||||
class="cmr-12">Their purpose is as follows:</span>
|
||||
<dl class="description"><dt class="description">
|
||||
<span
|
||||
class="cmtt-12">examples</span> </dt><dd
|
||||
class="cmtt-12">simple</span> </dt><dd
|
||||
class="description"><span
|
||||
class="cmr-12">contains a set of simple example programs with a predefined choice</span>
|
||||
class="cmr-12">contains a set of simple example programs with a predefined choice of</span>
|
||||
<span
|
||||
class="cmr-12">of preconditioners, selectable via integer values. These are intended to get</span>
|
||||
class="cmr-12">preconditioners, selectable via integer values. These are intended to get</span>
|
||||
<span
|
||||
class="cmr-12">acquainted with the multilevel preconditioners available in AMG4PSBLAS.</span>
|
||||
</dd><dt class="description">
|
||||
<span
|
||||
class="cmtt-12">tests</span> </dt><dd
|
||||
class="cmtt-12">advanced</span> </dt><dd
|
||||
class="description"><span
|
||||
class="cmr-12">contains a set of more sophisticated examples that will allow the user, via</span>
|
||||
class="cmr-12">contains a set of more sophisticated examples that will allow the user,</span>
|
||||
<span
|
||||
class="cmr-12">the input files in the </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmr-12">via the input files in the </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">runs</span></span></span> <span
|
||||
class="cmr-12">subdirectories, to experiment with the full range</span>
|
||||
class="cmr-12">subdirectories, to experiment with the full</span>
|
||||
<span
|
||||
class="cmr-12">of preconditioners implemented in the package.</span></dd></dl>
|
||||
<!--l. 213--><p class="noindent" ><span
|
||||
class="cmr-12">range of preconditioners implemented in the package.</span></dd></dl>
|
||||
<!--l. 214--><p class="noindent" ><span
|
||||
class="cmr-12">The </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">fileread</span></span></span> <span
|
||||
class="cmr-12">directories contain sample programs that read sparse matrices from files,</span>
|
||||
|
||||
+36
-32
@@ -71,38 +71,39 @@ class="cmr-12">The part of the code dealing with reading and assembling the spar
|
||||
<span
|
||||
class="cmr-12">right-hand side vector and the deallocation of the relevant data structures, performed</span>
|
||||
<span
|
||||
class="cmr-12">through the PSBLAS routines for sparse matrix and vector management, is not</span>
|
||||
class="cmr-12">through the PSBLAS routines for sparse matrix and vector management,</span>
|
||||
<span
|
||||
class="cmr-12">reported here for the sake of conciseness. The complete code can be found in the</span>
|
||||
class="cmr-12">is not reported here for the sake of conciseness. The complete code can be</span>
|
||||
<span
|
||||
class="cmr-12">example program file </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmr-12">found in the example program file </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">amg_dexample_ml.f90</span></span></span><span
|
||||
class="cmr-12">, in the directory </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">examples/fileread</span></span></span> <span
|
||||
class="cmr-12">of</span>
|
||||
<span
|
||||
class="cmr-12">the AMG4PSBLAS implementation (see Section</span><span
|
||||
class="cmr-12">, in the directory</span>
|
||||
<span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">samples/simple/file</span></span></span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">read</span></span></span> <span
|
||||
class="cmr-12">of the AMG4PSBLAS implementation (see Section</span><span
|
||||
class="cmr-12"> </span><a
|
||||
href="userhtmlsu5.html#x13-120003.5"><span
|
||||
class="cmr-12">3.5</span><!--tex4ht:ref: sec:ex_and_test --></a><span
|
||||
class="cmr-12">). A sample test problem along</span>
|
||||
class="cmr-12">). A</span>
|
||||
<span
|
||||
class="cmr-12">with the relevant input data is available in </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">examples/fileread/runs</span></span></span><span
|
||||
class="cmr-12">. For details on</span>
|
||||
class="cmr-12">sample test problem along with the relevant input data is available in</span>
|
||||
<span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">samples/simple/fileread/runs</span></span></span><span
|
||||
class="cmr-12">. For details on the use of the PSBLAS routines, see</span>
|
||||
<span
|
||||
class="cmr-12">the use of the PSBLAS routines, see the PSBLAS User’s Guide</span><span
|
||||
class="cmr-12">the PSBLAS User’s Guide</span><span
|
||||
class="cmr-12"> </span><span class="cite"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlli5.html#XPSBLASGUIDE"><span
|
||||
class="cmr-12">20</span></a><span
|
||||
class="cmr-12">]</span></span><span
|
||||
class="cmr-12">.</span>
|
||||
<!--l. 138--><p class="indent" > <span
|
||||
class="cmr-12">The setup and application of the default multilevel preconditioner for the real single</span>
|
||||
|
||||
|
||||
|
||||
<!--l. 138--><p class="indent" > <span
|
||||
class="cmr-12">The setup and application of the default multilevel preconditioner for the real single</span>
|
||||
<span
|
||||
class="cmr-12">precision and the complex, single and double precision, versions are obtained</span>
|
||||
<span
|
||||
@@ -114,7 +115,8 @@ class="cmr-12">for</span>
|
||||
<span
|
||||
class="cmr-12">details). If these versions are installed, the corresponding codes are available in</span>
|
||||
<span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">examples/fileread/</span></span></span><span
|
||||
class="cmtt-12">samples/simple/file</span></span></span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">read</span></span></span><span
|
||||
class="cmr-12">.</span>
|
||||
|
||||
|
||||
@@ -160,7 +162,7 @@ class="cmr-12">.</span>
|
||||
! with basic smoothed aggregation, 1 hybrid forward/backward
|
||||
! GS sweep as pre/post-smoother and UMFPACK as coarsest-level
|
||||
! solver
|
||||
  call P%init(’ML’,info)
|
||||
  call P%init(ctxt,’ML’,info)
|
||||
!
|
||||
! build the preconditioner
|
||||
  call P%hierarchy_build(A,desc_A,info)
|
||||
@@ -169,8 +171,8 @@ class="cmr-12">.</span>
|
||||
! set the solver parameters and the initial guess
|
||||
  ... ...
|
||||
!
|
||||
! solve Ax=b with preconditioned CG
|
||||
  call psb_krylov(’CG’,A,P,b,x,tol,desc_A,info)
|
||||
! solve Ax=b with preconditioned FCG
|
||||
  call psb_krylov(’FCG’,A,P,b,x,tol,desc_A,info)
|
||||
  ... ...
|
||||
!
|
||||
! deallocate the preconditioner
|
||||
@@ -277,7 +279,7 @@ class="cmr-12">For all the previous preconditioners, example programs where the
|
||||
class="cmr-12">and the right-hand side are generated by discretizing a PDE with Dirichlet</span>
|
||||
<span
|
||||
class="cmr-12">boundary conditions are also available in the directory </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">examples/pdegen</span></span></span><span
|
||||
class="cmtt-12">samples/simple/pdegen</span></span></span><span
|
||||
class="cmr-12">.</span>
|
||||
|
||||
|
||||
@@ -296,7 +298,7 @@ class="cmr-12">.</span>
|
||||
! build a V-cycle preconditioner with 1 block-Jacobi sweep (with
|
||||
! ILU(0) on the blocks) as pre- and post-smoother, and 8  block-Jacobi
|
||||
! sweeps (with ILU(0) on the blocks) as coarsest-level solver
|
||||
  call P%init(’ML’,info)
|
||||
  call P%init(ctxt,’ML’,info)
|
||||
  call P%set(’SMOOTHER_TYPE’,’BJAC’,info)
|
||||
  call P%set(’COARSE_SOLVE’,’BJAC’,info)
|
||||
  call P%set(’COARSE_SWEEPS’,8,info)
|
||||
@@ -323,25 +325,27 @@ class="content">setup of a multilevel preconditioner based on the default decoup
|
||||
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 360--><p class="noindent" >
|
||||
<!--l. 362--><p class="noindent" >
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-8">
|
||||
... ...
|
||||
! build a W-cycle preconditioner with 2 hybrid Gauss-Seidel sweeps
|
||||
! as pre- and post-smoother, a distributed coarsest
|
||||
! matrix, and MUMPS as coarsest-level solver
|
||||
  call P%init(’ML’,info)
|
||||
  call P%init(ctxt,’ML’,info)
|
||||
  call P%set(’PAR_AGGR_ALG’,’COUPLED’,info)
|
||||
call P%set(’AGGR_TYPE’,’MATCHBOXP’,info)
|
||||
call P%set(’AGGR_SIZE’,8,info)
|
||||
  call P%set(’AGGR_TYPE’,’MATCHBOXP’,info)
|
||||
  call P%set(’AGGR_SIZE’,8,info)
|
||||
  call P%set(’ML_CYCLE’,’WCYCLE’,info)
|
||||
  call P%set(’SMOOTHER_TYPE’,’FBGS’,info)
|
||||
  call P%set(’SMOOTHER_SWEEPS’,2,info)
|
||||
  call P%set(’COARSE_SOLVE’,’KRM’,info)
|
||||
  call P%set(’COARSE_MAT’,’DIST’,info)
|
||||
  call P%set(’KRM_METHOD’,’FCG’,info)
|
||||
  call P%hierarchy_build(A,desc_A,info)
|
||||
  call P%smoothers_build(A,desc_A,info)
|
||||
... ...
|
||||
</pre>
|
||||
<!--l. 379--><p class="nopar" ></div></div>
|
||||
<!--l. 383--><p class="nopar" ></div></div>
|
||||
<br /> <div class="caption"
|
||||
><span class="id">Listing 3: </span><span
|
||||
class="content">setup of a multilevel preconditioner based on the coupled coarsening using
|
||||
@@ -353,7 +357,7 @@ weighted matching</span></div><!--tex4ht:label?: x15-14003r3 -->
|
||||
|
||||
|
||||
|
||||
<!--l. 386--><p class="indent" > <a
|
||||
<!--l. 390--><p class="indent" > <a
|
||||
id="x15-14004r4"></a><hr class="float"><div class="float"
|
||||
>
|
||||
|
||||
@@ -361,18 +365,18 @@ weighted matching</span></div><!--tex4ht:label?: x15-14003r3 -->
|
||||
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 398--><p class="noindent" >
|
||||
<!--l. 402--><p class="noindent" >
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-9">
|
||||
... ...
|
||||
! set RAS with overlap 2 and ILU(0) on the local blocks
|
||||
  call P%init(’AS’,info)
|
||||
  call P%init(ctxt,’AS’,info)
|
||||
  call P%set(’SUB_OVR’,2,info)
|
||||
  call P%bld(A,desc_A,info)
|
||||
... ...
|
||||
! solve Ax=b with preconditioned BiCGSTAB
|
||||
  call psb_krylov(’BICGSTAB’,A,P,b,x,tol,desc_A,info)
|
||||
</pre>
|
||||
<!--l. 410--><p class="nopar" ></div></div>
|
||||
<!--l. 414--><p class="nopar" ></div></div>
|
||||
<br /> <div class="caption"
|
||||
><span class="id">Listing 4: </span><span
|
||||
class="content">setup of a one-level Schwarz preconditioner.</span></div><!--tex4ht:label?: x15-14004r4 -->
|
||||
@@ -383,7 +387,7 @@ class="content">setup of a one-level Schwarz preconditioner.</span></div><!--tex
|
||||
|
||||
|
||||
|
||||
<!--l. 420--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 424--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu7.html" ><span
|
||||
class="cmr-12">next</span></a><span
|
||||
@@ -394,6 +398,6 @@ class="cmr-12">] [</span><a
|
||||
href="userhtmlse4.html#userhtmlsu6.html" ><span
|
||||
class="cmr-12">up</span></a><span
|
||||
class="cmr-12">] </span></p></div>
|
||||
<!--l. 420--><p class="indent" > <a
|
||||
<!--l. 424--><p class="indent" > <a
|
||||
id="tailuserhtmlsu6.html"></a>
|
||||
</body></html>
|
||||
|
||||
+29
-24
@@ -10,7 +10,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 420--><div class="crosslinks"><p class="noindent"><span
|
||||
<!--l. 424--><div class="crosslinks"><p class="noindent"><span
|
||||
class="cmr-12">[</span><a
|
||||
href="userhtmlsu6.html" ><span
|
||||
class="cmr-12">prev</span></a><span
|
||||
@@ -28,7 +28,7 @@ class="cmr-12">] </span></p></div>
|
||||
class="cmr-12">4.2 </span></span> <a
|
||||
id="x16-150004.2"></a><span
|
||||
class="cmr-12">GPU example</span></h4>
|
||||
<!--l. 422--><p class="noindent" ><span
|
||||
<!--l. 426--><p class="noindent" ><span
|
||||
class="cmr-12">The code discussed here shows how to set up a program exploiting the combined GPU</span>
|
||||
<span
|
||||
class="cmr-12">capabilities of PSBLAS and AMG4PSBLAS. The code example is available in the</span>
|
||||
@@ -36,14 +36,14 @@ class="cmr-12">capabilities of PSBLAS and AMG4PSBLAS. The code example is availa
|
||||
class="cmr-12">source distribution directory </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">amg4psblas/examples/gpu</span></span></span><span
|
||||
class="cmr-12">.</span>
|
||||
<!--l. 427--><p class="indent" > <span
|
||||
<!--l. 431--><p class="indent" > <span
|
||||
class="cmr-12">First of all, we need to include the appropriate modules and declare some auxiliary</span>
|
||||
<span
|
||||
class="cmr-12">variables:</span>
|
||||
|
||||
|
||||
|
||||
<!--l. 429--><p class="indent" > <a
|
||||
<!--l. 433--><p class="indent" > <a
|
||||
id="x16-15001r5"></a><hr class="float"><div class="float"
|
||||
>
|
||||
|
||||
@@ -51,7 +51,7 @@ class="cmr-12">variables:</span>
|
||||
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 448--><p class="noindent" >
|
||||
<!--l. 452--><p class="noindent" >
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-10">
|
||||
program amg_dexample_gpu
|
||||
  use psb_base_mod
|
||||
@@ -69,7 +69,7 @@ program amg_dexample_gpu
|
||||
  type(psb_i_vect_gpu)       :: igmold
|
||||
 
|
||||
</pre>
|
||||
<!--l. 467--><p class="nopar" ></div></div>
|
||||
<!--l. 471--><p class="nopar" ></div></div>
|
||||
<br /> <div class="caption"
|
||||
><span class="id">Listing 5: </span><span
|
||||
class="content">setup of a GPU-enabled test program part one.</span></div><!--tex4ht:label?: x16-15001r5 -->
|
||||
@@ -77,7 +77,7 @@ class="content">setup of a GPU-enabled test program part one.</span></div><!--te
|
||||
|
||||
|
||||
</div><hr class="endfloat" />
|
||||
<!--l. 474--><p class="indent" > <span
|
||||
<!--l. 478--><p class="indent" > <span
|
||||
class="cmr-12">In this particular example we are choosing to employ a </span><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">HLG</span></span></span> <span
|
||||
class="cmr-12">data structure for</span>
|
||||
@@ -85,7 +85,7 @@ class="cmr-12">data structure for</span>
|
||||
class="cmr-12">sparse matrices on GPUs; for more information please refer to the PSBLAS-EXT users’</span>
|
||||
<span
|
||||
class="cmr-12">guide.</span>
|
||||
<!--l. 478--><p class="indent" > <span
|
||||
<!--l. 482--><p class="indent" > <span
|
||||
class="cmr-12">We then have to initialize the GPU environment, and pass the appropriate MOLD</span>
|
||||
<span
|
||||
class="cmr-12">variables to the build methods (see also the PSBLAS and PSBLAS-EXT users’</span>
|
||||
@@ -94,7 +94,7 @@ class="cmr-12">guides).</span>
|
||||
|
||||
|
||||
|
||||
<!--l. 481--><p class="indent" > <a
|
||||
<!--l. 485--><p class="indent" > <a
|
||||
id="x16-15002r6"></a><hr class="float"><div class="float"
|
||||
>
|
||||
|
||||
@@ -102,7 +102,7 @@ class="cmr-12">guides).</span>
|
||||
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 497--><p class="noindent" >
|
||||
<!--l. 501--><p class="noindent" >
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-11">
|
||||
  call psb_init(ctxt)
|
||||
  call psb_info(ctxt,iam,np)
|
||||
@@ -116,7 +116,7 @@ class="cmr-12">guides).</span>
|
||||
  call prec%smoothers_build(a,desc_a,info, amold=agmold, vmold=vgmold, imold=igmold)
|
||||
 
|
||||
</pre>
|
||||
<!--l. 512--><p class="nopar" ></div></div>
|
||||
<!--l. 516--><p class="nopar" ></div></div>
|
||||
<br /> <div class="caption"
|
||||
><span class="id">Listing 6: </span><span
|
||||
class="content">setup of a GPU-enabled test program part two.</span></div><!--tex4ht:label?: x16-15002r6 -->
|
||||
@@ -124,7 +124,7 @@ class="content">setup of a GPU-enabled test program part two.</span></div><!--te
|
||||
|
||||
|
||||
</div><hr class="endfloat" />
|
||||
<!--l. 519--><p class="indent" > <span
|
||||
<!--l. 523--><p class="indent" > <span
|
||||
class="cmr-12">Finally, we convert the input matrix, the descriptor and the vectors to use a</span>
|
||||
<span
|
||||
class="cmr-12">GPU-enabled internal storage format. We then preallocate the preconditioner</span>
|
||||
@@ -135,7 +135,7 @@ class="cmr-12">GPU environment</span>
|
||||
|
||||
|
||||
|
||||
<!--l. 523--><p class="indent" > <a
|
||||
<!--l. 527--><p class="indent" > <a
|
||||
id="x16-15003r7"></a><hr class="float"><div class="float"
|
||||
>
|
||||
|
||||
@@ -143,7 +143,7 @@ class="cmr-12">GPU environment</span>
|
||||
|
||||
<div class="center"
|
||||
>
|
||||
<!--l. 552--><p class="noindent" >
|
||||
<!--l. 557--><p class="noindent" >
|
||||
<div class="minipage"><pre class="verbatim" id="verbatim-12">
|
||||
  call desc_a%cnv(mold=igmold)
|
||||
  call a%cscnv(info,mold=agmold)
|
||||
@@ -167,7 +167,7 @@ class="cmr-12">GPU environment</span>
|
||||
  stop
|
||||
 
|
||||
</pre>
|
||||
<!--l. 579--><p class="nopar" ></div></div>
|
||||
<!--l. 584--><p class="nopar" ></div></div>
|
||||
<br /> <div class="caption"
|
||||
><span class="id">Listing 7: </span><span
|
||||
class="content">setup of a GPU-enabled test program part three.</span></div><!--tex4ht:label?: x16-15003r7 -->
|
||||
@@ -175,25 +175,30 @@ class="content">setup of a GPU-enabled test program part three.</span></div><!--
|
||||
|
||||
|
||||
</div><hr class="endfloat" />
|
||||
<!--l. 587--><p class="indent" > <span
|
||||
class="cmr-12">It is very important to employ solvers that are suited to the GPU, i.e. solvers that</span>
|
||||
<!--l. 592--><p class="indent" > <span
|
||||
class="cmr-12">It is very important to employ smoothers and coarsest solvers that are suited to the</span>
|
||||
<span
|
||||
class="cmr-12">do NOT employ triangular system solve kernels. Solvers that satisfy this constraint</span>
|
||||
class="cmr-12">GPU, i.e. methods that do NOT employ triangular system solve kernels. Methods that</span>
|
||||
<span
|
||||
class="cmr-12">include:</span>
|
||||
class="cmr-12">satisfy this constraint include:</span>
|
||||
<ul class="itemize1">
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">JACOBI</span></span></span>
|
||||
</li>
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">BJAC</span></span></span> <span
|
||||
class="cmr-12">with the following methods on the local blocks:</span>
|
||||
<ul class="itemize2">
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">INVK</span></span></span>
|
||||
</li>
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
</li>
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">INVT</span></span></span>
|
||||
</li>
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
</li>
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-12">AINV</span></span></span></li></ul>
|
||||
<!--l. 596--><p class="noindent" ><span
|
||||
</li></ul>
|
||||
<!--l. 604--><p class="noindent" ><span
|
||||
class="cmr-12">and their </span><span
|
||||
class="cmmi-12">ℓ</span><sub><span
|
||||
class="cmr-8">1</span></sub> <span
|
||||
|
||||
+375
-371
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -211,12 +211,12 @@ ps: $(PS)
|
||||
|
||||
.PHONY: clean clean-tmp preview print gzip gunzip tar ci
|
||||
|
||||
clean:
|
||||
clean: clean-tmp
|
||||
rm -f $(PDF) $(PS)
|
||||
cd tmp ; rm -r -f *
|
||||
|
||||
|
||||
clean-tmp:
|
||||
cd tmp ; rm -r -f *
|
||||
(test -d tmp && cd tmp && rm -r -f *)
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -190,22 +190,23 @@ make install
|
||||
\subsection{Bug reporting}
|
||||
If you find any bugs in our codes, please report them through our
|
||||
issues page on \\[2mm]
|
||||
\url{https://github.com/psctoolkit/amg4psblas/issues}\\
|
||||
\url{https://github.com/psctoolkit/psctoolkit/issues}\\
|
||||
|
||||
To enable us to track the bug, please provide a log from the failing
|
||||
application, the test conditions, and ideally a self-contained test
|
||||
program reproducing the issue.
|
||||
|
||||
\subsection{Example and test programs\label{sec:ex_and_test}}
|
||||
The package contains the \verb|examples| and \verb|tests| directories;
|
||||
The package contains a \verb|samples| directory, divided in two
|
||||
subdirs \verb|simple| and \verb|advanced|;
|
||||
both of them are further divided into \verb|fileread| and
|
||||
\verb|pdegen| subdirectories. Their purpose is as follows:
|
||||
\begin{description}
|
||||
\item[\tt examples] contains a set of simple example programs with a
|
||||
\item[\tt simple] contains a set of simple example programs with a
|
||||
predefined choice of preconditioners, selectable via integer
|
||||
values. These are intended to get acquainted with the
|
||||
multilevel preconditioners available in AMG4PSBLAS.
|
||||
\item[\tt tests] contains a set of more sophisticated examples that
|
||||
\item[\tt advanced] contains a set of more sophisticated examples that
|
||||
will allow the user, via the input files in the \verb|runs|
|
||||
subdirectories, to experiment with the full range of preconditioners
|
||||
implemented in the package.
|
||||
|
||||
@@ -159,4 +159,4 @@ Some influential environment variables:
|
||||
Use these variables to override the choices made by `configure' or to help
|
||||
it to find libraries and programs with nonstandard names/locations.
|
||||
|
||||
Report bugs to <https://github.com/sfilippone/amg4psblas/issues>.
|
||||
Report bugs to <https://github.com/psctoolkit/psctoolkit/issues>.
|
||||
|
||||
+30
-22
@@ -129,9 +129,9 @@ relevant data structures, performed
|
||||
through the PSBLAS routines for sparse matrix and vector management, is not reported
|
||||
here for the sake of conciseness.
|
||||
The complete code can be found in the example program file \verb|amg_dexample_ml.f90|,
|
||||
in the directory \verb|examples/fileread| of the AMG4PSBLAS implementation (see
|
||||
in the directory \verb|samples/simple/file|\-\verb|read| of the AMG4PSBLAS implementation (see
|
||||
Section~\ref{sec:ex_and_test}). A sample test problem along with the relevant
|
||||
input data is available in \verb|examples/fileread/runs|.
|
||||
input data is available in \verb|samples/simple/fileread/runs|.
|
||||
For details on the use of the PSBLAS routines, see the PSBLAS User's
|
||||
Guide~\cite{PSBLASGUIDE}.
|
||||
|
||||
@@ -139,7 +139,7 @@ The setup and application of the default multilevel preconditioner
|
||||
for the real single precision and the complex, single and double
|
||||
precision, versions are obtained with straightforward modifications of the previous
|
||||
example (see Section~\ref{sec:userinterface} for details). If these versions are installed,
|
||||
the corresponding codes are available in \verb|examples/fileread/|.
|
||||
the corresponding codes are available in \verb|samples/simple/file|\-\verb|read|.
|
||||
|
||||
\begin{listing}[tbp]
|
||||
\begin{center}
|
||||
@@ -174,7 +174,7 @@ the corresponding codes are available in \verb|examples/fileread/|.
|
||||
! with basic smoothed aggregation, 1 hybrid forward/backward
|
||||
! GS sweep as pre/post-smoother and UMFPACK as coarsest-level
|
||||
! solver
|
||||
call P%init('ML',info)
|
||||
call P%init(ctxt,'ML',info)
|
||||
!
|
||||
! build the preconditioner
|
||||
call P%hierarchy_build(A,desc_A,info)
|
||||
@@ -184,8 +184,8 @@ the corresponding codes are available in \verb|examples/fileread/|.
|
||||
! set the solver parameters and the initial guess
|
||||
... ...
|
||||
!
|
||||
! solve Ax=b with preconditioned CG
|
||||
call psb_krylov('CG',A,P,b,x,tol,desc_A,info)
|
||||
! solve Ax=b with preconditioned FCG
|
||||
call psb_krylov('FCG',A,P,b,x,tol,desc_A,info)
|
||||
... ...
|
||||
!
|
||||
! deallocate the preconditioner
|
||||
@@ -229,7 +229,7 @@ stop
|
||||
! with basic smoothed aggregation, 1 hybrid forward/backward
|
||||
! GS sweep as pre/post-smoother and UMFPACK as coarsest-level
|
||||
! solver
|
||||
call P%init('ML',info)
|
||||
call P%init(ctxt,'ML',info)
|
||||
!
|
||||
! build the preconditioner
|
||||
call P%hierarchy_build(A,desc_A,info)
|
||||
@@ -239,8 +239,8 @@ stop
|
||||
! set the solver parameters and the initial guess
|
||||
... ...
|
||||
!
|
||||
! solve Ax=b with preconditioned CG
|
||||
call psb_krylov('CG',A,P,b,x,tol,desc_A,info)
|
||||
! solve Ax=b with preconditioned FCG
|
||||
call psb_krylov('FCG',A,P,b,x,tol,desc_A,info)
|
||||
... ...
|
||||
!
|
||||
! deallocate the preconditioner
|
||||
@@ -300,14 +300,14 @@ The corresponding example program is available in the file
|
||||
|
||||
For all the previous preconditioners, example programs where the sparse matrix and
|
||||
the right-hand side are generated by discretizing a PDE with Dirichlet
|
||||
boundary conditions are also available in the directory \verb|examples/pdegen|.
|
||||
boundary conditions are also available in the directory \verb|samples/simple/pdegen|.
|
||||
\vspace{-1em}\begin{listing}[tbh]
|
||||
\ifpdf%
|
||||
\begin{minted}[breaklines=true,bgcolor=bg,fontsize=\small]{fortran}
|
||||
! build a V-cycle preconditioner with 1 block-Jacobi sweep (with
|
||||
! ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi
|
||||
! sweeps (with ILU(0) on the blocks) as coarsest-level solver
|
||||
call P%init('ML',info)
|
||||
call P%init(ctxt,'ML',info)
|
||||
call P%set('SMOOTHER_TYPE','BJAC',info)
|
||||
call P%set('COARSE_SOLVE','BJAC',info)
|
||||
call P%set('COARSE_SWEEPS',8,info)
|
||||
@@ -323,7 +323,7 @@ call P%smoothers_build(A,desc_A,info)
|
||||
! build a V-cycle preconditioner with 1 block-Jacobi sweep (with
|
||||
! ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi
|
||||
! sweeps (with ILU(0) on the blocks) as coarsest-level solver
|
||||
call P%init('ML',info)
|
||||
call P%init(ctxt,'ML',info)
|
||||
call P%set('SMOOTHER_TYPE','BJAC',info)
|
||||
call P%set('COARSE_SOLVE','BJAC',info)
|
||||
call P%set('COARSE_SWEEPS',8,info)
|
||||
@@ -345,7 +345,7 @@ call P%smoothers_build(A,desc_A,info)
|
||||
!2 hybrid Gauss-Seidel sweeps as pre- and post-smoother,
|
||||
!and parallel flexible Conjugate Gradient coupled with the block-Jacobi
|
||||
!preconditioner having ILU(0) on the blocks as coarsest solver.
|
||||
call P%init('ML',info)
|
||||
call P%init(ctxt,'ML',info)
|
||||
call P%set('PAR_AGGR_ALG','COUPLED',info)
|
||||
call P%set('AGGR_TYPE','MATCHBOXP',info)
|
||||
call P%set('AGGR_SIZE',8,info)
|
||||
@@ -353,6 +353,8 @@ call P%set('ML_CYCLE','WCYCLE',info)
|
||||
call P%set('SMOOTHER_TYPE','FBGS',info)
|
||||
call P%set('SMOOTHER_SWEEPS',2,info)
|
||||
call P%set('COARSE_SOLVE','KRM',info)
|
||||
call P%set('COARSE_MAT','DIST',info)
|
||||
call P%set('KRM_METHOD','FCG',info)
|
||||
call P%hierarchy_build(A,desc_A,info)
|
||||
call P%smoothers_build(A,desc_A,info)
|
||||
\end{minted}
|
||||
@@ -365,14 +367,16 @@ call P%smoothers_build(A,desc_A,info)
|
||||
! build a W-cycle preconditioner with 2 hybrid Gauss-Seidel sweeps
|
||||
! as pre- and post-smoother, a distributed coarsest
|
||||
! matrix, and MUMPS as coarsest-level solver
|
||||
call P%init('ML',info)
|
||||
call P%init(ctxt,'ML',info)
|
||||
call P%set('PAR_AGGR_ALG','COUPLED',info)
|
||||
call P%set('AGGR_TYPE','MATCHBOXP',info)
|
||||
call P%set('AGGR_SIZE',8,info)
|
||||
call P%set('AGGR_TYPE','MATCHBOXP',info)
|
||||
call P%set('AGGR_SIZE',8,info)
|
||||
call P%set('ML_CYCLE','WCYCLE',info)
|
||||
call P%set('SMOOTHER_TYPE','FBGS',info)
|
||||
call P%set('SMOOTHER_SWEEPS',2,info)
|
||||
call P%set('COARSE_SOLVE','KRM',info)
|
||||
call P%set('COARSE_MAT','DIST',info)
|
||||
call P%set('KRM_METHOD','FCG',info)
|
||||
call P%hierarchy_build(A,desc_A,info)
|
||||
call P%smoothers_build(A,desc_A,info)
|
||||
... ...
|
||||
@@ -387,7 +391,7 @@ call P%set('AGGR_SIZE',8,info)
|
||||
\ifpdf
|
||||
\begin{minted}[breaklines=true,bgcolor=bg,fontsize=\small]{fortran}
|
||||
! build a one-level RAS with overlap 2 and ILU(0) on the local blocks.
|
||||
call P%init('AS',info)
|
||||
call P%init(ctxt,'AS',info)
|
||||
call P%set('SUB_OVR',2,info)
|
||||
call P%build(A,desc_A,info)
|
||||
... ...
|
||||
@@ -401,7 +405,7 @@ call P%build(A,desc_A,info)
|
||||
\begin{verbatim}
|
||||
... ...
|
||||
! set RAS with overlap 2 and ILU(0) on the local blocks
|
||||
call P%init('AS',info)
|
||||
call P%init(ctxt,'AS',info)
|
||||
call P%set('SUB_OVR',2,info)
|
||||
call P%bld(A,desc_A,info)
|
||||
... ...
|
||||
@@ -535,7 +539,8 @@ Krylov method. At the end of the code, we close the GPU environment
|
||||
call prec%allocate_wrk(info)
|
||||
t1 = psb_wtime()
|
||||
call psb_krylov(s_choice%kmethd,a,prec,b,x,s_choice%eps,&
|
||||
& desc_a,info,itmax=s_choice%itmax,iter=iter,err=err,itrace=s_choice%itrace,&
|
||||
& desc_a,info,itmax=s_choice%itmax,iter=iter,err=err,&
|
||||
& itrace=s_choice%itrace,&
|
||||
& istop=s_choice%istopc,irst=s_choice%irst)
|
||||
call prec%deallocate_wrk(info)
|
||||
call psb_barrier(ctxt)
|
||||
@@ -584,15 +589,18 @@ Krylov method. At the end of the code, we close the GPU environment
|
||||
\caption{setup of a GPU-enabled test program part three.\label{fig:gpu-ex3}}
|
||||
\end{listing}
|
||||
|
||||
It is very important to employ solvers that are suited
|
||||
to the GPU, i.e. solvers that do NOT employ triangular
|
||||
system solve kernels. Solvers that satisfy this constraint include:
|
||||
It is very important to employ smoothers and coarsest solvers that are suited
|
||||
to the GPU, i.e. methods that do NOT employ triangular
|
||||
system solve kernels. Methods that satisfy this constraint include:
|
||||
\begin{itemize}
|
||||
\item \verb|JACOBI|
|
||||
\item \verb|BJAC| with the following methods on the local blocks:
|
||||
\begin{itemize}
|
||||
\item \verb|INVK|
|
||||
\item \verb|INVT|
|
||||
\item \verb|AINV|
|
||||
\end{itemize}
|
||||
\end{itemize}
|
||||
and their $\ell_1$ variants.
|
||||
|
||||
%%% Local Variables:
|
||||
|
||||
@@ -176,9 +176,10 @@ Similar considerations apply to the point-Jacobi, Gauss-Seidel and block-Jacobi
|
||||
coarsest-level solvers, and shortcuts are available
|
||||
in this case too (see Table~\ref{tab:p_coarse_1}). \\
|
||||
|
||||
\textbf{Remark 3.} Many of the coarsest-level solvers cannot be used
|
||||
with both replicated and distributed coarsest-matrix layouts;
|
||||
therefore, setting the solver after the layout may change the layout.
|
||||
\textbf{Remark 3.} Many of the coarsest-level solvers apply to a
|
||||
specific coarsest-matrix layout;
|
||||
therefore, setting the solver after the layout may change the layout
|
||||
to either distributed or replicated.
|
||||
Similarly, setting the layout after the solver may change the solver.
|
||||
|
||||
More precisely, UMFPACK and SuperLU require the coarsest-level
|
||||
@@ -399,8 +400,14 @@ the parameter \texttt{ilev}.} \\
|
||||
\fortinline|'COARSE_SOLVE'| & \fortinline|character(len=*)|
|
||||
& \fortinline|'MUMPS'| \par \fortinline|'UMF'| \par
|
||||
\fortinline|'SLU'| \par \fortinline|'SLUDIST'| \par
|
||||
\fortinline|'JACOBI'| \par \fortinline|'GS'| \par \fortinline|'BJAC'| \par \fortinline|'KRM'|
|
||||
\fortinline|'L1-JACOBI'| \par \fortinline|'L1-BJAC'| \par \fortinline|'L1-FBGS'|
|
||||
\fortinline|'ILU'| \par
|
||||
\fortinline|'JACOBI'| \par
|
||||
\fortinline|'GS'| \par
|
||||
\fortinline|'BJAC'| \par
|
||||
\fortinline|'KRM'| \par
|
||||
\fortinline|'L1-JACOBI'| \par
|
||||
\fortinline|'L1-BJAC'| \par
|
||||
\fortinline|'L1-FBGS'|
|
||||
& See~Note.
|
||||
& Solver used at the coarsest level: sequential
|
||||
LU from MUMPS, UMFPACK, or SuperLU
|
||||
|
||||
@@ -39,23 +39,18 @@
|
||||
!
|
||||
! This sample program solves a linear system obtained by discretizing a
|
||||
! PDE with Dirichlet BCs. The solver is CG, coupled with one of the
|
||||
! following multi-level preconditioner, as explained in Section 4.1 of
|
||||
! following multi-level preconditioner, as explained in Section 4.2 of
|
||||
! the AMG4PSBLAS User's and Reference Guide:
|
||||
!
|
||||
! - choice = 1, the default multi-level preconditioner solver, i.e.,
|
||||
! V-cycle with decoupled smoothed aggregation, 1 hybrid forward/backward
|
||||
! GS sweep as pre/post-smoother and UMFPACK as coarsest-level
|
||||
! solver (Sec. 4.1, Listing 1)
|
||||
! - choice = 1, a V-cycle with decoupled smoothed aggregation, 4 Jacobi
|
||||
! sweeps as pre/post-smoother and 8 Jacobi sweeps as coarsest-level
|
||||
! solver with replicated coarsest matrix
|
||||
!
|
||||
! - choice = 2, a V-cycle preconditioner with 1 block-Jacobi sweep
|
||||
! (with ILU(0) on the blocks) as pre- and post-smoother, and 8 block-Jacobi
|
||||
! sweeps (with ILU(0) on the blocks) as coarsest-level solver (Sec. 4.1, Listing 2)
|
||||
!
|
||||
! - choice = 3, W-cycle preconditioner based on the coupled aggregation relying
|
||||
! on matching, with maximum size of aggregates equal to 8 and smoothed prolongators,
|
||||
! 2 hybrid forward/backward GS sweeps as pre/post-smoother, a distributed coarsest
|
||||
! matrix, and preconditioned Flexible Conjugate Gradient as coarsest-level solver
|
||||
! (Sec. 4.1, Listing 3)
|
||||
! - choice = 2, a W-cycle based on the coupled aggregation relying on matching,
|
||||
! with maximum size of aggregates equal to 8 and smoothed prolongators,
|
||||
! 2 sweeps of Block-Jacobi ipre/post-smoother using approximate inverse INVK and
|
||||
! 4 sweeps of Block-Jacobi with INVK as coarsest-level solver on distributed
|
||||
! coarsest matrix
|
||||
!
|
||||
! The matrix and the rhs are read from files (if an rhs is not available, the
|
||||
! unit rhs is set).
|
||||
@@ -183,8 +178,9 @@ program amg_dexample_gpu
|
||||
|
||||
case(1)
|
||||
|
||||
! initialize a V-cycle preconditioner with 4 Jacobi sweep
|
||||
! and 8 Jacobi sweeps as coarsest-level solver
|
||||
! initialize a V-cycle preconditioner, relying on decoupled smoothed aggregation
|
||||
! with 4 Jacobi sweeps as pre/post-smoother
|
||||
! and 8 Jacobi sweeps as coarsest-level solver on replicated coarsest matrix
|
||||
|
||||
call P%init(ctxt,'ML',info)
|
||||
call P%set('SMOOTHER_TYPE','JACOBI',info)
|
||||
@@ -195,19 +191,22 @@ program amg_dexample_gpu
|
||||
|
||||
case(2)
|
||||
|
||||
! initialize a V-cycle preconditioner based on the coupled aggregation relying on matching,
|
||||
! initialize a W-cycle preconditioner based on the coupled aggregation relying on matching,
|
||||
! with maximum size of aggregates equal to 8 and smoothed prolongators,
|
||||
! Block-Jacobi smoother using approximate inverse INVK and
|
||||
! and 4 sweeps of INVK on he coarsest level
|
||||
! 2 sweeps of Block-Jacobi pre/post-smoother using approximate inverse INVK and
|
||||
! 4 sweeps of Block-Jacobi with INVK on the coarsest level distributed matrix
|
||||
|
||||
call P%init(ctxt,'ML',info)
|
||||
call P%set('PAR_AGGR_ALG','COUPLED',info)
|
||||
call P%set('AGGR_TYPE','MATCHBOXP',info)
|
||||
call P%set('AGGR_SIZE',8,info)
|
||||
call P%set('ML_CYCLE','WCYCLE',info)
|
||||
call P%set('SMOOTHER_TYPE','BJAC',info)
|
||||
call P%set('SMOOTHER_SWEEPS',2,info)
|
||||
call P%set('SUB_SOLVE','INVK',info)
|
||||
call P%set('COARSE_SOLVE','INVK',info)
|
||||
call P%set('COARSE_SOLVE','BJAC',info)
|
||||
call P%set('COARSE_SUBSOLVE','INVK',info)
|
||||
call P%set('COARSE_SWEEPS',4,info)
|
||||
call P%set('COARSE_MAT','DIST',info)
|
||||
kmethod = 'CG'
|
||||
|
||||
|
||||
@@ -676,8 +676,9 @@ contains
|
||||
call read_data(prec%aggr_prol,inp_unit) ! aggregation type
|
||||
call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
|
||||
call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
|
||||
call read_data(prec%aggr_filter,inp_unit) ! filtering
|
||||
call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
|
||||
call read_data(prec%aggr_filter,inp_unit) ! filtering
|
||||
call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
|
||||
call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
|
||||
if (prec%thrvsz > 0) then
|
||||
call psb_realloc(prec%thrvsz,prec%athresv,info)
|
||||
@@ -685,7 +686,6 @@ contains
|
||||
else
|
||||
read(inp_unit,*) ! dummy read to skip a record
|
||||
end if
|
||||
call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
|
||||
! coasest-level solver
|
||||
call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
|
||||
call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
|
||||
|
||||
@@ -676,8 +676,9 @@ contains
|
||||
call read_data(prec%aggr_prol,inp_unit) ! aggregation type
|
||||
call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
|
||||
call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
|
||||
call read_data(prec%aggr_filter,inp_unit) ! filtering
|
||||
call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
|
||||
call read_data(prec%aggr_filter,inp_unit) ! filtering
|
||||
call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
|
||||
call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
|
||||
if (prec%thrvsz > 0) then
|
||||
call psb_realloc(prec%thrvsz,prec%athresv,info)
|
||||
@@ -685,7 +686,6 @@ contains
|
||||
else
|
||||
read(inp_unit,*) ! dummy read to skip a record
|
||||
end if
|
||||
call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
|
||||
! coasest-level solver
|
||||
call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
|
||||
call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
|
||||
|
||||
@@ -676,8 +676,9 @@ contains
|
||||
call read_data(prec%aggr_prol,inp_unit) ! aggregation type
|
||||
call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
|
||||
call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
|
||||
call read_data(prec%aggr_filter,inp_unit) ! filtering
|
||||
call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
|
||||
call read_data(prec%aggr_filter,inp_unit) ! filtering
|
||||
call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
|
||||
call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
|
||||
if (prec%thrvsz > 0) then
|
||||
call psb_realloc(prec%thrvsz,prec%athresv,info)
|
||||
@@ -685,7 +686,6 @@ contains
|
||||
else
|
||||
read(inp_unit,*) ! dummy read to skip a record
|
||||
end if
|
||||
call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
|
||||
! coasest-level solver
|
||||
call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
|
||||
call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
|
||||
|
||||
@@ -676,8 +676,9 @@ contains
|
||||
call read_data(prec%aggr_prol,inp_unit) ! aggregation type
|
||||
call read_data(prec%par_aggr_alg,inp_unit) ! parallel aggregation alg
|
||||
call read_data(prec%aggr_ord,inp_unit) ! ordering for aggregation
|
||||
call read_data(prec%aggr_filter,inp_unit) ! filtering
|
||||
call read_data(prec%mncrratio,inp_unit) ! minimum aggregation ratio
|
||||
call read_data(prec%aggr_filter,inp_unit) ! filtering
|
||||
call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
|
||||
call read_data(prec%thrvsz,inp_unit) ! size of aggr thresh vector
|
||||
if (prec%thrvsz > 0) then
|
||||
call psb_realloc(prec%thrvsz,prec%athresv,info)
|
||||
@@ -685,7 +686,6 @@ contains
|
||||
else
|
||||
read(inp_unit,*) ! dummy read to skip a record
|
||||
end if
|
||||
call read_data(prec%athres,inp_unit) ! smoothed aggr thresh
|
||||
! coasest-level solver
|
||||
call read_data(prec%csolve,inp_unit) ! coarsest-lev solver
|
||||
call read_data(prec%csbsolve,inp_unit) ! coarsest-lev subsolver
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user