prec/psb_cilu_fct.f90
 prec/psb_dilu_fct.f90
 prec/psb_silu_fct.f90
 prec/psb_zilu_fct.f90

"Dirty trick" to speed up factorization when input is already in CSR.
psblas3-type-indexed
Salvatore Filippone 15 years ago
parent e307e0a22e
commit 802546ceb3

@ -152,6 +152,26 @@ contains
! !
! !
select type(aa => a%a)
type is (psb_c_csr_sparse_mat)
do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < i).and.(k >= 1)) then
l1 = l1 + 1
laspk(l1) = aa%val(j)
lia1(l1) = k
else if (k == i) then
d(i) = aa%val(j)
else if ((k > i).and.(k <= m)) then
l2 = l2 + 1
uaspk(l2) = aa%val(j)
uia1(l2) = k
end if
enddo
class default
if ((mod(i,nrb) == 1).or.(nrb==1)) then if ((mod(i,nrb) == 1).or.(nrb==1)) then
irb = min(ma-i+1,nrb) irb = min(ma-i+1,nrb)
call a%a%csget(i,i+irb-1,trw,info) call a%a%csget(i,i+irb-1,trw,info)
@ -182,6 +202,7 @@ contains
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1
enddo enddo
end select
!!$ !!$
lia2(i+1) = l1 + 1 lia2(i+1) = l1 + 1
@ -269,6 +290,26 @@ contains
do i = ma+1, m do i = ma+1, m
d(i) = czero d(i) = czero
select type(aa => b%a)
type is (psb_c_csr_sparse_mat)
do j = aa%irp(i-ma), aa%irp(i-ma+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < i).and.(k >= 1)) then
l1 = l1 + 1
laspk(l1) = aa%val(j)
lia1(l1) = k
else if (k == i) then
d(i) = aa%val(j)
else if ((k > i).and.(k <= m)) then
l2 = l2 + 1
uaspk(l2) = aa%val(j)
uia1(l2) = k
end if
enddo
class default
if ((mod(i,nrb) == 1).or.(nrb==1)) then if ((mod(i,nrb) == 1).or.(nrb==1)) then
irb = min(ma-i+1,nrb) irb = min(ma-i+1,nrb)
call b%a%csget(i-ma,i-ma+irb-1,trw,info) call b%a%csget(i-ma,i-ma+irb-1,trw,info)
@ -299,6 +340,7 @@ contains
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1
enddo enddo
end select
lia2(i+1) = l1 + 1 lia2(i+1) = l1 + 1

@ -119,8 +119,8 @@ contains
implicit none implicit none
type(psb_d_sparse_mat) :: a type(psb_d_sparse_mat), target :: a
type(psb_d_sparse_mat) :: b type(psb_d_sparse_mat), target :: b
integer :: m,ma,mb,l1,l2,info integer :: m,ma,mb,l1,l2,info
integer, dimension(:) :: lia1,lia2,uia1,uia2 integer, dimension(:) :: lia1,lia2,uia1,uia2
real(psb_dpk_), dimension(:) :: laspk,uaspk,d real(psb_dpk_), dimension(:) :: laspk,uaspk,d
@ -155,6 +155,26 @@ contains
d(i) = dzero d(i) = dzero
! !
! !
select type(aa => a%a)
type is (psb_d_csr_sparse_mat)
do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < i).and.(k >= 1)) then
l1 = l1 + 1
laspk(l1) = aa%val(j)
lia1(l1) = k
else if (k == i) then
d(i) = aa%val(j)
else if ((k > i).and.(k <= m)) then
l2 = l2 + 1
uaspk(l2) = aa%val(j)
uia1(l2) = k
end if
enddo
class default
if ((mod(i,nrb) == 1).or.(nrb==1)) then if ((mod(i,nrb) == 1).or.(nrb==1)) then
irb = min(ma-i+1,nrb) irb = min(ma-i+1,nrb)
call a%a%csget(i,i+irb-1,trw,info) call a%a%csget(i,i+irb-1,trw,info)
@ -185,6 +205,7 @@ contains
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1
enddo enddo
end select
!!$ !!$
lia2(i+1) = l1 + 1 lia2(i+1) = l1 + 1
@ -272,6 +293,26 @@ contains
do i = ma+1, m do i = ma+1, m
d(i) = dzero d(i) = dzero
select type(aa => b%a)
type is (psb_d_csr_sparse_mat)
do j = aa%irp(i-ma), aa%irp(i-ma+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < i).and.(k >= 1)) then
l1 = l1 + 1
laspk(l1) = aa%val(j)
lia1(l1) = k
else if (k == i) then
d(i) = aa%val(j)
else if ((k > i).and.(k <= m)) then
l2 = l2 + 1
uaspk(l2) = aa%val(j)
uia1(l2) = k
end if
enddo
class default
if ((mod(i,nrb) == 1).or.(nrb==1)) then if ((mod(i,nrb) == 1).or.(nrb==1)) then
irb = min(ma-i+1,nrb) irb = min(ma-i+1,nrb)
call b%a%csget(i-ma,i-ma+irb-1,trw,info) call b%a%csget(i-ma,i-ma+irb-1,trw,info)
@ -302,6 +343,7 @@ contains
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1
enddo enddo
end select
lia2(i+1) = l1 + 1 lia2(i+1) = l1 + 1

