mld2p4-2:

mlprec/mld_cilut_fact.f90
 mlprec/mld_dilut_fact.f90
 mlprec/mld_silut_fact.f90
 mlprec/mld_zilut_fact.f90
 tests/pdegen/ppde.f90
 tests/pdegen/runs/ppde.inp

ILUT fix in copyin. 
Use %sizeof() method instead of function.
stopcriterion
Salvatore Filippone 13 years ago
parent c377ba1503
commit 852102c4f8

@ -526,7 +526,7 @@ contains
complex(psb_spk_), intent(inout) :: row(:) complex(psb_spk_), intent(inout) :: row(:)
real(psb_spk_), intent(in) :: weight real(psb_spk_), intent(in) :: weight
type(psb_int_heap), intent(inout) :: heap type(psb_int_heap), intent(inout) :: heap
integer :: k,j,irb,kin,nz integer :: k,j,irb,kin,nz
integer, parameter :: nrb=40 integer, parameter :: nrb=40
real(psb_spk_) :: dmaxup real(psb_spk_) :: dmaxup
@ -556,26 +556,26 @@ contains
jmaxup = 0 jmaxup = 0
dmaxup = szero dmaxup = szero
nrmi = szero nrmi = szero
select type (aa=> a%a) select type (aa=> a%a)
type is (psb_c_csr_sparse_mat) type is (psb_c_csr_sparse_mat)
! !
! Take a fast shortcut if the matrix is stored in CSR format ! Take a fast shortcut if the matrix is stored in CSR format
! !
do j = aa%irp(i), aa%irp(i+1) - 1 do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j) k = aa%ja(j)
if ((jmin<=k).and.(k<=jmax)) then if ((jmin<=k).and.(k<=jmax)) then
row(k) = aa%val(j)*weight row(k) = aa%val(j)*weight
call psb_insert_heap(k,heap,info) call psb_insert_heap(k,heap,info)
if (info /= psb_success_) exit if (info /= psb_success_) exit
end if if (k<jd) nlw = nlw + 1
if (k<jd) nlw = nlw + 1 if (k>jd) then
if (k>jd) then nup = nup + 1
nup = nup + 1 if (abs(row(k))>dmaxup) then
if (abs(row(k))>dmaxup) then jmaxup = k
jmaxup = k dmaxup = abs(row(k))
dmaxup = abs(row(k)) end if
end if end if
end if end if
end do end do
@ -584,13 +584,13 @@ contains
call psb_errpush(info,name,a_err='psb_insert_heap') call psb_errpush(info,name,a_err='psb_insert_heap')
goto 9999 goto 9999
end if end if
nz = aa%irp(i+1) - aa%irp(i) nz = aa%irp(i+1) - aa%irp(i)
nrmi = weight*dnrm2(nz,aa%val(aa%irp(i)),ione) nrmi = weight*dnrm2(nz,aa%val(aa%irp(i)),ione)
class default class default
! !
! Otherwise use psb_sp_getblk, slower but able (in principle) of ! Otherwise use psb_sp_getblk, slower but able (in principle) of
! handling any format. In this case, a block of rows is extracted ! handling any format. In this case, a block of rows is extracted
@ -609,7 +609,7 @@ contains
end if end if
ktrw=1 ktrw=1
end if end if
kin = ktrw kin = ktrw
nz = trw%get_nzeros() nz = trw%get_nzeros()
do do
@ -620,14 +620,13 @@ contains
row(k) = trw%val(ktrw)*weight row(k) = trw%val(ktrw)*weight
call psb_insert_heap(k,heap,info) call psb_insert_heap(k,heap,info)
if (info /= psb_success_) exit if (info /= psb_success_) exit
if (k<jd) nlw = nlw + 1
end if if (k>jd) then
if (k<jd) nlw = nlw + 1 nup = nup + 1
if (k>jd) then if (abs(row(k))>dmaxup) then
nup = nup + 1 jmaxup = k
if (abs(row(k))>dmaxup) then dmaxup = abs(row(k))
jmaxup = k end if
dmaxup = abs(row(k))
end if end if
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1

