@ -41,7 +41,7 @@
subroutine psb_dsymbmm ( a , b , c , info )
subroutine psb_dsymbmm ( a , b , c , info )
use psb_spmat_type
use psb_spmat_type
use psb_string_mod
use psb_string_mod
use psb_serial_mod , only : psb_msort
use psb_serial_mod , psb_protect_name = > psb_dsymbmm
implicit none
implicit none
type ( psb_dspmat_type ) :: a , b , c
type ( psb_dspmat_type ) :: a , b , c
@ -56,41 +56,14 @@ subroutine psb_dsymbmm(a,b,c,info)
integer , allocatable :: ic ( : ) , jc ( : )
integer , allocatable :: ic ( : ) , jc ( : )
end subroutine symbmm
end subroutine symbmm
end interface
end interface
interface psb_sp_getrow
subroutine psb_dspgetrow ( irw , a , nz , ia , ja , val , info , iren , lrw )
use psb_spmat_type
type ( psb_dspmat_type ) , intent ( in ) :: a
integer , intent ( in ) :: irw
integer , intent ( out ) :: nz
integer , intent ( inout ) :: ia ( : ) , ja ( : )
real ( kind ( 1.d0 ) ) , intent ( inout ) :: val ( : )
integer , intent ( in ) , target , optional :: iren ( : )
integer , intent ( in ) , optional :: lrw
integer , intent ( out ) :: info
end subroutine psb_dspgetrow
end interface
character ( len = 20 ) :: name , ch_err
character ( len = 20 ) :: name , ch_err
integer :: err_act
integer :: err_act
logical :: csra , csrb
name = 'psb_symbmm'
name = 'psb_symbmm'
call psb_erractionsave ( err_act )
call psb_erractionsave ( err_act )
select case ( toupper ( a % fida ( 1 : 3 ) ) )
csra = ( toupper ( a % fida ( 1 : 3 ) ) == 'CSR' )
case ( 'CSR' )
csrb = ( toupper ( b % fida ( 1 : 3 ) ) == 'CSR' )
case default
info = 135
ch_err = a % fida ( 1 : 3 )
call psb_errpush ( info , name , a_err = ch_err )
go to 9999
end select
select case ( toupper ( b % fida ( 1 : 3 ) ) )
case ( 'CSR' )
case default
info = 136
ch_err = b % fida ( 1 : 3 )
call psb_errpush ( info , name , a_err = ch_err )
go to 9999
end select
if ( b % m / = a % k ) then
if ( b % m / = a % k ) then
write ( 0 , * ) 'Mismatch in SYMBMM: ' , a % m , a % k , b % m , b % k
write ( 0 , * ) 'Mismatch in SYMBMM: ' , a % m , a % k , b % m , b % k
@ -105,7 +78,7 @@ subroutine psb_dsymbmm(a,b,c,info)
! Note : we need to test whether there is a performance impact
! Note : we need to test whether there is a performance impact
! in not using the original Douglas & Bank code .
! in not using the original Douglas & Bank code .
!
!
if ( . true . ) then
if ( csra . and . csrb ) then
call symbmm ( a % m , a % k , b % k , a % ia2 , a % ia1 , 0 , &
call symbmm ( a % m , a % k , b % k , a % ia2 , a % ia1 , 0 , &
& b % ia2 , b % ia1 , 0 , &
& b % ia2 , b % ia1 , 0 , &
& c % ia2 , c % ia1 , 0 , itemp )
& c % ia2 , c % ia1 , 0 , itemp )
@ -140,6 +113,7 @@ contains
integer , allocatable :: iarw ( : ) , iacl ( : ) , ibrw ( : ) , ibcl ( : )
integer , allocatable :: iarw ( : ) , iacl ( : ) , ibrw ( : ) , ibcl ( : )
real ( kind ( 1.d0 ) ) , allocatable :: aval ( : ) , bval ( : )
real ( kind ( 1.d0 ) ) , allocatable :: aval ( : ) , bval ( : )
integer :: maxlmn , i , j , m , n , k , l , istart , length , nazr , nbzr , jj , ii , minlm , minmn
integer :: maxlmn , i , j , m , n , k , l , istart , length , nazr , nbzr , jj , ii , minlm , minmn
type ( psb_dspmat_type ) :: w
n = a % m
n = a % m
@ -169,7 +143,7 @@ contains
main : do i = 1 , n
main : do i = 1 , n
istart = - 1
istart = - 1
length = 0
length = 0
call psb_sp_getrow ( i , a , nazr , iarw , iacl , aval , info )
call psb_sp_getrow ( i , a , nazr , iarw , iacl , aval , info ,bw = w )
do jj = 1 , nazr
do jj = 1 , nazr
j = iacl ( jj )
j = iacl ( jj )
@ -179,7 +153,7 @@ contains
info = 1
info = 1
return
return
endif
endif
call psb_sp_getrow ( j , b , nbzr , ibrw , ibcl , bval , info )
call psb_sp_getrow ( j , b , nbzr , ibrw , ibcl , bval , info ,bw = w )
do k = 1 , nbzr
do k = 1 , nbzr
if ( ( ibcl ( k ) < 1 ) . or . ( ibcl ( k ) > maxlmn ) ) then
if ( ( ibcl ( k ) < 1 ) . or . ( ibcl ( k ) > maxlmn ) ) then
write ( 0 , * ) 'Problem in SYMBMM 1:' , j , k , ibcl ( k ) , maxlmn
write ( 0 , * ) 'Problem in SYMBMM 1:' , j , k , ibcl ( k ) , maxlmn