Add argument to cdall to force HASH.

psblas-paraggr
Salvatore Filippone 6 years ago
parent b8251d67ce
commit 5ae90a0dae

@ -169,16 +169,17 @@ module psb_cd_tools_mod
interface psb_cdall
subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl,&
& globalcheck,lidx)
& globalcheck,lidx,usehash)
import :: psb_ipk_, psb_desc_type, psb_parts
implicit None
procedure(psb_parts) :: parts
integer(psb_ipk_), intent(in) :: mg,ng,ictxt, vg(:), vl(:),nl,lidx(:)
integer(psb_ipk_), intent(in) :: flag
logical, intent(in) :: repl, globalcheck
logical, intent(in) :: repl, globalcheck, usehash
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(out) :: desc
optional :: mg,ng,parts,vg,vl,flag,nl,repl, globalcheck,lidx
optional :: mg, ng, parts, vg, vl, flag, nl, repl, globalcheck, lidx, usehash
end subroutine psb_cdall
end interface

@ -41,7 +41,7 @@
! ictxt - integer. The communication context.
! desc - type(psb_desc_type). The communication descriptor.
! info - integer. Eventually returns an error code
subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx,usehash)
use psb_base_mod
use psi_mod
use psb_repl_map_mod
@ -52,7 +52,7 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
integer(psb_ipk_), intent(in) :: ictxt, v(:)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(out) :: desc
logical, intent(in), optional :: globalcheck
logical, intent(in), optional :: globalcheck,usehash
integer(psb_ipk_), intent(in), optional :: idx(:)
!locals
@ -65,7 +65,7 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
& nov(:), ov_idx(:,:), ix(:)
integer(psb_ipk_) :: debug_level, debug_unit
integer(psb_mpik_) :: iictxt
logical :: check_, islarge
logical :: check_, islarge, usehash_
character(len=20) :: name
if(psb_get_errstatus() /= 0) return
@ -92,6 +92,11 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
else
check_ = .false.
end if
if (present(usehash)) then
usehash_ = usehash
else
usehash_ = .false.
end if
n = m
@ -351,7 +356,7 @@ subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
if (np == 1) then
allocate(psb_repl_map :: desc%indxmap, stat=info)
else
if (islarge) then
if (islarge.or.usehash_) then
allocate(psb_hash_map :: desc%indxmap, stat=info)
else
allocate(psb_list_map :: desc%indxmap, stat=info)

@ -1,4 +1,4 @@
subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalcheck,lidx)
subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl,globalcheck,lidx,usehash)
use psb_desc_mod
use psb_serial_mod
use psb_const_mod
@ -10,11 +10,11 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche
procedure(psb_parts) :: parts
integer(psb_ipk_), intent(in) :: mg,ng,ictxt, vg(:), vl(:),nl,lidx(:)
integer(psb_ipk_), intent(in) :: flag
logical, intent(in) :: repl, globalcheck
logical, intent(in) :: repl, globalcheck,usehash
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(out) :: desc
optional :: mg,ng,parts,vg,vl,flag,nl,repl, globalcheck,lidx
optional :: mg,ng,parts,vg,vl,flag,nl,repl, globalcheck,lidx, usehash
interface
subroutine psb_cdals(m, n, parts, ictxt, desc, info)
@ -31,13 +31,13 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche
integer(psb_ipk_), intent(out) :: info
Type(psb_desc_type), intent(out) :: desc
end subroutine psb_cdalv
subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx)
subroutine psb_cd_inloc(v, ictxt, desc, info, globalcheck,idx, usehash)
use psb_desc_mod
implicit None
integer(psb_ipk_), intent(in) :: ictxt, v(:)
integer(psb_ipk_), intent(out) :: info
type(psb_desc_type), intent(out) :: desc
logical, intent(in), optional :: globalcheck
logical, intent(in), optional :: globalcheck, usehash
integer(psb_ipk_), intent(in), optional :: idx(:)
end subroutine psb_cd_inloc
subroutine psb_cdrep(m, ictxt, desc,info)
@ -49,6 +49,7 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche
end interface
character(len=20) :: name
integer(psb_ipk_) :: err_act, n_, flag_, i, me, np, nlp, nnv, lr
logical :: usehash_
integer(psb_ipk_), allocatable :: itmpsz(:)
integer(psb_mpik_) :: iictxt
@ -130,6 +131,14 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche
else if (present(nl)) then
if (present(usehash)) then
usehash_ = usehash
else
usehash_ = .false.
end if
if (usehash_) then
write(0,*) 'Fix usehash_ implementationt '
end if
if (np == 1) then
allocate(psb_repl_map :: desc%indxmap, stat=info)

Loading…
Cancel
Save