Fix handling of level sweeps in the case of global solver and print warning.

stopcriterion
Salvatore Filippone 5 years ago
parent 8006626693
commit 70a85c6972

@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold)
subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold,ilv)
use psb_base_mod
use mld_c_onelev_mod, mld_protect_name => mld_c_base_onelev_build
implicit none
@ -44,6 +44,7 @@ subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold)
class(psb_c_base_sparse_mat), intent(in), optional :: amold
class(psb_c_base_vect_type), intent(in), optional :: vmold
class(psb_i_base_vect_type), intent(in), optional :: imold
integer(psb_ipk_), intent(in), optional :: ilv
! Local
integer(psb_ipk_) :: err,i,k, err_act
integer(psb_ipk_) :: ictxt, me, np
@ -120,6 +121,24 @@ subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold)
goto 9999
end if
if (lv%sm%sv%is_global()) then
if ((lv%parms%sweeps_pre>1).or.(lv%parms%sweeps_post>1)) then
lv%parms%sweeps_pre = 1
lv%parms%sweeps_post = 1
if (me == 0) then
if (present(ilv)) then
write(debug_unit,*) 'Warning: the solver "',trim(lv%sm%sv%get_fmt()),&
& '" at level ',ilv
write(debug_unit,*) ' is configured as a global solver '
else
write(debug_unit,*) 'Warning: the solver "',trim(lv%sm%sv%get_fmt()),&
& '" is configured as a global solver '
end if
write(debug_unit,*) ' Pre and post sweeps at this level reset to 1'
end if
end if
end if
if (any((/present(amold),present(vmold),present(imold)/))) &
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)

@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold)
subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold,ilv)
use psb_base_mod
use mld_d_onelev_mod, mld_protect_name => mld_d_base_onelev_build
implicit none
@ -44,6 +44,7 @@ subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold)
class(psb_d_base_sparse_mat), intent(in), optional :: amold
class(psb_d_base_vect_type), intent(in), optional :: vmold
class(psb_i_base_vect_type), intent(in), optional :: imold
integer(psb_ipk_), intent(in), optional :: ilv
! Local
integer(psb_ipk_) :: err,i,k, err_act
integer(psb_ipk_) :: ictxt, me, np
@ -120,6 +121,24 @@ subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold)
goto 9999
end if
if (lv%sm%sv%is_global()) then
if ((lv%parms%sweeps_pre>1).or.(lv%parms%sweeps_post>1)) then
lv%parms%sweeps_pre = 1
lv%parms%sweeps_post = 1
if (me == 0) then
if (present(ilv)) then
write(debug_unit,*) 'Warning: the solver "',trim(lv%sm%sv%get_fmt()),&
& '" at level ',ilv
write(debug_unit,*) ' is configured as a global solver '
else
write(debug_unit,*) 'Warning: the solver "',trim(lv%sm%sv%get_fmt()),&
& '" is configured as a global solver '
end if
write(debug_unit,*) ' Pre and post sweeps at this level reset to 1'
end if
end if
end if
if (any((/present(amold),present(vmold),present(imold)/))) &
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)

@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold)
subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold,ilv)
use psb_base_mod
use mld_s_onelev_mod, mld_protect_name => mld_s_base_onelev_build
implicit none
@ -44,6 +44,7 @@ subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold)
class(psb_s_base_sparse_mat), intent(in), optional :: amold
class(psb_s_base_vect_type), intent(in), optional :: vmold
class(psb_i_base_vect_type), intent(in), optional :: imold
integer(psb_ipk_), intent(in), optional :: ilv
! Local
integer(psb_ipk_) :: err,i,k, err_act
integer(psb_ipk_) :: ictxt, me, np
@ -120,6 +121,24 @@ subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold)
goto 9999
end if
if (lv%sm%sv%is_global()) then
if ((lv%parms%sweeps_pre>1).or.(lv%parms%sweeps_post>1)) then
lv%parms%sweeps_pre = 1
lv%parms%sweeps_post = 1
if (me == 0) then
if (present(ilv)) then
write(debug_unit,*) 'Warning: the solver "',trim(lv%sm%sv%get_fmt()),&
& '" at level ',ilv
write(debug_unit,*) ' is configured as a global solver '
else
write(debug_unit,*) 'Warning: the solver "',trim(lv%sm%sv%get_fmt()),&
& '" is configured as a global solver '
end if
write(debug_unit,*) ' Pre and post sweeps at this level reset to 1'
end if
end if
end if
if (any((/present(amold),present(vmold),present(imold)/))) &
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)

@ -35,7 +35,7 @@
! POSSIBILITY OF SUCH DAMAGE.
!
!
subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold)
subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold,ilv)
use psb_base_mod
use mld_z_onelev_mod, mld_protect_name => mld_z_base_onelev_build
implicit none
@ -44,6 +44,7 @@ subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold)
class(psb_z_base_sparse_mat), intent(in), optional :: amold
class(psb_z_base_vect_type), intent(in), optional :: vmold
class(psb_i_base_vect_type), intent(in), optional :: imold
integer(psb_ipk_), intent(in), optional :: ilv
! Local
integer(psb_ipk_) :: err,i,k, err_act
integer(psb_ipk_) :: ictxt, me, np
@ -120,6 +121,24 @@ subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold)
goto 9999
end if
if (lv%sm%sv%is_global()) then
if ((lv%parms%sweeps_pre>1).or.(lv%parms%sweeps_post>1)) then
lv%parms%sweeps_pre = 1
lv%parms%sweeps_post = 1
if (me == 0) then
if (present(ilv)) then
write(debug_unit,*) 'Warning: the solver "',trim(lv%sm%sv%get_fmt()),&
& '" at level ',ilv
write(debug_unit,*) ' is configured as a global solver '
else
write(debug_unit,*) 'Warning: the solver "',trim(lv%sm%sv%get_fmt()),&
& '" is configured as a global solver '
end if
write(debug_unit,*) ' Pre and post sweeps at this level reset to 1'
end if
end if
end if
if (any((/present(amold),present(vmold),present(imold)/))) &
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)