@ -154,6 +154,26 @@ contains
d(i) = szero d(i) = szero
! !
! !
select type(aa => a%a)
type is (psb_s_csr_sparse_mat)
do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < i).and.(k >= 1)) then
l1 = l1 + 1
laspk(l1) = aa%val(j)
lia1(l1) = k
else if (k == i) then
d(i) = aa%val(j)
else if ((k > i).and.(k <= m)) then
l2 = l2 + 1
uaspk(l2) = aa%val(j)
uia1(l2) = k
end if
enddo
class default
if ((mod(i,nrb) == 1).or.(nrb==1)) then if ((mod(i,nrb) == 1).or.(nrb==1)) then
irb = min(ma-i+1,nrb) irb = min(ma-i+1,nrb)
call a%a%csget(i,i+irb-1,trw,info) call a%a%csget(i,i+irb-1,trw,info)
@ -184,6 +204,7 @@ contains
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1
enddo enddo
end select
!!$ !!$
lia2(i+1) = l1 + 1 lia2(i+1) = l1 + 1
@ -271,6 +292,26 @@ contains
do i = ma+1, m do i = ma+1, m
d(i) = szero d(i) = szero
select type(aa => b%a)
type is (psb_s_csr_sparse_mat)
do j = aa%irp(i-ma), aa%irp(i-ma+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < i).and.(k >= 1)) then
l1 = l1 + 1
laspk(l1) = aa%val(j)
lia1(l1) = k
else if (k == i) then
d(i) = aa%val(j)
else if ((k > i).and.(k <= m)) then
l2 = l2 + 1
uaspk(l2) = aa%val(j)
uia1(l2) = k
end if
enddo
class default
if ((mod(i,nrb) == 1).or.(nrb==1)) then if ((mod(i,nrb) == 1).or.(nrb==1)) then
irb = min(ma-i+1,nrb) irb = min(ma-i+1,nrb)
call b%a%csget(i-ma,i-ma+irb-1,trw,info) call b%a%csget(i-ma,i-ma+irb-1,trw,info)
@ -301,6 +342,7 @@ contains
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1
enddo enddo
end select
lia2(i+1) = l1 + 1 lia2(i+1) = l1 + 1

@ -152,6 +152,26 @@ contains
! !
! !
select type(aa => a%a)
type is (psb_z_csr_sparse_mat)
do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < i).and.(k >= 1)) then
l1 = l1 + 1
laspk(l1) = aa%val(j)
lia1(l1) = k
else if (k == i) then
d(i) = aa%val(j)
else if ((k > i).and.(k <= m)) then
l2 = l2 + 1
uaspk(l2) = aa%val(j)
uia1(l2) = k
end if
enddo
class default
if ((mod(i,nrb) == 1).or.(nrb==1)) then if ((mod(i,nrb) == 1).or.(nrb==1)) then
irb = min(ma-i+1,nrb) irb = min(ma-i+1,nrb)
call a%a%csget(i,i+irb-1,trw,info) call a%a%csget(i,i+irb-1,trw,info)
@ -182,6 +202,7 @@ contains
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1
enddo enddo
end select
!!$ !!$
lia2(i+1) = l1 + 1 lia2(i+1) = l1 + 1
@ -269,6 +290,26 @@ contains
do i = ma+1, m do i = ma+1, m
d(i) = zzero d(i) = zzero
select type(aa => b%a)
type is (psb_z_csr_sparse_mat)
do j = aa%irp(i-ma), aa%irp(i-ma+1) - 1
k = aa%ja(j)
! write(0,*)'KKKKK',k
if ((k < i).and.(k >= 1)) then
l1 = l1 + 1
laspk(l1) = aa%val(j)
lia1(l1) = k
else if (k == i) then
d(i) = aa%val(j)
else if ((k > i).and.(k <= m)) then
l2 = l2 + 1
uaspk(l2) = aa%val(j)
uia1(l2) = k
end if
enddo
class default
if ((mod(i,nrb) == 1).or.(nrb==1)) then if ((mod(i,nrb) == 1).or.(nrb==1)) then
irb = min(ma-i+1,nrb) irb = min(ma-i+1,nrb)
call b%a%csget(i-ma,i-ma+irb-1,trw,info) call b%a%csget(i-ma,i-ma+irb-1,trw,info)
@ -299,6 +340,7 @@ contains
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1
enddo enddo
end select
lia2(i+1) = l1 + 1 lia2(i+1) = l1 + 1

Loading…
Cancel
Save