@ -524,7 +524,7 @@ contains
real(psb_dpk_), intent(inout) :: nrmi,row(:) real(psb_dpk_), intent(inout) :: nrmi,row(:)
real(psb_dpk_), intent(in) :: weight real(psb_dpk_), intent(in) :: weight
type(psb_int_heap), intent(inout) :: heap type(psb_int_heap), intent(inout) :: heap
integer :: k,j,irb,kin,nz integer :: k,j,irb,kin,nz
integer, parameter :: nrb=40 integer, parameter :: nrb=40
real(psb_dpk_) :: dmaxup real(psb_dpk_) :: dmaxup
@ -554,26 +554,26 @@ contains
jmaxup = 0 jmaxup = 0
dmaxup = dzero dmaxup = dzero
nrmi = dzero nrmi = dzero
select type (aa=> a%a) select type (aa=> a%a)
type is (psb_d_csr_sparse_mat) type is (psb_d_csr_sparse_mat)
! !
! Take a fast shortcut if the matrix is stored in CSR format ! Take a fast shortcut if the matrix is stored in CSR format
! !
do j = aa%irp(i), aa%irp(i+1) - 1 do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j) k = aa%ja(j)
if ((jmin<=k).and.(k<=jmax)) then if ((jmin<=k).and.(k<=jmax)) then
row(k) = aa%val(j)*weight row(k) = aa%val(j)*weight
call psb_insert_heap(k,heap,info) call psb_insert_heap(k,heap,info)
if (info /= psb_success_) exit if (info /= psb_success_) exit
end if if (k<jd) nlw = nlw + 1
if (k<jd) nlw = nlw + 1 if (k>jd) then
if (k>jd) then nup = nup + 1
nup = nup + 1 if (abs(row(k))>dmaxup) then
if (abs(row(k))>dmaxup) then jmaxup = k
jmaxup = k dmaxup = abs(row(k))
dmaxup = abs(row(k)) end if
end if end if
end if end if
end do end do
@ -582,13 +582,13 @@ contains
call psb_errpush(info,name,a_err='psb_insert_heap') call psb_errpush(info,name,a_err='psb_insert_heap')
goto 9999 goto 9999
end if end if
nz = aa%irp(i+1) - aa%irp(i) nz = aa%irp(i+1) - aa%irp(i)
nrmi = weight*dnrm2(nz,aa%val(aa%irp(i)),ione) nrmi = weight*dnrm2(nz,aa%val(aa%irp(i)),ione)
class default class default
! !
! Otherwise use psb_sp_getblk, slower but able (in principle) of ! Otherwise use psb_sp_getblk, slower but able (in principle) of
! handling any format. In this case, a block of rows is extracted ! handling any format. In this case, a block of rows is extracted
@ -607,7 +607,7 @@ contains
end if end if
ktrw=1 ktrw=1
end if end if
kin = ktrw kin = ktrw
nz = trw%get_nzeros() nz = trw%get_nzeros()
do do
@ -618,14 +618,14 @@ contains
row(k) = trw%val(ktrw)*weight row(k) = trw%val(ktrw)*weight
call psb_insert_heap(k,heap,info) call psb_insert_heap(k,heap,info)
if (info /= psb_success_) exit if (info /= psb_success_) exit
end if if (k<jd) nlw = nlw + 1
if (k<jd) nlw = nlw + 1 if (k>jd) then
if (k>jd) then nup = nup + 1
nup = nup + 1 if (abs(row(k))>dmaxup) then
if (abs(row(k))>dmaxup) then jmaxup = k
jmaxup = k dmaxup = abs(row(k))
dmaxup = abs(row(k)) end if
end if end if
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1