@ -288,7 +288,7 @@ subroutine mld_c_smoothers_bld(a,desc_a,prec,info,amold,vmold,imold)
!
! build the base preconditioner at level i
!
call prec%precv(i)%bld(info,amold=amold,vmold=vmold,imold=imold)
call prec%precv(i)%bld(info,amold=amold,vmold=vmold,imold=imold,ilv=i)
if (info /= psb_success_) then
write(ch_err,'(a,i7)') 'Error @ level',i

@ -288,7 +288,7 @@ subroutine mld_d_smoothers_bld(a,desc_a,prec,info,amold,vmold,imold)
!
! build the base preconditioner at level i
!
call prec%precv(i)%bld(info,amold=amold,vmold=vmold,imold=imold)
call prec%precv(i)%bld(info,amold=amold,vmold=vmold,imold=imold,ilv=i)
if (info /= psb_success_) then
write(ch_err,'(a,i7)') 'Error @ level',i

@ -288,7 +288,7 @@ subroutine mld_s_smoothers_bld(a,desc_a,prec,info,amold,vmold,imold)
!
! build the base preconditioner at level i
!
call prec%precv(i)%bld(info,amold=amold,vmold=vmold,imold=imold)
call prec%precv(i)%bld(info,amold=amold,vmold=vmold,imold=imold,ilv=i)
if (info /= psb_success_) then
write(ch_err,'(a,i7)') 'Error @ level',i

@ -288,7 +288,7 @@ subroutine mld_z_smoothers_bld(a,desc_a,prec,info,amold,vmold,imold)
!
! build the base preconditioner at level i
!
call prec%precv(i)%bld(info,amold=amold,vmold=vmold,imold=imold)
call prec%precv(i)%bld(info,amold=amold,vmold=vmold,imold=imold,ilv=i)
if (info /= psb_success_) then
write(ch_err,'(a,i7)') 'Error @ level',i

@ -225,7 +225,7 @@ module mld_c_onelev_mod
end interface
interface
subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold)
subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold,ilv)
import :: psb_c_base_sparse_mat, psb_c_base_vect_type, &
& psb_i_base_vect_type, psb_spk_, mld_c_onelev_type, &
& psb_ipk_, psb_epk_, psb_desc_type
@ -235,6 +235,7 @@ module mld_c_onelev_mod
class(psb_c_base_sparse_mat), intent(in), optional :: amold
class(psb_c_base_vect_type), intent(in), optional :: vmold
class(psb_i_base_vect_type), intent(in), optional :: imold
integer(psb_ipk_), intent(in), optional :: ilv
end subroutine mld_c_base_onelev_build
end interface

@ -225,7 +225,7 @@ module mld_d_onelev_mod
end interface
interface
subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold)
subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold,ilv)
import :: psb_d_base_sparse_mat, psb_d_base_vect_type, &
& psb_i_base_vect_type, psb_dpk_, mld_d_onelev_type, &
& psb_ipk_, psb_epk_, psb_desc_type
@ -235,6 +235,7 @@ module mld_d_onelev_mod
class(psb_d_base_sparse_mat), intent(in), optional :: amold
class(psb_d_base_vect_type), intent(in), optional :: vmold
class(psb_i_base_vect_type), intent(in), optional :: imold
integer(psb_ipk_), intent(in), optional :: ilv
end subroutine mld_d_base_onelev_build
end interface

@ -225,7 +225,7 @@ module mld_s_onelev_mod
end interface
interface
subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold)
subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold,ilv)
import :: psb_s_base_sparse_mat, psb_s_base_vect_type, &
& psb_i_base_vect_type, psb_spk_, mld_s_onelev_type, &
& psb_ipk_, psb_epk_, psb_desc_type
@ -235,6 +235,7 @@ module mld_s_onelev_mod
class(psb_s_base_sparse_mat), intent(in), optional :: amold
class(psb_s_base_vect_type), intent(in), optional :: vmold
class(psb_i_base_vect_type), intent(in), optional :: imold
integer(psb_ipk_), intent(in), optional :: ilv
end subroutine mld_s_base_onelev_build
end interface

@ -225,7 +225,7 @@ module mld_z_onelev_mod
end interface
interface
subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold)
subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold,ilv)
import :: psb_z_base_sparse_mat, psb_z_base_vect_type, &
& psb_i_base_vect_type, psb_dpk_, mld_z_onelev_type, &
& psb_ipk_, psb_epk_, psb_desc_type
@ -235,6 +235,7 @@ module mld_z_onelev_mod
class(psb_z_base_sparse_mat), intent(in), optional :: amold
class(psb_z_base_vect_type), intent(in), optional :: vmold
class(psb_i_base_vect_type), intent(in), optional :: imold
integer(psb_ipk_), intent(in), optional :: ilv
end subroutine mld_z_base_onelev_build
end interface

Loading…
Cancel
Save