|
|
@ -515,7 +515,6 @@ contains
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
write(0,*) 'Hash status: invalid ',idxmap%get_state()
|
|
|
|
write(0,*) 'Hash status: invalid ',idxmap%get_state()
|
|
|
|
idxout(1:is) = -1
|
|
|
|
idxout(1:is) = -1
|
|
|
@ -655,7 +654,7 @@ contains
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
logical, volatile :: isLoopValid
|
|
|
|
logical, volatile :: isLoopValid
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
name = 'hash_g2l_ins'
|
|
|
|
name = 'hash_g2lv1_ins'
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
ctxt = idxmap%get_ctxt()
|
|
|
|
ctxt = idxmap%get_ctxt()
|
|
|
@ -679,7 +678,7 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
mglob = idxmap%get_gr()
|
|
|
|
mglob = idxmap%get_gr()
|
|
|
|
nrow = idxmap%get_lr()
|
|
|
|
nrow = idxmap%get_lr()
|
|
|
|
|
|
|
|
!write(0,*) me,name,' before loop ',psb_errstatus_fatal()
|
|
|
|
if (use_openmp) then
|
|
|
|
if (use_openmp) then
|
|
|
|
#ifdef OPENMP
|
|
|
|
#ifdef OPENMP
|
|
|
|
!call OMP_init_lock(ins_lck)
|
|
|
|
!call OMP_init_lock(ins_lck)
|
|
|
@ -751,6 +750,7 @@ contains
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
!write(0,*) 'Error spot 1'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
|
|
|
|
|
|
|
@ -832,6 +832,7 @@ contains
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
!write(0,*) 'Error spot 2'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
|
|
|
|
|
|
|
@ -883,38 +884,42 @@ contains
|
|
|
|
! At first, we check the index presence in 'idxmap'. Usually
|
|
|
|
! At first, we check the index presence in 'idxmap'. Usually
|
|
|
|
! the index is found. If it is not found, we repeat the checking,
|
|
|
|
! the index is found. If it is not found, we repeat the checking,
|
|
|
|
! but inside a critical region.
|
|
|
|
! but inside a critical region.
|
|
|
|
|
|
|
|
!write(0,*) me,name,' b hic 1 ',psb_errstatus_fatal()
|
|
|
|
call hash_inner_cnv(ip,lip,idxmap%hashvmask,&
|
|
|
|
call hash_inner_cnv(ip,lip,idxmap%hashvmask,&
|
|
|
|
& idxmap%hashv,idxmap%glb_lc,ncol)
|
|
|
|
& idxmap%hashv,idxmap%glb_lc,ncol)
|
|
|
|
|
|
|
|
!write(0,*) me,name,' a hic 1 ',psb_errstatus_fatal()
|
|
|
|
if (lip < 0) then
|
|
|
|
if (lip < 0) then
|
|
|
|
!call OMP_set_lock(ins_lck)
|
|
|
|
!call OMP_set_lock(ins_lck)
|
|
|
|
! We check again if the index is already in 'idxmap', this
|
|
|
|
! We check again if the index is already in 'idxmap', this
|
|
|
|
! time inside a critical region (we assume that the index
|
|
|
|
! time inside a critical region (we assume that the index
|
|
|
|
! is often already existing, so this lock is relatively rare).
|
|
|
|
! is often already existing, so this lock is relatively rare).
|
|
|
|
ncol = idxmap%get_lc()
|
|
|
|
ncol = idxmap%get_lc()
|
|
|
|
nxt = ncol + 1
|
|
|
|
nxt = ncol + 1
|
|
|
|
|
|
|
|
!write(0,*) me,name,' b hic 2 ',psb_errstatus_fatal()
|
|
|
|
call hash_inner_cnv(ip,lip,idxmap%hashvmask,&
|
|
|
|
call hash_inner_cnv(ip,lip,idxmap%hashvmask,&
|
|
|
|
& idxmap%hashv,idxmap%glb_lc,ncol)
|
|
|
|
& idxmap%hashv,idxmap%glb_lc,ncol)
|
|
|
|
|
|
|
|
!write(0,*) me,name,' a hic 2 ',psb_errstatus_fatal()
|
|
|
|
if (lip > 0) then
|
|
|
|
if (lip > 0) then
|
|
|
|
idx(i) = lip
|
|
|
|
idx(i) = lip
|
|
|
|
else if (lip < 0) then
|
|
|
|
else if (lip < 0) then
|
|
|
|
! Index not found
|
|
|
|
! Index not found
|
|
|
|
|
|
|
|
!write(0,*) me,name,' b hsik ',psb_errstatus_fatal()
|
|
|
|
call psb_hash_searchinskey(ip,tlip,nxt,idxmap%hash,info)
|
|
|
|
call psb_hash_searchinskey(ip,tlip,nxt,idxmap%hash,info)
|
|
|
|
|
|
|
|
!write(0,*) me,name,' a hsik ',psb_errstatus_fatal()
|
|
|
|
lip = tlip
|
|
|
|
lip = tlip
|
|
|
|
|
|
|
|
|
|
|
|
if (info >= 0) then
|
|
|
|
if (info >= 0) then
|
|
|
|
|
|
|
|
!write(0,*) 'Error before spot 3', info
|
|
|
|
! 'nxt' is not equal to 'tlip' when the key is already inside
|
|
|
|
! 'nxt' is not equal to 'tlip' when the key is already inside
|
|
|
|
! the hash map. In that case 'tlip' is the value corresponding
|
|
|
|
! the hash map. In that case 'tlip' is the value corresponding
|
|
|
|
! to the existing mapping.
|
|
|
|
! to the existing mapping.
|
|
|
|
if (nxt == tlip) then
|
|
|
|
if (nxt == tlip) then
|
|
|
|
|
|
|
|
|
|
|
|
ncol = MAX(ncol,nxt)
|
|
|
|
ncol = MAX(ncol,nxt)
|
|
|
|
|
|
|
|
|
|
|
|
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,&
|
|
|
|
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,&
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
!write(0,*) 'Error spot 3', info
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
|
|
|
|
|
|
|
@ -996,6 +1001,7 @@ contains
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
|
|
|
|
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
!write(0,*) 'Error spot 4'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
|
|
|
|
|
|
|
@ -1069,6 +1075,7 @@ contains
|
|
|
|
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,&
|
|
|
|
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,&
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
|
|
|
|
!write(0,*) 'Error spot'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
isLoopValid = .false.
|
|
|
|
isLoopValid = .false.
|
|
|
@ -1113,9 +1120,11 @@ contains
|
|
|
|
if (info >=0) then
|
|
|
|
if (info >=0) then
|
|
|
|
if (nxt == lip) then
|
|
|
|
if (nxt == lip) then
|
|
|
|
ncol = max(nxt,ncol)
|
|
|
|
ncol = max(nxt,ncol)
|
|
|
|
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
call psb_ensure_size(ncol,idxmap%loc_to_glob,info,&
|
|
|
|
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=1
|
|
|
|
info=1
|
|
|
|
|
|
|
|
!write(0,*) 'Error spot'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
&a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
isLoopValid = .false.
|
|
|
|
isLoopValid = .false.
|
|
|
@ -1162,6 +1171,7 @@ contains
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=1
|
|
|
|
info=1
|
|
|
|
|
|
|
|
write(0,*) 'Error spot 5'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
& a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
& a_err='psb_ensure_size',i_err=(/info/))
|
|
|
|
isLoopValid = .false.
|
|
|
|
isLoopValid = .false.
|
|
|
@ -1205,6 +1215,7 @@ contains
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
& pad=-1_psb_lpk_,addsz=laddsz)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
info=1
|
|
|
|
info=1
|
|
|
|
|
|
|
|
write(0,*) 'Error spot 6'
|
|
|
|
ch_err='psb_ensure_size'
|
|
|
|
ch_err='psb_ensure_size'
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
call psb_errpush(psb_err_from_subroutine_ai_,name,&
|
|
|
|
&a_err=ch_err,i_err=(/info,izero,izero,izero,izero/))
|
|
|
|
&a_err=ch_err,i_err=(/info,izero,izero,izero,izero/))
|
|
|
@ -1239,6 +1250,7 @@ contains
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
if (.not. isLoopValid) goto 9999
|
|
|
|
if (.not. isLoopValid) goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
!write(0,*) me,name,' after loop ',psb_errstatus_fatal()
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -1252,6 +1264,7 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
subroutine hash_g2lv2_ins(idxin,idxout,idxmap,info,mask,lidx)
|
|
|
|
subroutine hash_g2lv2_ins(idxin,idxout,idxmap,info,mask,lidx)
|
|
|
|
use psb_realloc_mod
|
|
|
|
use psb_realloc_mod
|
|
|
|
|
|
|
|
use psb_error_mod
|
|
|
|
implicit none
|
|
|
|
implicit none
|
|
|
|
class(psb_hash_map), intent(inout) :: idxmap
|
|
|
|
class(psb_hash_map), intent(inout) :: idxmap
|
|
|
|
integer(psb_lpk_), intent(in) :: idxin(:)
|
|
|
|
integer(psb_lpk_), intent(in) :: idxin(:)
|
|
|
@ -1264,7 +1277,9 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
is = size(idxin)
|
|
|
|
is = size(idxin)
|
|
|
|
im = min(is,size(idxout))
|
|
|
|
im = min(is,size(idxout))
|
|
|
|
|
|
|
|
!write(0,*) 'g2lv2_ins before realloc ',psb_errstatus_fatal()
|
|
|
|
call psb_realloc(im,tidx,info)
|
|
|
|
call psb_realloc(im,tidx,info)
|
|
|
|
|
|
|
|
!write(0,*) 'g2lv2_ins after realloc ',psb_errstatus_fatal()
|
|
|
|
tidx(1:im) = idxin(1:im)
|
|
|
|
tidx(1:im) = idxin(1:im)
|
|
|
|
call idxmap%g2lip_ins(tidx(1:im),info,mask=mask,lidx=lidx)
|
|
|
|
call idxmap%g2lip_ins(tidx(1:im),info,mask=mask,lidx=lidx)
|
|
|
|
idxout(1:im) = tidx(1:im)
|
|
|
|
idxout(1:im) = tidx(1:im)
|
|
|
|