Merge branch 'fix-hash' into development

newmatdist
sfilippone 1 year ago
commit 684dee1ecf

@ -108,7 +108,7 @@ module psb_desc_const_mod
integer(psb_ipk_), parameter :: psb_max_hash_bits = 22
integer(psb_ipk_), parameter :: psb_hash_size = 2**psb_hash_bits, psb_hash_mask=psb_hash_size-1
integer(psb_ipk_), parameter :: psb_hpnt_nentries_ = 7
integer(psb_ipk_), parameter :: psb_default_large_threshold=1*1024*1024
integer(psb_ipk_), parameter :: psb_default_hash_threshold=1*1024*1024
!
! Choice of algorithm for sparse matrix A2AV
!

@ -285,14 +285,14 @@ module psb_desc_mod
module procedure psb_cdfree
end interface psb_free
interface psb_cd_set_large_threshold
module procedure psb_i_cd_set_large_threshold
end interface psb_cd_set_large_threshold
interface psb_cd_set_hash_threshold
module procedure psb_i_cd_set_hash_threshold
end interface psb_cd_set_hash_threshold
#if defined(PSB_IPK4) && defined(PSB_LPK8)
interface psb_cd_set_large_threshold
module procedure psb_l_cd_set_large_threshold
end interface psb_cd_set_large_threshold
interface psb_cd_set_hash_threshold
module procedure psb_l_cd_set_hash_threshold
end interface psb_cd_set_hash_threshold
#endif
interface psb_set_sp_a2av_alg
@ -309,7 +309,7 @@ module psb_desc_mod
& cd_g2ls2_ins, cd_g2lv1_ins, cd_g2lv2_ins, cd_fnd_owner
integer(psb_lpk_), private, save :: cd_large_threshold = psb_default_large_threshold
integer(psb_lpk_), private, save :: cd_hash_threshold = psb_default_hash_threshold
integer(psb_ipk_), private, save :: sp_a2av_alg = psb_sp_a2av_smpl_triad_
contains
@ -363,27 +363,27 @@ contains
subroutine psb_i_cd_set_large_threshold(ith)
subroutine psb_i_cd_set_hash_threshold(ith)
implicit none
integer(psb_ipk_), intent(in) :: ith
if (ith > 0) then
cd_large_threshold = ith
cd_hash_threshold = ith
end if
end subroutine psb_i_cd_set_large_threshold
end subroutine psb_i_cd_set_hash_threshold
subroutine psb_l_cd_set_large_threshold(ith)
subroutine psb_l_cd_set_hash_threshold(ith)
implicit none
integer(psb_lpk_), intent(in) :: ith
if (ith > 0) then
cd_large_threshold = ith
cd_hash_threshold = ith
end if
end subroutine psb_l_cd_set_large_threshold
end subroutine psb_l_cd_set_hash_threshold
function psb_cd_get_large_threshold() result(val)
function psb_cd_get_hash_threshold() result(val)
implicit none
integer(psb_lpk_) :: val
val = cd_large_threshold
end function psb_cd_get_large_threshold
val = cd_hash_threshold
end function psb_cd_get_hash_threshold
function psb_cd_is_large_size(m) result(val)
use psb_penv_mod
@ -392,7 +392,7 @@ contains
integer(psb_lpk_), intent(in) :: m
logical :: val
!locals
val = (m > psb_cd_get_large_threshold())
val = (m > psb_cd_get_hash_threshold())
end function psb_cd_is_large_size
function psb_cd_choose_large_state(ctxt,m) result(val)

File diff suppressed because it is too large Load Diff

