base/modules/psb_desc_type.f90

Changed move_alloc and free to work on NULL input var.
psblas-3.0-maint
Salvatore Filippone 13 years ago
parent 14f2f434f5
commit 2203f7239c

@ -635,17 +635,19 @@ contains
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
name = 'psb_cdfree' name = 'psb_cdfree'
if (desc%is_valid()) then
ictxt=psb_cd_get_context(desc) ictxt=psb_cd_get_context(desc)
call psb_info(ictxt, me, np) call psb_info(ictxt, me, np)
! ....verify blacs grid correctness.. ! ....verify blacs grid correctness..
if (np == -1) then if (np == -1) then
info = psb_err_context_error_ info = psb_err_context_error_
call psb_errpush(info,name) call psb_errpush(info,name)
goto 9999 goto 9999
endif endif
else
ictxt = -1
end if
if (.not.allocated(desc%halo_index)) then if (.not.allocated(desc%halo_index)) then
info=298 info=298
@ -739,7 +741,11 @@ contains
if (err_act == psb_act_ret_) then if (err_act == psb_act_ret_) then
return return
else else
call psb_error(ictxt) if (ictxt == -1) then
call psb_error()
else
call psb_error(ictxt)
end if
end if end if
return return
@ -780,37 +786,43 @@ contains
name = 'psb_cdtransfer' name = 'psb_cdtransfer'
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
ictxt = psb_cd_get_context(desc_in) !
call psb_info(ictxt,me,np) ! Note: this might be called even
! Should not require ictxt to be present: this ! when desc_in is empty.
! function might be called even when desc_in is !
! empty. if (desc_in%is_valid()) then
ictxt = psb_cd_get_context(desc_in)
if (info == psb_success_) & call psb_info(ictxt,me,np)
& call psb_move_alloc( desc_in%halo_index , desc_out%halo_index , info)
if (info == psb_success_) & if (info == psb_success_) &
& call psb_move_alloc( desc_in%bnd_elem , desc_out%bnd_elem , info) & call psb_move_alloc( desc_in%halo_index , desc_out%halo_index , info)
if (info == psb_success_) & if (info == psb_success_) &
& call psb_move_alloc( desc_in%ovrlap_elem , desc_out%ovrlap_elem , info) & call psb_move_alloc( desc_in%bnd_elem , desc_out%bnd_elem , info)
if (info == psb_success_) & if (info == psb_success_) &
& call psb_move_alloc( desc_in%ovrlap_index, desc_out%ovrlap_index , info) & call psb_move_alloc( desc_in%ovrlap_elem , desc_out%ovrlap_elem , info)
if (info == psb_success_) & if (info == psb_success_) &
& call psb_move_alloc( desc_in%ovr_mst_idx , desc_out%ovr_mst_idx , info) & call psb_move_alloc( desc_in%ovrlap_index, desc_out%ovrlap_index , info)
if (info == psb_success_) & if (info == psb_success_) &
& call psb_move_alloc( desc_in%ext_index , desc_out%ext_index , info) & call psb_move_alloc( desc_in%ovr_mst_idx , desc_out%ovr_mst_idx , info)
if (info == psb_success_) & if (info == psb_success_) &
& call psb_move_alloc( desc_in%lprm , desc_out%lprm , info) & call psb_move_alloc( desc_in%ext_index , desc_out%ext_index , info)
if (info == psb_success_) & if (info == psb_success_) &
& call psb_move_alloc( desc_in%idx_space , desc_out%idx_space , info) & call psb_move_alloc( desc_in%lprm , desc_out%lprm , info)
if (info == psb_success_) & if (info == psb_success_) &
& call move_alloc(desc_in%indxmap, desc_out%indxmap) & call psb_move_alloc( desc_in%idx_space , desc_out%idx_space , info)
if (info /= psb_success_) then if (info == psb_success_) &
info = psb_err_from_subroutine_ & call move_alloc(desc_in%indxmap, desc_out%indxmap)
call psb_errpush(info,name) if (info /= psb_success_) then
goto 9999 info = psb_err_from_subroutine_
endif call psb_errpush(info,name)
if (debug_level >= psb_debug_ext_) & goto 9999
& write(debug_unit,*) me,' ',trim(name),': end' endif
if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': end'
else
call desc_out%free(info)
end if
call desc_in%free(info)
call psb_erractionrestore(err_act) call psb_erractionrestore(err_act)
return return

Loading…
Cancel
Save