@ -525,7 +525,7 @@ contains
real(psb_spk_), intent(inout) :: nrmi,row(:) real(psb_spk_), intent(inout) :: nrmi,row(:)
real(psb_spk_), intent(in) :: weight real(psb_spk_), intent(in) :: weight
type(psb_int_heap), intent(inout) :: heap type(psb_int_heap), intent(inout) :: heap
integer :: k,j,irb,kin,nz integer :: k,j,irb,kin,nz
integer, parameter :: nrb=40 integer, parameter :: nrb=40
real(psb_spk_) :: dmaxup real(psb_spk_) :: dmaxup
@ -555,26 +555,26 @@ contains
jmaxup = 0 jmaxup = 0
dmaxup = szero dmaxup = szero
nrmi = szero nrmi = szero
select type (aa=> a%a) select type (aa=> a%a)
type is (psb_s_csr_sparse_mat) type is (psb_s_csr_sparse_mat)
! !
! Take a fast shortcut if the matrix is stored in CSR format ! Take a fast shortcut if the matrix is stored in CSR format
! !
do j = aa%irp(i), aa%irp(i+1) - 1 do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j) k = aa%ja(j)
if ((jmin<=k).and.(k<=jmax)) then if ((jmin<=k).and.(k<=jmax)) then
row(k) = aa%val(j)*weight row(k) = aa%val(j)*weight
call psb_insert_heap(k,heap,info) call psb_insert_heap(k,heap,info)
if (info /= psb_success_) exit if (info /= psb_success_) exit
end if if (k<jd) nlw = nlw + 1
if (k<jd) nlw = nlw + 1 if (k>jd) then
if (k>jd) then nup = nup + 1
nup = nup + 1 if (abs(row(k))>dmaxup) then
if (abs(row(k))>dmaxup) then jmaxup = k
jmaxup = k dmaxup = abs(row(k))
dmaxup = abs(row(k)) end if
end if end if
end if end if
end do end do
@ -583,13 +583,13 @@ contains
call psb_errpush(info,name,a_err='psb_insert_heap') call psb_errpush(info,name,a_err='psb_insert_heap')
goto 9999 goto 9999
end if end if
nz = aa%irp(i+1) - aa%irp(i) nz = aa%irp(i+1) - aa%irp(i)
nrmi = weight*dnrm2(nz,aa%val(aa%irp(i)),ione) nrmi = weight*dnrm2(nz,aa%val(aa%irp(i)),ione)
class default class default
! !
! Otherwise use psb_sp_getblk, slower but able (in principle) of ! Otherwise use psb_sp_getblk, slower but able (in principle) of
! handling any format. In this case, a block of rows is extracted ! handling any format. In this case, a block of rows is extracted
@ -597,7 +597,7 @@ contains
! rows are copied one by one into the array row, through successive ! rows are copied one by one into the array row, through successive
! calls to ilut_copyin. ! calls to ilut_copyin.
! !
if ((mod(i,nrb) == 1).or.(nrb == 1)) then if ((mod(i,nrb) == 1).or.(nrb == 1)) then
irb = min(m-i+1,nrb) irb = min(m-i+1,nrb)
call aa%csget(i,i+irb-1,trw,info) call aa%csget(i,i+irb-1,trw,info)
@ -619,14 +619,13 @@ contains
row(k) = trw%val(ktrw)*weight row(k) = trw%val(ktrw)*weight
call psb_insert_heap(k,heap,info) call psb_insert_heap(k,heap,info)
if (info /= psb_success_) exit if (info /= psb_success_) exit
if (k<jd) nlw = nlw + 1
end if if (k>jd) then
if (k<jd) nlw = nlw + 1 nup = nup + 1
if (k>jd) then if (abs(row(k))>dmaxup) then
nup = nup + 1 jmaxup = k
if (abs(row(k))>dmaxup) then dmaxup = abs(row(k))
jmaxup = k end if
dmaxup = abs(row(k))
end if end if
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1