@ -125,7 +125,7 @@ subroutine psb_cd_inloc(v, ctxt, desc, info, globalcheck,idx,usehash)
if (me == psb_root_) then
exch(1)=m
exch(2)=n
exch(3)=psb_cd_get_large_threshold()
exch(3)=psb_cd_get_hash_threshold()
call psb_bcast(ctxt,exch(1:3),root=psb_root_)
else
call psb_bcast(ctxt,exch(1:3),root=psb_root_)
@ -140,7 +140,7 @@ subroutine psb_cd_inloc(v, ctxt, desc, info, globalcheck,idx,usehash)
call psb_errpush(err,name,l_err=l_err)
goto 9999
endif
call psb_cd_set_large_threshold(exch(3))
call psb_cd_set_hash_threshold(exch(3))
endif
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': doing global checks'

@ -99,7 +99,7 @@ subroutine psb_cdals(m, n, parts, ctxt, desc, info)
& write(debug_unit,*) me,' ',trim(name),': doing global checks'
!global check on m and n parameters
if (me == psb_root_) then
exch(1)=m; exch(2)=n; exch(3)=psb_cd_get_large_threshold()
exch(1)=m; exch(2)=n; exch(3)=psb_cd_get_hash_threshold()
call psb_bcast(ctxt,exch(1:3),root=psb_root_)
else
call psb_bcast(ctxt,exch(1:3),root=psb_root_)
@ -112,7 +112,7 @@ subroutine psb_cdals(m, n, parts, ctxt, desc, info)
call psb_errpush(err,name,m_err=(/2/))
goto 9999
endif
call psb_cd_set_large_threshold(exch(3))
call psb_cd_set_hash_threshold(exch(3))
endif
call psb_nullify_desc(desc)

