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,7 +635,7 @@ 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)
@ -645,7 +645,9 @@ contains
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
@ -738,9 +740,13 @@ contains
if (err_act == psb_act_ret_) then if (err_act == psb_act_ret_) then
return return
else
if (ictxt == -1) then
call psb_error()
else else
call psb_error(ictxt) call psb_error(ictxt)
end if end if
end if
return return
end subroutine psb_cdfree end subroutine psb_cdfree
@ -780,11 +786,13 @@ 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()
!
! Note: this might be called even
! when desc_in is empty.
!
if (desc_in%is_valid()) then
ictxt = psb_cd_get_context(desc_in) ictxt = psb_cd_get_context(desc_in)
call psb_info(ictxt,me,np) call psb_info(ictxt,me,np)
! Should not require ictxt to be present: this
! function might be called even when desc_in is
! empty.
if (info == psb_success_) & if (info == psb_success_) &
& call psb_move_alloc( desc_in%halo_index , desc_out%halo_index , info) & call psb_move_alloc( desc_in%halo_index , desc_out%halo_index , info)
@ -811,6 +819,10 @@ contains
endif endif
if (debug_level >= psb_debug_ext_) & if (debug_level >= psb_debug_ext_) &
& write(debug_unit,*) me,' ',trim(name),': end' & 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