initializing the rsb library in the rsb module.
initializing a string used uninitialized in ppde.f90.
psblas3-type-indexed
Michele Martone 14 years ago
parent ad87a0924d
commit 026ddad716

@ -7,6 +7,7 @@
! * should test and fix all the problems that for sure will occur ! * should test and fix all the problems that for sure will occur
! * duplicate handling is not defined ! * duplicate handling is not defined
! * the printing function is not complete ! * the printing function is not complete
! * should substitute -1 with another valid PSBLAS error code
! * .. ! * ..
! !
module psb_d_rsb_mat_mod module psb_d_rsb_mat_mod
@ -86,7 +87,7 @@ module psb_d_rsb_mat_mod
#ifdef HAVE_LIBRSB #ifdef HAVE_LIBRSB
contains contains
function psv_rsb_mat_init() result(res) function psb_rsb_matmod_init() result(res)
implicit none implicit none
integer :: res integer :: res
!PSBRSB_DEBUG('') !PSBRSB_DEBUG('')
@ -94,13 +95,28 @@ module psb_d_rsb_mat_mod
#ifdef HAVE_LIBRSB #ifdef HAVE_LIBRSB
res=d_rsb_to_psb_info(rsb_init(c_null_ptr)) res=d_rsb_to_psb_info(rsb_init(c_null_ptr))
#endif #endif
end function psv_rsb_mat_init end function psb_rsb_matmod_init
function psb_rsb_matmod_exit() result(res)
implicit none
integer :: res
!PSBRSB_DEBUG('')
res=-1 ! FIXME
#ifdef HAVE_LIBRSB
res=d_rsb_to_psb_info(rsb_exit())
#endif
end function psb_rsb_matmod_exit
function d_rsb_to_psb_info(info) result(res) function d_rsb_to_psb_info(info) result(res)
implicit none implicit none
integer :: res,info integer , intent(in) :: info
integer :: res
!PSBRSB_DEBUG('') !PSBRSB_DEBUG('')
res=info if(info.ne.0)then
res=-1
else
res=psb_success_
end if
end function d_rsb_to_psb_info end function d_rsb_to_psb_info
function d_rsb_get_flags(a) result(flags) function d_rsb_get_flags(a) result(flags)

@ -104,6 +104,12 @@ program ppde
call psb_init(ictxt) call psb_init(ictxt)
call psb_info(ictxt,iam,np) call psb_info(ictxt,iam,np)
info=psb_rsb_matmod_init()
if(info.ne.psb_success_)then
info=psb_err_from_subroutine_
ch_err='create_matrix: rsb module initialization failed'
call psb_errpush(info,name,a_err=ch_err)
endif
if (iam < 0) then if (iam < 0) then
! This should not happen, but just in case ! This should not happen, but just in case
@ -133,6 +139,7 @@ program ppde
goto 9999 goto 9999
end if end if
fname=''! added by martone
call a%cscnv(bm,info,type='CSR') call a%cscnv(bm,info,type='CSR')
write(fname,'(a,i2.2,a,i2.2,a)') 'mat',iam,'-',np,'.mtx' write(fname,'(a,i2.2,a,i2.2,a)') 'mat',iam,'-',np,'.mtx'
call bm%print(fname,head='%Test sparse gen RSB') call bm%print(fname,head='%Test sparse gen RSB')
@ -219,6 +226,14 @@ program ppde
if(info /= psb_success_) then if(info /= psb_success_) then
call psb_error(ictxt) call psb_error(ictxt)
end if end if
info=psb_rsb_matmod_exit()
if(info.ne.psb_success_)then
info=psb_err_from_subroutine_
ch_err='create_matrix: rsb module finalization failed'
call psb_errpush(info,name,a_err=ch_err)
endif
call psb_exit(ictxt) call psb_exit(ictxt)
stop stop

@ -2,7 +2,7 @@
BICGSTAB Iterative method BICGSTAB CGS BICG BICGSTABL RGMRES BICGSTAB Iterative method BICGSTAB CGS BICG BICGSTABL RGMRES
BJAC Preconditioner NONE DIAG BJAC BJAC Preconditioner NONE DIAG BJAC
CSR Storage format for matrix A: CSR COO JAD CSR Storage format for matrix A: CSR COO JAD
004 Domain size (acutal system is this**3) 040 Domain size (acutal system is this**3)
2 Stopping criterion 2 Stopping criterion
0100 MAXIT 0100 MAXIT
-1 ITRACE -1 ITRACE

Loading…
Cancel
Save