|
|
@ -1,3 +1,41 @@
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ MLD2P4 version 2.0
|
|
|
|
|
|
|
|
!!$ MultiLevel Domain Decomposition Parallel Preconditioners Package
|
|
|
|
|
|
|
|
!!$ based on PSBLAS (Parallel Sparse BLAS version 3.0)
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ (C) Copyright 2008,2009,2010,2012
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ Salvatore Filippone University of Rome Tor Vergata
|
|
|
|
|
|
|
|
!!$ Alfredo Buttari CNRS-IRIT, Toulouse
|
|
|
|
|
|
|
|
!!$ Pasqua D'Ambra ICAR-CNR, Naples
|
|
|
|
|
|
|
|
!!$ Daniela di Serafino Second University of Naples
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ Redistribution and use in source and binary forms, with or without
|
|
|
|
|
|
|
|
!!$ modification, are permitted provided that the following conditions
|
|
|
|
|
|
|
|
!!$ are met:
|
|
|
|
|
|
|
|
!!$ 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
|
|
|
!!$ notice, this list of conditions and the following disclaimer.
|
|
|
|
|
|
|
|
!!$ 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
|
|
|
!!$ notice, this list of conditions, and the following disclaimer in the
|
|
|
|
|
|
|
|
!!$ documentation and/or other materials provided with the distribution.
|
|
|
|
|
|
|
|
!!$ 3. The name of the MLD2P4 group or the names of its contributors may
|
|
|
|
|
|
|
|
!!$ not be used to endorse or promote products derived from this
|
|
|
|
|
|
|
|
!!$ software without specific written permission.
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
|
|
|
|
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
|
|
|
|
|
|
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
|
|
|
|
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
|
|
|
|
|
|
|
|
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
|
|
|
|
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
|
|
|
|
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
|
|
|
|
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
|
|
|
|
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
|
|
|
|
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
|
|
|
|
!!$ POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
!!$
|
|
|
|
|
|
|
|
|
|
|
|
subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
|
|
|
|
|
|
|
@ -10,18 +48,18 @@ subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
type(psb_zspmat_type), intent(in) :: a
|
|
|
|
type(psb_zspmat_type), intent(in) :: a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
type(psb_desc_type), intent(in) :: desc_a
|
|
|
|
real(psb_dpk_), intent(in) :: theta
|
|
|
|
real(psb_dpk_), intent(in) :: theta
|
|
|
|
integer, allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
|
|
|
integer(psb_ipk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
|
|
|
integer, intent(out) :: info
|
|
|
|
integer(psb_ipk_), intent(out) :: info
|
|
|
|
|
|
|
|
|
|
|
|
! Local variables
|
|
|
|
! Local variables
|
|
|
|
integer, allocatable :: ils(:), neigh(:), irow(:), icol(:)
|
|
|
|
integer(psb_ipk_), allocatable :: ils(:), neigh(:), irow(:), icol(:)
|
|
|
|
complex(psb_dpk_), allocatable :: val(:), diag(:)
|
|
|
|
complex(psb_dpk_), allocatable :: val(:), diag(:)
|
|
|
|
integer :: icnt,nlp,k,n,ia,isz,nr, naggr,i,j,m, nz
|
|
|
|
integer(psb_ipk_) :: icnt,nlp,k,n,ia,isz,nr, naggr,i,j,m, nz
|
|
|
|
real(psb_dpk_) :: cpling, tcl
|
|
|
|
real(psb_dpk_) :: cpling, tcl
|
|
|
|
logical :: recovery
|
|
|
|
logical :: recovery
|
|
|
|
integer :: debug_level, debug_unit
|
|
|
|
integer(psb_ipk_) :: debug_level, debug_unit,err_act
|
|
|
|
integer :: ictxt,np,me,err_act
|
|
|
|
integer(psb_ipk_) :: ictxt,np,me
|
|
|
|
integer :: nrow, ncol, n_ne
|
|
|
|
integer(psb_ipk_) :: nrow, ncol, n_ne
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
character(len=20) :: name, ch_err
|
|
|
|
|
|
|
|
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
|
if (psb_get_errstatus() /= 0) return
|
|
|
@ -40,7 +78,7 @@ subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
allocate(ilaggr(nr),neigh(nr),stat=info)
|
|
|
|
allocate(ilaggr(nr),neigh(nr),stat=info)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_alloc_request_
|
|
|
|
info=psb_err_alloc_request_
|
|
|
|
call psb_errpush(info,name,i_err=(/2*nr,0,0,0,0/),&
|
|
|
|
call psb_errpush(info,name,i_err=(/2*nr,izero,izero,izero,izero/),&
|
|
|
|
& a_err='integer')
|
|
|
|
& a_err='integer')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
@ -48,7 +86,7 @@ subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
allocate(diag(nr),stat=info)
|
|
|
|
allocate(diag(nr),stat=info)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_alloc_request_
|
|
|
|
info=psb_err_alloc_request_
|
|
|
|
call psb_errpush(info,name,i_err=(/nr,0,0,0,0/),&
|
|
|
|
call psb_errpush(info,name,i_err=(/nr,izero,izero,izero,izero/),&
|
|
|
|
& a_err='complex(psb_dpk_)')
|
|
|
|
& a_err='complex(psb_dpk_)')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
@ -106,7 +144,7 @@ subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
!
|
|
|
|
!
|
|
|
|
! 2. Untouched neighbours of these nodes are marked <0.
|
|
|
|
! 2. Untouched neighbours of these nodes are marked <0.
|
|
|
|
!
|
|
|
|
!
|
|
|
|
call a%get_neigh(i,neigh,n_ne,info,lev=2)
|
|
|
|
call a%get_neigh(i,neigh,n_ne,info,lev=2_psb_ipk_)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
call psb_errpush(info,name,a_err='psb_neigh')
|
|
|
|
call psb_errpush(info,name,a_err='psb_neigh')
|
|
|
@ -135,7 +173,7 @@ subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
allocate(ils(nr),stat=info)
|
|
|
|
allocate(ils(nr),stat=info)
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
if(info /= psb_success_) then
|
|
|
|
info=psb_err_alloc_request_
|
|
|
|
info=psb_err_alloc_request_
|
|
|
|
call psb_errpush(info,name,i_err=(/naggr+10,0,0,0,0/),&
|
|
|
|
call psb_errpush(info,name,i_err=(/naggr+10,izero,izero,izero,izero/),&
|
|
|
|
& a_err='integer')
|
|
|
|
& a_err='integer')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
@ -172,7 +210,7 @@ subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
!
|
|
|
|
!
|
|
|
|
isz = nr+1
|
|
|
|
isz = nr+1
|
|
|
|
ia = -1
|
|
|
|
ia = -1
|
|
|
|
cpling = dzero
|
|
|
|
cpling = szero
|
|
|
|
call a%csget(i,i,nz,irow,icol,val,info)
|
|
|
|
call a%csget(i,i,nz,irow,icol,val,info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
|
info=psb_err_from_subroutine_
|
|
|
@ -276,7 +314,7 @@ subroutine mld_z_dec_map_bld(theta,a,desc_a,nlaggr,ilaggr,info)
|
|
|
|
allocate(nlaggr(np),stat=info)
|
|
|
|
allocate(nlaggr(np),stat=info)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=psb_err_alloc_request_
|
|
|
|
info=psb_err_alloc_request_
|
|
|
|
call psb_errpush(info,name,i_err=(/np,0,0,0,0/),&
|
|
|
|
call psb_errpush(info,name,i_err=(/np,izero,izero,izero,izero/),&
|
|
|
|
& a_err='integer')
|
|
|
|
& a_err='integer')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|