From 9e90a04e311d4eac69b7ce61e896e52984336406 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Sun, 22 Apr 2018 15:36:01 +0100 Subject: [PATCH] Change default in CDALL with VL: no global checks. Split psb_cd_choose_large_state with psb_cd_is_large. --- base/modules/desc/psb_desc_mod.F90 | 20 +++++++++++++++----- base/tools/psb_cd_inloc.f90 | 18 +++++++----------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/base/modules/desc/psb_desc_mod.F90 b/base/modules/desc/psb_desc_mod.F90 index 724b9114..41893ff2 100644 --- a/base/modules/desc/psb_desc_mod.F90 +++ b/base/modules/desc/psb_desc_mod.F90 @@ -334,11 +334,23 @@ contains val = cd_large_threshold end function psb_cd_get_large_threshold - logical function psb_cd_choose_large_state(ictxt,m) + function psb_cd_is_large_size(m) result(val) use psb_penv_mod implicit none - integer(psb_ipk_), intent(in) :: ictxt,m + integer(psb_ipk_), intent(in) :: m + logical :: val + !locals + val = (m > psb_cd_get_large_threshold()) + end function psb_cd_is_large_size + + function psb_cd_choose_large_state(ictxt,m) result(val) + use psb_penv_mod + + implicit none + integer(psb_ipk_), intent(in) :: ictxt + integer(psb_ipk_), intent(in) :: m + logical :: val !locals integer(psb_ipk_) :: np,me @@ -348,9 +360,7 @@ contains ! it makes no sense to use them if you don't have at least ! 3 processes, no matter what the size of the process. ! - psb_cd_choose_large_state = & - & (m > psb_cd_get_large_threshold()) .and. & - & (np > 2) + val = psb_cd_is_large_size(m) .and. (np > 2) end function psb_cd_choose_large_state subroutine psb_nullify_desc(desc) diff --git a/base/tools/psb_cd_inloc.f90 b/base/tools/psb_cd_inloc.f90 index 1b31fe2e..6ea184d1 100644 --- a/base/tools/psb_cd_inloc.f90 +++ b/base/tools/psb_cd_inloc.f90 @@ -82,19 +82,15 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx) iictxt = ictxt loc_row = size(v) - if (.false.) then - m = loc_row - call psb_sum(ictxt,m) - else - m = maxval(v) - nrt = loc_row - call psb_sum(ictxt,nrt) - call psb_max(ictxt,m) - end if + m = maxval(v) + nrt = loc_row + call psb_sum(ictxt,nrt) + call psb_max(ictxt,m) + if (present(globalcheck)) then check_ = globalcheck else - check_ = .true. + check_ = .false. end if n = m @@ -138,7 +134,7 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx) if (debug_level >= psb_debug_ext_) & & write(debug_unit,*) me,' ',trim(name),': doing global checks' - islarge = psb_cd_choose_large_state(ictxt,m) + islarge = psb_cd_is_large_size(m) allocate(vl(loc_row),ix(loc_row),stat=info) if (info /= psb_success_) then