psblas3-submodules:
base/internals/psi_dswapdata.F90 base/internals/psi_dswaptran.F90 base/internals/psi_ovrl_restr.f90 base/internals/psi_ovrl_save.f90 base/internals/psi_ovrl_upd.f90 base/modules/psb_base_mat_mod.f90 base/modules/psb_d_base_mat_mod.f90 base/modules/psb_d_csc_mat_mod.f90 base/modules/psb_d_csr_mat_mod.f90 base/modules/psb_d_mat_mod.f90 base/modules/psb_d_sort_mod.f90 base/modules/psb_error_impl.F90 base/modules/psb_error_mod.F90 base/modules/psi_d_mod.f90 base/modules/psi_serial_mod.f90 base/serial/impl/psb_base_mat_impl.f90 base/serial/impl/psb_d_base_mat_impl.F90 base/serial/impl/psb_d_coo_impl.f90 base/serial/impl/psb_d_csc_impl.f90 base/serial/impl/psb_d_csr_impl.f90 base/serial/impl/psb_d_mat_impl.F90 base/serial/psi_serial_impl.f90 base/serial/sort/psb_d_hsort_impl.f90 base/serial/sort/psb_d_isort_impl.f90 base/serial/sort/psb_d_msort_impl.f90 base/serial/sort/psb_d_qsort_impl.f90 prec/impl/psb_dilu_fct.f90 test/pargen/runs/ppde.inp util/psb_d_renum_impl.F90 util/psb_metispart_mod.F90 Encapsulated in submodules many of the D impl files. Made CSR data components PRIVATE and adjusted prec/util accordingly (defined special accessor functions).psblas3-submodules
parent
8b994d012f
commit
f63f52e21b
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,152 +1,151 @@
|
||||
! checks wether an error has occurred on one of the porecesses in the execution pool
|
||||
subroutine psb_errcomm(ictxt, err)
|
||||
use psb_error_mod, psb_protect_name => psb_errcomm
|
||||
use psb_penv_mod
|
||||
integer(psb_mpik_), intent(in) :: ictxt
|
||||
integer(psb_ipk_), intent(inout):: err
|
||||
|
||||
call psb_amx(ictxt, err)
|
||||
|
||||
end subroutine psb_errcomm
|
||||
|
||||
subroutine psb_ser_error_handler(err_act)
|
||||
use psb_error_mod, psb_protect_name => psb_ser_error_handler
|
||||
use psb_penv_mod
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(inout) :: err_act
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
if (err_act /= psb_act_ret_) &
|
||||
& call psb_error()
|
||||
if (err_act == psb_act_abort_) stop
|
||||
|
||||
return
|
||||
end subroutine psb_ser_error_handler
|
||||
|
||||
subroutine psb_par_error_handler(ictxt,err_act)
|
||||
use psb_error_mod, psb_protect_name => psb_par_error_handler
|
||||
use psb_penv_mod
|
||||
implicit none
|
||||
integer(psb_mpik_), intent(in) :: ictxt
|
||||
integer(psb_ipk_), intent(in) :: err_act
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
if (err_act == psb_act_print_) &
|
||||
& call psb_error(ictxt, abrt=.false.)
|
||||
if (err_act == psb_act_abort_) &
|
||||
& call psb_error(ictxt, abrt=.true.)
|
||||
|
||||
return
|
||||
|
||||
end subroutine psb_par_error_handler
|
||||
|
||||
subroutine psb_par_error_print_stack(ictxt)
|
||||
use psb_error_mod, psb_protect_name => psb_par_error_print_stack
|
||||
use psb_penv_mod
|
||||
integer(psb_mpik_), intent(in) :: ictxt
|
||||
|
||||
call psb_error(ictxt, abrt=.false.)
|
||||
|
||||
end subroutine psb_par_error_print_stack
|
||||
|
||||
subroutine psb_ser_error_print_stack()
|
||||
use psb_error_mod, psb_protect_name => psb_ser_error_print_stack
|
||||
|
||||
call psb_error()
|
||||
end subroutine psb_ser_error_print_stack
|
||||
|
||||
|
||||
|
||||
|
||||
! handles the occurence of an error in a serial routine
|
||||
subroutine psb_serror()
|
||||
use psb_const_mod
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
integer(psb_ipk_) :: err_c
|
||||
character(len=20) :: r_name
|
||||
character(len=40) :: a_e_d
|
||||
integer(psb_ipk_) :: i_e_d(5)
|
||||
|
||||
if (psb_errstatus_fatal()) then
|
||||
if(psb_get_errverbosity() > 1) then
|
||||
|
||||
do while (psb_get_numerr() > izero)
|
||||
write(psb_err_unit,'(50("="))')
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d)
|
||||
! write(psb_err_unit,'(50("="))')
|
||||
end do
|
||||
submodule (psb_error_mod) psb_error_impl_mod
|
||||
|
||||
contains
|
||||
! checks wether an error has occurred on one of the porecesses in the execution pool
|
||||
subroutine psb_errcomm(ictxt, err)
|
||||
use psb_penv_mod
|
||||
integer(psb_mpik_), intent(in) :: ictxt
|
||||
integer(psb_ipk_), intent(inout):: err
|
||||
|
||||
call psb_amx(ictxt, err)
|
||||
|
||||
end subroutine psb_errcomm
|
||||
|
||||
subroutine psb_ser_error_handler(err_act)
|
||||
use psb_penv_mod
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(inout) :: err_act
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
if (err_act /= psb_act_ret_) &
|
||||
& call psb_error()
|
||||
if (err_act == psb_act_abort_) stop
|
||||
|
||||
return
|
||||
end subroutine psb_ser_error_handler
|
||||
|
||||
subroutine psb_par_error_handler(ictxt,err_act)
|
||||
use psb_penv_mod
|
||||
implicit none
|
||||
integer(psb_mpik_), intent(in) :: ictxt
|
||||
integer(psb_ipk_), intent(in) :: err_act
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
if (err_act == psb_act_print_) &
|
||||
& call psb_error(ictxt, abrt=.false.)
|
||||
if (err_act == psb_act_abort_) &
|
||||
& call psb_error(ictxt, abrt=.true.)
|
||||
|
||||
return
|
||||
|
||||
end subroutine psb_par_error_handler
|
||||
|
||||
subroutine psb_par_error_print_stack(ictxt)
|
||||
use psb_penv_mod
|
||||
integer(psb_mpik_), intent(in) :: ictxt
|
||||
|
||||
call psb_error(ictxt, abrt=.false.)
|
||||
|
||||
end subroutine psb_par_error_print_stack
|
||||
|
||||
else
|
||||
subroutine psb_ser_error_print_stack()
|
||||
|
||||
call psb_error()
|
||||
end subroutine psb_ser_error_print_stack
|
||||
|
||||
|
||||
|
||||
|
||||
! handles the occurence of an error in a serial routine
|
||||
subroutine psb_serror()
|
||||
use psb_const_mod
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
integer(psb_ipk_) :: err_c
|
||||
character(len=20) :: r_name
|
||||
character(len=40) :: a_e_d
|
||||
integer(psb_ipk_) :: i_e_d(5)
|
||||
|
||||
if (psb_errstatus_fatal()) then
|
||||
if(psb_get_errverbosity() > 1) then
|
||||
|
||||
do while (psb_get_numerr() > izero)
|
||||
write(psb_err_unit,'(50("="))')
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d)
|
||||
! write(psb_err_unit,'(50("="))')
|
||||
end do
|
||||
|
||||
else
|
||||
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d)
|
||||
do while (psb_get_numerr() > 0)
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
end do
|
||||
call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d)
|
||||
do while (psb_get_numerr() > 0)
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
end do
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
#if defined(HAVE_FLUSH_STMT)
|
||||
flush(psb_err_unit)
|
||||
flush(psb_err_unit)
|
||||
#endif
|
||||
|
||||
|
||||
end subroutine psb_serror
|
||||
end subroutine psb_serror
|
||||
|
||||
|
||||
! handles the occurence of an error in a parallel routine
|
||||
subroutine psb_perror(ictxt,abrt)
|
||||
use psb_const_mod
|
||||
use psb_error_mod
|
||||
use psb_penv_mod
|
||||
implicit none
|
||||
integer(psb_mpik_), intent(in) :: ictxt
|
||||
logical, intent(in), optional :: abrt
|
||||
! handles the occurence of an error in a parallel routine
|
||||
subroutine psb_perror(ictxt,abrt)
|
||||
use psb_const_mod
|
||||
use psb_error_mod
|
||||
use psb_penv_mod
|
||||
implicit none
|
||||
integer(psb_mpik_), intent(in) :: ictxt
|
||||
logical, intent(in), optional :: abrt
|
||||
|
||||
integer(psb_ipk_) :: err_c
|
||||
character(len=20) :: r_name
|
||||
character(len=40) :: a_e_d
|
||||
integer(psb_ipk_) :: i_e_d(5)
|
||||
integer(psb_mpik_) :: iam, np
|
||||
logical :: abrt_
|
||||
integer(psb_ipk_) :: err_c
|
||||
character(len=20) :: r_name
|
||||
character(len=40) :: a_e_d
|
||||
integer(psb_ipk_) :: i_e_d(5)
|
||||
integer(psb_mpik_) :: iam, np
|
||||
logical :: abrt_
|
||||
|
||||
abrt_=.true.
|
||||
if (present(abrt)) abrt_=abrt
|
||||
call psb_info(ictxt,iam,np)
|
||||
|
||||
if (psb_errstatus_fatal()) then
|
||||
if (psb_get_errverbosity() > 1) then
|
||||
abrt_=.true.
|
||||
if (present(abrt)) abrt_=abrt
|
||||
call psb_info(ictxt,iam,np)
|
||||
|
||||
do while (psb_get_numerr() > izero)
|
||||
write(psb_err_unit,'(50("="))')
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d,iam)
|
||||
! write(psb_err_unit,'(50("="))')
|
||||
end do
|
||||
if (psb_errstatus_fatal()) then
|
||||
if (psb_get_errverbosity() > 1) then
|
||||
|
||||
do while (psb_get_numerr() > izero)
|
||||
write(psb_err_unit,'(50("="))')
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d,iam)
|
||||
! write(psb_err_unit,'(50("="))')
|
||||
end do
|
||||
#if defined(HAVE_FLUSH_STMT)
|
||||
flush(psb_err_unit)
|
||||
flush(psb_err_unit)
|
||||
#endif
|
||||
|
||||
if (abrt_) call psb_abort(ictxt,-1)
|
||||
|
||||
else
|
||||
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d,iam)
|
||||
do while (psb_get_numerr() > 0)
|
||||
|
||||
if (abrt_) call psb_abort(ictxt,-1)
|
||||
|
||||
else
|
||||
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
end do
|
||||
call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d,iam)
|
||||
do while (psb_get_numerr() > 0)
|
||||
call psb_errpop(err_c, r_name, i_e_d, a_e_d)
|
||||
end do
|
||||
#if defined(HAVE_FLUSH_STMT)
|
||||
flush(psb_err_unit)
|
||||
flush(psb_err_unit)
|
||||
#endif
|
||||
|
||||
if (abrt_) call psb_abort(ictxt,-1)
|
||||
if (abrt_) call psb_abort(ictxt,-1)
|
||||
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
end subroutine psb_perror
|
||||
end subroutine psb_perror
|
||||
|
||||
end submodule psb_error_impl_mod
|
||||
|
@ -1,295 +1,288 @@
|
||||
function psb_base_get_nz_row(idx,a) result(res)
|
||||
use psb_error_mod
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_get_nz_row
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: idx
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_) :: res
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='base_get_nz_row'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
res = -1
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end function psb_base_get_nz_row
|
||||
|
||||
function psb_base_get_nzeros(a) result(res)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_get_nzeros
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_) :: res
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='base_get_nzeros'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
res = -1
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end function psb_base_get_nzeros
|
||||
|
||||
function psb_base_get_size(a) result(res)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_get_size
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_) :: res
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='get_size'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
res = -1
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end function psb_base_get_size
|
||||
|
||||
subroutine psb_base_reinit(a,clear)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_reinit
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
logical, intent(in), optional :: clear
|
||||
|
||||
integer(psb_ipk_) :: err_act, info
|
||||
character(len=20) :: name='reinit'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
info = psb_err_missing_override_method_
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_reinit
|
||||
|
||||
subroutine psb_base_sparse_print(iout,a,iv,head,ivr,ivc)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_sparse_print
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info
|
||||
character(len=20) :: name='sparse_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
info = psb_err_missing_override_method_
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_sparse_print
|
||||
|
||||
subroutine psb_base_csgetptn(imin,imax,a,nz,ia,ja,info,&
|
||||
& jmin,jmax,iren,append,nzin,rscale,cscale)
|
||||
! Output is always in COO format
|
||||
use psb_error_mod
|
||||
use psb_const_mod
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_csgetptn
|
||||
implicit none
|
||||
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in) :: imin,imax
|
||||
integer(psb_ipk_), intent(out) :: nz
|
||||
integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:)
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
logical, intent(in), optional :: append
|
||||
integer(psb_ipk_), intent(in), optional :: iren(:)
|
||||
integer(psb_ipk_), intent(in), optional :: jmin,jmax, nzin
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='csget'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
info = psb_err_missing_override_method_
|
||||
call psb_errpush(info,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_csgetptn
|
||||
|
||||
subroutine psb_base_get_neigh(a,idx,neigh,n,info,lev)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_get_neigh
|
||||
use psb_error_mod
|
||||
use psb_realloc_mod
|
||||
use psb_sort_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in) :: idx
|
||||
integer(psb_ipk_), intent(out) :: n
|
||||
integer(psb_ipk_), allocatable, intent(out) :: neigh(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: lev
|
||||
|
||||
integer(psb_ipk_) :: lev_, i, nl, ifl,ill,&
|
||||
& n1, err_act, nn, nidx,ntl,ma
|
||||
integer(psb_ipk_), allocatable :: ia(:), ja(:)
|
||||
character(len=20) :: name='get_neigh'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
if(present(lev)) then
|
||||
lev_ = lev
|
||||
else
|
||||
lev_=1
|
||||
end if
|
||||
! Turns out we can write get_neigh at this
|
||||
! level
|
||||
n = 0
|
||||
ma = a%get_nrows()
|
||||
call a%csget(idx,idx,n,ia,ja,info)
|
||||
if (info == psb_success_) call psb_realloc(n,neigh,info)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_alloc_dealloc_,name)
|
||||
goto 9999
|
||||
end if
|
||||
neigh(1:n) = ja(1:n)
|
||||
ifl = 1
|
||||
ill = n
|
||||
do nl = 2, lev_
|
||||
n1 = ill - ifl + 1
|
||||
call psb_ensure_size(ill+n1*n1,neigh,info)
|
||||
submodule (psb_base_mat_mod) psb_base_mat_impl_mod
|
||||
contains
|
||||
|
||||
function psb_base_get_nz_row(idx,a) result(res)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: idx
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_) :: res
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='base_get_nz_row'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
res = -1
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end function psb_base_get_nz_row
|
||||
|
||||
function psb_base_get_nzeros(a) result(res)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_) :: res
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='base_get_nzeros'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
res = -1
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end function psb_base_get_nzeros
|
||||
|
||||
function psb_base_get_size(a) result(res)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_) :: res
|
||||
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='get_size'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
res = -1
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end function psb_base_get_size
|
||||
|
||||
subroutine psb_base_reinit(a,clear)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
logical, intent(in), optional :: clear
|
||||
|
||||
integer(psb_ipk_) :: err_act, info
|
||||
character(len=20) :: name='reinit'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
info = psb_err_missing_override_method_
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_reinit
|
||||
|
||||
subroutine psb_base_sparse_print(iout,a,iv,head,ivr,ivc)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
|
||||
integer(psb_ipk_), intent(in) :: iout
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: iv(:)
|
||||
character(len=*), optional :: head
|
||||
integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:)
|
||||
|
||||
integer(psb_ipk_) :: err_act, info
|
||||
character(len=20) :: name='sparse_print'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
info = psb_err_missing_override_method_
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_sparse_print
|
||||
|
||||
subroutine psb_base_csgetptn(imin,imax,a,nz,ia,ja,info,&
|
||||
& jmin,jmax,iren,append,nzin,rscale,cscale)
|
||||
! Output is always in COO format
|
||||
use psb_error_mod
|
||||
use psb_const_mod
|
||||
implicit none
|
||||
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in) :: imin,imax
|
||||
integer(psb_ipk_), intent(out) :: nz
|
||||
integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:)
|
||||
integer(psb_ipk_),intent(out) :: info
|
||||
logical, intent(in), optional :: append
|
||||
integer(psb_ipk_), intent(in), optional :: iren(:)
|
||||
integer(psb_ipk_), intent(in), optional :: jmin,jmax, nzin
|
||||
logical, intent(in), optional :: rscale,cscale
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='csget'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
info = psb_err_missing_override_method_
|
||||
call psb_errpush(info,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_csgetptn
|
||||
|
||||
subroutine psb_base_get_neigh(a,idx,neigh,n,info,lev)
|
||||
use psb_error_mod
|
||||
use psb_realloc_mod
|
||||
use psb_sort_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(in) :: a
|
||||
integer(psb_ipk_), intent(in) :: idx
|
||||
integer(psb_ipk_), intent(out) :: n
|
||||
integer(psb_ipk_), allocatable, intent(out) :: neigh(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
integer(psb_ipk_), optional, intent(in) :: lev
|
||||
|
||||
integer(psb_ipk_) :: lev_, i, nl, ifl,ill,&
|
||||
& n1, err_act, nn, nidx,ntl,ma
|
||||
integer(psb_ipk_), allocatable :: ia(:), ja(:)
|
||||
character(len=20) :: name='get_neigh'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = psb_success_
|
||||
if(present(lev)) then
|
||||
lev_ = lev
|
||||
else
|
||||
lev_=1
|
||||
end if
|
||||
! Turns out we can write get_neigh at this
|
||||
! level
|
||||
n = 0
|
||||
ma = a%get_nrows()
|
||||
call a%csget(idx,idx,n,ia,ja,info)
|
||||
if (info == psb_success_) call psb_realloc(n,neigh,info)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_alloc_dealloc_,name)
|
||||
goto 9999
|
||||
end if
|
||||
ntl = 0
|
||||
do i=ifl,ill
|
||||
nidx=neigh(i)
|
||||
if ((nidx /= idx).and.(nidx > 0).and.(nidx <= ma)) then
|
||||
call a%csget(nidx,nidx,nn,ia,ja,info)
|
||||
if (info == psb_success_) call psb_ensure_size(ill+ntl+nn,neigh,info)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_alloc_dealloc_,name)
|
||||
goto 9999
|
||||
end if
|
||||
neigh(ill+ntl+1:ill+ntl+nn)=ja(1:nn)
|
||||
ntl = ntl+nn
|
||||
neigh(1:n) = ja(1:n)
|
||||
ifl = 1
|
||||
ill = n
|
||||
do nl = 2, lev_
|
||||
n1 = ill - ifl + 1
|
||||
call psb_ensure_size(ill+n1*n1,neigh,info)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_alloc_dealloc_,name)
|
||||
goto 9999
|
||||
end if
|
||||
ntl = 0
|
||||
do i=ifl,ill
|
||||
nidx=neigh(i)
|
||||
if ((nidx /= idx).and.(nidx > 0).and.(nidx <= ma)) then
|
||||
call a%csget(nidx,nidx,nn,ia,ja,info)
|
||||
if (info == psb_success_) call psb_ensure_size(ill+ntl+nn,neigh,info)
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_alloc_dealloc_,name)
|
||||
goto 9999
|
||||
end if
|
||||
neigh(ill+ntl+1:ill+ntl+nn)=ja(1:nn)
|
||||
ntl = ntl+nn
|
||||
end if
|
||||
end do
|
||||
call psb_msort_unique(neigh(ill+1:ill+ntl),nn,dir=psb_sort_up_)
|
||||
ifl = ill + 1
|
||||
ill = ill + nn
|
||||
end do
|
||||
call psb_msort_unique(neigh(ill+1:ill+ntl),nn,dir=psb_sort_up_)
|
||||
ifl = ill + 1
|
||||
ill = ill + nn
|
||||
end do
|
||||
call psb_msort_unique(neigh(1:ill),nn,dir=psb_sort_up_)
|
||||
n = nn
|
||||
call psb_msort_unique(neigh(1:ill),nn,dir=psb_sort_up_)
|
||||
n = nn
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
|
||||
return
|
||||
|
||||
end subroutine psb_base_get_neigh
|
||||
|
||||
subroutine psb_base_allocate_mnnz(m,n,a,nz)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_allocate_mnnz
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: m,n
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: nz
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='allocate_mnz'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_allocate_mnnz
|
||||
|
||||
subroutine psb_base_reallocate_nz(nz,a)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_reallocate_nz
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: nz
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='reallocate_nz'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_reallocate_nz
|
||||
|
||||
subroutine psb_base_free(a)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_free
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='free'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_free
|
||||
|
||||
subroutine psb_base_trim(a)
|
||||
use psb_base_mat_mod, psb_protect_name => psb_base_trim
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='trim'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
!
|
||||
! This is the base version.
|
||||
! The correct action is: do nothing.
|
||||
! Indeed, the more complicated the data structure, the
|
||||
! more likely this is the only possible course.
|
||||
!
|
||||
|
||||
return
|
||||
|
||||
end subroutine psb_base_trim
|
||||
|
||||
return
|
||||
|
||||
end subroutine psb_base_get_neigh
|
||||
|
||||
subroutine psb_base_allocate_mnnz(m,n,a,nz)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: m,n
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_), intent(in), optional :: nz
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='allocate_mnz'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_allocate_mnnz
|
||||
|
||||
subroutine psb_base_reallocate_nz(nz,a)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
integer(psb_ipk_), intent(in) :: nz
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='reallocate_nz'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_reallocate_nz
|
||||
|
||||
subroutine psb_base_free(a)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='free'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_get_erraction(err_act)
|
||||
! This is the base version. If we get here
|
||||
! it means the derived class is incomplete,
|
||||
! so we throw an error.
|
||||
call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt())
|
||||
|
||||
call psb_error_handler(err_act)
|
||||
end subroutine psb_base_free
|
||||
|
||||
subroutine psb_base_trim(a)
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
class(psb_base_sparse_mat), intent(inout) :: a
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='trim'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
!
|
||||
! This is the base version.
|
||||
! The correct action is: do nothing.
|
||||
! Indeed, the more complicated the data structure, the
|
||||
! more likely this is the only possible course.
|
||||
!
|
||||
|
||||
return
|
||||
|
||||
end subroutine psb_base_trim
|
||||
|
||||
end submodule psb_base_mat_impl_mod
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue