Make sure p_adjcncy and halo_owner are preserved over desc%reinit

merge-paraggr-newops^2
Salvatore Filippone 5 years ago
parent 91f737475e
commit 55666cc0fe

@ -94,8 +94,8 @@ module psb_hash_map_mod
procedure, pass(idxmap) :: lg2lv1_ins => hash_g2lv1_ins
procedure, pass(idxmap) :: lg2lv2_ins => hash_g2lv2_ins
procedure, pass(idxmap) :: hash_cpy
generic, public :: assignment(=) => hash_cpy
!!$ procedure, pass(idxmap) :: hash_cpy
!!$ generic, public :: assignment(=) => hash_cpy
procedure, pass(idxmap) :: bld_g2l_map => hash_bld_g2l_map
end type psb_hash_map
@ -1478,7 +1478,7 @@ contains
& call psb_safe_ab_cpy(idxmap%glb_lc,outmap%glb_lc,info)
if (info == psb_success_)&
& call psb_hash_copy(idxmap%hash,outmap%hash,info)
!!$ outmap = idxmap
class default
! This should be impossible
info = -1
@ -1499,28 +1499,30 @@ contains
end subroutine hash_clone
subroutine hash_cpy(outmap,idxmap)
use psb_penv_mod
use psb_error_mod
use psb_realloc_mod
implicit none
class(psb_hash_map), intent(in) :: idxmap
type(psb_hash_map), intent(out) :: outmap
integer(psb_ipk_) :: info
info = psb_success_
outmap%psb_indx_map = idxmap%psb_indx_map
outmap%hashvsize = idxmap%hashvsize
outmap%hashvmask = idxmap%hashvmask
if (info == psb_success_)&
& call psb_safe_ab_cpy(idxmap%loc_to_glob,outmap%loc_to_glob,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(idxmap%hashv,outmap%hashv,info)
if (info == psb_success_)&
& call psb_safe_ab_cpy(idxmap%glb_lc,outmap%glb_lc,info)
if (info == psb_success_)&
& call psb_hash_copy(idxmap%hash,outmap%hash,info)
end subroutine hash_cpy
!!$ subroutine hash_cpy(outmap,idxmap)
!!$ use psb_penv_mod
!!$ use psb_error_mod
!!$ use psb_realloc_mod
!!$ implicit none
!!$ class(psb_hash_map), intent(in) :: idxmap
!!$ type(psb_hash_map), intent(out) :: outmap
!!$ integer(psb_ipk_) :: info
!!$
!!$ info = psb_success_
!!$ call idxmap%psb_indx_map%cpy(outmap%psb_indx_map,info)
!!$ if (info == psb_success_) then
!!$ outmap%hashvsize = idxmap%hashvsize
!!$ outmap%hashvmask = idxmap%hashvmask
!!$ end if
!!$ if (info == psb_success_)&
!!$ & call psb_safe_ab_cpy(idxmap%loc_to_glob,outmap%loc_to_glob,info)
!!$ if (info == psb_success_)&
!!$ & call psb_safe_ab_cpy(idxmap%hashv,outmap%hashv,info)
!!$ if (info == psb_success_)&
!!$ & call psb_safe_ab_cpy(idxmap%glb_lc,outmap%glb_lc,info)
!!$ if (info == psb_success_)&
!!$ & call psb_hash_copy(idxmap%hash,outmap%hash,info)
!!$ end subroutine hash_cpy
subroutine hash_reinit(idxmap,info)
use psb_penv_mod
@ -1533,7 +1535,7 @@ contains
integer(psb_lpk_) :: lk
integer(psb_lpk_) :: ntot
integer(psb_ipk_) :: ictxt, me, np
integer(psb_ipk_), allocatable :: lidx(:)
integer(psb_ipk_), allocatable :: lidx(:), tadj(:), th_own(:)
integer(psb_lpk_), allocatable :: gidx(:)
character(len=20) :: name='hash_reinit'
logical, parameter :: debug=.false.
@ -1549,13 +1551,16 @@ contains
lidx = (/(k,k=1,nc)/)
gidx = (/(lk,lk=1,nc)/)
call idxmap%l2gip(gidx,info)
tadj = idxmap%get_p_adjcncy()
call idxmap%get_halo_owner(th_own,info)
call idxmap%free()
call hash_init_vlu(idxmap,ictxt,ntot,nr,gidx(1:nr),info)
if (nc>nr) then
call idxmap%g2lip_ins(gidx(nr+1:nc),info,lidx=lidx(nr+1:nc))
end if
call idxmap%set_p_adjcncy(tadj)
call idxmap%set_halo_owner(th_own,info)
if (info /= psb_success_) then
info = psb_err_from_subroutine_

@ -1486,6 +1486,7 @@ contains
end subroutine base_set_halo_owner
subroutine base_get_halo_owner(idxmap,v,info)
use psb_realloc_mod
use psb_penv_mod
use psb_error_mod
implicit none
@ -1494,8 +1495,9 @@ contains
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: nh
nh = min(size(v),size(idxmap%halo_owner))
v(1:nh) = idxmap%halo_owner(1:nh)
nh = size(idxmap%halo_owner)
!v = idxmap%halo_owner(1:nh)
call psb_safe_ab_cpy(idxmap%halo_owner,v,info)
end subroutine base_get_halo_owner
subroutine base_fnd_halo_owner_s(idxmap,xin,xout,info)

@ -69,6 +69,9 @@ Subroutine psb_cd_reinit(desc,info)
call psb_move_alloc(tmp_halo,desc%halo_index,info)
call psb_move_alloc(tmp_ext,desc%ext_index,info)
call desc%indxmap%reinit(info)
!!$ if (me == 0) write(0,*) 'On cdreinit status :',&
!!$ & allocated(desc%indxmap%p_adjcncy),allocated(desc%indxmap%halo_owner), &
!!$ & desc%get_fmt()
! call psb_cd_set_bld(desc,info)
end if

Loading…
Cancel
Save