Fix computation of global matrix coarse size.

stopcriterion
Salvatore Filippone 5 years ago
parent ee34e9e9f7
commit d51de74a05

@ -86,8 +86,19 @@ subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold)
end if end if
lv%ac_nz_loc = lv%ac%get_nzeros() lv%ac_nz_loc = lv%ac%get_nzeros()
lv%ac_nz_tot = lv%ac_nz_loc lv%ac_nz_tot = lv%ac_nz_loc
call psb_sum(ictxt,lv%ac_nz_tot) select case(lv%parms%coarse_mat)
! end do case(mld_distr_mat_)
call psb_sum(ictxt,lv%ac_nz_tot)
case(mld_repl_mat_)
! Do nothing
case default
! Should never get here
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='Wrong lv%parms')
goto 9999
end select
if (debug_level >= psb_debug_outer_) & if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),& & write(debug_unit,*) me,' ',trim(name),&
& 'Calling mlprcbld at level ',i & 'Calling mlprcbld at level ',i
@ -95,51 +106,31 @@ subroutine mld_c_base_onelev_build(lv,info,amold,vmold,imold)
& 'Jacobi sweeps',izero,is_int_non_negative) & 'Jacobi sweeps',izero,is_int_non_negative)
call mld_check_def(lv%parms%sweeps_post,& call mld_check_def(lv%parms%sweeps_post,&
& 'Jacobi sweeps',izero,is_int_non_negative) & 'Jacobi sweeps',izero,is_int_non_negative)
if (.false.) then
call lv%sm%build(lv%base_a,lv%base_desc,&
& info,amold=amold,vmold=vmold,imold=imold)
if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
& amold=amold,vmold=vmold,imold=imold)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if
else
call lv%sm%build(lv%base_a,lv%base_desc,info)
if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0 ) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if
if (any((/present(amold),present(vmold),present(imold)/))) & call lv%sm%build(lv%base_a,lv%base_desc,info)
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold) if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0 ) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if end if
if (any((/present(amold),present(vmold),present(imold)/))) &
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
9999 call psb_error_handler(err_act) 9999 call psb_error_handler(err_act)
return return
end subroutine mld_c_base_onelev_build end subroutine mld_c_base_onelev_build

@ -86,8 +86,19 @@ subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold)
end if end if
lv%ac_nz_loc = lv%ac%get_nzeros() lv%ac_nz_loc = lv%ac%get_nzeros()
lv%ac_nz_tot = lv%ac_nz_loc lv%ac_nz_tot = lv%ac_nz_loc
call psb_sum(ictxt,lv%ac_nz_tot) select case(lv%parms%coarse_mat)
! end do case(mld_distr_mat_)
call psb_sum(ictxt,lv%ac_nz_tot)
case(mld_repl_mat_)
! Do nothing
case default
! Should never get here
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='Wrong lv%parms')
goto 9999
end select
if (debug_level >= psb_debug_outer_) & if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),& & write(debug_unit,*) me,' ',trim(name),&
& 'Calling mlprcbld at level ',i & 'Calling mlprcbld at level ',i
@ -95,51 +106,31 @@ subroutine mld_d_base_onelev_build(lv,info,amold,vmold,imold)
& 'Jacobi sweeps',izero,is_int_non_negative) & 'Jacobi sweeps',izero,is_int_non_negative)
call mld_check_def(lv%parms%sweeps_post,& call mld_check_def(lv%parms%sweeps_post,&
& 'Jacobi sweeps',izero,is_int_non_negative) & 'Jacobi sweeps',izero,is_int_non_negative)
if (.false.) then
call lv%sm%build(lv%base_a,lv%base_desc,&
& info,amold=amold,vmold=vmold,imold=imold)
if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
& amold=amold,vmold=vmold,imold=imold)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if
else
call lv%sm%build(lv%base_a,lv%base_desc,info)
if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0 ) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if
if (any((/present(amold),present(vmold),present(imold)/))) & call lv%sm%build(lv%base_a,lv%base_desc,info)
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold) if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0 ) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if end if
if (any((/present(amold),present(vmold),present(imold)/))) &
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
9999 call psb_error_handler(err_act) 9999 call psb_error_handler(err_act)
return return
end subroutine mld_d_base_onelev_build end subroutine mld_d_base_onelev_build