@ -102,7 +102,7 @@ subroutine psb_cdalv(v, ctxt, desc, info, flag)
if (me == psb_root_) then
exch(1)=m
exch(2)=n
exch(3)=psb_cd_get_large_threshold()
exch(3)=psb_cd_get_hash_threshold()
call psb_bcast(ctxt,exch(1:3),root=psb_root_)
else
call psb_bcast(ctxt,exch(1:3),root=psb_root_)
@ -117,7 +117,7 @@ subroutine psb_cdalv(v, ctxt, desc, info, flag)
call psb_errpush(err,name,l_err=l_err)
goto 9999
endif
call psb_cd_set_large_threshold(exch(3))
call psb_cd_set_hash_threshold(exch(3))
endif
call psb_nullify_desc(desc)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -54,9 +54,9 @@ href="userhtmlse3.html#x8-180003.1.8" id="QQ2-8-21">Clone — clone current
<br /> &#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >3.1.9 <a
href="userhtmlse3.html#x8-190003.1.9" id="QQ2-8-22">CNV &#8212; convert internal storage format</a></span>
<br /> &#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >3.1.10 <a
href="userhtmlse3.html#x8-200003.1.10" id="QQ2-8-23">psb_cd_get_large_threshold &#8212; Get threshold for index mapping switch</a></span>
href="userhtmlse3.html#x8-200003.1.10" id="QQ2-8-23">psb_cd_get_hash_threshold &#8212; Get threshold for index mapping switch</a></span>
<br /> &#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >3.1.11 <a
href="userhtmlse3.html#x8-210003.1.11" id="QQ2-8-24">psb_cd_set_large_threshold &#8212; Set threshold for index mapping switch</a></span>
href="userhtmlse3.html#x8-210003.1.11" id="QQ2-8-24">psb_cd_set_hash_threshold &#8212; Set threshold for index mapping switch</a></span>
<br /> &#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >3.1.12 <a
href="userhtmlse3.html#x8-220003.1.12" id="QQ2-8-25">get_p_adjcncy &#8212; Get process adjacency list</a></span>
<br /> &#x00A0;&#x00A0;&#x00A0;<span class="subsubsectionToc" >3.1.13 <a

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -387,11 +387,11 @@ accelerators.
\subsubsection{psb\_cd\_get\_large\_threshold --- Get threshold for
\subsubsection{psb\_cd\_get\_hash\_threshold --- Get threshold for
index mapping switch}
\begin{verbatim}
ith = psb_cd_get_large_threshold()
ith = psb_cd_get_hash_threshold()
\end{verbatim}
\begin{description}
@ -403,12 +403,12 @@ ith = psb_cd_get_large_threshold()
\subsubsection{psb\_cd\_set\_large\_threshold --- Set threshold for
\subsubsection{psb\_cd\_set\_hash\_threshold --- Set threshold for
index mapping switch}
%\addcontentsline{toc}{paragraph}{psb\_cd\_set\_large\_threshold}
\begin{verbatim}
call psb_cd_set_large_threshold(ith)
call psb_cd_set_hash_threshold(ith)
\end{verbatim}
\begin{description}
@ -420,6 +420,11 @@ Type: {\bf required}.\\
Intent: {\bf in}.\\
Specified as: an integer value greater than zero.
\end{description}
This threshold guides the library into using a list based or a
hash-table based descriptor for global to local index conversion;
if the size of the global index space is below this threshold, a list
based structure is used, if it is above a hash-table based structure
is used.
Note: the threshold value is only queried by the library at the time a
call to \fortinline|psb_cdall| is executed, therefore changing the threshold
has no effect on communication descriptors that have already been

@ -191,7 +191,7 @@ contains
integer(psb_ipk_) :: npx,npy,npz, iamx,iamy,iamz,mynx,myny,mynz
integer(psb_ipk_), allocatable :: bndx(:),bndy(:),bndz(:)
! Process grid
integer(psb_ipk_) :: np, iam
integer(psb_ipk_) :: np, iam, nth
integer(psb_ipk_) :: icoeff
integer(psb_lpk_), allocatable :: irow(:),icol(:),myidx(:)
real(psb_dpk_), allocatable :: val(:)
@ -550,6 +550,9 @@ program pdgenspmv
use psb_base_mod
use psb_util_mod
use psb_d_pde3d_mod
#if defined(PSB_OPENMP)
use omp_lib
#endif
implicit none
@ -571,7 +574,7 @@ program pdgenspmv
real(psb_dpk_), allocatable :: tst(:)
! blacs parameters
type(psb_ctxt_type) :: ctxt
integer(psb_ipk_) :: iam, np
integer(psb_ipk_) :: iam, np, nth
! solver parameters
integer(psb_ipk_) :: iter, itmax,itrace, istopc, irst, nr, ipart
@ -589,6 +592,15 @@ program pdgenspmv
call psb_init(ctxt)
call psb_info(ctxt,iam,np)
#if defined(PSB_OPENMP)
!$OMP parallel shared(nth)
!$OMP master
nth = omp_get_num_threads()
!$OMP end master
!$OMP end parallel
#else
nth = 1
#endif
if (iam < 0) then
! This should not happen, but just in case
@ -667,7 +679,9 @@ program pdgenspmv
flops = 2.d0*times*annz
tflops=flops
write(psb_out_unit,'("Matrix: ell1 ",i0)') idim
write(psb_out_unit,'("Test on : ",i20," processors")') np
write(psb_out_unit,'("Test on : ",i20," processes ")') np
write(psb_out_unit,'("Test on : ",i20," threads ")') nth
write(psb_out_unit,'("Total number of tasks : ",i20 )') nth*np
write(psb_out_unit,'("Size of matrix : ",i20," ")') nr
write(psb_out_unit,'("Number of nonzeros : ",i20," ")') annz
write(psb_out_unit,'("Memory occupation : ",i20," ")') amatsize

@ -728,7 +728,7 @@ program psb_d_pde3d
if(psb_errstatus_fatal()) goto 9999
name='pde3d90'
call psb_set_errverbosity(itwo)
call psb_cd_set_large_threshold(125000_psb_ipk_)
call psb_cd_set_hash_threshold(125000_psb_ipk_)
!
! Hello world
!

Loading…
Cancel
Save