Merge branch 'development' into MixedI8

This commit is contained in:
Salvatore Filippone
2018-10-22 13:46:33 +01:00
252 changed files with 4682 additions and 10854 deletions
+34 -23
View File
@@ -112,7 +112,8 @@ subroutine mld_c_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
ncol = desc_a%get_local_cols()
nr = a%get_nrows()
allocate(ilaggr(nr),neigh(nr),ideg(nr),idxs(nr),stat=info)
allocate(ilaggr(nr),neigh(nr),ideg(nr),idxs(nr),&
& icol(nr),val(nr),stat=info)
if(info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/2*nr,izero,izero,izero,izero/),&
@@ -127,18 +128,17 @@ subroutine mld_c_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
goto 9999
end if
call a%cp_to(acsr)
if (iorder == mld_aggr_ord_nat_) then
do i=1, nr
ilaggr(i) = -(nr+1)
idxs(i) = i
end do
else
call a%cp_to(acsr)
do i=1, nr
ilaggr(i) = -(nr+1)
ideg(i) = acsr%irp(i+1) - acsr%irp(i)
end do
call acsr%free()
call psb_msort(ideg,ix=idxs,dir=psb_sort_down_)
end if
@@ -151,13 +151,16 @@ subroutine mld_c_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
step1: do ii=1, nr
i = idxs(ii)
if (ilaggr(i) == -(nr+1)) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='csget')
goto 9999
end if
if (ilaggr(i) == -(nr+1)) then
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='csget')
!!$ goto 9999
!!$ end if
!
! Build the set of all strongly coupled nodes
@@ -204,12 +207,15 @@ subroutine mld_c_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
i = idxs(ii)
if (ilaggr(i) == -(nr+1)) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_sp_getrow')
goto 9999
end if
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='psb_sp_getrow')
!!$ goto 9999
!!$ end if
!
! Find the most strongly connected neighbour that is
! already aggregated, if any, and join its aggregate
@@ -240,12 +246,15 @@ subroutine mld_c_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
i = idxs(ii)
if (ilaggr(i) < 0) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_sp_getrow')
goto 9999
end if
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='psb_sp_getrow')
!!$ goto 9999
!!$ end if
!
! Find its strongly connected neighbourhood not
! already aggregated, and make it into a new aggregate.
@@ -288,7 +297,7 @@ subroutine mld_c_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
endif
if (naggr > ncol) then
write(0,*) name,'Error : naggr > ncol',naggr,ncol
!write(0,*) name,'Error : naggr > ncol',naggr,ncol
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Fatal error: naggr>ncol')
goto 9999
@@ -314,6 +323,8 @@ subroutine mld_c_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
nlaggr(me+1) = naggr
call psb_sum(ictxt,nlaggr(1:np))
call acsr%free()
call psb_erractionrestore(err_act)
return
+34 -23
View File
@@ -112,7 +112,8 @@ subroutine mld_d_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
ncol = desc_a%get_local_cols()
nr = a%get_nrows()
allocate(ilaggr(nr),neigh(nr),ideg(nr),idxs(nr),stat=info)
allocate(ilaggr(nr),neigh(nr),ideg(nr),idxs(nr),&
& icol(nr),val(nr),stat=info)
if(info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/2*nr,izero,izero,izero,izero/),&
@@ -127,18 +128,17 @@ subroutine mld_d_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
goto 9999
end if
call a%cp_to(acsr)
if (iorder == mld_aggr_ord_nat_) then
do i=1, nr
ilaggr(i) = -(nr+1)
idxs(i) = i
end do
else
call a%cp_to(acsr)
do i=1, nr
ilaggr(i) = -(nr+1)
ideg(i) = acsr%irp(i+1) - acsr%irp(i)
end do
call acsr%free()
call psb_msort(ideg,ix=idxs,dir=psb_sort_down_)
end if
@@ -151,13 +151,16 @@ subroutine mld_d_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
step1: do ii=1, nr
i = idxs(ii)
if (ilaggr(i) == -(nr+1)) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='csget')
goto 9999
end if
if (ilaggr(i) == -(nr+1)) then
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='csget')
!!$ goto 9999
!!$ end if
!
! Build the set of all strongly coupled nodes
@@ -204,12 +207,15 @@ subroutine mld_d_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
i = idxs(ii)
if (ilaggr(i) == -(nr+1)) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_sp_getrow')
goto 9999
end if
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='psb_sp_getrow')
!!$ goto 9999
!!$ end if
!
! Find the most strongly connected neighbour that is
! already aggregated, if any, and join its aggregate
@@ -240,12 +246,15 @@ subroutine mld_d_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
i = idxs(ii)
if (ilaggr(i) < 0) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_sp_getrow')
goto 9999
end if
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='psb_sp_getrow')
!!$ goto 9999
!!$ end if
!
! Find its strongly connected neighbourhood not
! already aggregated, and make it into a new aggregate.
@@ -288,7 +297,7 @@ subroutine mld_d_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
endif
if (naggr > ncol) then
write(0,*) name,'Error : naggr > ncol',naggr,ncol
!write(0,*) name,'Error : naggr > ncol',naggr,ncol
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Fatal error: naggr>ncol')
goto 9999
@@ -314,6 +323,8 @@ subroutine mld_d_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
nlaggr(me+1) = naggr
call psb_sum(ictxt,nlaggr(1:np))
call acsr%free()
call psb_erractionrestore(err_act)
return
+34 -23
View File
@@ -112,7 +112,8 @@ subroutine mld_s_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
ncol = desc_a%get_local_cols()
nr = a%get_nrows()
allocate(ilaggr(nr),neigh(nr),ideg(nr),idxs(nr),stat=info)
allocate(ilaggr(nr),neigh(nr),ideg(nr),idxs(nr),&
& icol(nr),val(nr),stat=info)
if(info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/2*nr,izero,izero,izero,izero/),&
@@ -127,18 +128,17 @@ subroutine mld_s_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
goto 9999
end if
call a%cp_to(acsr)
if (iorder == mld_aggr_ord_nat_) then
do i=1, nr
ilaggr(i) = -(nr+1)
idxs(i) = i
end do
else
call a%cp_to(acsr)
do i=1, nr
ilaggr(i) = -(nr+1)
ideg(i) = acsr%irp(i+1) - acsr%irp(i)
end do
call acsr%free()
call psb_msort(ideg,ix=idxs,dir=psb_sort_down_)
end if
@@ -151,13 +151,16 @@ subroutine mld_s_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
step1: do ii=1, nr
i = idxs(ii)
if (ilaggr(i) == -(nr+1)) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='csget')
goto 9999
end if
if (ilaggr(i) == -(nr+1)) then
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='csget')
!!$ goto 9999
!!$ end if
!
! Build the set of all strongly coupled nodes
@@ -204,12 +207,15 @@ subroutine mld_s_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
i = idxs(ii)
if (ilaggr(i) == -(nr+1)) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_sp_getrow')
goto 9999
end if
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='psb_sp_getrow')
!!$ goto 9999
!!$ end if
!
! Find the most strongly connected neighbour that is
! already aggregated, if any, and join its aggregate
@@ -240,12 +246,15 @@ subroutine mld_s_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
i = idxs(ii)
if (ilaggr(i) < 0) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_sp_getrow')
goto 9999
end if
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='psb_sp_getrow')
!!$ goto 9999
!!$ end if
!
! Find its strongly connected neighbourhood not
! already aggregated, and make it into a new aggregate.
@@ -288,7 +297,7 @@ subroutine mld_s_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
endif
if (naggr > ncol) then
write(0,*) name,'Error : naggr > ncol',naggr,ncol
!write(0,*) name,'Error : naggr > ncol',naggr,ncol
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Fatal error: naggr>ncol')
goto 9999
@@ -314,6 +323,8 @@ subroutine mld_s_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
nlaggr(me+1) = naggr
call psb_sum(ictxt,nlaggr(1:np))
call acsr%free()
call psb_erractionrestore(err_act)
return
+34 -23
View File
@@ -112,7 +112,8 @@ subroutine mld_z_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
ncol = desc_a%get_local_cols()
nr = a%get_nrows()
allocate(ilaggr(nr),neigh(nr),ideg(nr),idxs(nr),stat=info)
allocate(ilaggr(nr),neigh(nr),ideg(nr),idxs(nr),&
& icol(nr),val(nr),stat=info)
if(info /= psb_success_) then
info=psb_err_alloc_request_
call psb_errpush(info,name,i_err=(/2*nr,izero,izero,izero,izero/),&
@@ -127,18 +128,17 @@ subroutine mld_z_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
goto 9999
end if
call a%cp_to(acsr)
if (iorder == mld_aggr_ord_nat_) then
do i=1, nr
ilaggr(i) = -(nr+1)
idxs(i) = i
end do
else
call a%cp_to(acsr)
do i=1, nr
ilaggr(i) = -(nr+1)
ideg(i) = acsr%irp(i+1) - acsr%irp(i)
end do
call acsr%free()
call psb_msort(ideg,ix=idxs,dir=psb_sort_down_)
end if
@@ -151,13 +151,16 @@ subroutine mld_z_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
step1: do ii=1, nr
i = idxs(ii)
if (ilaggr(i) == -(nr+1)) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='csget')
goto 9999
end if
if (ilaggr(i) == -(nr+1)) then
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='csget')
!!$ goto 9999
!!$ end if
!
! Build the set of all strongly coupled nodes
@@ -204,12 +207,15 @@ subroutine mld_z_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
i = idxs(ii)
if (ilaggr(i) == -(nr+1)) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_sp_getrow')
goto 9999
end if
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='psb_sp_getrow')
!!$ goto 9999
!!$ end if
!
! Find the most strongly connected neighbour that is
! already aggregated, if any, and join its aggregate
@@ -240,12 +246,15 @@ subroutine mld_z_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
i = idxs(ii)
if (ilaggr(i) < 0) then
call a%csget(i,i,nz,irow,icol,val,info)
if (info /= psb_success_) then
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='psb_sp_getrow')
goto 9999
end if
nz = (acsr%irp(i+1)-acsr%irp(i))
icol(1:nz) = acsr%ja(acsr%irp(i):acsr%irp(i+1)-1)
val(1:nz) = acsr%val(acsr%irp(i):acsr%irp(i+1)-1)
!!$ call a%csget(i,i,nz,irow,icol,val,info,chksz=.false.)
!!$ if (info /= psb_success_) then
!!$ info=psb_err_from_subroutine_
!!$ call psb_errpush(info,name,a_err='psb_sp_getrow')
!!$ goto 9999
!!$ end if
!
! Find its strongly connected neighbourhood not
! already aggregated, and make it into a new aggregate.
@@ -288,7 +297,7 @@ subroutine mld_z_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
endif
if (naggr > ncol) then
write(0,*) name,'Error : naggr > ncol',naggr,ncol
!write(0,*) name,'Error : naggr > ncol',naggr,ncol
info=psb_err_internal_error_
call psb_errpush(info,name,a_err='Fatal error: naggr>ncol')
goto 9999
@@ -314,6 +323,8 @@ subroutine mld_z_soc1_map_bld(iorder,theta,a,desc_a,nlaggr,ilaggr,info)
nlaggr(me+1) = naggr
call psb_sum(ictxt,nlaggr(1:np))
call acsr%free()
call psb_erractionrestore(err_act)
return
+1 -12
View File
@@ -19,9 +19,6 @@ mld_c_base_onelev_dump.o \
mld_c_base_onelev_free.o \
mld_c_base_onelev_mat_asb.o \
mld_c_base_onelev_setag.o \
mld_c_base_onelev_setc.o \
mld_c_base_onelev_seti.o \
mld_c_base_onelev_setr.o \
mld_c_base_onelev_setsm.o \
mld_c_base_onelev_setsv.o \
mld_d_base_onelev_build.o \
@@ -35,9 +32,6 @@ mld_d_base_onelev_dump.o \
mld_d_base_onelev_free.o \
mld_d_base_onelev_mat_asb.o \
mld_d_base_onelev_setag.o \
mld_d_base_onelev_setc.o \
mld_d_base_onelev_seti.o \
mld_d_base_onelev_setr.o \
mld_d_base_onelev_setsm.o \
mld_d_base_onelev_setsv.o \
mld_s_base_onelev_build.o \
@@ -51,9 +45,6 @@ mld_s_base_onelev_dump.o \
mld_s_base_onelev_free.o \
mld_s_base_onelev_mat_asb.o \
mld_s_base_onelev_setag.o \
mld_s_base_onelev_setc.o \
mld_s_base_onelev_seti.o \
mld_s_base_onelev_setr.o \
mld_s_base_onelev_setsm.o \
mld_s_base_onelev_setsv.o \
mld_z_base_onelev_build.o \
@@ -67,12 +58,10 @@ mld_z_base_onelev_dump.o \
mld_z_base_onelev_free.o \
mld_z_base_onelev_mat_asb.o \
mld_z_base_onelev_setag.o \
mld_z_base_onelev_setc.o \
mld_z_base_onelev_seti.o \
mld_z_base_onelev_setr.o \
mld_z_base_onelev_setsm.o \
mld_z_base_onelev_setsv.o
LIBNAME=libmld_prec.a
lib: $(OBJS)
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_onelev_csetc(lv,what,val,info,pos)
subroutine mld_c_base_onelev_csetc(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_c_onelev_mod, mld_protect_name => mld_c_base_onelev_csetc
@@ -47,7 +47,8 @@ subroutine mld_c_base_onelev_csetc(lv,what,val,info,pos)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='c_base_onelev_csetc'
@@ -77,15 +78,16 @@ subroutine mld_c_base_onelev_csetc(lv,what,val,info,pos)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end if
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_onelev_cseti(lv,what,val,info,pos)
subroutine mld_c_base_onelev_cseti(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_c_onelev_mod, mld_protect_name => mld_c_base_onelev_cseti
@@ -62,7 +62,8 @@ subroutine mld_c_base_onelev_cseti(lv,what,val,info,pos)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='c_base_onelev_cseti'
@@ -232,14 +233,15 @@ subroutine mld_c_base_onelev_cseti(lv,what,val,info,pos)
case default
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end select
if (info /= psb_success_) goto 9999
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_onelev_csetr(lv,what,val,info,pos)
subroutine mld_c_base_onelev_csetr(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_c_onelev_mod, mld_protect_name => mld_c_base_onelev_csetr
@@ -47,7 +47,8 @@ subroutine mld_c_base_onelev_csetr(lv,what,val,info,pos)
character(len=*), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='c_base_onelev_csetr'
@@ -82,14 +83,16 @@ subroutine mld_c_base_onelev_csetr(lv,what,val,info,pos)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end select
if (info /= psb_success_) goto 9999
@@ -1,99 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_onelev_setc(lv,what,val,info,pos)
use psb_base_mod
use mld_c_onelev_mod, mld_protect_name => mld_c_base_onelev_setc
Implicit None
! Arguments
class(mld_c_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='c_base_onelev_setc'
integer(psb_ipk_) :: ival
call psb_erractionsave(err_act)
info = psb_success_
ival = lv%stringval(val)
if (ival >= 0) then
call lv%set(what,ival,info,pos=pos)
else
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_base_onelev_setc
@@ -1,253 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_onelev_seti(lv,what,val,info,pos)
use psb_base_mod
use mld_c_onelev_mod, mld_protect_name => mld_c_base_onelev_seti
use mld_c_base_aggregator_mod
use mld_c_dec_aggregator_mod
use mld_c_symdec_aggregator_mod
use mld_c_jac_smoother
use mld_c_as_smoother
use mld_c_diag_solver
use mld_c_ilu_solver
use mld_c_id_solver
use mld_c_gs_solver
#if defined(HAVE_SLU_)
use mld_c_slu_solver
#endif
#if defined(HAVE_MUMPS_)
use mld_c_mumps_solver
#endif
Implicit None
! Arguments
class(mld_c_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='c_base_onelev_seti'
type(mld_c_base_smoother_type) :: mld_c_base_smoother_mold
type(mld_c_jac_smoother_type) :: mld_c_jac_smoother_mold
type(mld_c_as_smoother_type) :: mld_c_as_smoother_mold
type(mld_c_diag_solver_type) :: mld_c_diag_solver_mold
type(mld_c_ilu_solver_type) :: mld_c_ilu_solver_mold
type(mld_c_id_solver_type) :: mld_c_id_solver_mold
type(mld_c_gs_solver_type) :: mld_c_gs_solver_mold
type(mld_c_bwgs_solver_type) :: mld_c_bwgs_solver_mold
#if defined(HAVE_SLU_)
type(mld_c_slu_solver_type) :: mld_c_slu_solver_mold
#endif
#if defined(HAVE_MUMPS_)
type(mld_c_mumps_solver_type) :: mld_c_mumps_solver_mold
#endif
call psb_erractionsave(err_act)
info = psb_success_
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
select case (what)
case (mld_smoother_type_)
select case (val)
case (mld_noprec_)
call lv%set(mld_c_base_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_c_id_solver_mold,info,pos=pos)
case (mld_jac_)
call lv%set(mld_c_jac_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_c_diag_solver_mold,info,pos=pos)
case (mld_bjac_)
call lv%set(mld_c_jac_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_c_ilu_solver_mold,info,pos=pos)
case (mld_as_)
call lv%set(mld_c_as_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_c_ilu_solver_mold,info,pos=pos)
case (mld_fbgs_)
call lv%set(mld_c_jac_smoother_mold,info,pos='pre')
if (info == 0) call lv%set(mld_c_gs_solver_mold,info,pos='pre')
if (info == 0) call lv%set(mld_c_jac_smoother_mold,info,pos='post')
if (info == 0) call lv%set(mld_c_bwgs_solver_mold,info,pos='post')
case default
!
! Do nothing and hope for the best :)
!
end select
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) call lv%sm%default()
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) call lv%sm2a%default()
end if
case(mld_sub_solve_)
select case (val)
case (mld_f_none_)
call lv%set(mld_c_id_solver_mold,info,pos=pos)
case (mld_diag_scale_)
call lv%set(mld_c_diag_solver_mold,info,pos=pos)
case (mld_gs_)
call lv%set(mld_c_gs_solver_mold,info,pos=pos)
case (mld_bwgs_)
call lv%set(mld_c_bwgs_solver_mold,info,pos=pos)
case (mld_ilu_n_,mld_milu_n_,mld_ilu_t_)
call lv%set(mld_c_ilu_solver_mold,info,pos=pos)
if (info == 0) then
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
call lv%sm%sv%set('SUB_SOLVE',val,info)
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) call lv%sm2a%sv%set('SUB_SOLVE',val,info)
end if
end if
#ifdef HAVE_SLU_
case (mld_slu_)
call lv%set(mld_c_slu_solver_mold,info,pos=pos)
#endif
#ifdef HAVE_MUMPS_
case (mld_mumps_)
call lv%set(mld_c_mumps_solver_mold,info,pos=pos)
#endif
case default
!
! Do nothing and hope for the best :)
!
end select
case (mld_smoother_sweeps_)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) &
& lv%parms%sweeps_pre = val
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_)) &
& lv%parms%sweeps_post = val
case (mld_ml_cycle_)
lv%parms%ml_cycle = val
case (mld_par_aggr_alg_)
lv%parms%par_aggr_alg = val
if (allocated(lv%aggr)) then
call lv%aggr%free(info)
if (info == 0) deallocate(lv%aggr,stat=info)
if (info /= 0) then
info = psb_err_internal_error_
return
end if
end if
select case(val)
case(mld_dec_aggr_)
allocate(mld_c_dec_aggregator_type :: lv%aggr, stat=info)
case(mld_sym_dec_aggr_)
allocate(mld_c_symdec_aggregator_type :: lv%aggr, stat=info)
case default
info = psb_err_internal_error_
end select
if (info == psb_success_) call lv%aggr%default()
case (mld_aggr_ord_)
lv%parms%aggr_ord = val
case (mld_aggr_type_)
lv%parms%aggr_type = val
if (allocated(lv%aggr)) call lv%aggr%set_aggr_type(lv%parms,info)
case (mld_aggr_prol_)
lv%parms%aggr_prol = val
case (mld_coarse_mat_)
lv%parms%coarse_mat = val
case (mld_aggr_omega_alg_)
lv%parms%aggr_omega_alg= val
case (mld_aggr_eig_)
lv%parms%aggr_eig = val
case (mld_aggr_filter_)
lv%parms%aggr_filter = val
case (mld_coarse_solve_)
lv%parms%coarse_solve = val
case default
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end select
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_base_onelev_seti
@@ -1,104 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_onelev_setr(lv,what,val,info,pos)
use psb_base_mod
use mld_c_onelev_mod, mld_protect_name => mld_c_base_onelev_setr
Implicit None
! Arguments
class(mld_c_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='c_base_onelev_setr'
call psb_erractionsave(err_act)
info = psb_success_
select case (what)
case (mld_aggr_omega_val_)
lv%parms%aggr_omega_val= val
case (mld_aggr_thresh_)
lv%parms%aggr_thresh = val
case default
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end select
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_base_onelev_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_onelev_csetc(lv,what,val,info,pos)
subroutine mld_d_base_onelev_csetc(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_d_onelev_mod, mld_protect_name => mld_d_base_onelev_csetc
@@ -47,7 +47,8 @@ subroutine mld_d_base_onelev_csetc(lv,what,val,info,pos)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='d_base_onelev_csetc'
@@ -77,15 +78,16 @@ subroutine mld_d_base_onelev_csetc(lv,what,val,info,pos)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end if
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_onelev_cseti(lv,what,val,info,pos)
subroutine mld_d_base_onelev_cseti(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_d_onelev_mod, mld_protect_name => mld_d_base_onelev_cseti
@@ -68,7 +68,8 @@ subroutine mld_d_base_onelev_cseti(lv,what,val,info,pos)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='d_base_onelev_cseti'
@@ -252,14 +253,15 @@ subroutine mld_d_base_onelev_cseti(lv,what,val,info,pos)
case default
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end select
if (info /= psb_success_) goto 9999
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_onelev_csetr(lv,what,val,info,pos)
subroutine mld_d_base_onelev_csetr(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_d_onelev_mod, mld_protect_name => mld_d_base_onelev_csetr
@@ -47,7 +47,8 @@ subroutine mld_d_base_onelev_csetr(lv,what,val,info,pos)
character(len=*), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='d_base_onelev_csetr'
@@ -82,14 +83,16 @@ subroutine mld_d_base_onelev_csetr(lv,what,val,info,pos)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end select
if (info /= psb_success_) goto 9999
@@ -1,99 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_onelev_setc(lv,what,val,info,pos)
use psb_base_mod
use mld_d_onelev_mod, mld_protect_name => mld_d_base_onelev_setc
Implicit None
! Arguments
class(mld_d_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='d_base_onelev_setc'
integer(psb_ipk_) :: ival
call psb_erractionsave(err_act)
info = psb_success_
ival = lv%stringval(val)
if (ival >= 0) then
call lv%set(what,ival,info,pos=pos)
else
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_base_onelev_setc
@@ -1,273 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_onelev_seti(lv,what,val,info,pos)
use psb_base_mod
use mld_d_onelev_mod, mld_protect_name => mld_d_base_onelev_seti
use mld_d_base_aggregator_mod
use mld_d_dec_aggregator_mod
use mld_d_symdec_aggregator_mod
use mld_d_jac_smoother
use mld_d_as_smoother
use mld_d_diag_solver
use mld_d_ilu_solver
use mld_d_id_solver
use mld_d_gs_solver
#if defined(HAVE_UMF_)
use mld_d_umf_solver
#endif
#if defined(HAVE_SLUDIST_)
use mld_d_sludist_solver
#endif
#if defined(HAVE_SLU_)
use mld_d_slu_solver
#endif
#if defined(HAVE_MUMPS_)
use mld_d_mumps_solver
#endif
Implicit None
! Arguments
class(mld_d_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='d_base_onelev_seti'
type(mld_d_base_smoother_type) :: mld_d_base_smoother_mold
type(mld_d_jac_smoother_type) :: mld_d_jac_smoother_mold
type(mld_d_as_smoother_type) :: mld_d_as_smoother_mold
type(mld_d_diag_solver_type) :: mld_d_diag_solver_mold
type(mld_d_ilu_solver_type) :: mld_d_ilu_solver_mold
type(mld_d_id_solver_type) :: mld_d_id_solver_mold
type(mld_d_gs_solver_type) :: mld_d_gs_solver_mold
type(mld_d_bwgs_solver_type) :: mld_d_bwgs_solver_mold
#if defined(HAVE_UMF_)
type(mld_d_umf_solver_type) :: mld_d_umf_solver_mold
#endif
#if defined(HAVE_SLUDIST_)
type(mld_d_sludist_solver_type) :: mld_d_sludist_solver_mold
#endif
#if defined(HAVE_SLU_)
type(mld_d_slu_solver_type) :: mld_d_slu_solver_mold
#endif
#if defined(HAVE_MUMPS_)
type(mld_d_mumps_solver_type) :: mld_d_mumps_solver_mold
#endif
call psb_erractionsave(err_act)
info = psb_success_
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
select case (what)
case (mld_smoother_type_)
select case (val)
case (mld_noprec_)
call lv%set(mld_d_base_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_d_id_solver_mold,info,pos=pos)
case (mld_jac_)
call lv%set(mld_d_jac_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_d_diag_solver_mold,info,pos=pos)
case (mld_bjac_)
call lv%set(mld_d_jac_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_d_ilu_solver_mold,info,pos=pos)
case (mld_as_)
call lv%set(mld_d_as_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_d_ilu_solver_mold,info,pos=pos)
case (mld_fbgs_)
call lv%set(mld_d_jac_smoother_mold,info,pos='pre')
if (info == 0) call lv%set(mld_d_gs_solver_mold,info,pos='pre')
if (info == 0) call lv%set(mld_d_jac_smoother_mold,info,pos='post')
if (info == 0) call lv%set(mld_d_bwgs_solver_mold,info,pos='post')
case default
!
! Do nothing and hope for the best :)
!
end select
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) call lv%sm%default()
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) call lv%sm2a%default()
end if
case(mld_sub_solve_)
select case (val)
case (mld_f_none_)
call lv%set(mld_d_id_solver_mold,info,pos=pos)
case (mld_diag_scale_)
call lv%set(mld_d_diag_solver_mold,info,pos=pos)
case (mld_gs_)
call lv%set(mld_d_gs_solver_mold,info,pos=pos)
case (mld_bwgs_)
call lv%set(mld_d_bwgs_solver_mold,info,pos=pos)
case (mld_ilu_n_,mld_milu_n_,mld_ilu_t_)
call lv%set(mld_d_ilu_solver_mold,info,pos=pos)
if (info == 0) then
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
call lv%sm%sv%set('SUB_SOLVE',val,info)
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) call lv%sm2a%sv%set('SUB_SOLVE',val,info)
end if
end if
#ifdef HAVE_SLU_
case (mld_slu_)
call lv%set(mld_d_slu_solver_mold,info,pos=pos)
#endif
#ifdef HAVE_MUMPS_
case (mld_mumps_)
call lv%set(mld_d_mumps_solver_mold,info,pos=pos)
#endif
#ifdef HAVE_SLUDIST_
case (mld_sludist_)
call lv%set(mld_d_sludist_solver_mold,info,pos=pos)
#endif
#ifdef HAVE_UMF_
case (mld_umf_)
call lv%set(mld_d_umf_solver_mold,info,pos=pos)
#endif
case default
!
! Do nothing and hope for the best :)
!
end select
case (mld_smoother_sweeps_)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) &
& lv%parms%sweeps_pre = val
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_)) &
& lv%parms%sweeps_post = val
case (mld_ml_cycle_)
lv%parms%ml_cycle = val
case (mld_par_aggr_alg_)
lv%parms%par_aggr_alg = val
if (allocated(lv%aggr)) then
call lv%aggr%free(info)
if (info == 0) deallocate(lv%aggr,stat=info)
if (info /= 0) then
info = psb_err_internal_error_
return
end if
end if
select case(val)
case(mld_dec_aggr_)
allocate(mld_d_dec_aggregator_type :: lv%aggr, stat=info)
case(mld_sym_dec_aggr_)
allocate(mld_d_symdec_aggregator_type :: lv%aggr, stat=info)
case default
info = psb_err_internal_error_
end select
if (info == psb_success_) call lv%aggr%default()
case (mld_aggr_ord_)
lv%parms%aggr_ord = val
case (mld_aggr_type_)
lv%parms%aggr_type = val
if (allocated(lv%aggr)) call lv%aggr%set_aggr_type(lv%parms,info)
case (mld_aggr_prol_)
lv%parms%aggr_prol = val
case (mld_coarse_mat_)
lv%parms%coarse_mat = val
case (mld_aggr_omega_alg_)
lv%parms%aggr_omega_alg= val
case (mld_aggr_eig_)
lv%parms%aggr_eig = val
case (mld_aggr_filter_)
lv%parms%aggr_filter = val
case (mld_coarse_solve_)
lv%parms%coarse_solve = val
case default
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end select
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_base_onelev_seti
@@ -1,104 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_onelev_setr(lv,what,val,info,pos)
use psb_base_mod
use mld_d_onelev_mod, mld_protect_name => mld_d_base_onelev_setr
Implicit None
! Arguments
class(mld_d_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='d_base_onelev_setr'
call psb_erractionsave(err_act)
info = psb_success_
select case (what)
case (mld_aggr_omega_val_)
lv%parms%aggr_omega_val= val
case (mld_aggr_thresh_)
lv%parms%aggr_thresh = val
case default
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end select
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_base_onelev_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_onelev_csetc(lv,what,val,info,pos)
subroutine mld_s_base_onelev_csetc(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_s_onelev_mod, mld_protect_name => mld_s_base_onelev_csetc
@@ -47,7 +47,8 @@ subroutine mld_s_base_onelev_csetc(lv,what,val,info,pos)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='s_base_onelev_csetc'
@@ -77,15 +78,16 @@ subroutine mld_s_base_onelev_csetc(lv,what,val,info,pos)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end if
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_onelev_cseti(lv,what,val,info,pos)
subroutine mld_s_base_onelev_cseti(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_s_onelev_mod, mld_protect_name => mld_s_base_onelev_cseti
@@ -62,7 +62,8 @@ subroutine mld_s_base_onelev_cseti(lv,what,val,info,pos)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='s_base_onelev_cseti'
@@ -232,14 +233,15 @@ subroutine mld_s_base_onelev_cseti(lv,what,val,info,pos)
case default
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end select
if (info /= psb_success_) goto 9999
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_onelev_csetr(lv,what,val,info,pos)
subroutine mld_s_base_onelev_csetr(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_s_onelev_mod, mld_protect_name => mld_s_base_onelev_csetr
@@ -47,7 +47,8 @@ subroutine mld_s_base_onelev_csetr(lv,what,val,info,pos)
character(len=*), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='s_base_onelev_csetr'
@@ -82,14 +83,16 @@ subroutine mld_s_base_onelev_csetr(lv,what,val,info,pos)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end select
if (info /= psb_success_) goto 9999
@@ -1,99 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_onelev_setc(lv,what,val,info,pos)
use psb_base_mod
use mld_s_onelev_mod, mld_protect_name => mld_s_base_onelev_setc
Implicit None
! Arguments
class(mld_s_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='s_base_onelev_setc'
integer(psb_ipk_) :: ival
call psb_erractionsave(err_act)
info = psb_success_
ival = lv%stringval(val)
if (ival >= 0) then
call lv%set(what,ival,info,pos=pos)
else
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_base_onelev_setc
@@ -1,253 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_onelev_seti(lv,what,val,info,pos)
use psb_base_mod
use mld_s_onelev_mod, mld_protect_name => mld_s_base_onelev_seti
use mld_s_base_aggregator_mod
use mld_s_dec_aggregator_mod
use mld_s_symdec_aggregator_mod
use mld_s_jac_smoother
use mld_s_as_smoother
use mld_s_diag_solver
use mld_s_ilu_solver
use mld_s_id_solver
use mld_s_gs_solver
#if defined(HAVE_SLU_)
use mld_s_slu_solver
#endif
#if defined(HAVE_MUMPS_)
use mld_s_mumps_solver
#endif
Implicit None
! Arguments
class(mld_s_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='s_base_onelev_seti'
type(mld_s_base_smoother_type) :: mld_s_base_smoother_mold
type(mld_s_jac_smoother_type) :: mld_s_jac_smoother_mold
type(mld_s_as_smoother_type) :: mld_s_as_smoother_mold
type(mld_s_diag_solver_type) :: mld_s_diag_solver_mold
type(mld_s_ilu_solver_type) :: mld_s_ilu_solver_mold
type(mld_s_id_solver_type) :: mld_s_id_solver_mold
type(mld_s_gs_solver_type) :: mld_s_gs_solver_mold
type(mld_s_bwgs_solver_type) :: mld_s_bwgs_solver_mold
#if defined(HAVE_SLU_)
type(mld_s_slu_solver_type) :: mld_s_slu_solver_mold
#endif
#if defined(HAVE_MUMPS_)
type(mld_s_mumps_solver_type) :: mld_s_mumps_solver_mold
#endif
call psb_erractionsave(err_act)
info = psb_success_
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
select case (what)
case (mld_smoother_type_)
select case (val)
case (mld_noprec_)
call lv%set(mld_s_base_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_s_id_solver_mold,info,pos=pos)
case (mld_jac_)
call lv%set(mld_s_jac_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_s_diag_solver_mold,info,pos=pos)
case (mld_bjac_)
call lv%set(mld_s_jac_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_s_ilu_solver_mold,info,pos=pos)
case (mld_as_)
call lv%set(mld_s_as_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_s_ilu_solver_mold,info,pos=pos)
case (mld_fbgs_)
call lv%set(mld_s_jac_smoother_mold,info,pos='pre')
if (info == 0) call lv%set(mld_s_gs_solver_mold,info,pos='pre')
if (info == 0) call lv%set(mld_s_jac_smoother_mold,info,pos='post')
if (info == 0) call lv%set(mld_s_bwgs_solver_mold,info,pos='post')
case default
!
! Do nothing and hope for the best :)
!
end select
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) call lv%sm%default()
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) call lv%sm2a%default()
end if
case(mld_sub_solve_)
select case (val)
case (mld_f_none_)
call lv%set(mld_s_id_solver_mold,info,pos=pos)
case (mld_diag_scale_)
call lv%set(mld_s_diag_solver_mold,info,pos=pos)
case (mld_gs_)
call lv%set(mld_s_gs_solver_mold,info,pos=pos)
case (mld_bwgs_)
call lv%set(mld_s_bwgs_solver_mold,info,pos=pos)
case (mld_ilu_n_,mld_milu_n_,mld_ilu_t_)
call lv%set(mld_s_ilu_solver_mold,info,pos=pos)
if (info == 0) then
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
call lv%sm%sv%set('SUB_SOLVE',val,info)
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) call lv%sm2a%sv%set('SUB_SOLVE',val,info)
end if
end if
#ifdef HAVE_SLU_
case (mld_slu_)
call lv%set(mld_s_slu_solver_mold,info,pos=pos)
#endif
#ifdef HAVE_MUMPS_
case (mld_mumps_)
call lv%set(mld_s_mumps_solver_mold,info,pos=pos)
#endif
case default
!
! Do nothing and hope for the best :)
!
end select
case (mld_smoother_sweeps_)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) &
& lv%parms%sweeps_pre = val
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_)) &
& lv%parms%sweeps_post = val
case (mld_ml_cycle_)
lv%parms%ml_cycle = val
case (mld_par_aggr_alg_)
lv%parms%par_aggr_alg = val
if (allocated(lv%aggr)) then
call lv%aggr%free(info)
if (info == 0) deallocate(lv%aggr,stat=info)
if (info /= 0) then
info = psb_err_internal_error_
return
end if
end if
select case(val)
case(mld_dec_aggr_)
allocate(mld_s_dec_aggregator_type :: lv%aggr, stat=info)
case(mld_sym_dec_aggr_)
allocate(mld_s_symdec_aggregator_type :: lv%aggr, stat=info)
case default
info = psb_err_internal_error_
end select
if (info == psb_success_) call lv%aggr%default()
case (mld_aggr_ord_)
lv%parms%aggr_ord = val
case (mld_aggr_type_)
lv%parms%aggr_type = val
if (allocated(lv%aggr)) call lv%aggr%set_aggr_type(lv%parms,info)
case (mld_aggr_prol_)
lv%parms%aggr_prol = val
case (mld_coarse_mat_)
lv%parms%coarse_mat = val
case (mld_aggr_omega_alg_)
lv%parms%aggr_omega_alg= val
case (mld_aggr_eig_)
lv%parms%aggr_eig = val
case (mld_aggr_filter_)
lv%parms%aggr_filter = val
case (mld_coarse_solve_)
lv%parms%coarse_solve = val
case default
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end select
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_base_onelev_seti
@@ -1,104 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_onelev_setr(lv,what,val,info,pos)
use psb_base_mod
use mld_s_onelev_mod, mld_protect_name => mld_s_base_onelev_setr
Implicit None
! Arguments
class(mld_s_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='s_base_onelev_setr'
call psb_erractionsave(err_act)
info = psb_success_
select case (what)
case (mld_aggr_omega_val_)
lv%parms%aggr_omega_val= val
case (mld_aggr_thresh_)
lv%parms%aggr_thresh = val
case default
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end select
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_base_onelev_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_onelev_csetc(lv,what,val,info,pos)
subroutine mld_z_base_onelev_csetc(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_z_onelev_mod, mld_protect_name => mld_z_base_onelev_csetc
@@ -47,7 +47,8 @@ subroutine mld_z_base_onelev_csetc(lv,what,val,info,pos)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='z_base_onelev_csetc'
@@ -77,15 +78,16 @@ subroutine mld_z_base_onelev_csetc(lv,what,val,info,pos)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end if
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_onelev_cseti(lv,what,val,info,pos)
subroutine mld_z_base_onelev_cseti(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_z_onelev_mod, mld_protect_name => mld_z_base_onelev_cseti
@@ -68,7 +68,8 @@ subroutine mld_z_base_onelev_cseti(lv,what,val,info,pos)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='z_base_onelev_cseti'
@@ -252,14 +253,15 @@ subroutine mld_z_base_onelev_cseti(lv,what,val,info,pos)
case default
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end select
if (info /= psb_success_) goto 9999
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_onelev_csetr(lv,what,val,info,pos)
subroutine mld_z_base_onelev_csetr(lv,what,val,info,pos,idx)
use psb_base_mod
use mld_z_onelev_mod, mld_protect_name => mld_z_base_onelev_csetr
@@ -47,7 +47,8 @@ subroutine mld_z_base_onelev_csetr(lv,what,val,info,pos)
character(len=*), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='z_base_onelev_csetr'
@@ -82,14 +83,16 @@ subroutine mld_z_base_onelev_csetr(lv,what,val,info,pos)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
call lv%sm%set(what,val,info,idx=idx)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
call lv%sm2a%set(what,val,info,idx=idx)
end if
end if
if (allocated(lv%aggr)) call lv%aggr%set(what,val,info,idx=idx)
end select
if (info /= psb_success_) goto 9999
@@ -1,99 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_onelev_setc(lv,what,val,info,pos)
use psb_base_mod
use mld_z_onelev_mod, mld_protect_name => mld_z_base_onelev_setc
Implicit None
! Arguments
class(mld_z_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='z_base_onelev_setc'
integer(psb_ipk_) :: ival
call psb_erractionsave(err_act)
info = psb_success_
ival = lv%stringval(val)
if (ival >= 0) then
call lv%set(what,ival,info,pos=pos)
else
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_z_base_onelev_setc
@@ -1,273 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_onelev_seti(lv,what,val,info,pos)
use psb_base_mod
use mld_z_onelev_mod, mld_protect_name => mld_z_base_onelev_seti
use mld_z_base_aggregator_mod
use mld_z_dec_aggregator_mod
use mld_z_symdec_aggregator_mod
use mld_z_jac_smoother
use mld_z_as_smoother
use mld_z_diag_solver
use mld_z_ilu_solver
use mld_z_id_solver
use mld_z_gs_solver
#if defined(HAVE_UMF_)
use mld_z_umf_solver
#endif
#if defined(HAVE_SLUDIST_)
use mld_z_sludist_solver
#endif
#if defined(HAVE_SLU_)
use mld_z_slu_solver
#endif
#if defined(HAVE_MUMPS_)
use mld_z_mumps_solver
#endif
Implicit None
! Arguments
class(mld_z_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='z_base_onelev_seti'
type(mld_z_base_smoother_type) :: mld_z_base_smoother_mold
type(mld_z_jac_smoother_type) :: mld_z_jac_smoother_mold
type(mld_z_as_smoother_type) :: mld_z_as_smoother_mold
type(mld_z_diag_solver_type) :: mld_z_diag_solver_mold
type(mld_z_ilu_solver_type) :: mld_z_ilu_solver_mold
type(mld_z_id_solver_type) :: mld_z_id_solver_mold
type(mld_z_gs_solver_type) :: mld_z_gs_solver_mold
type(mld_z_bwgs_solver_type) :: mld_z_bwgs_solver_mold
#if defined(HAVE_UMF_)
type(mld_z_umf_solver_type) :: mld_z_umf_solver_mold
#endif
#if defined(HAVE_SLUDIST_)
type(mld_z_sludist_solver_type) :: mld_z_sludist_solver_mold
#endif
#if defined(HAVE_SLU_)
type(mld_z_slu_solver_type) :: mld_z_slu_solver_mold
#endif
#if defined(HAVE_MUMPS_)
type(mld_z_mumps_solver_type) :: mld_z_mumps_solver_mold
#endif
call psb_erractionsave(err_act)
info = psb_success_
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
select case (what)
case (mld_smoother_type_)
select case (val)
case (mld_noprec_)
call lv%set(mld_z_base_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_z_id_solver_mold,info,pos=pos)
case (mld_jac_)
call lv%set(mld_z_jac_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_z_diag_solver_mold,info,pos=pos)
case (mld_bjac_)
call lv%set(mld_z_jac_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_z_ilu_solver_mold,info,pos=pos)
case (mld_as_)
call lv%set(mld_z_as_smoother_mold,info,pos=pos)
if (info == 0) call lv%set(mld_z_ilu_solver_mold,info,pos=pos)
case (mld_fbgs_)
call lv%set(mld_z_jac_smoother_mold,info,pos='pre')
if (info == 0) call lv%set(mld_z_gs_solver_mold,info,pos='pre')
if (info == 0) call lv%set(mld_z_jac_smoother_mold,info,pos='post')
if (info == 0) call lv%set(mld_z_bwgs_solver_mold,info,pos='post')
case default
!
! Do nothing and hope for the best :)
!
end select
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) call lv%sm%default()
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) call lv%sm2a%default()
end if
case(mld_sub_solve_)
select case (val)
case (mld_f_none_)
call lv%set(mld_z_id_solver_mold,info,pos=pos)
case (mld_diag_scale_)
call lv%set(mld_z_diag_solver_mold,info,pos=pos)
case (mld_gs_)
call lv%set(mld_z_gs_solver_mold,info,pos=pos)
case (mld_bwgs_)
call lv%set(mld_z_bwgs_solver_mold,info,pos=pos)
case (mld_ilu_n_,mld_milu_n_,mld_ilu_t_)
call lv%set(mld_z_ilu_solver_mold,info,pos=pos)
if (info == 0) then
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
call lv%sm%sv%set('SUB_SOLVE',val,info)
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) call lv%sm2a%sv%set('SUB_SOLVE',val,info)
end if
end if
#ifdef HAVE_SLU_
case (mld_slu_)
call lv%set(mld_z_slu_solver_mold,info,pos=pos)
#endif
#ifdef HAVE_MUMPS_
case (mld_mumps_)
call lv%set(mld_z_mumps_solver_mold,info,pos=pos)
#endif
#ifdef HAVE_SLUDIST_
case (mld_sludist_)
call lv%set(mld_z_sludist_solver_mold,info,pos=pos)
#endif
#ifdef HAVE_UMF_
case (mld_umf_)
call lv%set(mld_z_umf_solver_mold,info,pos=pos)
#endif
case default
!
! Do nothing and hope for the best :)
!
end select
case (mld_smoother_sweeps_)
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) &
& lv%parms%sweeps_pre = val
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_)) &
& lv%parms%sweeps_post = val
case (mld_ml_cycle_)
lv%parms%ml_cycle = val
case (mld_par_aggr_alg_)
lv%parms%par_aggr_alg = val
if (allocated(lv%aggr)) then
call lv%aggr%free(info)
if (info == 0) deallocate(lv%aggr,stat=info)
if (info /= 0) then
info = psb_err_internal_error_
return
end if
end if
select case(val)
case(mld_dec_aggr_)
allocate(mld_z_dec_aggregator_type :: lv%aggr, stat=info)
case(mld_sym_dec_aggr_)
allocate(mld_z_symdec_aggregator_type :: lv%aggr, stat=info)
case default
info = psb_err_internal_error_
end select
if (info == psb_success_) call lv%aggr%default()
case (mld_aggr_ord_)
lv%parms%aggr_ord = val
case (mld_aggr_type_)
lv%parms%aggr_type = val
if (allocated(lv%aggr)) call lv%aggr%set_aggr_type(lv%parms,info)
case (mld_aggr_prol_)
lv%parms%aggr_prol = val
case (mld_coarse_mat_)
lv%parms%coarse_mat = val
case (mld_aggr_omega_alg_)
lv%parms%aggr_omega_alg= val
case (mld_aggr_eig_)
lv%parms%aggr_eig = val
case (mld_aggr_filter_)
lv%parms%aggr_filter = val
case (mld_coarse_solve_)
lv%parms%coarse_solve = val
case default
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end select
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_z_base_onelev_seti
@@ -1,104 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_onelev_setr(lv,what,val,info,pos)
use psb_base_mod
use mld_z_onelev_mod, mld_protect_name => mld_z_base_onelev_setr
Implicit None
! Arguments
class(mld_z_onelev_type), intent(inout) :: lv
integer(psb_ipk_), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
character(len=*), optional, intent(in) :: pos
! Local
integer(psb_ipk_) :: ipos_, err_act
character(len=20) :: name='z_base_onelev_setr'
call psb_erractionsave(err_act)
info = psb_success_
select case (what)
case (mld_aggr_omega_val_)
lv%parms%aggr_omega_val= val
case (mld_aggr_thresh_)
lv%parms%aggr_thresh = val
case default
if (present(pos)) then
select case(psb_toupper(trim(pos)))
case('PRE')
ipos_ = mld_smooth_pre_
case('POST')
ipos_ = mld_smooth_post_
case default
ipos_ = mld_smooth_both_
end select
else
ipos_ = mld_smooth_both_
end if
if ((ipos_==mld_smooth_pre_) .or.(ipos_==mld_smooth_both_)) then
if (allocated(lv%sm)) then
call lv%sm%set(what,val,info)
end if
end if
if ((ipos_==mld_smooth_post_).or.(ipos_==mld_smooth_both_))then
if (allocated(lv%sm2a)) then
call lv%sm2a%set(what,val,info)
end if
end if
end select
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_z_base_onelev_setr
+15 -8
View File
@@ -228,13 +228,18 @@ subroutine mld_c_hierarchy_bld(a,desc_a,prec,info)
& prec%precv(i)%sm,prec%precv(i)%sm2a,info)
if (info == 0) call move_alloc(prec%precv(i)%aggr,tprecv(i)%aggr)
end do
! Further intermediates, if any
do i=iszv-1, nplevs - 1
if (info == 0) tprecv(i)%parms = medparms
if (info == 0) call restore_smoothers(tprecv(i),med_sm,med_sm2,info)
if ((info == 0).and..not.allocated(tprecv(i)%aggr))&
& allocate(tprecv(i)%aggr,source=tprecv(iszv-1)%aggr,stat=info)
end do
if (iszv < nplevs) then
allocate(tmp_aggr,source=tprecv(iszv-1)%aggr,stat=info)
! Further intermediates, if any
do i=iszv, nplevs - 1
if (info == 0) tprecv(i)%parms = medparms
if (info == 0) call restore_smoothers(tprecv(i),med_sm,med_sm2,info)
if ((info == 0).and..not.allocated(tprecv(i)%aggr))&
& allocate(tprecv(i)%aggr,source=tmp_aggr,stat=info)
end do
deallocate(tmp_aggr,stat=info)
end if
! Then coarse
if (info == 0) tprecv(nplevs)%parms = coarseparms
if (info == 0) call restore_smoothers(tprecv(nplevs),coarse_sm,coarse_sm2,info)
@@ -242,7 +247,8 @@ subroutine mld_c_hierarchy_bld(a,desc_a,prec,info)
if (nplevs <= iszv) then
allocate(tprecv(nplevs)%aggr,source=prec%precv(nplevs)%aggr,stat=info)
else
allocate(tprecv(nplevs)%aggr,source=tprecv(nplevs-1)%aggr,stat=info)
allocate(tmp_aggr,source=tprecv(nplevs-1)%aggr,stat=info)
call move_alloc(tmp_aggr,tprecv(nplevs)%aggr)
end if
end if
if (info /= psb_success_) then
@@ -440,6 +446,7 @@ subroutine mld_c_hierarchy_bld(a,desc_a,prec,info)
iszv = size(prec%precv)
call prec%cmp_complexity()
call prec%cmp_avg_cr()
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
+14 -11
View File
@@ -75,7 +75,7 @@
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_ccprecseti(p,what,val,info,ilev,ilmax,pos)
subroutine mld_ccprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_c_prec_mod, mld_protect_name => mld_ccprecseti
@@ -102,6 +102,7 @@ subroutine mld_ccprecseti(p,what,val,info,ilev,ilmax,pos)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_, nlev_, ilmax_, il
@@ -283,7 +284,7 @@ subroutine mld_ccprecseti(p,what,val,info,ilev,ilmax,pos)
case default
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
end select
@@ -410,7 +411,7 @@ subroutine mld_ccprecseti(p,what,val,info,ilev,ilmax,pos)
case default
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
call p%precv(ilev_)%set(what,val,info,pos=pos,idx=idx)
end do
end select
@@ -457,7 +458,7 @@ end subroutine mld_ccprecseti
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_ccprecsetc(p,what,string,info,ilev,ilmax,pos)
subroutine mld_ccprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_c_prec_mod, mld_protect_name => mld_ccprecsetc
@@ -470,7 +471,8 @@ subroutine mld_ccprecsetc(p,what,string,info,ilev,ilmax,pos)
character(len=*), intent(in) :: string
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
@@ -486,7 +488,7 @@ subroutine mld_ccprecsetc(p,what,string,info,ilev,ilmax,pos)
if (val >=0) then
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos)
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos,idx=idx)
else
nlev_ = size(p%precv)
@@ -515,7 +517,7 @@ subroutine mld_ccprecsetc(p,what,string,info,ilev,ilmax,pos)
return
endif
do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos)
call p%precv(il)%set(what,string,info,pos=pos,idx=idx)
end do
end if
@@ -560,7 +562,7 @@ end subroutine mld_ccprecsetc
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_ccprecsetr(p,what,val,info,ilev,ilmax,pos)
subroutine mld_ccprecsetr(p,what,val,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_c_prec_mod, mld_protect_name => mld_ccprecsetr
@@ -573,7 +575,8 @@ subroutine mld_ccprecsetr(p,what,val,info,ilev,ilmax,pos)
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_,nlev_, ilmax_, il
@@ -634,7 +637,7 @@ subroutine mld_ccprecsetr(p,what,val,info,ilev,ilmax,pos)
if (present(ilev)) then
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
else if (.not.present(ilev)) then
@@ -650,7 +653,7 @@ subroutine mld_ccprecsetr(p,what,val,info,ilev,ilmax,pos)
case default
do il=1,nlev_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
end select
+1
View File
@@ -172,6 +172,7 @@ subroutine mld_cfile_prec_descr(prec,iout,root)
write(iout_,*) 'Multilevel hierarchy: '
write(iout_,*) ' Number of levels : ',nlev
write(iout_,*) ' Operator complexity: ',prec%get_complexity()
write(iout_,*) ' Average coarsening : ',prec%get_avg_cr()
ilmin = 2
if (nlev == 2) ilmin=1
do ilev=ilmin,nlev
+6 -4
View File
@@ -366,8 +366,9 @@ subroutine mld_cprecaply2_vect(prec,x,y,desc_data,info,trans,work)
if (size(prec%precv) >1) then
!
! Number of levels > 1: apply the multilevel preconditioner
!
call mld_mlprec_aply(cone,prec,x,czero,y,desc_data,trans_,work_,info)
!
! FIXME: generic name causes an ICE with Intel
call mld_cmlprec_aply_vect(cone,prec,x,czero,y,desc_data,trans_,work_,info)
if(info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_cmlprec_aply')
@@ -516,8 +517,9 @@ subroutine mld_cprecaply1_vect(prec,x,desc_data,info,trans,work)
if (size(prec%precv) >1) then
!
! Number of levels > 1: apply the multilevel preconditioner
!
call mld_mlprec_aply(cone,prec,x,czero,ww,desc_data,trans_,work_,info)
!
! FIXME: generic name causes an ICE with Intel
call mld_cmlprec_aply_vect(cone,prec,x,czero,ww,desc_data,trans_,work_,info)
if (info == 0) call psb_geaxpby(cone,ww,czero,x,desc_data,info)
if(info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_cmlprec_aply')
+3 -1
View File
@@ -83,7 +83,7 @@
! info - integer, output.
! Error code.
!
subroutine mld_cprecinit(prec,ptype,info)
subroutine mld_cprecinit(ictxt,prec,ptype,info)
use psb_base_mod
use mld_c_prec_mod, mld_protect_name => mld_cprecinit
@@ -101,6 +101,7 @@ subroutine mld_cprecinit(prec,ptype,info)
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ictxt
class(mld_cprec_type), intent(inout) :: prec
character(len=*), intent(in) :: ptype
integer(psb_ipk_), intent(out) :: info
@@ -117,6 +118,7 @@ subroutine mld_cprecinit(prec,ptype,info)
! Do we want to do something?
endif
endif
prec%ictxt = ictxt
prec%min_coarse_size = -1
select case(psb_toupper(ptype(1:len_trim(ptype))))
-627
View File
@@ -37,385 +37,6 @@
!
! File: mld_cprecset.f90
!
! Subroutine: mld_cprecseti
! Version: complex
!
! This routine sets the integer parameters defining the preconditioner. More
! precisely, the integer parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set character and complex parameters, see mld_cprecsetc and mld_cprecsetr,
! respectively.
!
!
! Arguments:
! p - type(mld_cprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! val - integer, input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_cprecseti(p,what,val,info,ilev,ilmax,pos)
use psb_base_mod
use mld_c_prec_mod, mld_protect_name => mld_cprecseti
use mld_c_jac_smoother
use mld_c_as_smoother
use mld_c_diag_solver
use mld_c_ilu_solver
use mld_c_id_solver
use mld_c_gs_solver
#if defined(HAVE_SLU_)
use mld_c_slu_solver
#endif
#if defined(HAVE_MUMPS_)
use mld_c_mumps_solver
#endif
implicit none
! Arguments
class(mld_cprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_, nlev_, ilmax_, il
character(len=*), parameter :: name='mld_precseti'
info = psb_success_
if (.not.allocated(p%precv)) then
info = 3111
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
select case(what)
case (mld_min_coarse_size_)
p%min_coarse_size = max(val,-1)
return
case(mld_max_levs_)
p%max_levs = max(val,1)
return
case(mld_outer_sweeps_)
p%outer_sweeps = max(val,1)
return
end select
!
! Set preconditioner parameters at level ilev.
!
if (present(ilev)) then
select case(what)
case(mld_smoother_type_,mld_sub_solve_,mld_smoother_sweeps_,&
& mld_ml_cycle_,mld_par_aggr_alg_,mld_aggr_ord_,mld_aggr_type_,&
& mld_aggr_prol_, mld_aggr_omega_alg_,mld_aggr_eig_,&
& mld_sub_restr_,mld_sub_prol_, &
& mld_sub_ovr_,mld_sub_fillin_,&
& mld_coarse_mat_)
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(ilev_)%set(mld_sub_solve_,val,info,pos=pos)
case(mld_coarse_solve_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_coarse_solve_,val,info,pos=pos)
select case (val)
case(mld_bjac_)
call p%precv(nlev_)%set(mld_smoother_type_,val,info,pos=pos)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
case(mld_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_ilu_n_, mld_ilu_t_,mld_milu_n_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
case(mld_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_umf_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_sludist_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_jac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
end select
endif
case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_smoother_sweeps_,val,info,pos=pos)
case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_sub_fillin_,val,info,pos=pos)
case default
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
end select
else if (.not.present(ilev)) then
!
! ilev not specified: set preconditioner parameters at all the appropriate
! levels
!
select case(what)
case(mld_sub_solve_,mld_sub_restr_,mld_sub_prol_,&
& mld_sub_ovr_,mld_sub_fillin_,&
& mld_smoother_sweeps_,mld_smoother_type_)
do ilev_=1,max(1,nlev_-1)
call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return
end do
case(mld_ml_cycle_,mld_par_aggr_alg_,mld_aggr_ord_,mld_aggr_type_,mld_aggr_prol_,&
& mld_aggr_eig_,mld_aggr_filter_)
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
end do
case(mld_coarse_mat_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_coarse_mat_,val,info,pos=pos)
end if
case(mld_coarse_solve_)
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(mld_bjac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info)
case(mld_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_ilu_n_, mld_ilu_t_,mld_milu_n_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
case(mld_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_umf_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_sludist_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_jac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
end select
endif
case(mld_coarse_subsolve_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
endif
case(mld_coarse_sweeps_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_smoother_sweeps_,val,info,pos=pos)
end if
case(mld_coarse_fillin_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_sub_fillin_,val,info,pos=pos)
end if
case default
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
end do
end select
endif
end subroutine mld_cprecseti
subroutine mld_cprecsetsm(p,val,info,ilev,ilmax,pos)
use psb_base_mod
@@ -606,251 +227,3 @@ subroutine mld_cprecsetag(p,val,info,ilev,ilmax,pos)
end subroutine mld_cprecsetag
!
! Subroutine: mld_cprecsetc
! Version: complex
!
! This routine sets the character parameters defining the preconditioner. More
! precisely, the character parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set integer and complex parameters, see mld_cprecseti and mld_cprecsetr,
! respectively.
!
!
! Arguments:
! p - type(mld_cprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! string - character(len=*), input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_cprecsetc(p,what,string,info,ilev,ilmax,pos)
use psb_base_mod
use mld_c_prec_mod, mld_protect_name => mld_cprecsetc
implicit none
! Arguments
class(mld_cprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: string
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
character(len=*), parameter :: name='mld_precsetc'
info = psb_success_
if (.not.allocated(p%precv)) then
info = 3111
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
else
ilev_ = 1
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
info = -1
return
endif
val = mld_stringval(string)
if (val >=0) then
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos)
else
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos)
end do
end if
end subroutine mld_cprecsetc
!
! Subroutine: mld_cprecsetr
! Version: complex
!
! This routine sets the complex parameters defining the preconditioner. More
! precisely, the complex parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set integer and character parameters, see mld_cprecseti and mld_cprecsetc,
! respectively.
!
! Arguments:
! p - type(mld_cprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! val - real(psb_spk_), input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_cprecsetr(p,what,val,info,ilev,ilmax,pos)
use psb_base_mod
use mld_c_prec_mod, mld_protect_name => mld_cprecsetr
implicit none
! Arguments
class(mld_cprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_,nlev_, ilmax_, il
real(psb_spk_) :: thr
character(len=*), parameter :: name='mld_precsetr'
info = psb_success_
select case(what)
case (mld_min_cr_ratio_)
p%min_cr_ratio = max(sone,val)
return
end select
if (.not.allocated(p%precv)) then
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
info = 3111
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
!
! Set preconditioner parameters at level ilev.
!
if (present(ilev)) then
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
else if (.not.present(ilev)) then
!
! ilev not specified: set preconditioner parameters at all the appropriate levels
!
select case(what)
case(mld_coarse_iluthrs_)
ilev_=nlev_
call p%precv(ilev_)%set(mld_sub_iluthrs_,val,info,pos=pos)
case default
do il=1,nlev_
call p%precv(il)%set(what,val,info,pos=pos)
end do
end select
endif
end subroutine mld_cprecsetr
+15 -8
View File
@@ -228,13 +228,18 @@ subroutine mld_d_hierarchy_bld(a,desc_a,prec,info)
& prec%precv(i)%sm,prec%precv(i)%sm2a,info)
if (info == 0) call move_alloc(prec%precv(i)%aggr,tprecv(i)%aggr)
end do
! Further intermediates, if any
do i=iszv-1, nplevs - 1
if (info == 0) tprecv(i)%parms = medparms
if (info == 0) call restore_smoothers(tprecv(i),med_sm,med_sm2,info)
if ((info == 0).and..not.allocated(tprecv(i)%aggr))&
& allocate(tprecv(i)%aggr,source=tprecv(iszv-1)%aggr,stat=info)
end do
if (iszv < nplevs) then
allocate(tmp_aggr,source=tprecv(iszv-1)%aggr,stat=info)
! Further intermediates, if any
do i=iszv, nplevs - 1
if (info == 0) tprecv(i)%parms = medparms
if (info == 0) call restore_smoothers(tprecv(i),med_sm,med_sm2,info)
if ((info == 0).and..not.allocated(tprecv(i)%aggr))&
& allocate(tprecv(i)%aggr,source=tmp_aggr,stat=info)
end do
deallocate(tmp_aggr,stat=info)
end if
! Then coarse
if (info == 0) tprecv(nplevs)%parms = coarseparms
if (info == 0) call restore_smoothers(tprecv(nplevs),coarse_sm,coarse_sm2,info)
@@ -242,7 +247,8 @@ subroutine mld_d_hierarchy_bld(a,desc_a,prec,info)
if (nplevs <= iszv) then
allocate(tprecv(nplevs)%aggr,source=prec%precv(nplevs)%aggr,stat=info)
else
allocate(tprecv(nplevs)%aggr,source=tprecv(nplevs-1)%aggr,stat=info)
allocate(tmp_aggr,source=tprecv(nplevs-1)%aggr,stat=info)
call move_alloc(tmp_aggr,tprecv(nplevs)%aggr)
end if
end if
if (info /= psb_success_) then
@@ -440,6 +446,7 @@ subroutine mld_d_hierarchy_bld(a,desc_a,prec,info)
iszv = size(prec%precv)
call prec%cmp_complexity()
call prec%cmp_avg_cr()
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
+14 -11
View File
@@ -75,7 +75,7 @@
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_dcprecseti(p,what,val,info,ilev,ilmax,pos)
subroutine mld_dcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_d_prec_mod, mld_protect_name => mld_dcprecseti
@@ -108,6 +108,7 @@ subroutine mld_dcprecseti(p,what,val,info,ilev,ilmax,pos)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_, nlev_, ilmax_, il
@@ -303,7 +304,7 @@ subroutine mld_dcprecseti(p,what,val,info,ilev,ilmax,pos)
case default
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
end select
@@ -444,7 +445,7 @@ subroutine mld_dcprecseti(p,what,val,info,ilev,ilmax,pos)
case default
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
call p%precv(ilev_)%set(what,val,info,pos=pos,idx=idx)
end do
end select
@@ -491,7 +492,7 @@ end subroutine mld_dcprecseti
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_dcprecsetc(p,what,string,info,ilev,ilmax,pos)
subroutine mld_dcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_d_prec_mod, mld_protect_name => mld_dcprecsetc
@@ -504,7 +505,8 @@ subroutine mld_dcprecsetc(p,what,string,info,ilev,ilmax,pos)
character(len=*), intent(in) :: string
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
@@ -520,7 +522,7 @@ subroutine mld_dcprecsetc(p,what,string,info,ilev,ilmax,pos)
if (val >=0) then
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos)
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos,idx=idx)
else
nlev_ = size(p%precv)
@@ -549,7 +551,7 @@ subroutine mld_dcprecsetc(p,what,string,info,ilev,ilmax,pos)
return
endif
do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos)
call p%precv(il)%set(what,string,info,pos=pos,idx=idx)
end do
end if
@@ -594,7 +596,7 @@ end subroutine mld_dcprecsetc
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_dcprecsetr(p,what,val,info,ilev,ilmax,pos)
subroutine mld_dcprecsetr(p,what,val,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_d_prec_mod, mld_protect_name => mld_dcprecsetr
@@ -607,7 +609,8 @@ subroutine mld_dcprecsetr(p,what,val,info,ilev,ilmax,pos)
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_,nlev_, ilmax_, il
@@ -668,7 +671,7 @@ subroutine mld_dcprecsetr(p,what,val,info,ilev,ilmax,pos)
if (present(ilev)) then
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
else if (.not.present(ilev)) then
@@ -684,7 +687,7 @@ subroutine mld_dcprecsetr(p,what,val,info,ilev,ilmax,pos)
case default
do il=1,nlev_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
end select
+1
View File
@@ -172,6 +172,7 @@ subroutine mld_dfile_prec_descr(prec,iout,root)
write(iout_,*) 'Multilevel hierarchy: '
write(iout_,*) ' Number of levels : ',nlev
write(iout_,*) ' Operator complexity: ',prec%get_complexity()
write(iout_,*) ' Average coarsening : ',prec%get_avg_cr()
ilmin = 2
if (nlev == 2) ilmin=1
do ilev=ilmin,nlev
+6 -4
View File
@@ -366,8 +366,9 @@ subroutine mld_dprecaply2_vect(prec,x,y,desc_data,info,trans,work)
if (size(prec%precv) >1) then
!
! Number of levels > 1: apply the multilevel preconditioner
!
call mld_mlprec_aply(done,prec,x,dzero,y,desc_data,trans_,work_,info)
!
! FIXME: generic name causes an ICE with Intel
call mld_dmlprec_aply_vect(done,prec,x,dzero,y,desc_data,trans_,work_,info)
if(info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_dmlprec_aply')
@@ -516,8 +517,9 @@ subroutine mld_dprecaply1_vect(prec,x,desc_data,info,trans,work)
if (size(prec%precv) >1) then
!
! Number of levels > 1: apply the multilevel preconditioner
!
call mld_mlprec_aply(done,prec,x,dzero,ww,desc_data,trans_,work_,info)
!
! FIXME: generic name causes an ICE with Intel
call mld_dmlprec_aply_vect(done,prec,x,dzero,ww,desc_data,trans_,work_,info)
if (info == 0) call psb_geaxpby(done,ww,dzero,x,desc_data,info)
if(info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_dmlprec_aply')
+3 -1
View File
@@ -83,7 +83,7 @@
! info - integer, output.
! Error code.
!
subroutine mld_dprecinit(prec,ptype,info)
subroutine mld_dprecinit(ictxt,prec,ptype,info)
use psb_base_mod
use mld_d_prec_mod, mld_protect_name => mld_dprecinit
@@ -104,6 +104,7 @@ subroutine mld_dprecinit(prec,ptype,info)
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ictxt
class(mld_dprec_type), intent(inout) :: prec
character(len=*), intent(in) :: ptype
integer(psb_ipk_), intent(out) :: info
@@ -120,6 +121,7 @@ subroutine mld_dprecinit(prec,ptype,info)
! Do we want to do something?
endif
endif
prec%ictxt = ictxt
prec%min_coarse_size = -1
select case(psb_toupper(ptype(1:len_trim(ptype))))
-660
View File
@@ -37,418 +37,6 @@
!
! File: mld_dprecset.f90
!
! Subroutine: mld_dprecseti
! Version: real
!
! This routine sets the integer parameters defining the preconditioner. More
! precisely, the integer parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set character and real parameters, see mld_dprecsetc and mld_dprecsetr,
! respectively.
!
!
! Arguments:
! p - type(mld_dprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! val - integer, input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_dprecseti(p,what,val,info,ilev,ilmax,pos)
use psb_base_mod
use mld_d_prec_mod, mld_protect_name => mld_dprecseti
use mld_d_jac_smoother
use mld_d_as_smoother
use mld_d_diag_solver
use mld_d_ilu_solver
use mld_d_id_solver
use mld_d_gs_solver
#if defined(HAVE_UMF_)
use mld_d_umf_solver
#endif
#if defined(HAVE_SLUDIST_)
use mld_d_sludist_solver
#endif
#if defined(HAVE_SLU_)
use mld_d_slu_solver
#endif
#if defined(HAVE_MUMPS_)
use mld_d_mumps_solver
#endif
implicit none
! Arguments
class(mld_dprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_, nlev_, ilmax_, il
character(len=*), parameter :: name='mld_precseti'
info = psb_success_
if (.not.allocated(p%precv)) then
info = 3111
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
select case(what)
case (mld_min_coarse_size_)
p%min_coarse_size = max(val,-1)
return
case(mld_max_levs_)
p%max_levs = max(val,1)
return
case(mld_outer_sweeps_)
p%outer_sweeps = max(val,1)
return
end select
!
! Set preconditioner parameters at level ilev.
!
if (present(ilev)) then
select case(what)
case(mld_smoother_type_,mld_sub_solve_,mld_smoother_sweeps_,&
& mld_ml_cycle_,mld_par_aggr_alg_,mld_aggr_ord_,mld_aggr_type_,&
& mld_aggr_prol_, mld_aggr_omega_alg_,mld_aggr_eig_,&
& mld_sub_restr_,mld_sub_prol_, &
& mld_sub_ovr_,mld_sub_fillin_,&
& mld_coarse_mat_)
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(ilev_)%set(mld_sub_solve_,val,info,pos=pos)
case(mld_coarse_solve_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_coarse_solve_,val,info,pos=pos)
select case (val)
case(mld_bjac_)
call p%precv(nlev_)%set(mld_smoother_type_,val,info,pos=pos)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
case(mld_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_ilu_n_, mld_ilu_t_,mld_milu_n_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
case(mld_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_umf_)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_sludist_)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_umf_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_jac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
end select
endif
case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_smoother_sweeps_,val,info,pos=pos)
case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_sub_fillin_,val,info,pos=pos)
case default
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
end select
else if (.not.present(ilev)) then
!
! ilev not specified: set preconditioner parameters at all the appropriate
! levels
!
select case(what)
case(mld_sub_solve_,mld_sub_restr_,mld_sub_prol_,&
& mld_sub_ovr_,mld_sub_fillin_,&
& mld_smoother_sweeps_,mld_smoother_type_)
do ilev_=1,max(1,nlev_-1)
call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return
end do
case(mld_ml_cycle_,mld_par_aggr_alg_,mld_aggr_ord_,mld_aggr_type_,mld_aggr_prol_,&
& mld_aggr_eig_,mld_aggr_filter_)
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
end do
case(mld_coarse_mat_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_coarse_mat_,val,info,pos=pos)
end if
case(mld_coarse_solve_)
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(mld_bjac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info)
case(mld_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_ilu_n_, mld_ilu_t_,mld_milu_n_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
case(mld_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_umf_)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_sludist_)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_umf_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_jac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
end select
endif
case(mld_coarse_subsolve_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
endif
case(mld_coarse_sweeps_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_smoother_sweeps_,val,info,pos=pos)
end if
case(mld_coarse_fillin_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_sub_fillin_,val,info,pos=pos)
end if
case default
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
end do
end select
endif
end subroutine mld_dprecseti
subroutine mld_dprecsetsm(p,val,info,ilev,ilmax,pos)
use psb_base_mod
@@ -639,251 +227,3 @@ subroutine mld_dprecsetag(p,val,info,ilev,ilmax,pos)
end subroutine mld_dprecsetag
!
! Subroutine: mld_dprecsetc
! Version: real
!
! This routine sets the character parameters defining the preconditioner. More
! precisely, the character parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set integer and real parameters, see mld_dprecseti and mld_dprecsetr,
! respectively.
!
!
! Arguments:
! p - type(mld_dprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! string - character(len=*), input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_dprecsetc(p,what,string,info,ilev,ilmax,pos)
use psb_base_mod
use mld_d_prec_mod, mld_protect_name => mld_dprecsetc
implicit none
! Arguments
class(mld_dprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: string
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
character(len=*), parameter :: name='mld_precsetc'
info = psb_success_
if (.not.allocated(p%precv)) then
info = 3111
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
else
ilev_ = 1
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
info = -1
return
endif
val = mld_stringval(string)
if (val >=0) then
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos)
else
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos)
end do
end if
end subroutine mld_dprecsetc
!
! Subroutine: mld_dprecsetr
! Version: real
!
! This routine sets the real parameters defining the preconditioner. More
! precisely, the real parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set integer and character parameters, see mld_dprecseti and mld_dprecsetc,
! respectively.
!
! Arguments:
! p - type(mld_dprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! val - real(psb_dpk_), input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_dprecsetr(p,what,val,info,ilev,ilmax,pos)
use psb_base_mod
use mld_d_prec_mod, mld_protect_name => mld_dprecsetr
implicit none
! Arguments
class(mld_dprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_,nlev_, ilmax_, il
real(psb_dpk_) :: thr
character(len=*), parameter :: name='mld_precsetr'
info = psb_success_
select case(what)
case (mld_min_cr_ratio_)
p%min_cr_ratio = max(done,val)
return
end select
if (.not.allocated(p%precv)) then
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
info = 3111
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
!
! Set preconditioner parameters at level ilev.
!
if (present(ilev)) then
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
else if (.not.present(ilev)) then
!
! ilev not specified: set preconditioner parameters at all the appropriate levels
!
select case(what)
case(mld_coarse_iluthrs_)
ilev_=nlev_
call p%precv(ilev_)%set(mld_sub_iluthrs_,val,info,pos=pos)
case default
do il=1,nlev_
call p%precv(il)%set(what,val,info,pos=pos)
end do
end select
endif
end subroutine mld_dprecsetr
+15 -8
View File
@@ -228,13 +228,18 @@ subroutine mld_s_hierarchy_bld(a,desc_a,prec,info)
& prec%precv(i)%sm,prec%precv(i)%sm2a,info)
if (info == 0) call move_alloc(prec%precv(i)%aggr,tprecv(i)%aggr)
end do
! Further intermediates, if any
do i=iszv-1, nplevs - 1
if (info == 0) tprecv(i)%parms = medparms
if (info == 0) call restore_smoothers(tprecv(i),med_sm,med_sm2,info)
if ((info == 0).and..not.allocated(tprecv(i)%aggr))&
& allocate(tprecv(i)%aggr,source=tprecv(iszv-1)%aggr,stat=info)
end do
if (iszv < nplevs) then
allocate(tmp_aggr,source=tprecv(iszv-1)%aggr,stat=info)
! Further intermediates, if any
do i=iszv, nplevs - 1
if (info == 0) tprecv(i)%parms = medparms
if (info == 0) call restore_smoothers(tprecv(i),med_sm,med_sm2,info)
if ((info == 0).and..not.allocated(tprecv(i)%aggr))&
& allocate(tprecv(i)%aggr,source=tmp_aggr,stat=info)
end do
deallocate(tmp_aggr,stat=info)
end if
! Then coarse
if (info == 0) tprecv(nplevs)%parms = coarseparms
if (info == 0) call restore_smoothers(tprecv(nplevs),coarse_sm,coarse_sm2,info)
@@ -242,7 +247,8 @@ subroutine mld_s_hierarchy_bld(a,desc_a,prec,info)
if (nplevs <= iszv) then
allocate(tprecv(nplevs)%aggr,source=prec%precv(nplevs)%aggr,stat=info)
else
allocate(tprecv(nplevs)%aggr,source=tprecv(nplevs-1)%aggr,stat=info)
allocate(tmp_aggr,source=tprecv(nplevs-1)%aggr,stat=info)
call move_alloc(tmp_aggr,tprecv(nplevs)%aggr)
end if
end if
if (info /= psb_success_) then
@@ -440,6 +446,7 @@ subroutine mld_s_hierarchy_bld(a,desc_a,prec,info)
iszv = size(prec%precv)
call prec%cmp_complexity()
call prec%cmp_avg_cr()
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
+14 -11
View File
@@ -75,7 +75,7 @@
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_scprecseti(p,what,val,info,ilev,ilmax,pos)
subroutine mld_scprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_s_prec_mod, mld_protect_name => mld_scprecseti
@@ -102,6 +102,7 @@ subroutine mld_scprecseti(p,what,val,info,ilev,ilmax,pos)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_, nlev_, ilmax_, il
@@ -283,7 +284,7 @@ subroutine mld_scprecseti(p,what,val,info,ilev,ilmax,pos)
case default
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
end select
@@ -410,7 +411,7 @@ subroutine mld_scprecseti(p,what,val,info,ilev,ilmax,pos)
case default
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
call p%precv(ilev_)%set(what,val,info,pos=pos,idx=idx)
end do
end select
@@ -457,7 +458,7 @@ end subroutine mld_scprecseti
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_scprecsetc(p,what,string,info,ilev,ilmax,pos)
subroutine mld_scprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_s_prec_mod, mld_protect_name => mld_scprecsetc
@@ -470,7 +471,8 @@ subroutine mld_scprecsetc(p,what,string,info,ilev,ilmax,pos)
character(len=*), intent(in) :: string
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
@@ -486,7 +488,7 @@ subroutine mld_scprecsetc(p,what,string,info,ilev,ilmax,pos)
if (val >=0) then
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos)
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos,idx=idx)
else
nlev_ = size(p%precv)
@@ -515,7 +517,7 @@ subroutine mld_scprecsetc(p,what,string,info,ilev,ilmax,pos)
return
endif
do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos)
call p%precv(il)%set(what,string,info,pos=pos,idx=idx)
end do
end if
@@ -560,7 +562,7 @@ end subroutine mld_scprecsetc
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_scprecsetr(p,what,val,info,ilev,ilmax,pos)
subroutine mld_scprecsetr(p,what,val,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_s_prec_mod, mld_protect_name => mld_scprecsetr
@@ -573,7 +575,8 @@ subroutine mld_scprecsetr(p,what,val,info,ilev,ilmax,pos)
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_,nlev_, ilmax_, il
@@ -634,7 +637,7 @@ subroutine mld_scprecsetr(p,what,val,info,ilev,ilmax,pos)
if (present(ilev)) then
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
else if (.not.present(ilev)) then
@@ -650,7 +653,7 @@ subroutine mld_scprecsetr(p,what,val,info,ilev,ilmax,pos)
case default
do il=1,nlev_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
end select
+1
View File
@@ -172,6 +172,7 @@ subroutine mld_sfile_prec_descr(prec,iout,root)
write(iout_,*) 'Multilevel hierarchy: '
write(iout_,*) ' Number of levels : ',nlev
write(iout_,*) ' Operator complexity: ',prec%get_complexity()
write(iout_,*) ' Average coarsening : ',prec%get_avg_cr()
ilmin = 2
if (nlev == 2) ilmin=1
do ilev=ilmin,nlev
+6 -4
View File
@@ -366,8 +366,9 @@ subroutine mld_sprecaply2_vect(prec,x,y,desc_data,info,trans,work)
if (size(prec%precv) >1) then
!
! Number of levels > 1: apply the multilevel preconditioner
!
call mld_mlprec_aply(sone,prec,x,szero,y,desc_data,trans_,work_,info)
!
! FIXME: generic name causes an ICE with Intel
call mld_smlprec_aply_vect(sone,prec,x,szero,y,desc_data,trans_,work_,info)
if(info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_smlprec_aply')
@@ -516,8 +517,9 @@ subroutine mld_sprecaply1_vect(prec,x,desc_data,info,trans,work)
if (size(prec%precv) >1) then
!
! Number of levels > 1: apply the multilevel preconditioner
!
call mld_mlprec_aply(sone,prec,x,szero,ww,desc_data,trans_,work_,info)
!
! FIXME: generic name causes an ICE with Intel
call mld_smlprec_aply_vect(sone,prec,x,szero,ww,desc_data,trans_,work_,info)
if (info == 0) call psb_geaxpby(sone,ww,szero,x,desc_data,info)
if(info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_smlprec_aply')
+3 -1
View File
@@ -83,7 +83,7 @@
! info - integer, output.
! Error code.
!
subroutine mld_sprecinit(prec,ptype,info)
subroutine mld_sprecinit(ictxt,prec,ptype,info)
use psb_base_mod
use mld_s_prec_mod, mld_protect_name => mld_sprecinit
@@ -101,6 +101,7 @@ subroutine mld_sprecinit(prec,ptype,info)
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ictxt
class(mld_sprec_type), intent(inout) :: prec
character(len=*), intent(in) :: ptype
integer(psb_ipk_), intent(out) :: info
@@ -117,6 +118,7 @@ subroutine mld_sprecinit(prec,ptype,info)
! Do we want to do something?
endif
endif
prec%ictxt = ictxt
prec%min_coarse_size = -1
select case(psb_toupper(ptype(1:len_trim(ptype))))
-627
View File
@@ -37,385 +37,6 @@
!
! File: mld_sprecset.f90
!
! Subroutine: mld_sprecseti
! Version: real
!
! This routine sets the integer parameters defining the preconditioner. More
! precisely, the integer parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set character and real parameters, see mld_sprecsetc and mld_sprecsetr,
! respectively.
!
!
! Arguments:
! p - type(mld_sprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! val - integer, input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_sprecseti(p,what,val,info,ilev,ilmax,pos)
use psb_base_mod
use mld_s_prec_mod, mld_protect_name => mld_sprecseti
use mld_s_jac_smoother
use mld_s_as_smoother
use mld_s_diag_solver
use mld_s_ilu_solver
use mld_s_id_solver
use mld_s_gs_solver
#if defined(HAVE_SLU_)
use mld_s_slu_solver
#endif
#if defined(HAVE_MUMPS_)
use mld_s_mumps_solver
#endif
implicit none
! Arguments
class(mld_sprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_, nlev_, ilmax_, il
character(len=*), parameter :: name='mld_precseti'
info = psb_success_
if (.not.allocated(p%precv)) then
info = 3111
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
select case(what)
case (mld_min_coarse_size_)
p%min_coarse_size = max(val,-1)
return
case(mld_max_levs_)
p%max_levs = max(val,1)
return
case(mld_outer_sweeps_)
p%outer_sweeps = max(val,1)
return
end select
!
! Set preconditioner parameters at level ilev.
!
if (present(ilev)) then
select case(what)
case(mld_smoother_type_,mld_sub_solve_,mld_smoother_sweeps_,&
& mld_ml_cycle_,mld_par_aggr_alg_,mld_aggr_ord_,mld_aggr_type_,&
& mld_aggr_prol_, mld_aggr_omega_alg_,mld_aggr_eig_,&
& mld_sub_restr_,mld_sub_prol_, &
& mld_sub_ovr_,mld_sub_fillin_,&
& mld_coarse_mat_)
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(ilev_)%set(mld_sub_solve_,val,info,pos=pos)
case(mld_coarse_solve_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_coarse_solve_,val,info,pos=pos)
select case (val)
case(mld_bjac_)
call p%precv(nlev_)%set(mld_smoother_type_,val,info,pos=pos)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
case(mld_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_ilu_n_, mld_ilu_t_,mld_milu_n_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
case(mld_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_umf_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_sludist_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_jac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
end select
endif
case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_smoother_sweeps_,val,info,pos=pos)
case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_sub_fillin_,val,info,pos=pos)
case default
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
end select
else if (.not.present(ilev)) then
!
! ilev not specified: set preconditioner parameters at all the appropriate
! levels
!
select case(what)
case(mld_sub_solve_,mld_sub_restr_,mld_sub_prol_,&
& mld_sub_ovr_,mld_sub_fillin_,&
& mld_smoother_sweeps_,mld_smoother_type_)
do ilev_=1,max(1,nlev_-1)
call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return
end do
case(mld_ml_cycle_,mld_par_aggr_alg_,mld_aggr_ord_,mld_aggr_type_,mld_aggr_prol_,&
& mld_aggr_eig_,mld_aggr_filter_)
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
end do
case(mld_coarse_mat_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_coarse_mat_,val,info,pos=pos)
end if
case(mld_coarse_solve_)
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(mld_bjac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info)
case(mld_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_ilu_n_, mld_ilu_t_,mld_milu_n_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
case(mld_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_umf_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_sludist_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_jac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
end select
endif
case(mld_coarse_subsolve_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
endif
case(mld_coarse_sweeps_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_smoother_sweeps_,val,info,pos=pos)
end if
case(mld_coarse_fillin_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_sub_fillin_,val,info,pos=pos)
end if
case default
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
end do
end select
endif
end subroutine mld_sprecseti
subroutine mld_sprecsetsm(p,val,info,ilev,ilmax,pos)
use psb_base_mod
@@ -606,251 +227,3 @@ subroutine mld_sprecsetag(p,val,info,ilev,ilmax,pos)
end subroutine mld_sprecsetag
!
! Subroutine: mld_sprecsetc
! Version: real
!
! This routine sets the character parameters defining the preconditioner. More
! precisely, the character parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set integer and real parameters, see mld_sprecseti and mld_sprecsetr,
! respectively.
!
!
! Arguments:
! p - type(mld_sprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! string - character(len=*), input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_sprecsetc(p,what,string,info,ilev,ilmax,pos)
use psb_base_mod
use mld_s_prec_mod, mld_protect_name => mld_sprecsetc
implicit none
! Arguments
class(mld_sprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: string
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
character(len=*), parameter :: name='mld_precsetc'
info = psb_success_
if (.not.allocated(p%precv)) then
info = 3111
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
else
ilev_ = 1
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
info = -1
return
endif
val = mld_stringval(string)
if (val >=0) then
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos)
else
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos)
end do
end if
end subroutine mld_sprecsetc
!
! Subroutine: mld_sprecsetr
! Version: real
!
! This routine sets the real parameters defining the preconditioner. More
! precisely, the real parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set integer and character parameters, see mld_sprecseti and mld_sprecsetc,
! respectively.
!
! Arguments:
! p - type(mld_sprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! val - real(psb_spk_), input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_sprecsetr(p,what,val,info,ilev,ilmax,pos)
use psb_base_mod
use mld_s_prec_mod, mld_protect_name => mld_sprecsetr
implicit none
! Arguments
class(mld_sprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_,nlev_, ilmax_, il
real(psb_spk_) :: thr
character(len=*), parameter :: name='mld_precsetr'
info = psb_success_
select case(what)
case (mld_min_cr_ratio_)
p%min_cr_ratio = max(sone,val)
return
end select
if (.not.allocated(p%precv)) then
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
info = 3111
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
!
! Set preconditioner parameters at level ilev.
!
if (present(ilev)) then
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
else if (.not.present(ilev)) then
!
! ilev not specified: set preconditioner parameters at all the appropriate levels
!
select case(what)
case(mld_coarse_iluthrs_)
ilev_=nlev_
call p%precv(ilev_)%set(mld_sub_iluthrs_,val,info,pos=pos)
case default
do il=1,nlev_
call p%precv(il)%set(what,val,info,pos=pos)
end do
end select
endif
end subroutine mld_sprecsetr
+15 -8
View File
@@ -228,13 +228,18 @@ subroutine mld_z_hierarchy_bld(a,desc_a,prec,info)
& prec%precv(i)%sm,prec%precv(i)%sm2a,info)
if (info == 0) call move_alloc(prec%precv(i)%aggr,tprecv(i)%aggr)
end do
! Further intermediates, if any
do i=iszv-1, nplevs - 1
if (info == 0) tprecv(i)%parms = medparms
if (info == 0) call restore_smoothers(tprecv(i),med_sm,med_sm2,info)
if ((info == 0).and..not.allocated(tprecv(i)%aggr))&
& allocate(tprecv(i)%aggr,source=tprecv(iszv-1)%aggr,stat=info)
end do
if (iszv < nplevs) then
allocate(tmp_aggr,source=tprecv(iszv-1)%aggr,stat=info)
! Further intermediates, if any
do i=iszv, nplevs - 1
if (info == 0) tprecv(i)%parms = medparms
if (info == 0) call restore_smoothers(tprecv(i),med_sm,med_sm2,info)
if ((info == 0).and..not.allocated(tprecv(i)%aggr))&
& allocate(tprecv(i)%aggr,source=tmp_aggr,stat=info)
end do
deallocate(tmp_aggr,stat=info)
end if
! Then coarse
if (info == 0) tprecv(nplevs)%parms = coarseparms
if (info == 0) call restore_smoothers(tprecv(nplevs),coarse_sm,coarse_sm2,info)
@@ -242,7 +247,8 @@ subroutine mld_z_hierarchy_bld(a,desc_a,prec,info)
if (nplevs <= iszv) then
allocate(tprecv(nplevs)%aggr,source=prec%precv(nplevs)%aggr,stat=info)
else
allocate(tprecv(nplevs)%aggr,source=tprecv(nplevs-1)%aggr,stat=info)
allocate(tmp_aggr,source=tprecv(nplevs-1)%aggr,stat=info)
call move_alloc(tmp_aggr,tprecv(nplevs)%aggr)
end if
end if
if (info /= psb_success_) then
@@ -440,6 +446,7 @@ subroutine mld_z_hierarchy_bld(a,desc_a,prec,info)
iszv = size(prec%precv)
call prec%cmp_complexity()
call prec%cmp_avg_cr()
if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),&
+14 -11
View File
@@ -75,7 +75,7 @@
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_zcprecseti(p,what,val,info,ilev,ilmax,pos)
subroutine mld_zcprecseti(p,what,val,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_z_prec_mod, mld_protect_name => mld_zcprecseti
@@ -108,6 +108,7 @@ subroutine mld_zcprecseti(p,what,val,info,ilev,ilmax,pos)
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_, nlev_, ilmax_, il
@@ -303,7 +304,7 @@ subroutine mld_zcprecseti(p,what,val,info,ilev,ilmax,pos)
case default
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
end select
@@ -444,7 +445,7 @@ subroutine mld_zcprecseti(p,what,val,info,ilev,ilmax,pos)
case default
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
call p%precv(ilev_)%set(what,val,info,pos=pos,idx=idx)
end do
end select
@@ -491,7 +492,7 @@ end subroutine mld_zcprecseti
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_zcprecsetc(p,what,string,info,ilev,ilmax,pos)
subroutine mld_zcprecsetc(p,what,string,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_z_prec_mod, mld_protect_name => mld_zcprecsetc
@@ -504,7 +505,8 @@ subroutine mld_zcprecsetc(p,what,string,info,ilev,ilmax,pos)
character(len=*), intent(in) :: string
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
@@ -520,7 +522,7 @@ subroutine mld_zcprecsetc(p,what,string,info,ilev,ilmax,pos)
if (val >=0) then
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos)
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos,idx=idx)
else
nlev_ = size(p%precv)
@@ -549,7 +551,7 @@ subroutine mld_zcprecsetc(p,what,string,info,ilev,ilmax,pos)
return
endif
do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos)
call p%precv(il)%set(what,string,info,pos=pos,idx=idx)
end do
end if
@@ -594,7 +596,7 @@ end subroutine mld_zcprecsetc
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_zcprecsetr(p,what,val,info,ilev,ilmax,pos)
subroutine mld_zcprecsetr(p,what,val,info,ilev,ilmax,pos,idx)
use psb_base_mod
use mld_z_prec_mod, mld_protect_name => mld_zcprecsetr
@@ -607,7 +609,8 @@ subroutine mld_zcprecsetr(p,what,val,info,ilev,ilmax,pos)
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
character(len=*), optional, intent(in) :: pos
integer(psb_ipk_), intent(in), optional :: idx
! Local variables
integer(psb_ipk_) :: ilev_,nlev_, ilmax_, il
@@ -668,7 +671,7 @@ subroutine mld_zcprecsetr(p,what,val,info,ilev,ilmax,pos)
if (present(ilev)) then
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
else if (.not.present(ilev)) then
@@ -684,7 +687,7 @@ subroutine mld_zcprecsetr(p,what,val,info,ilev,ilmax,pos)
case default
do il=1,nlev_
call p%precv(il)%set(what,val,info,pos=pos)
call p%precv(il)%set(what,val,info,pos=pos,idx=idx)
end do
end select
+1
View File
@@ -172,6 +172,7 @@ subroutine mld_zfile_prec_descr(prec,iout,root)
write(iout_,*) 'Multilevel hierarchy: '
write(iout_,*) ' Number of levels : ',nlev
write(iout_,*) ' Operator complexity: ',prec%get_complexity()
write(iout_,*) ' Average coarsening : ',prec%get_avg_cr()
ilmin = 2
if (nlev == 2) ilmin=1
do ilev=ilmin,nlev
+6 -4
View File
@@ -366,8 +366,9 @@ subroutine mld_zprecaply2_vect(prec,x,y,desc_data,info,trans,work)
if (size(prec%precv) >1) then
!
! Number of levels > 1: apply the multilevel preconditioner
!
call mld_mlprec_aply(zone,prec,x,zzero,y,desc_data,trans_,work_,info)
!
! FIXME: generic name causes an ICE with Intel
call mld_zmlprec_aply_vect(zone,prec,x,zzero,y,desc_data,trans_,work_,info)
if(info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_zmlprec_aply')
@@ -516,8 +517,9 @@ subroutine mld_zprecaply1_vect(prec,x,desc_data,info,trans,work)
if (size(prec%precv) >1) then
!
! Number of levels > 1: apply the multilevel preconditioner
!
call mld_mlprec_aply(zone,prec,x,zzero,ww,desc_data,trans_,work_,info)
!
! FIXME: generic name causes an ICE with Intel
call mld_zmlprec_aply_vect(zone,prec,x,zzero,ww,desc_data,trans_,work_,info)
if (info == 0) call psb_geaxpby(zone,ww,zzero,x,desc_data,info)
if(info /= psb_success_) then
call psb_errpush(psb_err_from_subroutine_,name,a_err='mld_zmlprec_aply')
+3 -1
View File
@@ -83,7 +83,7 @@
! info - integer, output.
! Error code.
!
subroutine mld_zprecinit(prec,ptype,info)
subroutine mld_zprecinit(ictxt,prec,ptype,info)
use psb_base_mod
use mld_z_prec_mod, mld_protect_name => mld_zprecinit
@@ -104,6 +104,7 @@ subroutine mld_zprecinit(prec,ptype,info)
implicit none
! Arguments
integer(psb_ipk_), intent(in) :: ictxt
class(mld_zprec_type), intent(inout) :: prec
character(len=*), intent(in) :: ptype
integer(psb_ipk_), intent(out) :: info
@@ -120,6 +121,7 @@ subroutine mld_zprecinit(prec,ptype,info)
! Do we want to do something?
endif
endif
prec%ictxt = ictxt
prec%min_coarse_size = -1
select case(psb_toupper(ptype(1:len_trim(ptype))))
-660
View File
@@ -37,418 +37,6 @@
!
! File: mld_zprecset.f90
!
! Subroutine: mld_zprecseti
! Version: complex
!
! This routine sets the integer parameters defining the preconditioner. More
! precisely, the integer parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set character and complex parameters, see mld_zprecsetc and mld_zprecsetr,
! respectively.
!
!
! Arguments:
! p - type(mld_zprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! val - integer, input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_zprecseti(p,what,val,info,ilev,ilmax,pos)
use psb_base_mod
use mld_z_prec_mod, mld_protect_name => mld_zprecseti
use mld_z_jac_smoother
use mld_z_as_smoother
use mld_z_diag_solver
use mld_z_ilu_solver
use mld_z_id_solver
use mld_z_gs_solver
#if defined(HAVE_UMF_)
use mld_z_umf_solver
#endif
#if defined(HAVE_SLUDIST_)
use mld_z_sludist_solver
#endif
#if defined(HAVE_SLU_)
use mld_z_slu_solver
#endif
#if defined(HAVE_MUMPS_)
use mld_z_mumps_solver
#endif
implicit none
! Arguments
class(mld_zprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_, nlev_, ilmax_, il
character(len=*), parameter :: name='mld_precseti'
info = psb_success_
if (.not.allocated(p%precv)) then
info = 3111
write(psb_err_unit,*) name,&
& ': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
select case(what)
case (mld_min_coarse_size_)
p%min_coarse_size = max(val,-1)
return
case(mld_max_levs_)
p%max_levs = max(val,1)
return
case(mld_outer_sweeps_)
p%outer_sweeps = max(val,1)
return
end select
!
! Set preconditioner parameters at level ilev.
!
if (present(ilev)) then
select case(what)
case(mld_smoother_type_,mld_sub_solve_,mld_smoother_sweeps_,&
& mld_ml_cycle_,mld_par_aggr_alg_,mld_aggr_ord_,mld_aggr_type_,&
& mld_aggr_prol_, mld_aggr_omega_alg_,mld_aggr_eig_,&
& mld_sub_restr_,mld_sub_prol_, &
& mld_sub_ovr_,mld_sub_fillin_,&
& mld_coarse_mat_)
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
case(mld_coarse_subsolve_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(ilev_)%set(mld_sub_solve_,val,info,pos=pos)
case(mld_coarse_solve_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_coarse_solve_,val,info,pos=pos)
select case (val)
case(mld_bjac_)
call p%precv(nlev_)%set(mld_smoother_type_,val,info,pos=pos)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
case(mld_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_ilu_n_, mld_ilu_t_,mld_milu_n_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
case(mld_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_umf_)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_sludist_)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_umf_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_jac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
end select
endif
case(mld_coarse_sweeps_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_smoother_sweeps_,val,info,pos=pos)
case(mld_coarse_fillin_)
if (ilev_ /= nlev_) then
write(psb_err_unit,*) name,&
& ': Error: Inconsistent specification of WHAT vs. ILEV'
info = -2
return
end if
call p%precv(nlev_)%set(mld_sub_fillin_,val,info,pos=pos)
case default
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
end select
else if (.not.present(ilev)) then
!
! ilev not specified: set preconditioner parameters at all the appropriate
! levels
!
select case(what)
case(mld_sub_solve_,mld_sub_restr_,mld_sub_prol_,&
& mld_sub_ovr_,mld_sub_fillin_,&
& mld_smoother_sweeps_,mld_smoother_type_)
do ilev_=1,max(1,nlev_-1)
call p%precv(ilev_)%set(what,val,info,pos=pos)
if (info /= 0) return
end do
case(mld_ml_cycle_,mld_par_aggr_alg_,mld_aggr_ord_,mld_aggr_type_,mld_aggr_prol_,&
& mld_aggr_eig_,mld_aggr_filter_)
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
end do
case(mld_coarse_mat_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_coarse_mat_,val,info,pos=pos)
end if
case(mld_coarse_solve_)
if (nlev_ > 1) then
call p%precv(nlev_)%set('COARSE_SOLVE',val,info,pos=pos)
select case (val)
case(mld_bjac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_umf_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
#endif
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info)
case(mld_slu_)
#if defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_ilu_n_, mld_ilu_t_,mld_milu_n_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
case(mld_mumps_)
#if defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_umf_)
#if defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_sludist_)
#if defined(HAVE_SLUDIST_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#elif defined(HAVE_UMF_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_umf_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_SLU_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_slu_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_repl_mat_,info,pos=pos)
#elif defined(HAVE_MUMPS_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_mumps_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#else
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_ilu_n_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
#endif
case(mld_jac_)
call p%precv(nlev_)%set(mld_smoother_type_,mld_bjac_,info,pos=pos)
call p%precv(nlev_)%set(mld_sub_solve_,mld_diag_scale_,info,pos=pos)
call p%precv(nlev_)%set(mld_coarse_mat_,mld_distr_mat_,info,pos=pos)
end select
endif
case(mld_coarse_subsolve_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_sub_solve_,val,info,pos=pos)
endif
case(mld_coarse_sweeps_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_smoother_sweeps_,val,info,pos=pos)
end if
case(mld_coarse_fillin_)
if (nlev_ > 1) then
call p%precv(nlev_)%set(mld_sub_fillin_,val,info,pos=pos)
end if
case default
do ilev_=1,nlev_
call p%precv(ilev_)%set(what,val,info,pos=pos)
end do
end select
endif
end subroutine mld_zprecseti
subroutine mld_zprecsetsm(p,val,info,ilev,ilmax,pos)
use psb_base_mod
@@ -639,251 +227,3 @@ subroutine mld_zprecsetag(p,val,info,ilev,ilmax,pos)
end subroutine mld_zprecsetag
!
! Subroutine: mld_zprecsetc
! Version: complex
!
! This routine sets the character parameters defining the preconditioner. More
! precisely, the character parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set integer and complex parameters, see mld_zprecseti and mld_zprecsetr,
! respectively.
!
!
! Arguments:
! p - type(mld_zprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! string - character(len=*), input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_zprecsetc(p,what,string,info,ilev,ilmax,pos)
use psb_base_mod
use mld_z_prec_mod, mld_protect_name => mld_zprecsetc
implicit none
! Arguments
class(mld_zprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: string
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_, nlev_,val,ilmax_, il
character(len=*), parameter :: name='mld_precsetc'
info = psb_success_
if (.not.allocated(p%precv)) then
info = 3111
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
else
ilev_ = 1
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
write(psb_err_unit,*) name,&
& ': Error: invalid ILEV/NLEV combination',ilev_, nlev_
info = -1
return
endif
val = mld_stringval(string)
if (val >=0) then
call p%set(what,val,info,ilev=ilev,ilmax=ilmax,pos=pos)
else
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
do il=ilev_, ilmax_
call p%precv(il)%set(what,string,info,pos=pos)
end do
end if
end subroutine mld_zprecsetc
!
! Subroutine: mld_zprecsetr
! Version: complex
!
! This routine sets the complex parameters defining the preconditioner. More
! precisely, the complex parameter identified by 'what' is assigned the value
! contained in 'val'.
! For the multilevel preconditioners, the levels are numbered in increasing
! order starting from the finest one, i.e. level 1 is the finest level.
!
! To set integer and character parameters, see mld_zprecseti and mld_zprecsetc,
! respectively.
!
! Arguments:
! p - type(mld_zprec_type), input/output.
! The preconditioner data structure.
! what - integer, input.
! The number identifying the parameter to be set.
! A mnemonic constant has been associated to each of these
! numbers, as reported in the MLD2P4 User's and Reference Guide.
! val - real(psb_dpk_), input.
! The value of the parameter to be set. The list of allowed
! values is reported in the MLD2P4 User's and Reference Guide.
! info - integer, output.
! Error code.
! ilev - integer, optional, input.
! For the multilevel preconditioner, the level at which the
! preconditioner parameter has to be set.
! If nlev is not present, the parameter identified by 'what'
! is set at all the appropriate levels.
!
! NOTE: currently, the use of the argument ilev is not "safe" and is reserved to
! MLD2P4 developers. Indeed, by using ilev it is possible to set different values
! of the same parameter at different levels 1,...,nlev-1, even in cases where
! the parameter must have the same value at all the levels but the coarsest one.
! For this reason, the interface mld_precset to this routine has been built in
! such a way that ilev is not visible to the user (see mld_prec_mod.f90).
!
subroutine mld_zprecsetr(p,what,val,info,ilev,ilmax,pos)
use psb_base_mod
use mld_z_prec_mod, mld_protect_name => mld_zprecsetr
implicit none
! Arguments
class(mld_zprec_type), intent(inout) :: p
integer(psb_ipk_), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), optional, intent(in) :: ilev,ilmax
character(len=*), optional, intent(in) :: pos
! Local variables
integer(psb_ipk_) :: ilev_,nlev_, ilmax_, il
real(psb_dpk_) :: thr
character(len=*), parameter :: name='mld_precsetr'
info = psb_success_
select case(what)
case (mld_min_cr_ratio_)
p%min_cr_ratio = max(done,val)
return
end select
if (.not.allocated(p%precv)) then
write(psb_err_unit,*) name,&
&': Error: uninitialized preconditioner,',&
&' should call MLD_PRECINIT'
info = 3111
return
endif
nlev_ = size(p%precv)
if (present(ilev)) then
ilev_ = ilev
if (present(ilmax)) then
ilmax_ = ilmax
else
ilmax_ = ilev_
end if
else
ilev_ = 1
ilmax_ = ilev_
end if
if ((ilev_<1).or.(ilev_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILEV/NLEV combination',ilev_, nlev_
return
endif
if ((ilmax_<1).or.(ilmax_ > nlev_)) then
info = -1
write(psb_err_unit,*) name,&
&': Error: invalid ILMAX/NLEV combination',ilmax_, nlev_
return
endif
!
! Set preconditioner parameters at level ilev.
!
if (present(ilev)) then
do il=ilev_, ilmax_
call p%precv(il)%set(what,val,info,pos=pos)
end do
else if (.not.present(ilev)) then
!
! ilev not specified: set preconditioner parameters at all the appropriate levels
!
select case(what)
case(mld_coarse_iluthrs_)
ilev_=nlev_
call p%precv(ilev_)%set(mld_sub_iluthrs_,val,info,pos=pos)
case default
do il=1,nlev_
call p%precv(il)%set(what,val,info,pos=pos)
end do
end select
endif
end subroutine mld_zprecsetr
-29
View File
@@ -15,12 +15,8 @@ mld_c_as_smoother_clone.o \
mld_c_as_smoother_cnv.o \
mld_c_as_smoother_csetc.o \
mld_c_as_smoother_cseti.o \
mld_c_as_smoother_csetr.o \
mld_c_as_smoother_dmp.o \
mld_c_as_smoother_free.o \
mld_c_as_smoother_setc.o \
mld_c_as_smoother_seti.o \
mld_c_as_smoother_setr.o \
mld_c_as_smoother_prol_a.o \
mld_c_as_smoother_prol_v.o \
mld_c_as_smoother_restr_a.o \
@@ -37,9 +33,6 @@ mld_c_base_smoother_csetr.o \
mld_c_base_smoother_descr.o \
mld_c_base_smoother_dmp.o \
mld_c_base_smoother_free.o \
mld_c_base_smoother_setc.o \
mld_c_base_smoother_seti.o \
mld_c_base_smoother_setr.o \
mld_c_jac_smoother_apply.o \
mld_c_jac_smoother_apply_vect.o \
mld_c_jac_smoother_bld.o \
@@ -55,12 +48,8 @@ mld_d_as_smoother_clone.o \
mld_d_as_smoother_cnv.o \
mld_d_as_smoother_csetc.o \
mld_d_as_smoother_cseti.o \
mld_d_as_smoother_csetr.o \
mld_d_as_smoother_dmp.o \
mld_d_as_smoother_free.o \
mld_d_as_smoother_setc.o \
mld_d_as_smoother_seti.o \
mld_d_as_smoother_setr.o \
mld_d_as_smoother_prol_a.o \
mld_d_as_smoother_prol_v.o \
mld_d_as_smoother_restr_a.o \
@@ -77,9 +66,6 @@ mld_d_base_smoother_csetr.o \
mld_d_base_smoother_descr.o \
mld_d_base_smoother_dmp.o \
mld_d_base_smoother_free.o \
mld_d_base_smoother_setc.o \
mld_d_base_smoother_seti.o \
mld_d_base_smoother_setr.o \
mld_d_jac_smoother_apply.o \
mld_d_jac_smoother_apply_vect.o \
mld_d_jac_smoother_bld.o \
@@ -95,12 +81,8 @@ mld_s_as_smoother_clone.o \
mld_s_as_smoother_cnv.o \
mld_s_as_smoother_csetc.o \
mld_s_as_smoother_cseti.o \
mld_s_as_smoother_csetr.o \
mld_s_as_smoother_dmp.o \
mld_s_as_smoother_free.o \
mld_s_as_smoother_setc.o \
mld_s_as_smoother_seti.o \
mld_s_as_smoother_setr.o \
mld_s_as_smoother_prol_a.o \
mld_s_as_smoother_prol_v.o \
mld_s_as_smoother_restr_a.o \
@@ -117,9 +99,6 @@ mld_s_base_smoother_csetr.o \
mld_s_base_smoother_descr.o \
mld_s_base_smoother_dmp.o \
mld_s_base_smoother_free.o \
mld_s_base_smoother_setc.o \
mld_s_base_smoother_seti.o \
mld_s_base_smoother_setr.o \
mld_s_jac_smoother_apply.o \
mld_s_jac_smoother_apply_vect.o \
mld_s_jac_smoother_bld.o \
@@ -135,12 +114,8 @@ mld_z_as_smoother_clone.o \
mld_z_as_smoother_cnv.o \
mld_z_as_smoother_csetc.o \
mld_z_as_smoother_cseti.o \
mld_z_as_smoother_csetr.o \
mld_z_as_smoother_dmp.o \
mld_z_as_smoother_free.o \
mld_z_as_smoother_setc.o \
mld_z_as_smoother_seti.o \
mld_z_as_smoother_setr.o \
mld_z_as_smoother_prol_a.o \
mld_z_as_smoother_prol_v.o \
mld_z_as_smoother_restr_a.o \
@@ -157,9 +132,6 @@ mld_z_base_smoother_csetr.o \
mld_z_base_smoother_descr.o \
mld_z_base_smoother_dmp.o \
mld_z_base_smoother_free.o \
mld_z_base_smoother_setc.o \
mld_z_base_smoother_seti.o \
mld_z_base_smoother_setr.o \
mld_z_jac_smoother_apply.o \
mld_z_jac_smoother_apply_vect.o \
mld_z_jac_smoother_bld.o \
@@ -168,7 +140,6 @@ mld_z_jac_smoother_dmp.o \
mld_z_jac_smoother_clone.o \
mld_z_jac_smoother_cnv.o
LIBNAME=libmld_prec.a
lib: $(OBJS)
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_as_smoother_csetc(sm,what,val,info)
subroutine mld_c_as_smoother_csetc(sm,what,val,info,idx)
use psb_base_mod
use mld_c_as_smoother, mld_protect_nam => mld_c_as_smoother_csetc
@@ -45,6 +45,7 @@ subroutine mld_c_as_smoother_csetc(sm,what,val,info)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='c_as_smoother_csetc'
@@ -54,9 +55,9 @@ subroutine mld_c_as_smoother_csetc(sm,what,val,info)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
call sm%set(what,ival,info,idx=idx)
else
call sm%mld_c_base_smoother_type%set(what,val,info)
call sm%mld_c_base_smoother_type%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) then
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_as_smoother_cseti(sm,what,val,info)
subroutine mld_c_as_smoother_cseti(sm,what,val,info,idx)
use psb_base_mod
use mld_c_as_smoother, mld_protect_nam => mld_c_as_smoother_cseti
@@ -46,6 +46,7 @@ subroutine mld_c_as_smoother_cseti(sm,what,val,info)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_as_smoother_cseti'
@@ -60,7 +61,7 @@ subroutine mld_c_as_smoother_cseti(sm,what,val,info)
case('SUB_PROL')
sm%prol = val
case default
call sm%mld_c_base_smoother_type%set(what,val,info)
call sm%mld_c_base_smoother_type%set(what,val,info,idx=idx)
end select
call psb_erractionrestore(err_act)
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_as_smoother_csetr(sm,what,val,info)
use psb_base_mod
use mld_c_as_smoother, mld_protect_nam => mld_c_as_smoother_csetr
Implicit None
! Arguments
class(mld_c_as_smoother_type), intent(inout) :: sm
character(len=*), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_as_smoother_csetr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
else
!!$ write(0,*) trim(name),' Missing component, not setting!'
!!$ info = 1121
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_as_smoother_csetr
@@ -1,74 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_as_smoother_setc(sm,what,val,info)
use psb_base_mod
use mld_c_as_smoother, mld_protect_nam => mld_c_as_smoother_setc
Implicit None
! Arguments
class(mld_c_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='c_as_smoother_setc'
info = psb_success_
call psb_erractionsave(err_act)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
else
call sm%mld_c_base_smoother_type%set(what,val,info)
end if
if (info /= psb_success_) then
info = psb_err_from_subroutine_
call psb_errpush(info, name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_as_smoother_setc
@@ -1,72 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_as_smoother_seti(sm,what,val,info)
use psb_base_mod
use mld_c_as_smoother, mld_protect_nam => mld_c_as_smoother_seti
Implicit None
! Arguments
class(mld_c_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_as_smoother_seti'
info = psb_success_
call psb_erractionsave(err_act)
select case(what)
case(mld_sub_ovr_)
sm%novr = val
case(mld_sub_restr_)
sm%restr = val
case(mld_sub_prol_)
sm%prol = val
case default
call sm%mld_c_base_smoother_type%set(what,val,info)
end select
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_as_smoother_seti
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_as_smoother_setr(sm,what,val,info)
use psb_base_mod
use mld_c_as_smoother, mld_protect_nam => mld_c_as_smoother_setr
Implicit None
! Arguments
class(mld_c_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_as_smoother_setr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
else
!!$ write(0,*) trim(name),' Missing component, not setting!'
!!$ info = 1121
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_as_smoother_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_smoother_csetc(sm,what,val,info)
subroutine mld_c_base_smoother_csetc(sm,what,val,info,idx)
use psb_base_mod
use mld_c_base_smoother_mod, mld_protect_name => mld_c_base_smoother_csetc
@@ -46,6 +46,7 @@ subroutine mld_c_base_smoother_csetc(sm,what,val,info)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='c_base_smoother_csetc'
@@ -55,10 +56,10 @@ subroutine mld_c_base_smoother_csetc(sm,what,val,info)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
call sm%set(what,ival,info,idx=idx)
else
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
end if
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_smoother_cseti(sm,what,val,info)
subroutine mld_c_base_smoother_cseti(sm,what,val,info,idx)
use psb_base_mod
use mld_c_base_smoother_mod, mld_protect_name => mld_c_base_smoother_cseti
@@ -45,6 +45,7 @@ subroutine mld_c_base_smoother_cseti(sm,what,val,info)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_base_smoother_cseti'
@@ -52,7 +53,7 @@ subroutine mld_c_base_smoother_cseti(sm,what,val,info)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_smoother_csetr(sm,what,val,info)
subroutine mld_c_base_smoother_csetr(sm,what,val,info,idx)
use psb_base_mod
use mld_c_base_smoother_mod, mld_protect_name => mld_c_base_smoother_csetr
@@ -46,6 +46,7 @@ subroutine mld_c_base_smoother_csetr(sm,what,val,info)
character(len=*), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_base_smoother_csetr'
@@ -55,7 +56,7 @@ subroutine mld_c_base_smoother_csetr(sm,what,val,info)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) goto 9999
@@ -1,73 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_smoother_setc(sm,what,val,info)
use psb_base_mod
use mld_c_base_smoother_mod, mld_protect_name => mld_c_base_smoother_setc
Implicit None
! Arguments
class(mld_c_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='c_base_smoother_setc'
call psb_erractionsave(err_act)
info = psb_success_
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
else
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_base_smoother_setc
@@ -1,64 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_smoother_seti(sm,what,val,info)
use psb_base_mod
use mld_c_base_smoother_mod, mld_protect_name => mld_c_base_smoother_seti
Implicit None
! Arguments
class(mld_c_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_base_smoother_seti'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_base_smoother_seti
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_smoother_setr(sm,what,val,info)
use psb_base_mod
use mld_c_base_smoother_mod, mld_protect_name => mld_c_base_smoother_setr
Implicit None
! Arguments
class(mld_c_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='c_base_smoother_setr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_c_base_smoother_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_as_smoother_csetc(sm,what,val,info)
subroutine mld_d_as_smoother_csetc(sm,what,val,info,idx)
use psb_base_mod
use mld_d_as_smoother, mld_protect_nam => mld_d_as_smoother_csetc
@@ -45,6 +45,7 @@ subroutine mld_d_as_smoother_csetc(sm,what,val,info)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='d_as_smoother_csetc'
@@ -54,9 +55,9 @@ subroutine mld_d_as_smoother_csetc(sm,what,val,info)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
call sm%set(what,ival,info,idx=idx)
else
call sm%mld_d_base_smoother_type%set(what,val,info)
call sm%mld_d_base_smoother_type%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) then
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_as_smoother_cseti(sm,what,val,info)
subroutine mld_d_as_smoother_cseti(sm,what,val,info,idx)
use psb_base_mod
use mld_d_as_smoother, mld_protect_nam => mld_d_as_smoother_cseti
@@ -46,6 +46,7 @@ subroutine mld_d_as_smoother_cseti(sm,what,val,info)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_as_smoother_cseti'
@@ -60,7 +61,7 @@ subroutine mld_d_as_smoother_cseti(sm,what,val,info)
case('SUB_PROL')
sm%prol = val
case default
call sm%mld_d_base_smoother_type%set(what,val,info)
call sm%mld_d_base_smoother_type%set(what,val,info,idx=idx)
end select
call psb_erractionrestore(err_act)
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_as_smoother_csetr(sm,what,val,info)
use psb_base_mod
use mld_d_as_smoother, mld_protect_nam => mld_d_as_smoother_csetr
Implicit None
! Arguments
class(mld_d_as_smoother_type), intent(inout) :: sm
character(len=*), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_as_smoother_csetr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
else
!!$ write(0,*) trim(name),' Missing component, not setting!'
!!$ info = 1121
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_as_smoother_csetr
@@ -1,74 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_as_smoother_setc(sm,what,val,info)
use psb_base_mod
use mld_d_as_smoother, mld_protect_nam => mld_d_as_smoother_setc
Implicit None
! Arguments
class(mld_d_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='d_as_smoother_setc'
info = psb_success_
call psb_erractionsave(err_act)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
else
call sm%mld_d_base_smoother_type%set(what,val,info)
end if
if (info /= psb_success_) then
info = psb_err_from_subroutine_
call psb_errpush(info, name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_as_smoother_setc
@@ -1,72 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_as_smoother_seti(sm,what,val,info)
use psb_base_mod
use mld_d_as_smoother, mld_protect_nam => mld_d_as_smoother_seti
Implicit None
! Arguments
class(mld_d_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_as_smoother_seti'
info = psb_success_
call psb_erractionsave(err_act)
select case(what)
case(mld_sub_ovr_)
sm%novr = val
case(mld_sub_restr_)
sm%restr = val
case(mld_sub_prol_)
sm%prol = val
case default
call sm%mld_d_base_smoother_type%set(what,val,info)
end select
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_as_smoother_seti
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_as_smoother_setr(sm,what,val,info)
use psb_base_mod
use mld_d_as_smoother, mld_protect_nam => mld_d_as_smoother_setr
Implicit None
! Arguments
class(mld_d_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_as_smoother_setr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
else
!!$ write(0,*) trim(name),' Missing component, not setting!'
!!$ info = 1121
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_as_smoother_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_smoother_csetc(sm,what,val,info)
subroutine mld_d_base_smoother_csetc(sm,what,val,info,idx)
use psb_base_mod
use mld_d_base_smoother_mod, mld_protect_name => mld_d_base_smoother_csetc
@@ -46,6 +46,7 @@ subroutine mld_d_base_smoother_csetc(sm,what,val,info)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='d_base_smoother_csetc'
@@ -55,10 +56,10 @@ subroutine mld_d_base_smoother_csetc(sm,what,val,info)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
call sm%set(what,ival,info,idx=idx)
else
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
end if
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_smoother_cseti(sm,what,val,info)
subroutine mld_d_base_smoother_cseti(sm,what,val,info,idx)
use psb_base_mod
use mld_d_base_smoother_mod, mld_protect_name => mld_d_base_smoother_cseti
@@ -45,6 +45,7 @@ subroutine mld_d_base_smoother_cseti(sm,what,val,info)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_base_smoother_cseti'
@@ -52,7 +53,7 @@ subroutine mld_d_base_smoother_cseti(sm,what,val,info)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_smoother_csetr(sm,what,val,info)
subroutine mld_d_base_smoother_csetr(sm,what,val,info,idx)
use psb_base_mod
use mld_d_base_smoother_mod, mld_protect_name => mld_d_base_smoother_csetr
@@ -46,6 +46,7 @@ subroutine mld_d_base_smoother_csetr(sm,what,val,info)
character(len=*), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_base_smoother_csetr'
@@ -55,7 +56,7 @@ subroutine mld_d_base_smoother_csetr(sm,what,val,info)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) goto 9999
@@ -1,73 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_smoother_setc(sm,what,val,info)
use psb_base_mod
use mld_d_base_smoother_mod, mld_protect_name => mld_d_base_smoother_setc
Implicit None
! Arguments
class(mld_d_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='d_base_smoother_setc'
call psb_erractionsave(err_act)
info = psb_success_
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
else
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_base_smoother_setc
@@ -1,64 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_smoother_seti(sm,what,val,info)
use psb_base_mod
use mld_d_base_smoother_mod, mld_protect_name => mld_d_base_smoother_seti
Implicit None
! Arguments
class(mld_d_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_base_smoother_seti'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_base_smoother_seti
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_smoother_setr(sm,what,val,info)
use psb_base_mod
use mld_d_base_smoother_mod, mld_protect_name => mld_d_base_smoother_setr
Implicit None
! Arguments
class(mld_d_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='d_base_smoother_setr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_d_base_smoother_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_as_smoother_csetc(sm,what,val,info)
subroutine mld_s_as_smoother_csetc(sm,what,val,info,idx)
use psb_base_mod
use mld_s_as_smoother, mld_protect_nam => mld_s_as_smoother_csetc
@@ -45,6 +45,7 @@ subroutine mld_s_as_smoother_csetc(sm,what,val,info)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='s_as_smoother_csetc'
@@ -54,9 +55,9 @@ subroutine mld_s_as_smoother_csetc(sm,what,val,info)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
call sm%set(what,ival,info,idx=idx)
else
call sm%mld_s_base_smoother_type%set(what,val,info)
call sm%mld_s_base_smoother_type%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) then
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_as_smoother_cseti(sm,what,val,info)
subroutine mld_s_as_smoother_cseti(sm,what,val,info,idx)
use psb_base_mod
use mld_s_as_smoother, mld_protect_nam => mld_s_as_smoother_cseti
@@ -46,6 +46,7 @@ subroutine mld_s_as_smoother_cseti(sm,what,val,info)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_as_smoother_cseti'
@@ -60,7 +61,7 @@ subroutine mld_s_as_smoother_cseti(sm,what,val,info)
case('SUB_PROL')
sm%prol = val
case default
call sm%mld_s_base_smoother_type%set(what,val,info)
call sm%mld_s_base_smoother_type%set(what,val,info,idx=idx)
end select
call psb_erractionrestore(err_act)
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_as_smoother_csetr(sm,what,val,info)
use psb_base_mod
use mld_s_as_smoother, mld_protect_nam => mld_s_as_smoother_csetr
Implicit None
! Arguments
class(mld_s_as_smoother_type), intent(inout) :: sm
character(len=*), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_as_smoother_csetr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
else
!!$ write(0,*) trim(name),' Missing component, not setting!'
!!$ info = 1121
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_as_smoother_csetr
@@ -1,74 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_as_smoother_setc(sm,what,val,info)
use psb_base_mod
use mld_s_as_smoother, mld_protect_nam => mld_s_as_smoother_setc
Implicit None
! Arguments
class(mld_s_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='s_as_smoother_setc'
info = psb_success_
call psb_erractionsave(err_act)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
else
call sm%mld_s_base_smoother_type%set(what,val,info)
end if
if (info /= psb_success_) then
info = psb_err_from_subroutine_
call psb_errpush(info, name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_as_smoother_setc
@@ -1,72 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_as_smoother_seti(sm,what,val,info)
use psb_base_mod
use mld_s_as_smoother, mld_protect_nam => mld_s_as_smoother_seti
Implicit None
! Arguments
class(mld_s_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_as_smoother_seti'
info = psb_success_
call psb_erractionsave(err_act)
select case(what)
case(mld_sub_ovr_)
sm%novr = val
case(mld_sub_restr_)
sm%restr = val
case(mld_sub_prol_)
sm%prol = val
case default
call sm%mld_s_base_smoother_type%set(what,val,info)
end select
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_as_smoother_seti
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_as_smoother_setr(sm,what,val,info)
use psb_base_mod
use mld_s_as_smoother, mld_protect_nam => mld_s_as_smoother_setr
Implicit None
! Arguments
class(mld_s_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_as_smoother_setr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
else
!!$ write(0,*) trim(name),' Missing component, not setting!'
!!$ info = 1121
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_as_smoother_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_smoother_csetc(sm,what,val,info)
subroutine mld_s_base_smoother_csetc(sm,what,val,info,idx)
use psb_base_mod
use mld_s_base_smoother_mod, mld_protect_name => mld_s_base_smoother_csetc
@@ -46,6 +46,7 @@ subroutine mld_s_base_smoother_csetc(sm,what,val,info)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='s_base_smoother_csetc'
@@ -55,10 +56,10 @@ subroutine mld_s_base_smoother_csetc(sm,what,val,info)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
call sm%set(what,ival,info,idx=idx)
else
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
end if
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_smoother_cseti(sm,what,val,info)
subroutine mld_s_base_smoother_cseti(sm,what,val,info,idx)
use psb_base_mod
use mld_s_base_smoother_mod, mld_protect_name => mld_s_base_smoother_cseti
@@ -45,6 +45,7 @@ subroutine mld_s_base_smoother_cseti(sm,what,val,info)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_base_smoother_cseti'
@@ -52,7 +53,7 @@ subroutine mld_s_base_smoother_cseti(sm,what,val,info)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_smoother_csetr(sm,what,val,info)
subroutine mld_s_base_smoother_csetr(sm,what,val,info,idx)
use psb_base_mod
use mld_s_base_smoother_mod, mld_protect_name => mld_s_base_smoother_csetr
@@ -46,6 +46,7 @@ subroutine mld_s_base_smoother_csetr(sm,what,val,info)
character(len=*), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_base_smoother_csetr'
@@ -55,7 +56,7 @@ subroutine mld_s_base_smoother_csetr(sm,what,val,info)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) goto 9999
@@ -1,73 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_smoother_setc(sm,what,val,info)
use psb_base_mod
use mld_s_base_smoother_mod, mld_protect_name => mld_s_base_smoother_setc
Implicit None
! Arguments
class(mld_s_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='s_base_smoother_setc'
call psb_erractionsave(err_act)
info = psb_success_
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
else
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_base_smoother_setc
@@ -1,64 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_smoother_seti(sm,what,val,info)
use psb_base_mod
use mld_s_base_smoother_mod, mld_protect_name => mld_s_base_smoother_seti
Implicit None
! Arguments
class(mld_s_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_base_smoother_seti'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_base_smoother_seti
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_smoother_setr(sm,what,val,info)
use psb_base_mod
use mld_s_base_smoother_mod, mld_protect_name => mld_s_base_smoother_setr
Implicit None
! Arguments
class(mld_s_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
real(psb_spk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='s_base_smoother_setr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_s_base_smoother_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_as_smoother_csetc(sm,what,val,info)
subroutine mld_z_as_smoother_csetc(sm,what,val,info,idx)
use psb_base_mod
use mld_z_as_smoother, mld_protect_nam => mld_z_as_smoother_csetc
@@ -45,6 +45,7 @@ subroutine mld_z_as_smoother_csetc(sm,what,val,info)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='z_as_smoother_csetc'
@@ -54,9 +55,9 @@ subroutine mld_z_as_smoother_csetc(sm,what,val,info)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
call sm%set(what,ival,info,idx=idx)
else
call sm%mld_z_base_smoother_type%set(what,val,info)
call sm%mld_z_base_smoother_type%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) then
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_as_smoother_cseti(sm,what,val,info)
subroutine mld_z_as_smoother_cseti(sm,what,val,info,idx)
use psb_base_mod
use mld_z_as_smoother, mld_protect_nam => mld_z_as_smoother_cseti
@@ -46,6 +46,7 @@ subroutine mld_z_as_smoother_cseti(sm,what,val,info)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_as_smoother_cseti'
@@ -60,7 +61,7 @@ subroutine mld_z_as_smoother_cseti(sm,what,val,info)
case('SUB_PROL')
sm%prol = val
case default
call sm%mld_z_base_smoother_type%set(what,val,info)
call sm%mld_z_base_smoother_type%set(what,val,info,idx=idx)
end select
call psb_erractionrestore(err_act)
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_as_smoother_csetr(sm,what,val,info)
use psb_base_mod
use mld_z_as_smoother, mld_protect_nam => mld_z_as_smoother_csetr
Implicit None
! Arguments
class(mld_z_as_smoother_type), intent(inout) :: sm
character(len=*), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_as_smoother_csetr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
else
!!$ write(0,*) trim(name),' Missing component, not setting!'
!!$ info = 1121
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_z_as_smoother_csetr
@@ -1,74 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_as_smoother_setc(sm,what,val,info)
use psb_base_mod
use mld_z_as_smoother, mld_protect_nam => mld_z_as_smoother_setc
Implicit None
! Arguments
class(mld_z_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='z_as_smoother_setc'
info = psb_success_
call psb_erractionsave(err_act)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
else
call sm%mld_z_base_smoother_type%set(what,val,info)
end if
if (info /= psb_success_) then
info = psb_err_from_subroutine_
call psb_errpush(info, name)
goto 9999
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_z_as_smoother_setc
@@ -1,72 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_as_smoother_seti(sm,what,val,info)
use psb_base_mod
use mld_z_as_smoother, mld_protect_nam => mld_z_as_smoother_seti
Implicit None
! Arguments
class(mld_z_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_as_smoother_seti'
info = psb_success_
call psb_erractionsave(err_act)
select case(what)
case(mld_sub_ovr_)
sm%novr = val
case(mld_sub_restr_)
sm%restr = val
case(mld_sub_prol_)
sm%prol = val
case default
call sm%mld_z_base_smoother_type%set(what,val,info)
end select
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_z_as_smoother_seti
@@ -1,68 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_as_smoother_setr(sm,what,val,info)
use psb_base_mod
use mld_z_as_smoother, mld_protect_nam => mld_z_as_smoother_setr
Implicit None
! Arguments
class(mld_z_as_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_as_smoother_setr'
call psb_erractionsave(err_act)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
else
!!$ write(0,*) trim(name),' Missing component, not setting!'
!!$ info = 1121
end if
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_z_as_smoother_setr
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_smoother_csetc(sm,what,val,info)
subroutine mld_z_base_smoother_csetc(sm,what,val,info,idx)
use psb_base_mod
use mld_z_base_smoother_mod, mld_protect_name => mld_z_base_smoother_csetc
@@ -46,6 +46,7 @@ subroutine mld_z_base_smoother_csetc(sm,what,val,info)
character(len=*), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='z_base_smoother_csetc'
@@ -55,10 +56,10 @@ subroutine mld_z_base_smoother_csetc(sm,what,val,info)
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
call sm%set(what,ival,info,idx=idx)
else
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
end if
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_smoother_cseti(sm,what,val,info)
subroutine mld_z_base_smoother_cseti(sm,what,val,info,idx)
use psb_base_mod
use mld_z_base_smoother_mod, mld_protect_name => mld_z_base_smoother_cseti
@@ -45,6 +45,7 @@ subroutine mld_z_base_smoother_cseti(sm,what,val,info)
character(len=*), intent(in) :: what
integer(psb_ipk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_base_smoother_cseti'
@@ -52,7 +53,7 @@ subroutine mld_z_base_smoother_cseti(sm,what,val,info)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
@@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_smoother_csetr(sm,what,val,info)
subroutine mld_z_base_smoother_csetr(sm,what,val,info,idx)
use psb_base_mod
use mld_z_base_smoother_mod, mld_protect_name => mld_z_base_smoother_csetr
@@ -46,6 +46,7 @@ subroutine mld_z_base_smoother_csetr(sm,what,val,info)
character(len=*), intent(in) :: what
real(psb_dpk_), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: idx
integer(psb_ipk_) :: err_act
character(len=20) :: name='z_base_smoother_csetr'
@@ -55,7 +56,7 @@ subroutine mld_z_base_smoother_csetr(sm,what,val,info)
info = psb_success_
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
call sm%sv%set(what,val,info,idx=idx)
end if
if (info /= psb_success_) goto 9999
@@ -1,73 +0,0 @@
!
!
! MLD2P4 version 2.2
! MultiLevel Domain Decomposition Parallel Preconditioners Package
! based on PSBLAS (Parallel Sparse BLAS version 3.5)
!
! (C) Copyright 2008-2018
!
! Salvatore Filippone
! Pasqua D'Ambra
! Daniela di Serafino
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions
! are met:
! 1. Redistributions of source code must retain the above copyright
! notice, this list of conditions and the following disclaimer.
! 2. Redistributions in binary form must reproduce the above copyright
! notice, this list of conditions, and the following disclaimer in the
! documentation and/or other materials provided with the distribution.
! 3. The name of the MLD2P4 group or the names of its contributors may
! not be used to endorse or promote products derived from this
! software without specific written permission.
!
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_smoother_setc(sm,what,val,info)
use psb_base_mod
use mld_z_base_smoother_mod, mld_protect_name => mld_z_base_smoother_setc
Implicit None
! Arguments
class(mld_z_base_smoother_type), intent(inout) :: sm
integer(psb_ipk_), intent(in) :: what
character(len=*), intent(in) :: val
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, ival
character(len=20) :: name='z_base_smoother_setc'
call psb_erractionsave(err_act)
info = psb_success_
ival = sm%stringval(val)
if (ival >= 0) then
call sm%set(what,ival,info)
else
if (allocated(sm%sv)) then
call sm%sv%set(what,val,info)
end if
end if
if (info /= psb_success_) goto 9999
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine mld_z_base_smoother_setc

Some files were not shown because too many files have changed in this diff Show More