@ -86,8 +86,19 @@ subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold)
end if end if
lv%ac_nz_loc = lv%ac%get_nzeros() lv%ac_nz_loc = lv%ac%get_nzeros()
lv%ac_nz_tot = lv%ac_nz_loc lv%ac_nz_tot = lv%ac_nz_loc
call psb_sum(ictxt,lv%ac_nz_tot) select case(lv%parms%coarse_mat)
! end do case(mld_distr_mat_)
call psb_sum(ictxt,lv%ac_nz_tot)
case(mld_repl_mat_)
! Do nothing
case default
! Should never get here
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='Wrong lv%parms')
goto 9999
end select
if (debug_level >= psb_debug_outer_) & if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),& & write(debug_unit,*) me,' ',trim(name),&
& 'Calling mlprcbld at level ',i & 'Calling mlprcbld at level ',i
@ -95,51 +106,31 @@ subroutine mld_s_base_onelev_build(lv,info,amold,vmold,imold)
& 'Jacobi sweeps',izero,is_int_non_negative) & 'Jacobi sweeps',izero,is_int_non_negative)
call mld_check_def(lv%parms%sweeps_post,& call mld_check_def(lv%parms%sweeps_post,&
& 'Jacobi sweeps',izero,is_int_non_negative) & 'Jacobi sweeps',izero,is_int_non_negative)
if (.false.) then
call lv%sm%build(lv%base_a,lv%base_desc,&
& info,amold=amold,vmold=vmold,imold=imold)
if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
& amold=amold,vmold=vmold,imold=imold)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if
else
call lv%sm%build(lv%base_a,lv%base_desc,info)
if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0 ) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if
if (any((/present(amold),present(vmold),present(imold)/))) & call lv%sm%build(lv%base_a,lv%base_desc,info)
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold) if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0 ) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if end if
if (any((/present(amold),present(vmold),present(imold)/))) &
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
9999 call psb_error_handler(err_act) 9999 call psb_error_handler(err_act)
return return
end subroutine mld_s_base_onelev_build end subroutine mld_s_base_onelev_build

@ -86,8 +86,19 @@ subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold)
end if end if
lv%ac_nz_loc = lv%ac%get_nzeros() lv%ac_nz_loc = lv%ac%get_nzeros()
lv%ac_nz_tot = lv%ac_nz_loc lv%ac_nz_tot = lv%ac_nz_loc
call psb_sum(ictxt,lv%ac_nz_tot) select case(lv%parms%coarse_mat)
! end do case(mld_distr_mat_)
call psb_sum(ictxt,lv%ac_nz_tot)
case(mld_repl_mat_)
! Do nothing
case default
! Should never get here
info = psb_err_internal_error_
call psb_errpush(info,name,a_err='Wrong lv%parms')
goto 9999
end select
if (debug_level >= psb_debug_outer_) & if (debug_level >= psb_debug_outer_) &
& write(debug_unit,*) me,' ',trim(name),& & write(debug_unit,*) me,' ',trim(name),&
& 'Calling mlprcbld at level ',i & 'Calling mlprcbld at level ',i
@ -95,51 +106,31 @@ subroutine mld_z_base_onelev_build(lv,info,amold,vmold,imold)
& 'Jacobi sweeps',izero,is_int_non_negative) & 'Jacobi sweeps',izero,is_int_non_negative)
call mld_check_def(lv%parms%sweeps_post,& call mld_check_def(lv%parms%sweeps_post,&
& 'Jacobi sweeps',izero,is_int_non_negative) & 'Jacobi sweeps',izero,is_int_non_negative)
if (.false.) then
call lv%sm%build(lv%base_a,lv%base_desc,&
& info,amold=amold,vmold=vmold,imold=imold)
if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info,&
& amold=amold,vmold=vmold,imold=imold)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if
else
call lv%sm%build(lv%base_a,lv%base_desc,info)
if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0 ) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if
if (any((/present(amold),present(vmold),present(imold)/))) & call lv%sm%build(lv%base_a,lv%base_desc,info)
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold) if (info == 0) then
if (allocated(lv%sm2a)) then
call lv%sm2a%build(lv%base_a,lv%base_desc,info)
lv%sm2 => lv%sm2a
else
lv%sm2 => lv%sm
end if
end if
if (info /=0 ) then
info = psb_err_internal_error_
call psb_errpush(info,name,&
& a_err='Smoother bld error')
goto 9999
end if end if
if (any((/present(amold),present(vmold),present(imold)/))) &
& call lv%cnv(info,amold=amold,vmold=vmold,imold=imold)
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return
9999 call psb_error_handler(err_act) 9999 call psb_error_handler(err_act)
return return
end subroutine mld_z_base_onelev_build end subroutine mld_z_base_onelev_build

Loading…
Cancel
Save