base/modules/psb_hash_map_mod.f90

In init_vlu: call realloc instead of allocate, to safeguard against
being called from reinit.
psblas-testmv
Salvatore Filippone 11 years ago
parent e0a941dac5
commit dc6d40cdad

@ -909,7 +909,7 @@ contains
call psb_get_mpicomm(ictxt,idxmap%mpic) call psb_get_mpicomm(ictxt,idxmap%mpic)
lc2 = int(1.5*nl) lc2 = int(1.5*nl)
allocate(idxmap%loc_to_glob(lc2),stat=info) call psb_realloc(lc2,idxmap%loc_to_glob,info)
if (info /= 0) then if (info /= 0) then
info = -2 info = -2
return return
@ -1461,27 +1461,25 @@ contains
implicit none implicit none
class(psb_hash_map), intent(inout) :: idxmap class(psb_hash_map), intent(inout) :: idxmap
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act, nr,nc,k, nl, ictxt, ntot integer(psb_ipk_) :: err_act, nr,nc,k, nl, ictxt, ntot, me, np
integer(psb_ipk_), allocatable :: idx(:),lidx(:) integer(psb_ipk_), allocatable :: idx(:),lidx(:)
character(len=20) :: name='hash_reinit' character(len=20) :: name='hash_reinit'
logical, parameter :: debug=.false. logical, parameter :: debug=.false.
write(0,*) 'Going through hash_reinit'
info = psb_success_ info = psb_success_
call psb_get_erraction(err_act) call psb_get_erraction(err_act)
ictxt = idxmap%get_ctxt() ictxt = idxmap%get_ctxt()
nr = idxmap%get_lr() nr = idxmap%get_lr()
nc = idxmap%get_lc() nc = idxmap%get_lc()
ntot = idxmap%get_gr() ntot = idxmap%get_gr()
if (nc>nr) then
lidx = (/(k,k=1,nc)/)
idx = (/(k,k=1,nc)/) lidx = (/(k,k=1,nc)/)
call idxmap%l2gip(idx,info) idx = (/(k,k=1,nc)/)
end if call idxmap%l2gip(idx,info)
if (info /= 0) &
& write(0,*) 'From l2gip',info
call idxmap%free() call idxmap%free()
call hash_init_vlu(idxmap,ictxt,ntot,nr,idx(1:nr),info) call hash_init_vlu(idxmap,ictxt,ntot,nr,idx(1:nr),info)
if (nc>nr) then if (nc>nr) then
call idxmap%g2lip_ins(idx(nr+1:nc),info,lidx=lidx(nr+1:nc)) call idxmap%g2lip_ins(idx(nr+1:nc),info,lidx=lidx(nr+1:nc))
end if end if

Loading…
Cancel
Save