Take out HAVE_MOLD.

Make support for MOLD mandatory in compiler version.
Define set_vect_defaults() and set_mat_defaults(), invoke them at
_init() time.
This commit is contained in:
Salvatore Filippone
2018-04-05 12:30:28 +01:00
parent 3d347d31dc
commit e37b43d45a
18 changed files with 278 additions and 725 deletions
+14 -38
View File
@@ -292,20 +292,6 @@ contains
integer(psb_mpik_) :: np_, npavail, iam, info, basecomm, basegroup, newgroup
character(len=20), parameter :: name='psb_init'
integer(psb_ipk_) :: iinfo
!
! Defaults for vectors and matrices
!
type(psb_s_csr_sparse_mat) :: smatdef
type(psb_d_csr_sparse_mat) :: dmatdef
type(psb_c_csr_sparse_mat) :: cmatdef
type(psb_z_csr_sparse_mat) :: zmatdef
type(psb_i_base_vect_type) :: ivetdef
type(psb_s_base_vect_type) :: svetdef
type(psb_d_base_vect_type) :: dvetdef
type(psb_c_base_vect_type) :: cvetdef
type(psb_z_base_vect_type) :: zvetdef
!
call psb_set_debug_unit(psb_err_unit)
@@ -396,30 +382,20 @@ contains
call psi_get_sizes()
if (ictxt == mpi_comm_null) return
#endif
call psb_set_vect_default(ivetdef)
call psb_set_vect_default(svetdef)
call psb_set_vect_default(dvetdef)
call psb_set_vect_default(cvetdef)
call psb_set_vect_default(zvetdef)
call psb_set_mat_default(smatdef)
call psb_set_mat_default(dmatdef)
call psb_set_mat_default(cmatdef)
call psb_set_mat_default(zmatdef)
! !$ call psb_rsb_init(info)
! !$ if (info.ne.psb_rsb_const_success) then
! !$ if (info.eq.psb_rsb_const_not_available) then
! !$ info=psb_success_ ! rsb is not present
! !$ else
! !$ ! rsb failed to initialize, and we issue an internal error.
! !$ ! or shall we tolerate this ?
! !$ info=psb_err_internal_error_
! !$ call psb_errpush(info,name)
! !$ call psb_error(ictxt)
! !$ endif
! !$ endif
call psb_init_vect_defaults()
call psb_init_mat_defaults()
! !$ call psb_rsb_init(info)
! !$ if (info.ne.psb_rsb_const_success) then
! !$ if (info.eq.psb_rsb_const_not_available) then
! !$ info=psb_success_ ! rsb is not present
! !$ else
! !$ ! rsb failed to initialize, and we issue an internal error.
! !$ ! or shall we tolerate this ?
! !$ info=psb_err_internal_error_
! !$ call psb_errpush(info,name)
! !$ call psb_error(ictxt)
! !$ endif
! !$ endif
end subroutine psb_init_mpik
+10 -66
View File
@@ -191,25 +191,15 @@ contains
class(psb_c_vect_type), intent(inout) :: x
class(psb_c_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_c_base_vect_type), pointer :: mld
info = psb_success_
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_c_get_base_vect_default())
#else
mld => psb_c_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -229,18 +219,9 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_c_get_base_vect_default())
#else
mld => psb_c_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(n)
@@ -321,6 +302,7 @@ contains
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function c_vect_get_fmt
subroutine c_vect_all(n, x, info, mold)
implicit none
@@ -333,11 +315,7 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_c_base_vect_type :: x%v,stat=info)
endif
@@ -481,23 +459,14 @@ contains
class(psb_c_vect_type), intent(inout) :: x
class(psb_c_base_vect_type), intent(in), optional :: mold
class(psb_c_base_vect_type), allocatable :: tmp
class(psb_c_base_vect_type), pointer :: mld
integer(psb_ipk_) :: info
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
else
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=psb_c_get_base_vect_default())
#else
mld => psb_c_get_base_vect_default()
call mld%mold(tmp,info)
#endif
end if
if (allocated(x%v)) then
call x%v%sync()
@@ -949,18 +918,9 @@ contains
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_c_get_base_multivect_default())
#else
mld => psb_c_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -973,22 +933,12 @@ contains
class(psb_c_multivect_type), intent(out) :: x
class(psb_c_base_multivect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_c_base_multivect_type), pointer :: mld
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_c_get_base_multivect_default())
#else
mld => psb_c_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(m,n)
@@ -1085,11 +1035,7 @@ contains
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_c_base_multivect_type :: x%v,stat=info)
endif
@@ -1248,18 +1194,16 @@ contains
integer(psb_ipk_) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
else
allocate(tmp,stat=info, mold=psb_c_get_base_multivect_default())
endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
end subroutine c_vect_cnv
+10 -66
View File
@@ -191,25 +191,15 @@ contains
class(psb_d_vect_type), intent(inout) :: x
class(psb_d_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_d_base_vect_type), pointer :: mld
info = psb_success_
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_d_get_base_vect_default())
#else
mld => psb_d_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -229,18 +219,9 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_d_get_base_vect_default())
#else
mld => psb_d_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(n)
@@ -321,6 +302,7 @@ contains
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function d_vect_get_fmt
subroutine d_vect_all(n, x, info, mold)
implicit none
@@ -333,11 +315,7 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_d_base_vect_type :: x%v,stat=info)
endif
@@ -481,23 +459,14 @@ contains
class(psb_d_vect_type), intent(inout) :: x
class(psb_d_base_vect_type), intent(in), optional :: mold
class(psb_d_base_vect_type), allocatable :: tmp
class(psb_d_base_vect_type), pointer :: mld
integer(psb_ipk_) :: info
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
else
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=psb_d_get_base_vect_default())
#else
mld => psb_d_get_base_vect_default()
call mld%mold(tmp,info)
#endif
end if
if (allocated(x%v)) then
call x%v%sync()
@@ -949,18 +918,9 @@ contains
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_d_get_base_multivect_default())
#else
mld => psb_d_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -973,22 +933,12 @@ contains
class(psb_d_multivect_type), intent(out) :: x
class(psb_d_base_multivect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_d_base_multivect_type), pointer :: mld
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_d_get_base_multivect_default())
#else
mld => psb_d_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(m,n)
@@ -1085,11 +1035,7 @@ contains
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_d_base_multivect_type :: x%v,stat=info)
endif
@@ -1248,18 +1194,16 @@ contains
integer(psb_ipk_) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
else
allocate(tmp,stat=info, mold=psb_d_get_base_multivect_default())
endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
end subroutine d_vect_cnv
+10 -66
View File
@@ -164,25 +164,15 @@ contains
class(psb_i_vect_type), intent(inout) :: x
class(psb_i_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_i_base_vect_type), pointer :: mld
info = psb_success_
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_i_get_base_vect_default())
#else
mld => psb_i_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -202,18 +192,9 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_i_get_base_vect_default())
#else
mld => psb_i_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(n)
@@ -294,6 +275,7 @@ contains
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function i_vect_get_fmt
subroutine i_vect_all(n, x, info, mold)
implicit none
@@ -306,11 +288,7 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_i_base_vect_type :: x%v,stat=info)
endif
@@ -454,23 +432,14 @@ contains
class(psb_i_vect_type), intent(inout) :: x
class(psb_i_base_vect_type), intent(in), optional :: mold
class(psb_i_base_vect_type), allocatable :: tmp
class(psb_i_base_vect_type), pointer :: mld
integer(psb_ipk_) :: info
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
else
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=psb_i_get_base_vect_default())
#else
mld => psb_i_get_base_vect_default()
call mld%mold(tmp,info)
#endif
end if
if (allocated(x%v)) then
call x%v%sync()
@@ -678,18 +647,9 @@ contains
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_i_get_base_multivect_default())
#else
mld => psb_i_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -702,22 +662,12 @@ contains
class(psb_i_multivect_type), intent(out) :: x
class(psb_i_base_multivect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_i_base_multivect_type), pointer :: mld
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_i_get_base_multivect_default())
#else
mld => psb_i_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(m,n)
@@ -814,11 +764,7 @@ contains
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_i_base_multivect_type :: x%v,stat=info)
endif
@@ -977,18 +923,16 @@ contains
integer(psb_ipk_) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
else
allocate(tmp,stat=info, mold=psb_i_get_base_multivect_default())
endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
end subroutine i_vect_cnv
+20
View File
@@ -3,4 +3,24 @@ module psb_mat_mod
use psb_d_mat_mod
use psb_c_mat_mod
use psb_z_mat_mod
contains
subroutine psb_init_mat_defaults()
implicit none
!
! Defaults for matrices
!
type(psb_s_csr_sparse_mat) :: smatdef
type(psb_d_csr_sparse_mat) :: dmatdef
type(psb_c_csr_sparse_mat) :: cmatdef
type(psb_z_csr_sparse_mat) :: zmatdef
call psb_set_mat_default(smatdef)
call psb_set_mat_default(dmatdef)
call psb_set_mat_default(cmatdef)
call psb_set_mat_default(zmatdef)
end subroutine psb_init_mat_defaults
end module psb_mat_mod
+10 -66
View File
@@ -191,25 +191,15 @@ contains
class(psb_s_vect_type), intent(inout) :: x
class(psb_s_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_s_base_vect_type), pointer :: mld
info = psb_success_
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_s_get_base_vect_default())
#else
mld => psb_s_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -229,18 +219,9 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_s_get_base_vect_default())
#else
mld => psb_s_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(n)
@@ -321,6 +302,7 @@ contains
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function s_vect_get_fmt
subroutine s_vect_all(n, x, info, mold)
implicit none
@@ -333,11 +315,7 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_s_base_vect_type :: x%v,stat=info)
endif
@@ -481,23 +459,14 @@ contains
class(psb_s_vect_type), intent(inout) :: x
class(psb_s_base_vect_type), intent(in), optional :: mold
class(psb_s_base_vect_type), allocatable :: tmp
class(psb_s_base_vect_type), pointer :: mld
integer(psb_ipk_) :: info
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
else
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=psb_s_get_base_vect_default())
#else
mld => psb_s_get_base_vect_default()
call mld%mold(tmp,info)
#endif
end if
if (allocated(x%v)) then
call x%v%sync()
@@ -949,18 +918,9 @@ contains
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_s_get_base_multivect_default())
#else
mld => psb_s_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -973,22 +933,12 @@ contains
class(psb_s_multivect_type), intent(out) :: x
class(psb_s_base_multivect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_s_base_multivect_type), pointer :: mld
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_s_get_base_multivect_default())
#else
mld => psb_s_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(m,n)
@@ -1085,11 +1035,7 @@ contains
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_s_base_multivect_type :: x%v,stat=info)
endif
@@ -1248,18 +1194,16 @@ contains
integer(psb_ipk_) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
else
allocate(tmp,stat=info, mold=psb_s_get_base_multivect_default())
endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
end subroutine s_vect_cnv
+23
View File
@@ -9,4 +9,27 @@ module psb_vect_mod
use psb_d_multivect_mod
use psb_c_multivect_mod
use psb_z_multivect_mod
contains
subroutine psb_init_vect_defaults()
implicit none
!
! Defaults for vectors
!
type(psb_i_base_vect_type) :: ivetdef
type(psb_s_base_vect_type) :: svetdef
type(psb_d_base_vect_type) :: dvetdef
type(psb_c_base_vect_type) :: cvetdef
type(psb_z_base_vect_type) :: zvetdef
call psb_set_vect_default(ivetdef)
call psb_set_vect_default(svetdef)
call psb_set_vect_default(dvetdef)
call psb_set_vect_default(cvetdef)
call psb_set_vect_default(zvetdef)
end subroutine psb_init_vect_defaults
end module psb_vect_mod
+10 -66
View File
@@ -191,25 +191,15 @@ contains
class(psb_z_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_z_base_vect_type), pointer :: mld
info = psb_success_
if (allocated(x%v)) &
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_z_get_base_vect_default())
#else
mld => psb_z_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -229,18 +219,9 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_z_get_base_vect_default())
#else
mld => psb_z_get_base_vect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(n)
@@ -321,6 +302,7 @@ contains
res = 'NULL'
if (allocated(x%v)) res = x%v%get_fmt()
end function z_vect_get_fmt
subroutine z_vect_all(n, x, info, mold)
implicit none
@@ -333,11 +315,7 @@ contains
& call x%free(info)
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_z_base_vect_type :: x%v,stat=info)
endif
@@ -481,23 +459,14 @@ contains
class(psb_z_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(in), optional :: mold
class(psb_z_base_vect_type), allocatable :: tmp
class(psb_z_base_vect_type), pointer :: mld
integer(psb_ipk_) :: info
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
else
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=psb_z_get_base_vect_default())
#else
mld => psb_z_get_base_vect_default()
call mld%mold(tmp,info)
#endif
end if
if (allocated(x%v)) then
call x%v%sync()
@@ -949,18 +918,9 @@ contains
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_z_get_base_multivect_default())
#else
mld => psb_z_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(invect)
@@ -973,22 +933,12 @@ contains
class(psb_z_multivect_type), intent(out) :: x
class(psb_z_base_multivect_type), intent(in), optional :: mold
integer(psb_ipk_) :: info
class(psb_z_base_multivect_type), pointer :: mld
info = psb_success_
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
#ifdef HAVE_MOLD
allocate(x%v,stat=info, mold=psb_z_get_base_multivect_default())
#else
mld => psb_z_get_base_multivect_default()
call mld%mold(x%v,info)
#endif
endif
if (info == psb_success_) call x%v%bld(m,n)
@@ -1085,11 +1035,7 @@ contains
integer(psb_ipk_), intent(out) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(x%v,stat=info,mold=mold)
#else
call mold%mold(x%v,info)
#endif
else
allocate(psb_z_base_multivect_type :: x%v,stat=info)
endif
@@ -1248,18 +1194,16 @@ contains
integer(psb_ipk_) :: info
if (present(mold)) then
#ifdef HAVE_MOLD
allocate(tmp,stat=info,mold=mold)
#else
call mold%mold(tmp,info)
#endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
else
allocate(tmp,stat=info, mold=psb_z_get_base_multivect_default())
endif
if (allocated(x%v)) then
call x%v%sync()
if (info == psb_success_) call tmp%bld(x%v%v)
call x%v%free(info)
end if
call move_alloc(tmp,x%v)
end subroutine z_vect_cnv
+1 -12
View File
@@ -942,6 +942,7 @@ subroutine psb_c_base_clone(a,b,info)
class(psb_c_base_sparse_mat), allocatable, intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
info = 0
if (allocated(b)) then
call b%free()
deallocate(b, stat=info)
@@ -953,12 +954,8 @@ subroutine psb_c_base_clone(a,b,info)
! Do not use SOURCE allocation: this makes sure that
! memory allocated elsewhere is treated properly.
#if defined(HAVE_MOLD)
allocate(b,mold=a,stat=info)
if (info /= psb_success_) info = psb_err_alloc_dealloc_
#else
call a%mold(b,info)
#endif
if (info == psb_success_) call b%cp_from_fmt(a, info)
end subroutine psb_c_base_clone
@@ -1954,11 +1951,7 @@ subroutine psb_c_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d)
call psb_errpush(info,name,i_err=ierr)
goto 9999
end if
#ifdef HAVE_MOLD
allocate(tmpv, mold=y,stat=info)
#else
call y%mold(tmpv,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_) call tmpv%mlt(cone,d%v(1:nac),x,czero,info)
if (info == psb_success_)&
@@ -1983,11 +1976,7 @@ subroutine psb_c_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d)
if (info == psb_success_) call y%mlt(d%v(1:nar),info)
else
#ifdef HAVE_MOLD
allocate(tmpv, mold=y,stat=info)
#else
call y%mold(tmpv,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_)&
& call a%inner_spsm(alpha,x,czero,tmpv,info,trans)
+1 -40
View File
@@ -1133,7 +1133,6 @@ subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl)
class(psb_c_base_sparse_mat), allocatable :: altmp
class(psb_c_base_sparse_mat), pointer :: mld
integer(psb_ipk_) :: err_act
character(len=20) :: name='cscnv'
logical, parameter :: debug=.false.
@@ -1155,11 +1154,7 @@ subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl)
if (present(mold)) then
#if defined(HAVE_MOLD)
allocate(altmp, mold=mold,stat=info)
#else
call mold%mold(altmp,info)
#endif
else if (present(type)) then
@@ -1176,12 +1171,7 @@ subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl)
goto 9999
end select
else
#if defined(HAVE_MOLD)
allocate(altmp, mold=psb_get_mat_default(a),stat=info)
#else
mld => psb_get_mat_default(a)
call mld%mold(altmp,info)
#endif
end if
if (info /= psb_success_) then
@@ -1238,7 +1228,6 @@ subroutine psb_c_cscnv_ip(a,info,type,mold,dupl)
class(psb_c_base_sparse_mat), allocatable :: altmp
class(psb_c_base_sparse_mat), pointer :: mld
integer(psb_ipk_) :: err_act
character(len=20) :: name='cscnv_ip'
logical, parameter :: debug=.false.
@@ -1266,11 +1255,7 @@ subroutine psb_c_cscnv_ip(a,info,type,mold,dupl)
if (present(mold)) then
#if defined(HAVE_MOLD)
allocate(altmp, mold=mold,stat=info)
#else
call mold%mold(altmp,info)
#endif
else if (present(type)) then
@@ -1287,12 +1272,7 @@ subroutine psb_c_cscnv_ip(a,info,type,mold,dupl)
goto 9999
end select
else
#if defined(HAVE_MOLD)
allocate(altmp, mold=psb_get_mat_default(a),stat=info)
#else
mld => psb_get_mat_default(a)
call mld%mold(altmp,info)
#endif
end if
if (info /= psb_success_) then
@@ -1507,11 +1487,7 @@ subroutine psb_c_mv_from(a,b)
integer(psb_ipk_) :: info
call a%free()
#if defined(HAVE_MOLD)
allocate(a%a,mold=b, stat=info)
#else
call b%mold(a%a,info)
#endif
call a%a%mv_from_fmt(b,info)
call b%free()
@@ -1539,11 +1515,7 @@ subroutine psb_c_cp_from(a,b)
! however this would run the risk of messing up with data
! allocated externally (e.g. GPU-side data).
!
#if defined(HAVE_MOLD)
allocate(a%a,mold=b,stat=info)
#else
call b%mold(a%a,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_) call a%a%cp_from_fmt(b, info)
if (info /= psb_success_) goto 9999
@@ -1592,11 +1564,8 @@ subroutine psb_c_mold(a,b)
class(psb_cspmat_type), intent(inout) :: a
class(psb_c_base_sparse_mat), allocatable, intent(out) :: b
integer(psb_ipk_) :: info
#if defined(HAVE_MOLD)
allocate(b,mold=a%a, stat=info)
#else
call a%a%mold(b,info)
#endif
end subroutine psb_c_mold
@@ -1706,11 +1675,7 @@ subroutine psb_c_transp_2mat(a,b)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
call a%a%mold(b%a,info)
#endif
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
goto 9999
@@ -1781,11 +1746,7 @@ subroutine psb_c_transc_2mat(a,b)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
call a%a%mold(b%a,info)
#endif
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
goto 9999
+1 -12
View File
@@ -942,6 +942,7 @@ subroutine psb_d_base_clone(a,b,info)
class(psb_d_base_sparse_mat), allocatable, intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
info = 0
if (allocated(b)) then
call b%free()
deallocate(b, stat=info)
@@ -953,12 +954,8 @@ subroutine psb_d_base_clone(a,b,info)
! Do not use SOURCE allocation: this makes sure that
! memory allocated elsewhere is treated properly.
#if defined(HAVE_MOLD)
allocate(b,mold=a,stat=info)
if (info /= psb_success_) info = psb_err_alloc_dealloc_
#else
call a%mold(b,info)
#endif
if (info == psb_success_) call b%cp_from_fmt(a, info)
end subroutine psb_d_base_clone
@@ -1954,11 +1951,7 @@ subroutine psb_d_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d)
call psb_errpush(info,name,i_err=ierr)
goto 9999
end if
#ifdef HAVE_MOLD
allocate(tmpv, mold=y,stat=info)
#else
call y%mold(tmpv,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_) call tmpv%mlt(done,d%v(1:nac),x,dzero,info)
if (info == psb_success_)&
@@ -1983,11 +1976,7 @@ subroutine psb_d_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d)
if (info == psb_success_) call y%mlt(d%v(1:nar),info)
else
#ifdef HAVE_MOLD
allocate(tmpv, mold=y,stat=info)
#else
call y%mold(tmpv,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_)&
& call a%inner_spsm(alpha,x,dzero,tmpv,info,trans)
+1 -40
View File
@@ -1133,7 +1133,6 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl)
class(psb_d_base_sparse_mat), allocatable :: altmp
class(psb_d_base_sparse_mat), pointer :: mld
integer(psb_ipk_) :: err_act
character(len=20) :: name='cscnv'
logical, parameter :: debug=.false.
@@ -1155,11 +1154,7 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl)
if (present(mold)) then
#if defined(HAVE_MOLD)
allocate(altmp, mold=mold,stat=info)
#else
call mold%mold(altmp,info)
#endif
else if (present(type)) then
@@ -1176,12 +1171,7 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl)
goto 9999
end select
else
#if defined(HAVE_MOLD)
allocate(altmp, mold=psb_get_mat_default(a),stat=info)
#else
mld => psb_get_mat_default(a)
call mld%mold(altmp,info)
#endif
end if
if (info /= psb_success_) then
@@ -1238,7 +1228,6 @@ subroutine psb_d_cscnv_ip(a,info,type,mold,dupl)
class(psb_d_base_sparse_mat), allocatable :: altmp
class(psb_d_base_sparse_mat), pointer :: mld
integer(psb_ipk_) :: err_act
character(len=20) :: name='cscnv_ip'
logical, parameter :: debug=.false.
@@ -1266,11 +1255,7 @@ subroutine psb_d_cscnv_ip(a,info,type,mold,dupl)
if (present(mold)) then
#if defined(HAVE_MOLD)
allocate(altmp, mold=mold,stat=info)
#else
call mold%mold(altmp,info)
#endif
else if (present(type)) then
@@ -1287,12 +1272,7 @@ subroutine psb_d_cscnv_ip(a,info,type,mold,dupl)
goto 9999
end select
else
#if defined(HAVE_MOLD)
allocate(altmp, mold=psb_get_mat_default(a),stat=info)
#else
mld => psb_get_mat_default(a)
call mld%mold(altmp,info)
#endif
end if
if (info /= psb_success_) then
@@ -1507,11 +1487,7 @@ subroutine psb_d_mv_from(a,b)
integer(psb_ipk_) :: info
call a%free()
#if defined(HAVE_MOLD)
allocate(a%a,mold=b, stat=info)
#else
call b%mold(a%a,info)
#endif
call a%a%mv_from_fmt(b,info)
call b%free()
@@ -1539,11 +1515,7 @@ subroutine psb_d_cp_from(a,b)
! however this would run the risk of messing up with data
! allocated externally (e.g. GPU-side data).
!
#if defined(HAVE_MOLD)
allocate(a%a,mold=b,stat=info)
#else
call b%mold(a%a,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_) call a%a%cp_from_fmt(b, info)
if (info /= psb_success_) goto 9999
@@ -1592,11 +1564,8 @@ subroutine psb_d_mold(a,b)
class(psb_dspmat_type), intent(inout) :: a
class(psb_d_base_sparse_mat), allocatable, intent(out) :: b
integer(psb_ipk_) :: info
#if defined(HAVE_MOLD)
allocate(b,mold=a%a, stat=info)
#else
call a%a%mold(b,info)
#endif
end subroutine psb_d_mold
@@ -1706,11 +1675,7 @@ subroutine psb_d_transp_2mat(a,b)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
call a%a%mold(b%a,info)
#endif
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
goto 9999
@@ -1781,11 +1746,7 @@ subroutine psb_d_transc_2mat(a,b)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
call a%a%mold(b%a,info)
#endif
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
goto 9999
+1 -12
View File
@@ -942,6 +942,7 @@ subroutine psb_s_base_clone(a,b,info)
class(psb_s_base_sparse_mat), allocatable, intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
info = 0
if (allocated(b)) then
call b%free()
deallocate(b, stat=info)
@@ -953,12 +954,8 @@ subroutine psb_s_base_clone(a,b,info)
! Do not use SOURCE allocation: this makes sure that
! memory allocated elsewhere is treated properly.
#if defined(HAVE_MOLD)
allocate(b,mold=a,stat=info)
if (info /= psb_success_) info = psb_err_alloc_dealloc_
#else
call a%mold(b,info)
#endif
if (info == psb_success_) call b%cp_from_fmt(a, info)
end subroutine psb_s_base_clone
@@ -1954,11 +1951,7 @@ subroutine psb_s_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d)
call psb_errpush(info,name,i_err=ierr)
goto 9999
end if
#ifdef HAVE_MOLD
allocate(tmpv, mold=y,stat=info)
#else
call y%mold(tmpv,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_) call tmpv%mlt(sone,d%v(1:nac),x,szero,info)
if (info == psb_success_)&
@@ -1983,11 +1976,7 @@ subroutine psb_s_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d)
if (info == psb_success_) call y%mlt(d%v(1:nar),info)
else
#ifdef HAVE_MOLD
allocate(tmpv, mold=y,stat=info)
#else
call y%mold(tmpv,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_)&
& call a%inner_spsm(alpha,x,szero,tmpv,info,trans)
+1 -40
View File
@@ -1133,7 +1133,6 @@ subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl)
class(psb_s_base_sparse_mat), allocatable :: altmp
class(psb_s_base_sparse_mat), pointer :: mld
integer(psb_ipk_) :: err_act
character(len=20) :: name='cscnv'
logical, parameter :: debug=.false.
@@ -1155,11 +1154,7 @@ subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl)
if (present(mold)) then
#if defined(HAVE_MOLD)
allocate(altmp, mold=mold,stat=info)
#else
call mold%mold(altmp,info)
#endif
else if (present(type)) then
@@ -1176,12 +1171,7 @@ subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl)
goto 9999
end select
else
#if defined(HAVE_MOLD)
allocate(altmp, mold=psb_get_mat_default(a),stat=info)
#else
mld => psb_get_mat_default(a)
call mld%mold(altmp,info)
#endif
end if
if (info /= psb_success_) then
@@ -1238,7 +1228,6 @@ subroutine psb_s_cscnv_ip(a,info,type,mold,dupl)
class(psb_s_base_sparse_mat), allocatable :: altmp
class(psb_s_base_sparse_mat), pointer :: mld
integer(psb_ipk_) :: err_act
character(len=20) :: name='cscnv_ip'
logical, parameter :: debug=.false.
@@ -1266,11 +1255,7 @@ subroutine psb_s_cscnv_ip(a,info,type,mold,dupl)
if (present(mold)) then
#if defined(HAVE_MOLD)
allocate(altmp, mold=mold,stat=info)
#else
call mold%mold(altmp,info)
#endif
else if (present(type)) then
@@ -1287,12 +1272,7 @@ subroutine psb_s_cscnv_ip(a,info,type,mold,dupl)
goto 9999
end select
else
#if defined(HAVE_MOLD)
allocate(altmp, mold=psb_get_mat_default(a),stat=info)
#else
mld => psb_get_mat_default(a)
call mld%mold(altmp,info)
#endif
end if
if (info /= psb_success_) then
@@ -1507,11 +1487,7 @@ subroutine psb_s_mv_from(a,b)
integer(psb_ipk_) :: info
call a%free()
#if defined(HAVE_MOLD)
allocate(a%a,mold=b, stat=info)
#else
call b%mold(a%a,info)
#endif
call a%a%mv_from_fmt(b,info)
call b%free()
@@ -1539,11 +1515,7 @@ subroutine psb_s_cp_from(a,b)
! however this would run the risk of messing up with data
! allocated externally (e.g. GPU-side data).
!
#if defined(HAVE_MOLD)
allocate(a%a,mold=b,stat=info)
#else
call b%mold(a%a,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_) call a%a%cp_from_fmt(b, info)
if (info /= psb_success_) goto 9999
@@ -1592,11 +1564,8 @@ subroutine psb_s_mold(a,b)
class(psb_sspmat_type), intent(inout) :: a
class(psb_s_base_sparse_mat), allocatable, intent(out) :: b
integer(psb_ipk_) :: info
#if defined(HAVE_MOLD)
allocate(b,mold=a%a, stat=info)
#else
call a%a%mold(b,info)
#endif
end subroutine psb_s_mold
@@ -1706,11 +1675,7 @@ subroutine psb_s_transp_2mat(a,b)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
call a%a%mold(b%a,info)
#endif
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
goto 9999
@@ -1781,11 +1746,7 @@ subroutine psb_s_transc_2mat(a,b)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
call a%a%mold(b%a,info)
#endif
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
goto 9999
+1 -12
View File
@@ -942,6 +942,7 @@ subroutine psb_z_base_clone(a,b,info)
class(psb_z_base_sparse_mat), allocatable, intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
info = 0
if (allocated(b)) then
call b%free()
deallocate(b, stat=info)
@@ -953,12 +954,8 @@ subroutine psb_z_base_clone(a,b,info)
! Do not use SOURCE allocation: this makes sure that
! memory allocated elsewhere is treated properly.
#if defined(HAVE_MOLD)
allocate(b,mold=a,stat=info)
if (info /= psb_success_) info = psb_err_alloc_dealloc_
#else
call a%mold(b,info)
#endif
if (info == psb_success_) call b%cp_from_fmt(a, info)
end subroutine psb_z_base_clone
@@ -1954,11 +1951,7 @@ subroutine psb_z_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d)
call psb_errpush(info,name,i_err=ierr)
goto 9999
end if
#ifdef HAVE_MOLD
allocate(tmpv, mold=y,stat=info)
#else
call y%mold(tmpv,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_) call tmpv%mlt(zone,d%v(1:nac),x,zzero,info)
if (info == psb_success_)&
@@ -1983,11 +1976,7 @@ subroutine psb_z_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d)
if (info == psb_success_) call y%mlt(d%v(1:nar),info)
else
#ifdef HAVE_MOLD
allocate(tmpv, mold=y,stat=info)
#else
call y%mold(tmpv,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_)&
& call a%inner_spsm(alpha,x,zzero,tmpv,info,trans)
+1 -40
View File
@@ -1133,7 +1133,6 @@ subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl)
class(psb_z_base_sparse_mat), allocatable :: altmp
class(psb_z_base_sparse_mat), pointer :: mld
integer(psb_ipk_) :: err_act
character(len=20) :: name='cscnv'
logical, parameter :: debug=.false.
@@ -1155,11 +1154,7 @@ subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl)
if (present(mold)) then
#if defined(HAVE_MOLD)
allocate(altmp, mold=mold,stat=info)
#else
call mold%mold(altmp,info)
#endif
else if (present(type)) then
@@ -1176,12 +1171,7 @@ subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl)
goto 9999
end select
else
#if defined(HAVE_MOLD)
allocate(altmp, mold=psb_get_mat_default(a),stat=info)
#else
mld => psb_get_mat_default(a)
call mld%mold(altmp,info)
#endif
end if
if (info /= psb_success_) then
@@ -1238,7 +1228,6 @@ subroutine psb_z_cscnv_ip(a,info,type,mold,dupl)
class(psb_z_base_sparse_mat), allocatable :: altmp
class(psb_z_base_sparse_mat), pointer :: mld
integer(psb_ipk_) :: err_act
character(len=20) :: name='cscnv_ip'
logical, parameter :: debug=.false.
@@ -1266,11 +1255,7 @@ subroutine psb_z_cscnv_ip(a,info,type,mold,dupl)
if (present(mold)) then
#if defined(HAVE_MOLD)
allocate(altmp, mold=mold,stat=info)
#else
call mold%mold(altmp,info)
#endif
else if (present(type)) then
@@ -1287,12 +1272,7 @@ subroutine psb_z_cscnv_ip(a,info,type,mold,dupl)
goto 9999
end select
else
#if defined(HAVE_MOLD)
allocate(altmp, mold=psb_get_mat_default(a),stat=info)
#else
mld => psb_get_mat_default(a)
call mld%mold(altmp,info)
#endif
end if
if (info /= psb_success_) then
@@ -1507,11 +1487,7 @@ subroutine psb_z_mv_from(a,b)
integer(psb_ipk_) :: info
call a%free()
#if defined(HAVE_MOLD)
allocate(a%a,mold=b, stat=info)
#else
call b%mold(a%a,info)
#endif
call a%a%mv_from_fmt(b,info)
call b%free()
@@ -1539,11 +1515,7 @@ subroutine psb_z_cp_from(a,b)
! however this would run the risk of messing up with data
! allocated externally (e.g. GPU-side data).
!
#if defined(HAVE_MOLD)
allocate(a%a,mold=b,stat=info)
#else
call b%mold(a%a,info)
#endif
if (info /= psb_success_) info = psb_err_alloc_dealloc_
if (info == psb_success_) call a%a%cp_from_fmt(b, info)
if (info /= psb_success_) goto 9999
@@ -1592,11 +1564,8 @@ subroutine psb_z_mold(a,b)
class(psb_zspmat_type), intent(inout) :: a
class(psb_z_base_sparse_mat), allocatable, intent(out) :: b
integer(psb_ipk_) :: info
#if defined(HAVE_MOLD)
allocate(b,mold=a%a, stat=info)
#else
call a%a%mold(b,info)
#endif
end subroutine psb_z_mold
@@ -1706,11 +1675,7 @@ subroutine psb_z_transp_2mat(a,b)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
call a%a%mold(b%a,info)
#endif
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
goto 9999
@@ -1781,11 +1746,7 @@ subroutine psb_z_transc_2mat(a,b)
goto 9999
endif
call b%free()
#if defined(HAVE_MOLD)
allocate(b%a,mold=a%a,stat=info)
#else
call a%a%mold(b%a,info)
#endif
if (info /= psb_success_) then
info = psb_err_alloc_dealloc_
goto 9999
Vendored
+145 -138
View File
@@ -7174,6 +7174,151 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for Fortran SAME_TYPE_AS" >&5
$as_echo_n "checking support for Fortran SAME_TYPE_AS... " >&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 stt
type foo
integer :: i
end type foo
type, extends(foo) :: new_foo
integer :: j
end type new_foo
type(foo) :: foov
type(new_foo) :: nfv1, nfv2
write(*,*) 'foov == nfv1? ', same_type_as(foov,nfv1)
write(*,*) 'nfv2 == nfv1? ', same_type_as(nfv2,nfv1)
end program stt
_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 SAME_TYPE_AS.
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 Fortran EXTENDS_TYPE_OF" >&5
$as_echo_n "checking support for Fortran EXTENDS_TYPE_OF... " >&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 xtt
type foo
integer :: i
end type foo
type, extends(foo) :: new_foo
integer :: j
end type new_foo
type(foo) :: foov
type(new_foo) :: nfv1, nfv2
write(*,*) 'nfv1 extends foov? ', extends_type_of(nfv1,foov)
end program xtt
_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 EXTENDS_TYPE_OF.
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 Fortran MOLD= allocation" >&5
$as_echo_n "checking support for Fortran MOLD= allocation... " >&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 xtt
type foo
integer :: i
end type foo
type, extends(foo) :: new_foo
integer :: j
end type new_foo
class(foo), allocatable :: fooab
type(new_foo) :: nfv
integer :: info
allocate(fooab, mold=nfv, stat=info)
end program xtt
_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 MOLD= allocation.
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
#
# Optional features
#
@@ -7388,144 +7533,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for Fortran SAME_TYPE_AS" >&5
$as_echo_n "checking support for Fortran SAME_TYPE_AS... " >&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 stt
type foo
integer :: i
end type foo
type, extends(foo) :: new_foo
integer :: j
end type new_foo
type(foo) :: foov
type(new_foo) :: nfv1, nfv2
write(*,*) 'foov == nfv1? ', same_type_as(foov,nfv1)
write(*,*) 'nfv2 == nfv1? ', same_type_as(nfv2,nfv1)
end program stt
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
FDEFINES="$psblas_cv_define_prepend-DHAVE_SAME_TYPE_AS $FDEFINES"
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
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 Fortran EXTENDS_TYPE_OF" >&5
$as_echo_n "checking support for Fortran EXTENDS_TYPE_OF... " >&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 xtt
type foo
integer :: i
end type foo
type, extends(foo) :: new_foo
integer :: j
end type new_foo
type(foo) :: foov
type(new_foo) :: nfv1, nfv2
write(*,*) 'nfv1 extends foov? ', extends_type_of(nfv1,foov)
end program xtt
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
FDEFINES="$psblas_cv_define_prepend-DHAVE_EXTENDS_TYPE_OF $FDEFINES"
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
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 Fortran MOLD= allocation" >&5
$as_echo_n "checking support for Fortran MOLD= allocation... " >&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 xtt
type foo
integer :: i
end type foo
type, extends(foo) :: new_foo
integer :: j
end type new_foo
class(foo), allocatable :: fooab
type(new_foo) :: nfv
integer :: info
allocate(fooab, mold=nfv, stat=info)
end program xtt
_ACEOF
if ac_fn_fc_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
FDEFINES="$psblas_cv_define_prepend-DHAVE_MOLD $FDEFINES"
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
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
###############################################################################
# Additional pathname stuff (yes, it is redundant and confusing...)
+18 -11
View File
@@ -529,6 +529,24 @@ PAC_FORTRAN_TEST_ISO_C_BIND(
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.8.])]
)
PAC_FORTRAN_TEST_SAME_TYPE(
[],
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for SAME_TYPE_AS.
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.8.])]
)
PAC_FORTRAN_TEST_EXTENDS_TYPE(
[],
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for EXTENDS_TYPE_OF.
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.8.])]
)
PAC_FORTRAN_TEST_MOLD(
[],
[AC_MSG_ERROR([Sorry, cannot build PSBLAS without support for MOLD= allocation.
Please get a Fortran compiler that supports it, e.g. GNU Fortran 4.8.])]
)
#
# Optional features
#
@@ -554,17 +572,6 @@ PAC_FORTRAN_TEST_FINAL(
[FDEFINES="$psblas_cv_define_prepend-DHAVE_FINAL $FDEFINES"],
)
PAC_FORTRAN_TEST_SAME_TYPE(
[FDEFINES="$psblas_cv_define_prepend-DHAVE_SAME_TYPE_AS $FDEFINES"],
)
PAC_FORTRAN_TEST_EXTENDS_TYPE(
[FDEFINES="$psblas_cv_define_prepend-DHAVE_EXTENDS_TYPE_OF $FDEFINES"],
)
PAC_FORTRAN_TEST_MOLD(
[FDEFINES="$psblas_cv_define_prepend-DHAVE_MOLD $FDEFINES"],
)
###############################################################################
# Additional pathname stuff (yes, it is redundant and confusing...)