@ -526,7 +526,7 @@ contains
complex(psb_dpk_), intent(inout) :: row(:) complex(psb_dpk_), intent(inout) :: row(:)
real(psb_dpk_), intent(in) :: weight real(psb_dpk_), intent(in) :: weight
type(psb_int_heap), intent(inout) :: heap type(psb_int_heap), intent(inout) :: heap
integer :: k,j,irb,kin,nz integer :: k,j,irb,kin,nz
integer, parameter :: nrb=40 integer, parameter :: nrb=40
real(psb_dpk_) :: dmaxup real(psb_dpk_) :: dmaxup
@ -556,26 +556,26 @@ contains
jmaxup = 0 jmaxup = 0
dmaxup = dzero dmaxup = dzero
nrmi = dzero nrmi = dzero
select type (aa=> a%a) select type (aa=> a%a)
type is (psb_z_csr_sparse_mat) type is (psb_z_csr_sparse_mat)
! !
! Take a fast shortcut if the matrix is stored in CSR format ! Take a fast shortcut if the matrix is stored in CSR format
! !
do j = aa%irp(i), aa%irp(i+1) - 1 do j = aa%irp(i), aa%irp(i+1) - 1
k = aa%ja(j) k = aa%ja(j)
if ((jmin<=k).and.(k<=jmax)) then if ((jmin<=k).and.(k<=jmax)) then
row(k) = aa%val(j)*weight row(k) = aa%val(j)*weight
call psb_insert_heap(k,heap,info) call psb_insert_heap(k,heap,info)
if (info /= psb_success_) exit if (info /= psb_success_) exit
end if if (k<jd) nlw = nlw + 1
if (k<jd) nlw = nlw + 1 if (k>jd) then
if (k>jd) then nup = nup + 1
nup = nup + 1 if (abs(row(k))>dmaxup) then
if (abs(row(k))>dmaxup) then jmaxup = k
jmaxup = k dmaxup = abs(row(k))
dmaxup = abs(row(k)) end if
end if end if
end if end if
end do end do
@ -587,17 +587,17 @@ contains
nz = aa%irp(i+1) - aa%irp(i) nz = aa%irp(i+1) - aa%irp(i)
nrmi = weight*dnrm2(nz,aa%val(aa%irp(i)),ione) nrmi = weight*dnrm2(nz,aa%val(aa%irp(i)),ione)
class default class default
! !
! Otherwise use psb_sp_getblk, slower but able (in principle) of ! Otherwise use psb_sp_getblk, slower but able (in principle) of
! handling any format. In this case, a block of rows is extracted ! handling any format. In this case, a block of rows is extracted
! instead of a single row, for performance reasons, and these ! instead of a single row, for performance reasons, and these
! rows are copied one by one into the array row, through successive ! rows are copied one by one into the array row, through successive
! calls to ilut_copyin. ! calls to ilut_copyin.
! !
if ((mod(i,nrb) == 1).or.(nrb == 1)) then if ((mod(i,nrb) == 1).or.(nrb == 1)) then
irb = min(m-i+1,nrb) irb = min(m-i+1,nrb)
@ -609,7 +609,7 @@ contains
end if end if
ktrw=1 ktrw=1
end if end if
kin = ktrw kin = ktrw
nz = trw%get_nzeros() nz = trw%get_nzeros()
do do
@ -620,14 +620,13 @@ contains
row(k) = trw%val(ktrw)*weight row(k) = trw%val(ktrw)*weight
call psb_insert_heap(k,heap,info) call psb_insert_heap(k,heap,info)
if (info /= psb_success_) exit if (info /= psb_success_) exit
if (k<jd) nlw = nlw + 1
end if if (k>jd) then
if (k<jd) nlw = nlw + 1 nup = nup + 1
if (k>jd) then if (abs(row(k))>dmaxup) then
nup = nup + 1 jmaxup = k
if (abs(row(k))>dmaxup) then dmaxup = abs(row(k))
jmaxup = k end if
dmaxup = abs(row(k))
end if end if
end if end if
ktrw = ktrw + 1 ktrw = ktrw + 1

@ -258,7 +258,7 @@ program ppde
t2 = psb_wtime() - t1 t2 = psb_wtime() - t1
call psb_amx(ictxt,t2) call psb_amx(ictxt,t2)
amatsize = psb_sizeof(a) amatsize = a%sizeof()
descsize = desc_a%sizeof() descsize = desc_a%sizeof()
precsize = mld_sizeof(prec) precsize = mld_sizeof(prec)
call psb_sum(ictxt,amatsize) call psb_sum(ictxt,amatsize)

@ -17,7 +17,7 @@ ILU ! Subdomain solver DSCALE ILU MILU ILUT UMF SLU
1 ! Smoother/Jacobi sweeps 1 ! Smoother/Jacobi sweeps
BJAC ! Smoother type JACOBI BJAC AS; ignored for non-ML BJAC ! Smoother type JACOBI BJAC AS; ignored for non-ML
3 ! Number of levels in a multilevel preconditioner 3 ! Number of levels in a multilevel preconditioner
MINENERGY ! Kind of aggregation: SMOOTHED, NONSMOOTHED SMOOTHED ! Kind of aggregation: SMOOTHED, NONSMOOTHED
DEC ! Type of aggregation DEC SYMDEC GLB DEC ! Type of aggregation DEC SYMDEC GLB
MULT ! Type of multilevel correction: ADD MULT MULT ! Type of multilevel correction: ADD MULT
TWOSIDE ! Side of correction PRE POST TWOSIDE (ignored for ADD) TWOSIDE ! Side of correction PRE POST TWOSIDE (ignored for ADD)

Loading…
Cancel
Save