mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-16 19:02:09 +00:00
Fix error_impl, and add check_error()
This commit is contained in:
@@ -46,11 +46,14 @@ subroutine psb_par_error_handler(ctxt,err_act)
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
|
||||
if (err_act == psb_act_print_) &
|
||||
& call psb_error(ctxt, abrt=.false.)
|
||||
if (err_act == psb_act_abort_) &
|
||||
& call psb_error(ctxt, abrt=.true.)
|
||||
|
||||
if (err_act == psb_act_print_) then
|
||||
call psb_error(ctxt, abrt=.false.)
|
||||
else if (err_act == psb_act_ret_) then
|
||||
! do nothing
|
||||
else
|
||||
call psb_error(ctxt, abrt=.true.)
|
||||
end if
|
||||
|
||||
return
|
||||
|
||||
end subroutine psb_par_error_handler
|
||||
|
||||
@@ -162,6 +162,7 @@ module psb_error_mod
|
||||
logical, save :: comm_global_checks = .false.
|
||||
|
||||
contains
|
||||
|
||||
subroutine psb_set_global_checks(val)
|
||||
logical, intent(in), optional :: val
|
||||
|
||||
@@ -182,7 +183,16 @@ contains
|
||||
|
||||
val = comm_global_checks
|
||||
end function psb_get_global_checks
|
||||
|
||||
|
||||
subroutine psb_check_error(ctxt,abrt)
|
||||
implicit none
|
||||
type(psb_ctxt_type), intent(in) :: ctxt
|
||||
logical, optional, intent(in) :: abrt
|
||||
|
||||
if (psb_errstatus_fatal()) then
|
||||
call psb_error(ctxt,abrt)
|
||||
end if
|
||||
end subroutine psb_check_error
|
||||
|
||||
! saves action to support error traceback
|
||||
! also changes error action to "return"
|
||||
|
||||
Reference in New Issue
Block a user