|
|
|
@ -49,25 +49,35 @@ module mld_d_umf_solver
|
|
|
|
|
use mld_d_base_solver_mod
|
|
|
|
|
|
|
|
|
|
#if defined(LONG_INTEGERS)
|
|
|
|
|
|
|
|
|
|
type, extends(mld_d_base_solver_type) :: mld_d_umf_solver_type
|
|
|
|
|
|
|
|
|
|
end type mld_d_umf_solver_type
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
type, extends(mld_d_base_solver_type) :: mld_d_umf_solver_type
|
|
|
|
|
type(c_ptr) :: symbolic=c_null_ptr, numeric=c_null_ptr
|
|
|
|
|
integer(c_long_long) :: symbsize=0, numsize=0
|
|
|
|
|
contains
|
|
|
|
|
procedure, pass(sv) :: build => d_umf_solver_bld
|
|
|
|
|
procedure, pass(sv) :: apply_a => d_umf_solver_apply
|
|
|
|
|
procedure, pass(sv) :: apply_v => d_umf_solver_apply_vect
|
|
|
|
|
procedure, pass(sv) :: free => d_umf_solver_free
|
|
|
|
|
procedure, pass(sv) :: descr => d_umf_solver_descr
|
|
|
|
|
procedure, pass(sv) :: sizeof => d_umf_solver_sizeof
|
|
|
|
|
#if defined(HAVE_FINAL)
|
|
|
|
|
final :: d_umf_solver_finalize
|
|
|
|
|
#endif
|
|
|
|
|
end type mld_d_umf_solver_type
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private :: d_umf_solver_bld, d_umf_solver_apply, &
|
|
|
|
|
& d_umf_solver_free, d_umf_solver_descr, d_umf_solver_sizeof
|
|
|
|
|
& d_umf_solver_free, d_umf_solver_descr, &
|
|
|
|
|
& d_umf_solver_sizeof, d_umf_solver_apply_vect
|
|
|
|
|
#if defined(HAVE_FINAL)
|
|
|
|
|
private :: d_umf_solver_finalize
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
@ -79,7 +89,7 @@ module mld_d_umf_solver
|
|
|
|
|
integer(c_int) :: info
|
|
|
|
|
integer(c_long_long) :: ssize, nsize
|
|
|
|
|
integer(c_int) :: rowind(*),colptr(*)
|
|
|
|
|
real(c_double) :: values(*)
|
|
|
|
|
real(c_double) :: values(*)
|
|
|
|
|
type(c_ptr) :: symptr, numptr
|
|
|
|
|
end function mld_dumf_fact
|
|
|
|
|
end interface
|
|
|
|
@ -90,7 +100,7 @@ module mld_d_umf_solver
|
|
|
|
|
use iso_c_binding
|
|
|
|
|
integer(c_int) :: info
|
|
|
|
|
integer(c_int), value :: itrans,n,ldb
|
|
|
|
|
real(c_double) :: x(*), b(ldb,*)
|
|
|
|
|
real(c_double) :: x(*), b(ldb,*)
|
|
|
|
|
type(c_ptr), value :: numptr
|
|
|
|
|
end function mld_dumf_solve
|
|
|
|
|
end interface
|
|
|
|
@ -155,7 +165,17 @@ contains
|
|
|
|
|
select case(trans_)
|
|
|
|
|
case('N')
|
|
|
|
|
info = mld_dumf_solve(0,n_row,ww,x,n_row,sv%numeric)
|
|
|
|
|
case('T','C')
|
|
|
|
|
case('T')
|
|
|
|
|
!
|
|
|
|
|
! Note: with UMF, 1 meand Ctranspose, 2 means transpose
|
|
|
|
|
! even for complex data.
|
|
|
|
|
!
|
|
|
|
|
if (psb_d_is_complex_) then
|
|
|
|
|
info = mld_dumf_solve(2,n_row,ww,x,n_row,sv%numeric)
|
|
|
|
|
else
|
|
|
|
|
info = mld_dumf_solve(1,n_row,ww,x,n_row,sv%numeric)
|
|
|
|
|
end if
|
|
|
|
|
case('C')
|
|
|
|
|
info = mld_dumf_solve(1,n_row,ww,x,n_row,sv%numeric)
|
|
|
|
|
case default
|
|
|
|
|
call psb_errpush(psb_err_internal_error_,name,a_err='Invalid TRANS in ILU subsolve')
|
|
|
|
@ -187,6 +207,44 @@ contains
|
|
|
|
|
|
|
|
|
|
end subroutine d_umf_solver_apply
|
|
|
|
|
|
|
|
|
|
subroutine d_umf_solver_apply_vect(alpha,sv,x,beta,y,desc_data,trans,work,info)
|
|
|
|
|
use psb_base_mod
|
|
|
|
|
implicit none
|
|
|
|
|
type(psb_desc_type), intent(in) :: desc_data
|
|
|
|
|
class(mld_d_umf_solver_type), intent(inout) :: sv
|
|
|
|
|
type(psb_d_vect_type),intent(inout) :: x
|
|
|
|
|
type(psb_d_vect_type),intent(inout) :: y
|
|
|
|
|
real(psb_dpk_),intent(in) :: alpha,beta
|
|
|
|
|
character(len=1),intent(in) :: trans
|
|
|
|
|
real(psb_dpk_),target, intent(inout) :: work(:)
|
|
|
|
|
integer, intent(out) :: info
|
|
|
|
|
|
|
|
|
|
integer :: err_act
|
|
|
|
|
character(len=20) :: name='d_umf_solver_apply_vect'
|
|
|
|
|
|
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
|
|
|
|
|
|
call x%v%sync()
|
|
|
|
|
call y%v%sync()
|
|
|
|
|
call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
|
|
|
|
call y%v%set_host()
|
|
|
|
|
if (info /= 0) goto 9999
|
|
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
9999 continue
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
|
if (err_act == psb_act_abort_) then
|
|
|
|
|
call psb_error()
|
|
|
|
|
return
|
|
|
|
|
end if
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
end subroutine d_umf_solver_apply_vect
|
|
|
|
|
|
|
|
|
|
subroutine d_umf_solver_bld(a,desc_a,sv,upd,info,b,amold,vmold)
|
|
|
|
|
|
|
|
|
|
use psb_base_mod
|
|
|
|
@ -248,9 +306,9 @@ contains
|
|
|
|
|
call atmp%free()
|
|
|
|
|
else
|
|
|
|
|
! ?
|
|
|
|
|
info=psb_err_internal_error_
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
|
goto 9999
|
|
|
|
|
info=psb_err_internal_error_
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
@ -302,6 +360,24 @@ contains
|
|
|
|
|
return
|
|
|
|
|
end subroutine d_umf_solver_free
|
|
|
|
|
|
|
|
|
|
#if defined(HAVE_FINAL)
|
|
|
|
|
subroutine d_umf_solver_finalize(sv)
|
|
|
|
|
|
|
|
|
|
Implicit None
|
|
|
|
|
|
|
|
|
|
! Arguments
|
|
|
|
|
type(mld_d_umf_solver_type), intent(inout) :: sv
|
|
|
|
|
integer :: info
|
|
|
|
|
Integer :: err_act
|
|
|
|
|
character(len=20) :: name='d_umf_solver_finalize'
|
|
|
|
|
|
|
|
|
|
call sv%free(info)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
end subroutine d_umf_solver_finalize
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
subroutine d_umf_solver_descr(sv,info,iout,coarse)
|
|
|
|
|
|
|
|
|
|
Implicit None
|
|
|
|
@ -348,7 +424,7 @@ contains
|
|
|
|
|
integer(psb_long_int_k_) :: val
|
|
|
|
|
integer :: i
|
|
|
|
|
|
|
|
|
|
val = 2*psb_sizeof_int + psb_sizeof_dp
|
|
|
|
|
val = 2*psb_sizeof_long_int
|
|
|
|
|
val = val + sv%symbsize
|
|
|
|
|
val = val + sv%numsize
|
|
|
|
|
return
|
|
|
|
|