mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-24 14:51:49 +00:00
psblas3:
Makefile base/modules/psb_error_mod.F90 base/newserial/Makefile base/newserial/psbn_base_mat_mod.f03 base/newserial/psbn_d_base_mat_mod.f03 base/newserial/psbn_d_coo_impl.f03 base/newserial/psbn_d_csr_impl.f03 base/newserial/psbn_d_csr_mat_mod.f03 base/newserial/psbn_mat_impl.f03 base/newserial/psbn_mat_mod.f03 test/serial/d_coo_matgen.f03 test/serial/d_matgen.f03 test/serial/psbn_d_cxx_impl.f03 test/serial/psbn_d_cxx_mat_mod.f03 Renamed various methods. Tight binding of methods to outer objects.
This commit is contained in:
@@ -357,7 +357,7 @@ contains
|
||||
endif
|
||||
|
||||
end do
|
||||
call acoo%csins(element-1,val,irow,icol,1,nr,1,nr,info)
|
||||
call acoo%csput(element-1,val,irow,icol,1,nr,1,nr,info)
|
||||
|
||||
end do
|
||||
|
||||
|
||||
+15
-14
@@ -201,7 +201,7 @@ contains
|
||||
|
||||
t0 = psb_wtime()
|
||||
|
||||
call psbn_csall(nr,nr,a_n,info)
|
||||
call a_n%csall(nr,nr,info)
|
||||
|
||||
talc = psb_wtime()-t0
|
||||
|
||||
@@ -357,7 +357,7 @@ contains
|
||||
endif
|
||||
|
||||
end do
|
||||
call psbn_csins(element-1,val,irow,icol,a_n,1,nr,1,nr,info)
|
||||
call a_n%csput(element-1,val,irow,icol,1,nr,1,nr,info)
|
||||
|
||||
end do
|
||||
|
||||
@@ -368,9 +368,9 @@ contains
|
||||
call psb_errpush(info,name,a_err=ch_err)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call a_n%print(19)
|
||||
t1 = psb_wtime()
|
||||
call psbn_cscnv(a_n,info,mold=acxx)
|
||||
call a_n%cscnv(info,mold=acsr)
|
||||
|
||||
if(info /= 0) then
|
||||
info=4010
|
||||
@@ -380,18 +380,19 @@ contains
|
||||
end if
|
||||
tasb = psb_wtime()-t1
|
||||
call a_n%print(20)
|
||||
|
||||
!!$ t1 = psb_wtime()
|
||||
!!$ call psbn_cscnv(a_n,info,mold=acoo)
|
||||
!!$
|
||||
!!$ if(info /= 0) then
|
||||
!!$ info=4010
|
||||
!!$ ch_err='asb rout.'
|
||||
!!$ call psb_errpush(info,name,a_err=ch_err)
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ tmov = psb_wtime()-t1
|
||||
t1 = psb_wtime()
|
||||
call a_n%cscnv(info,mold=acxx)
|
||||
|
||||
if(info /= 0) then
|
||||
info=4010
|
||||
ch_err='asb rout.'
|
||||
call psb_errpush(info,name,a_err=ch_err)
|
||||
goto 9999
|
||||
end if
|
||||
tmov = psb_wtime()-t1
|
||||
call a_n%print(21)
|
||||
!!$
|
||||
|
||||
if(iam == psb_root_) then
|
||||
write(*,'("The matrix has been generated and is currently in ",a3," format.")')&
|
||||
|
||||
@@ -942,10 +942,10 @@ end subroutine d_cxx_cssm_impl
|
||||
|
||||
|
||||
|
||||
subroutine d_cxx_csins_impl(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
subroutine d_cxx_csput_impl(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
use psb_error_mod
|
||||
use psb_realloc_mod
|
||||
use psbn_d_cxx_mat_mod, psb_protect_name => d_cxx_csins_impl
|
||||
use psbn_d_cxx_mat_mod, psb_protect_name => d_cxx_csput_impl
|
||||
implicit none
|
||||
|
||||
class(psbn_d_cxx_sparse_mat), intent(inout) :: a
|
||||
@@ -956,7 +956,7 @@ subroutine d_cxx_csins_impl(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
|
||||
|
||||
Integer :: err_act
|
||||
character(len=20) :: name='d_cxx_csins'
|
||||
character(len=20) :: name='d_cxx_csput'
|
||||
logical, parameter :: debug=.false.
|
||||
integer :: nza, i,j,k, nzl, isza, int_err(5)
|
||||
|
||||
@@ -1193,7 +1193,7 @@ contains
|
||||
|
||||
end subroutine d_cxx_srch_upd
|
||||
|
||||
end subroutine d_cxx_csins_impl
|
||||
end subroutine d_cxx_csput_impl
|
||||
|
||||
|
||||
|
||||
@@ -1438,39 +1438,17 @@ subroutine d_mv_cxx_to_fmt_impl(a,b,info)
|
||||
|
||||
info = 0
|
||||
|
||||
call tmp%mv_from_fmt(a,info)
|
||||
call b%mv_from_coo(tmp,info)
|
||||
select type (b)
|
||||
class is (psbn_d_coo_sparse_mat)
|
||||
call a%mv_to_coo(b,info)
|
||||
class default
|
||||
call tmp%mv_from_fmt(a,info)
|
||||
if (info == 0) call b%mv_from_coo(tmp,info)
|
||||
end select
|
||||
|
||||
end subroutine d_mv_cxx_to_fmt_impl
|
||||
|
||||
|
||||
subroutine d_mv_cxx_from_fmt_impl(a,b,info)
|
||||
use psb_const_mod
|
||||
use psb_realloc_mod
|
||||
use psbn_d_base_mat_mod
|
||||
use psbn_d_cxx_mat_mod, psb_protect_name => d_mv_cxx_from_fmt_impl
|
||||
implicit none
|
||||
|
||||
class(psbn_d_cxx_sparse_mat), intent(inout) :: a
|
||||
class(psbn_d_base_sparse_mat), intent(inout) :: b
|
||||
integer, intent(out) :: info
|
||||
|
||||
!locals
|
||||
type(psbn_d_coo_sparse_mat) :: tmp
|
||||
logical :: rwshr_
|
||||
Integer :: nza, nr, i,j,irw, idl,err_act, nc
|
||||
Integer, Parameter :: maxtry=8
|
||||
integer :: debug_level, debug_unit
|
||||
character(len=20) :: name
|
||||
|
||||
info = 0
|
||||
|
||||
call tmp%mv_from_fmt(b,info)
|
||||
call a%mv_from_coo(tmp,info)
|
||||
|
||||
end subroutine d_mv_cxx_from_fmt_impl
|
||||
|
||||
|
||||
|
||||
subroutine d_cp_cxx_to_fmt_impl(a,b,info)
|
||||
use psb_const_mod
|
||||
@@ -1493,9 +1471,13 @@ subroutine d_cp_cxx_to_fmt_impl(a,b,info)
|
||||
|
||||
info = 0
|
||||
|
||||
call tmp%cp_from_fmt(a,info)
|
||||
call b%mv_from_coo(tmp,info)
|
||||
|
||||
select type (b)
|
||||
class is (psbn_d_coo_sparse_mat)
|
||||
call a%cp_to_coo(b,info)
|
||||
class default
|
||||
call tmp%cp_from_fmt(a,info)
|
||||
if (info == 0) call b%mv_from_coo(tmp,info)
|
||||
end select
|
||||
end subroutine d_cp_cxx_to_fmt_impl
|
||||
|
||||
|
||||
@@ -1520,8 +1502,43 @@ subroutine d_cp_cxx_from_fmt_impl(a,b,info)
|
||||
|
||||
info = 0
|
||||
|
||||
call tmp%cp_from_fmt(b,info)
|
||||
call a%mv_from_coo(tmp,info)
|
||||
|
||||
select type (b)
|
||||
class is (psbn_d_coo_sparse_mat)
|
||||
call a%cp_from_coo(b,info)
|
||||
class default
|
||||
call tmp%cp_from_fmt(b,info)
|
||||
if (info == 0) call a%mv_from_coo(tmp,info)
|
||||
end select
|
||||
end subroutine d_cp_cxx_from_fmt_impl
|
||||
|
||||
|
||||
subroutine d_mv_cxx_from_fmt_impl(a,b,info)
|
||||
use psb_const_mod
|
||||
use psb_realloc_mod
|
||||
use psbn_d_base_mat_mod
|
||||
use psbn_d_cxx_mat_mod, psb_protect_name => d_mv_cxx_from_fmt_impl
|
||||
implicit none
|
||||
|
||||
class(psbn_d_cxx_sparse_mat), intent(inout) :: a
|
||||
class(psbn_d_base_sparse_mat), intent(inout) :: b
|
||||
integer, intent(out) :: info
|
||||
|
||||
!locals
|
||||
type(psbn_d_coo_sparse_mat) :: tmp
|
||||
logical :: rwshr_
|
||||
Integer :: nza, nr, i,j,irw, idl,err_act, nc
|
||||
Integer, Parameter :: maxtry=8
|
||||
integer :: debug_level, debug_unit
|
||||
character(len=20) :: name
|
||||
|
||||
info = 0
|
||||
|
||||
select type (b)
|
||||
class is (psbn_d_coo_sparse_mat)
|
||||
call a%mv_from_coo(b,info)
|
||||
class default
|
||||
call tmp%mv_from_fmt(b,info)
|
||||
if (info == 0) call a%mv_from_coo(tmp,info)
|
||||
end select
|
||||
end subroutine d_mv_cxx_from_fmt_impl
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ module psbn_d_cxx_mat_mod
|
||||
procedure, pass(a) :: d_base_cssm => d_cxx_cssm
|
||||
procedure, pass(a) :: d_base_cssv => d_cxx_cssv
|
||||
procedure, pass(a) :: reallocate_nz => d_cxx_reallocate_nz
|
||||
procedure, pass(a) :: csins => d_cxx_csins
|
||||
procedure, pass(a) :: csput => d_cxx_csput
|
||||
procedure, pass(a) :: allocate_mnnz => d_cxx_allocate_mnnz
|
||||
procedure, pass(a) :: cp_to_coo => d_cp_cxx_to_coo
|
||||
procedure, pass(a) :: cp_from_coo => d_cp_cxx_from_coo
|
||||
@@ -29,7 +29,7 @@ module psbn_d_cxx_mat_mod
|
||||
procedure, pass(a) :: get_fmt => d_cxx_get_fmt
|
||||
end type psbn_d_cxx_sparse_mat
|
||||
private :: d_cxx_get_nzeros, d_cxx_csmm, d_cxx_csmv, d_cxx_cssm, d_cxx_cssv, &
|
||||
& d_cxx_csins, d_cxx_reallocate_nz, d_cxx_allocate_mnnz, &
|
||||
& d_cxx_csput, d_cxx_reallocate_nz, d_cxx_allocate_mnnz, &
|
||||
& d_cxx_free, d_cxx_print, d_cxx_get_fmt, &
|
||||
& d_cp_cxx_to_coo, d_cp_cxx_from_coo, &
|
||||
& d_mv_cxx_to_coo, d_mv_cxx_from_coo, &
|
||||
@@ -128,7 +128,7 @@ module psbn_d_cxx_mat_mod
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine d_cxx_csins_impl(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
subroutine d_cxx_csput_impl(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
use psb_const_mod
|
||||
import psbn_d_cxx_sparse_mat
|
||||
class(psbn_d_cxx_sparse_mat), intent(inout) :: a
|
||||
@@ -136,7 +136,7 @@ module psbn_d_cxx_mat_mod
|
||||
integer, intent(in) :: nz, ia(:), ja(:), imin,imax,jmin,jmax
|
||||
integer, intent(out) :: info
|
||||
integer, intent(in), optional :: gtl(:)
|
||||
end subroutine d_cxx_csins_impl
|
||||
end subroutine d_cxx_csput_impl
|
||||
end interface
|
||||
|
||||
interface d_cxx_cssm_impl
|
||||
@@ -235,7 +235,7 @@ contains
|
||||
end function d_cxx_get_nzeros
|
||||
|
||||
|
||||
subroutine d_cxx_csins(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
subroutine d_cxx_csput(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
use psb_const_mod
|
||||
use psb_error_mod
|
||||
implicit none
|
||||
@@ -247,7 +247,7 @@ contains
|
||||
|
||||
|
||||
Integer :: err_act
|
||||
character(len=20) :: name='d_cxx_csins'
|
||||
character(len=20) :: name='d_cxx_csput'
|
||||
logical, parameter :: debug=.false.
|
||||
integer :: nza, i,j,k, nzl, isza, int_err(5)
|
||||
|
||||
@@ -282,7 +282,7 @@ contains
|
||||
|
||||
if (nz == 0) return
|
||||
|
||||
call d_cxx_csins_impl(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
call d_cxx_csput_impl(nz,val,ia,ja,a,imin,imax,jmin,jmax,info,gtl)
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
@@ -296,7 +296,7 @@ contains
|
||||
return
|
||||
end if
|
||||
return
|
||||
end subroutine d_cxx_csins
|
||||
end subroutine d_cxx_csput
|
||||
|
||||
|
||||
subroutine d_cxx_csmv(alpha,a,x,beta,y,info,trans)
|
||||
@@ -601,39 +601,6 @@ contains
|
||||
return
|
||||
|
||||
end subroutine d_cp_cxx_to_fmt
|
||||
|
||||
subroutine d_cp_cxx_from_fmt(a,b,info)
|
||||
use psb_error_mod
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(psbn_d_cxx_sparse_mat), intent(inout) :: a
|
||||
class(psbn_d_base_sparse_mat), intent(in) :: b
|
||||
integer, intent(out) :: info
|
||||
|
||||
Integer :: err_act
|
||||
character(len=20) :: name='from_fmt'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = 0
|
||||
call d_cp_cxx_from_fmt_impl(a,b,info)
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
call psb_errpush(info,name)
|
||||
|
||||
if (err_act /= psb_act_ret_) then
|
||||
call psb_error()
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine d_cp_cxx_from_fmt
|
||||
|
||||
|
||||
subroutine d_mv_cxx_to_coo(a,b,info)
|
||||
use psb_error_mod
|
||||
@@ -667,6 +634,39 @@ contains
|
||||
|
||||
end subroutine d_mv_cxx_to_coo
|
||||
|
||||
|
||||
subroutine d_cp_cxx_from_fmt(a,b,info)
|
||||
use psb_error_mod
|
||||
use psb_realloc_mod
|
||||
implicit none
|
||||
class(psbn_d_cxx_sparse_mat), intent(inout) :: a
|
||||
class(psbn_d_base_sparse_mat), intent(in) :: b
|
||||
integer, intent(out) :: info
|
||||
|
||||
Integer :: err_act
|
||||
character(len=20) :: name='from_fmt'
|
||||
logical, parameter :: debug=.false.
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
info = 0
|
||||
call d_cp_cxx_from_fmt_impl(a,b,info)
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 continue
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
call psb_errpush(info,name)
|
||||
|
||||
if (err_act /= psb_act_ret_) then
|
||||
call psb_error()
|
||||
end if
|
||||
return
|
||||
|
||||
end subroutine d_cp_cxx_from_fmt
|
||||
|
||||
subroutine d_mv_cxx_from_coo(a,b,info)
|
||||
use psb_error_mod
|
||||
use psb_realloc_mod
|
||||
|
||||
Reference in New Issue
Block a user