diff --git a/Changelog b/Changelog index b14f351f5..163d09f5f 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,12 @@ Changelog. A lot less detailed than usual, at least for past history. +2015/01/05: Fix silly bug in format conversion csr_from_coo. + +2014/12/21: Change error handling routines to make them more flexible for + C binding. More compact prologues/epilogues. + +2014/11/12: Fix silly bug in MMIO: cycling through rank-2 dense read/write was + transposing! 2014/10/22: Implement norm-1 and norm-infinity at base_sparse_mat relying on srwsum/aclsum. diff --git a/base/comm/psb_cgather.f90 b/base/comm/psb_cgather.f90 index 1f9b07ed6..a9b642049 100644 --- a/base/comm/psb_cgather.f90 +++ b/base/comm/psb_cgather.f90 @@ -127,7 +127,7 @@ subroutine psb_cgatherm(globx, locx, desc_a, info, iroot) call psb_errpush(info,name) goto 9999 end if - + call psb_realloc(m,k,globx,info) if (info /= psb_success_) then info=psb_err_alloc_dealloc_ @@ -160,13 +160,8 @@ subroutine psb_cgatherm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cgatherm @@ -298,21 +293,21 @@ subroutine psb_cgatherv(globx, locx, desc_a, info, iroot) call psb_errpush(info,name) goto 9999 end if - + call psb_realloc(m,globx,info) if (info /= psb_success_) then info=psb_err_alloc_dealloc_ call psb_errpush(info,name) goto 9999 end if - + globx(:)=czero do i=1,desc_a%get_local_rows() call psb_loc_to_glob(i,idx,desc_a,info) globx(idx) = locx(i) end do - + ! adjust overlapped elements do i=1, size(desc_a%ovrlap_elem,1) if (me /= desc_a%ovrlap_elem(i,3)) then @@ -321,19 +316,14 @@ subroutine psb_cgatherv(globx, locx, desc_a, info, iroot) globx(idx) = czero end if end do - + call psb_sum(ictxt,globx(1:m),root=root) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cgatherv @@ -446,13 +436,8 @@ subroutine psb_cgather_vect(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cgather_vect diff --git a/base/comm/psb_chalo.f90 b/base/comm/psb_chalo.f90 index 88d63166f..fe0f8d158 100644 --- a/base/comm/psb_chalo.f90 +++ b/base/comm/psb_chalo.f90 @@ -208,14 +208,9 @@ subroutine psb_chalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_chalom @@ -409,14 +404,9 @@ subroutine psb_chalov(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_chalov @@ -560,12 +550,7 @@ subroutine psb_chalo_vect(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_chalo_vect diff --git a/base/comm/psb_covrl.f90 b/base/comm/psb_covrl.f90 index 6fee907bc..970cea366 100644 --- a/base/comm/psb_covrl.f90 +++ b/base/comm/psb_covrl.f90 @@ -193,14 +193,9 @@ subroutine psb_covrlm(x,desc_a,info,jx,ik,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_covrlm !!$ !!$ Parallel Sparse BLAS version 3.1 @@ -378,14 +373,9 @@ subroutine psb_covrlv(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_covrlv @@ -508,13 +498,8 @@ subroutine psb_covrl_vect(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_covrl_vect diff --git a/base/comm/psb_cscatter.F90 b/base/comm/psb_cscatter.F90 index cf8c372b2..77085cd80 100644 --- a/base/comm/psb_cscatter.F90 +++ b/base/comm/psb_cscatter.F90 @@ -233,14 +233,9 @@ subroutine psb_cscatterm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_cscatterm @@ -468,13 +463,8 @@ subroutine psb_cscatterv(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_cscatterv diff --git a/base/comm/psb_cspgather.F90 b/base/comm/psb_cspgather.F90 index 531bd4c6b..018df2917 100644 --- a/base/comm/psb_cspgather.F90 +++ b/base/comm/psb_cspgather.F90 @@ -149,12 +149,8 @@ subroutine psb_csp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep 9999 continue call psb_errpush(info,name) - call psb_erractionrestore(err_act) - if (err_act.eq.psb_act_abort_) then - call psb_error() - return - end if - return + call psb_error_handler(ictxt,err_act) + return end subroutine psb_csp_allgather diff --git a/base/comm/psb_dgather.f90 b/base/comm/psb_dgather.f90 index 7d62687c8..2135402f6 100644 --- a/base/comm/psb_dgather.f90 +++ b/base/comm/psb_dgather.f90 @@ -127,7 +127,7 @@ subroutine psb_dgatherm(globx, locx, desc_a, info, iroot) call psb_errpush(info,name) goto 9999 end if - + call psb_realloc(m,k,globx,info) if (info /= psb_success_) then info=psb_err_alloc_dealloc_ @@ -160,13 +160,8 @@ subroutine psb_dgatherm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dgatherm @@ -298,21 +293,21 @@ subroutine psb_dgatherv(globx, locx, desc_a, info, iroot) call psb_errpush(info,name) goto 9999 end if - + call psb_realloc(m,globx,info) if (info /= psb_success_) then info=psb_err_alloc_dealloc_ call psb_errpush(info,name) goto 9999 end if - + globx(:)=dzero do i=1,desc_a%get_local_rows() call psb_loc_to_glob(i,idx,desc_a,info) globx(idx) = locx(i) end do - + ! adjust overlapped elements do i=1, size(desc_a%ovrlap_elem,1) if (me /= desc_a%ovrlap_elem(i,3)) then @@ -321,19 +316,14 @@ subroutine psb_dgatherv(globx, locx, desc_a, info, iroot) globx(idx) = dzero end if end do - + call psb_sum(ictxt,globx(1:m),root=root) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dgatherv @@ -446,13 +436,8 @@ subroutine psb_dgather_vect(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dgather_vect diff --git a/base/comm/psb_dhalo.f90 b/base/comm/psb_dhalo.f90 index 8fd81d7d6..4fa906659 100644 --- a/base/comm/psb_dhalo.f90 +++ b/base/comm/psb_dhalo.f90 @@ -208,14 +208,9 @@ subroutine psb_dhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_dhalom @@ -409,14 +404,9 @@ subroutine psb_dhalov(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_dhalov @@ -560,12 +550,7 @@ subroutine psb_dhalo_vect(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_dhalo_vect diff --git a/base/comm/psb_dovrl.f90 b/base/comm/psb_dovrl.f90 index 54d325f98..5add77f2c 100644 --- a/base/comm/psb_dovrl.f90 +++ b/base/comm/psb_dovrl.f90 @@ -193,14 +193,9 @@ subroutine psb_dovrlm(x,desc_a,info,jx,ik,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_dovrlm !!$ !!$ Parallel Sparse BLAS version 3.1 @@ -378,14 +373,9 @@ subroutine psb_dovrlv(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_dovrlv @@ -508,13 +498,8 @@ subroutine psb_dovrl_vect(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_dovrl_vect diff --git a/base/comm/psb_dscatter.F90 b/base/comm/psb_dscatter.F90 index e8652b788..886eff24e 100644 --- a/base/comm/psb_dscatter.F90 +++ b/base/comm/psb_dscatter.F90 @@ -233,14 +233,9 @@ subroutine psb_dscatterm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_dscatterm @@ -468,13 +463,8 @@ subroutine psb_dscatterv(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_dscatterv diff --git a/base/comm/psb_dspgather.F90 b/base/comm/psb_dspgather.F90 index c032874b4..777fd4acd 100644 --- a/base/comm/psb_dspgather.F90 +++ b/base/comm/psb_dspgather.F90 @@ -149,12 +149,8 @@ subroutine psb_dsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep 9999 continue call psb_errpush(info,name) - call psb_erractionrestore(err_act) - if (err_act.eq.psb_act_abort_) then - call psb_error() - return - end if - return + call psb_error_handler(ictxt,err_act) + return end subroutine psb_dsp_allgather diff --git a/base/comm/psb_igather.f90 b/base/comm/psb_igather.f90 index 5470c180a..07b36c3fe 100644 --- a/base/comm/psb_igather.f90 +++ b/base/comm/psb_igather.f90 @@ -160,14 +160,9 @@ subroutine psb_igatherm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_igatherm @@ -319,14 +314,9 @@ subroutine psb_igatherv(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_igatherv @@ -437,13 +427,8 @@ subroutine psb_igather_vect(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_igather_vect diff --git a/base/comm/psb_ihalo.f90 b/base/comm/psb_ihalo.f90 index 6b6cb3f84..209410961 100644 --- a/base/comm/psb_ihalo.f90 +++ b/base/comm/psb_ihalo.f90 @@ -212,14 +212,9 @@ subroutine psb_ihalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_ihalom @@ -415,14 +410,9 @@ subroutine psb_ihalov(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_ihalov @@ -568,12 +558,7 @@ subroutine psb_ihalo_vect(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_ihalo_vect diff --git a/base/comm/psb_iovrl.f90 b/base/comm/psb_iovrl.f90 index 1d72edbd3..6b0782872 100644 --- a/base/comm/psb_iovrl.f90 +++ b/base/comm/psb_iovrl.f90 @@ -191,14 +191,9 @@ subroutine psb_iovrlm(x,desc_a,info,jx,ik,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_iovrlm !!$ @@ -379,14 +374,9 @@ subroutine psb_iovrlv(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_iovrlv subroutine psb_iovrl_vect(x,desc_a,info,work,update,mode) @@ -508,13 +498,8 @@ subroutine psb_iovrl_vect(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_iovrl_vect diff --git a/base/comm/psb_iscatter.F90 b/base/comm/psb_iscatter.F90 index 9d9f54816..8adde4a7e 100644 --- a/base/comm/psb_iscatter.F90 +++ b/base/comm/psb_iscatter.F90 @@ -217,14 +217,9 @@ subroutine psb_iscatterm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_iscatterm @@ -424,13 +419,8 @@ subroutine psb_iscatterv(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_iscatterv diff --git a/base/comm/psb_sgather.f90 b/base/comm/psb_sgather.f90 index 297cd81e4..e825b16cb 100644 --- a/base/comm/psb_sgather.f90 +++ b/base/comm/psb_sgather.f90 @@ -127,7 +127,7 @@ subroutine psb_sgatherm(globx, locx, desc_a, info, iroot) call psb_errpush(info,name) goto 9999 end if - + call psb_realloc(m,k,globx,info) if (info /= psb_success_) then info=psb_err_alloc_dealloc_ @@ -160,13 +160,8 @@ subroutine psb_sgatherm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sgatherm @@ -298,21 +293,21 @@ subroutine psb_sgatherv(globx, locx, desc_a, info, iroot) call psb_errpush(info,name) goto 9999 end if - + call psb_realloc(m,globx,info) if (info /= psb_success_) then info=psb_err_alloc_dealloc_ call psb_errpush(info,name) goto 9999 end if - + globx(:)=szero do i=1,desc_a%get_local_rows() call psb_loc_to_glob(i,idx,desc_a,info) globx(idx) = locx(i) end do - + ! adjust overlapped elements do i=1, size(desc_a%ovrlap_elem,1) if (me /= desc_a%ovrlap_elem(i,3)) then @@ -321,19 +316,14 @@ subroutine psb_sgatherv(globx, locx, desc_a, info, iroot) globx(idx) = szero end if end do - + call psb_sum(ictxt,globx(1:m),root=root) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sgatherv @@ -446,13 +436,8 @@ subroutine psb_sgather_vect(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sgather_vect diff --git a/base/comm/psb_shalo.f90 b/base/comm/psb_shalo.f90 index de71fa4f8..979cc83f4 100644 --- a/base/comm/psb_shalo.f90 +++ b/base/comm/psb_shalo.f90 @@ -208,14 +208,9 @@ subroutine psb_shalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_shalom @@ -409,14 +404,9 @@ subroutine psb_shalov(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_shalov @@ -560,12 +550,7 @@ subroutine psb_shalo_vect(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_shalo_vect diff --git a/base/comm/psb_sovrl.f90 b/base/comm/psb_sovrl.f90 index 968aaf680..bca230276 100644 --- a/base/comm/psb_sovrl.f90 +++ b/base/comm/psb_sovrl.f90 @@ -193,14 +193,9 @@ subroutine psb_sovrlm(x,desc_a,info,jx,ik,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_sovrlm !!$ !!$ Parallel Sparse BLAS version 3.1 @@ -378,14 +373,9 @@ subroutine psb_sovrlv(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_sovrlv @@ -508,13 +498,8 @@ subroutine psb_sovrl_vect(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_sovrl_vect diff --git a/base/comm/psb_sscatter.F90 b/base/comm/psb_sscatter.F90 index 35424a348..c977d2c0e 100644 --- a/base/comm/psb_sscatter.F90 +++ b/base/comm/psb_sscatter.F90 @@ -233,14 +233,9 @@ subroutine psb_sscatterm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_sscatterm @@ -468,13 +463,8 @@ subroutine psb_sscatterv(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_sscatterv diff --git a/base/comm/psb_sspgather.F90 b/base/comm/psb_sspgather.F90 index 231eda6a7..5f68d2f0d 100644 --- a/base/comm/psb_sspgather.F90 +++ b/base/comm/psb_sspgather.F90 @@ -149,12 +149,8 @@ subroutine psb_ssp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep 9999 continue call psb_errpush(info,name) - call psb_erractionrestore(err_act) - if (err_act.eq.psb_act_abort_) then - call psb_error() - return - end if - return + call psb_error_handler(ictxt,err_act) + return end subroutine psb_ssp_allgather diff --git a/base/comm/psb_zgather.f90 b/base/comm/psb_zgather.f90 index c2759ea52..cb8564b3e 100644 --- a/base/comm/psb_zgather.f90 +++ b/base/comm/psb_zgather.f90 @@ -127,7 +127,7 @@ subroutine psb_zgatherm(globx, locx, desc_a, info, iroot) call psb_errpush(info,name) goto 9999 end if - + call psb_realloc(m,k,globx,info) if (info /= psb_success_) then info=psb_err_alloc_dealloc_ @@ -160,13 +160,8 @@ subroutine psb_zgatherm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zgatherm @@ -298,21 +293,21 @@ subroutine psb_zgatherv(globx, locx, desc_a, info, iroot) call psb_errpush(info,name) goto 9999 end if - + call psb_realloc(m,globx,info) if (info /= psb_success_) then info=psb_err_alloc_dealloc_ call psb_errpush(info,name) goto 9999 end if - + globx(:)=zzero do i=1,desc_a%get_local_rows() call psb_loc_to_glob(i,idx,desc_a,info) globx(idx) = locx(i) end do - + ! adjust overlapped elements do i=1, size(desc_a%ovrlap_elem,1) if (me /= desc_a%ovrlap_elem(i,3)) then @@ -321,19 +316,14 @@ subroutine psb_zgatherv(globx, locx, desc_a, info, iroot) globx(idx) = zzero end if end do - + call psb_sum(ictxt,globx(1:m),root=root) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zgatherv @@ -446,13 +436,8 @@ subroutine psb_zgather_vect(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zgather_vect diff --git a/base/comm/psb_zhalo.f90 b/base/comm/psb_zhalo.f90 index 22b61a25f..e9b5ac886 100644 --- a/base/comm/psb_zhalo.f90 +++ b/base/comm/psb_zhalo.f90 @@ -208,14 +208,9 @@ subroutine psb_zhalom(x,desc_a,info,alpha,jx,ik,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_zhalom @@ -409,14 +404,9 @@ subroutine psb_zhalov(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_zhalov @@ -560,12 +550,7 @@ subroutine psb_zhalo_vect(x,desc_a,info,alpha,work,tran,mode,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_zhalo_vect diff --git a/base/comm/psb_zovrl.f90 b/base/comm/psb_zovrl.f90 index 70e3472f1..b98d189cc 100644 --- a/base/comm/psb_zovrl.f90 +++ b/base/comm/psb_zovrl.f90 @@ -193,14 +193,9 @@ subroutine psb_zovrlm(x,desc_a,info,jx,ik,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_zovrlm !!$ !!$ Parallel Sparse BLAS version 3.1 @@ -378,14 +373,9 @@ subroutine psb_zovrlv(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_zovrlv @@ -508,13 +498,8 @@ subroutine psb_zovrl_vect(x,desc_a,info,work,update,mode) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_zovrl_vect diff --git a/base/comm/psb_zscatter.F90 b/base/comm/psb_zscatter.F90 index 402dc2183..33918793d 100644 --- a/base/comm/psb_zscatter.F90 +++ b/base/comm/psb_zscatter.F90 @@ -233,14 +233,9 @@ subroutine psb_zscatterm(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_zscatterm @@ -468,13 +463,8 @@ subroutine psb_zscatterv(globx, locx, desc_a, info, iroot) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) return - end if - return end subroutine psb_zscatterv diff --git a/base/comm/psb_zspgather.F90 b/base/comm/psb_zspgather.F90 index c74f16764..ec85c14ba 100644 --- a/base/comm/psb_zspgather.F90 +++ b/base/comm/psb_zspgather.F90 @@ -149,12 +149,8 @@ subroutine psb_zsp_allgather(globa, loca, desc_a, info, root, dupl,keepnum,keep 9999 continue call psb_errpush(info,name) - call psb_erractionrestore(err_act) - if (err_act.eq.psb_act_abort_) then - call psb_error() - return - end if - return + call psb_error_handler(ictxt,err_act) + return end subroutine psb_zsp_allgather diff --git a/base/internals/psb_indx_map_fnd_owner.F90 b/base/internals/psb_indx_map_fnd_owner.F90 index bdb756f75..4a02386ef 100644 --- a/base/internals/psb_indx_map_fnd_owner.F90 +++ b/base/internals/psb_indx_map_fnd_owner.F90 @@ -316,14 +316,8 @@ subroutine psb_indx_map_fnd_owner(idx,iprc,idxmap,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_indx_map_fnd_owner diff --git a/base/internals/psi_bld_tmphalo.f90 b/base/internals/psi_bld_tmphalo.f90 index 1a3e65885..94cb1a1f1 100644 --- a/base/internals/psi_bld_tmphalo.f90 +++ b/base/internals/psi_bld_tmphalo.f90 @@ -141,15 +141,8 @@ subroutine psi_bld_tmphalo(desc,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then return - else - call psb_error(ictxt) - end if - return - end subroutine psi_bld_tmphalo diff --git a/base/internals/psi_bld_tmpovrl.f90 b/base/internals/psi_bld_tmpovrl.f90 index 62a051d59..7c461fd89 100644 --- a/base/internals/psi_bld_tmpovrl.f90 +++ b/base/internals/psi_bld_tmpovrl.f90 @@ -143,15 +143,8 @@ subroutine psi_bld_tmpovrl(iv,desc,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then return - else - call psb_error(ictxt) - end if - return - end subroutine psi_bld_tmpovrl diff --git a/base/internals/psi_compute_size.f90 b/base/internals/psi_compute_size.f90 index 2d1927036..3ca8ad97e 100644 --- a/base/internals/psi_compute_size.f90 +++ b/base/internals/psi_compute_size.f90 @@ -123,12 +123,8 @@ subroutine psi_compute_size(desc_data, index_in, dl_lda, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psi_compute_size diff --git a/base/internals/psi_crea_bnd_elem.f90 b/base/internals/psi_crea_bnd_elem.f90 index 2acfb5bf5..61466ad64 100644 --- a/base/internals/psi_crea_bnd_elem.f90 +++ b/base/internals/psi_crea_bnd_elem.f90 @@ -112,11 +112,8 @@ subroutine psi_crea_bnd_elem(bndel,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psi_crea_bnd_elem diff --git a/base/internals/psi_crea_index.f90 b/base/internals/psi_crea_index.f90 index 3c1a5c7b0..2d414e352 100644 --- a/base/internals/psi_crea_index.f90 +++ b/base/internals/psi_crea_index.f90 @@ -152,11 +152,7 @@ subroutine psi_crea_index(desc_a,index_in,index_out,glob_idx,nxch,nsnd,nrcv,info call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psi_crea_index diff --git a/base/internals/psi_crea_ovr_elem.f90 b/base/internals/psi_crea_ovr_elem.f90 index b6191fa51..77de0de3c 100644 --- a/base/internals/psi_crea_ovr_elem.f90 +++ b/base/internals/psi_crea_ovr_elem.f90 @@ -139,12 +139,8 @@ subroutine psi_crea_ovr_elem(me,desc_overlap,ovr_elem,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psi_crea_ovr_elem diff --git a/base/internals/psi_cswapdata.F90 b/base/internals/psi_cswapdata.F90 index 11eea4216..b7c8d02f1 100644 --- a/base/internals/psi_cswapdata.F90 +++ b/base/internals/psi_cswapdata.F90 @@ -147,13 +147,9 @@ subroutine psi_cswapdatam(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswapdatam subroutine psi_cswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -519,13 +515,9 @@ subroutine psi_cswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswapidxm ! @@ -645,13 +637,9 @@ subroutine psi_cswapdatav(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswapdatav @@ -1005,13 +993,9 @@ subroutine psi_cswapidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswapidxv subroutine psi_cswapdata_vect(flag,beta,y,desc_a,work,info,data) @@ -1082,13 +1066,9 @@ subroutine psi_cswapdata_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswapdata_vect @@ -1444,13 +1424,9 @@ subroutine psi_cswapidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv, call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswapidx_vect @@ -1807,12 +1783,8 @@ subroutine psi_cswap_vidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrc call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswap_vidx_vect diff --git a/base/internals/psi_cswaptran.F90 b/base/internals/psi_cswaptran.F90 index 9a54caeae..0bb052db6 100644 --- a/base/internals/psi_cswaptran.F90 +++ b/base/internals/psi_cswaptran.F90 @@ -152,13 +152,9 @@ subroutine psi_cswaptranm(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswaptranm subroutine psi_ctranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -526,13 +522,9 @@ subroutine psi_ctranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_ctranidxm ! ! @@ -655,13 +647,9 @@ subroutine psi_cswaptranv(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswaptranv @@ -1031,13 +1019,9 @@ subroutine psi_ctranidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_ctranidxv @@ -1107,13 +1091,9 @@ subroutine psi_cswaptran_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_cswaptran_vect @@ -1480,13 +1460,9 @@ subroutine psi_ctranidx_vect(iictxt,iicomm,flag,beta,y,idx,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_ctranidx_vect diff --git a/base/internals/psi_desc_impl.f90 b/base/internals/psi_desc_impl.f90 index 9c910541d..332cf03af 100644 --- a/base/internals/psi_desc_impl.f90 +++ b/base/internals/psi_desc_impl.f90 @@ -181,12 +181,8 @@ subroutine psi_cnv_dsc(halo_in,ovrlap_in,ext_in,cdesc, info, mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psi_cnv_dsc @@ -493,13 +489,8 @@ subroutine psi_bld_ovr_mst(me,ovrlap_elem,mst_idx,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_bld_ovr_mst diff --git a/base/internals/psi_desc_index.F90 b/base/internals/psi_desc_index.F90 index d08ea8ed0..26291d853 100644 --- a/base/internals/psi_desc_index.F90 +++ b/base/internals/psi_desc_index.F90 @@ -337,11 +337,8 @@ subroutine psi_desc_index(desc,index_in,dep_list,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return + end subroutine psi_desc_index diff --git a/base/internals/psi_dswapdata.F90 b/base/internals/psi_dswapdata.F90 index 562d1481e..1935f12ad 100644 --- a/base/internals/psi_dswapdata.F90 +++ b/base/internals/psi_dswapdata.F90 @@ -147,13 +147,9 @@ subroutine psi_dswapdatam(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswapdatam subroutine psi_dswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -519,13 +515,9 @@ subroutine psi_dswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswapidxm ! @@ -645,13 +637,9 @@ subroutine psi_dswapdatav(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswapdatav @@ -1005,13 +993,9 @@ subroutine psi_dswapidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswapidxv subroutine psi_dswapdata_vect(flag,beta,y,desc_a,work,info,data) @@ -1082,13 +1066,9 @@ subroutine psi_dswapdata_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswapdata_vect @@ -1444,13 +1424,9 @@ subroutine psi_dswapidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv, call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswapidx_vect @@ -1807,12 +1783,8 @@ subroutine psi_dswap_vidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrc call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswap_vidx_vect diff --git a/base/internals/psi_dswaptran.F90 b/base/internals/psi_dswaptran.F90 index 682fcd7c7..2dfc204b5 100644 --- a/base/internals/psi_dswaptran.F90 +++ b/base/internals/psi_dswaptran.F90 @@ -152,13 +152,9 @@ subroutine psi_dswaptranm(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswaptranm subroutine psi_dtranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -526,13 +522,9 @@ subroutine psi_dtranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dtranidxm ! ! @@ -655,13 +647,9 @@ subroutine psi_dswaptranv(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswaptranv @@ -1031,13 +1019,9 @@ subroutine psi_dtranidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dtranidxv @@ -1107,13 +1091,9 @@ subroutine psi_dswaptran_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dswaptran_vect @@ -1480,13 +1460,9 @@ subroutine psi_dtranidx_vect(iictxt,iicomm,flag,beta,y,idx,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_dtranidx_vect diff --git a/base/internals/psi_extrct_dl.F90 b/base/internals/psi_extrct_dl.F90 index 2007e0729..e5dd68d58 100644 --- a/base/internals/psi_extrct_dl.F90 +++ b/base/internals/psi_extrct_dl.F90 @@ -288,12 +288,8 @@ subroutine psi_extract_dep_list(ictxt,is_bld,is_upd,desc_str,dep_list,& 9999 continue call psb_errpush(info,name,i_err=int_err) - call psb_erractionrestore(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - endif + call psb_error_handler(err_act) + return end subroutine psi_extract_dep_list diff --git a/base/internals/psi_fnd_owner.F90 b/base/internals/psi_fnd_owner.F90 index b477e4c62..09192210e 100644 --- a/base/internals/psi_fnd_owner.F90 +++ b/base/internals/psi_fnd_owner.F90 @@ -118,14 +118,8 @@ subroutine psi_fnd_owner(nv,idx,iprc,desc,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psi_fnd_owner diff --git a/base/internals/psi_iswapdata.F90 b/base/internals/psi_iswapdata.F90 index d4bd276bf..fd7cd0c9b 100644 --- a/base/internals/psi_iswapdata.F90 +++ b/base/internals/psi_iswapdata.F90 @@ -147,13 +147,9 @@ subroutine psi_iswapdatam(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_iswapdatam subroutine psi_iswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -519,13 +515,9 @@ subroutine psi_iswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_iswapidxm ! @@ -645,13 +637,9 @@ subroutine psi_iswapdatav(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_iswapdatav @@ -1005,13 +993,9 @@ subroutine psi_iswapidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_iswapidxv subroutine psi_iswapdata_vect(flag,beta,y,desc_a,work,info,data) @@ -1040,6 +1024,7 @@ subroutine psi_iswapdata_vect(flag,beta,y,desc_a,work,info,data) ! locals integer(psb_ipk_) :: ictxt, np, me, icomm, idxs, idxr, totxch, data_, err_act integer(psb_ipk_), pointer :: d_idx(:) + class(psb_i_base_vect_type), pointer :: d_vidx character(len=20) :: name info=psb_success_ @@ -1068,25 +1053,22 @@ subroutine psi_iswapdata_vect(flag,beta,y,desc_a,work,info,data) data_ = psb_comm_halo_ end if - call desc_a%get_list(data_,d_idx,totxch,idxr,idxs,info) +!!$ call desc_a%get_list(data_,d_idx,totxch,idxr,idxs,info) + call desc_a%get_list(data_,d_vidx,totxch,idxr,idxs,info) if (info /= psb_success_) then call psb_errpush(psb_err_internal_error_,name,a_err='psb_cd_get_list') goto 9999 end if - call psi_swapdata(ictxt,icomm,flag,beta,y,d_idx,totxch,idxs,idxr,work,info) + call psi_swapdata(ictxt,icomm,flag,beta,y,d_vidx,totxch,idxs,idxr,work,info) if (info /= psb_success_) goto 9999 call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_iswapdata_vect @@ -1442,12 +1424,367 @@ subroutine psi_iswapidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv, call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return +end subroutine psi_iswapidx_vect + + +subroutine psi_iswap_vidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,info) + + use psi_mod, psb_protect_name => psi_iswap_vidx_vect + use psb_error_mod + use psb_desc_mod + use psb_penv_mod + use psb_i_base_vect_mod +#ifdef MPI_MOD + use mpi +#endif + implicit none +#ifdef MPI_H + include 'mpif.h' +#endif + + integer(psb_ipk_), intent(in) :: iictxt,iicomm,flag + integer(psb_ipk_), intent(out) :: info + class(psb_i_base_vect_type) :: y + integer(psb_ipk_) :: beta + integer(psb_ipk_), target :: work(:) + class(psb_i_base_vect_type), intent(in) :: idx + integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv + + ! locals + integer(psb_mpik_) :: ictxt, icomm, np, me,& + & proc_to_comm, p2ptag, p2pstat(mpi_status_size), iret + integer(psb_mpik_), allocatable, dimension(:) :: bsdidx, brvidx,& + & sdsz, rvsz, prcid, rvhd, sdhd + integer(psb_ipk_) :: nesd, nerv,& + & err_act, i, idx_pt, totsnd_, totrcv_,& + & snd_pt, rcv_pt, pnti, n + integer(psb_ipk_) :: ierr(5) + logical :: swap_mpi, swap_sync, swap_send, swap_recv,& + & albf,do_send,do_recv + logical, parameter :: usersend=.false. + + integer(psb_ipk_), pointer, dimension(:) :: sndbuf, rcvbuf +#ifdef HAVE_VOLATILE + volatile :: sndbuf, rcvbuf +#endif + character(len=20) :: name + + info=psb_success_ + name='psi_swap_datav' + call psb_erractionsave(err_act) + ictxt = iictxt + icomm = iicomm + call psb_info(ictxt,me,np) + if (np == -1) then + info=psb_err_context_error_ + call psb_errpush(info,name) + goto 9999 + endif + + n=1 + + swap_mpi = iand(flag,psb_swap_mpi_) /= 0 + swap_sync = iand(flag,psb_swap_sync_) /= 0 + swap_send = iand(flag,psb_swap_send_) /= 0 + swap_recv = iand(flag,psb_swap_recv_) /= 0 + do_send = swap_mpi .or. swap_sync .or. swap_send + do_recv = swap_mpi .or. swap_sync .or. swap_recv + + totrcv_ = totrcv * n + totsnd_ = totsnd * n + + if (swap_mpi) then + allocate(sdsz(0:np-1), rvsz(0:np-1), bsdidx(0:np-1),& + & brvidx(0:np-1), rvhd(0:np-1), sdhd(0:np-1), prcid(0:np-1),& + & stat=info) + if(info /= psb_success_) then + call psb_errpush(psb_err_alloc_dealloc_,name) + goto 9999 + end if + + rvhd(:) = mpi_request_null + sdsz(:) = 0 + rvsz(:) = 0 + + ! prepare info for communications + + pnti = 1 + snd_pt = 1 + rcv_pt = 1 + do i=1, totxch + proc_to_comm = idx%v(pnti+psb_proc_id_) + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + call psb_get_rank(prcid(proc_to_comm),ictxt,proc_to_comm) + + brvidx(proc_to_comm) = rcv_pt + rvsz(proc_to_comm) = nerv + + bsdidx(proc_to_comm) = snd_pt + sdsz(proc_to_comm) = nesd + + rcv_pt = rcv_pt + nerv + snd_pt = snd_pt + nesd + pnti = pnti + nerv + nesd + 3 + + end do + + else + allocate(rvhd(totxch),prcid(totxch),stat=info) + if(info /= psb_success_) then + call psb_errpush(psb_err_alloc_dealloc_,name) + goto 9999 + end if end if + + + totrcv_ = max(totrcv_,1) + totsnd_ = max(totsnd_,1) + if((totrcv_+totsnd_) < size(work)) then + sndbuf => work(1:totsnd_) + rcvbuf => work(totsnd_+1:totsnd_+totrcv_) + albf=.false. + else + allocate(sndbuf(totsnd_),rcvbuf(totrcv_), stat=info) + if(info /= psb_success_) then + call psb_errpush(psb_err_alloc_dealloc_,name) + goto 9999 + end if + albf=.true. + end if + + + if (do_send) then + + ! Pack send buffers + pnti = 1 + snd_pt = 1 + do i=1, totxch + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + idx_pt = 1+pnti+nerv+psb_n_elem_send_ + call y%gth(idx_pt,nesd,idx,& + & sndbuf(snd_pt:snd_pt+nesd-1)) + snd_pt = snd_pt + nesd + pnti = pnti + nerv + nesd + 3 + end do + + end if + + ! Case SWAP_MPI + if (swap_mpi) then + + ! swap elements using mpi_alltoallv + call mpi_alltoallv(sndbuf,sdsz,bsdidx,& + & psb_mpi_ipk_integer,rcvbuf,rvsz,& + & brvidx,psb_mpi_ipk_integer,icomm,iret) + if(iret /= mpi_success) then + ierr(1) = iret + info=psb_err_mpi_error_ + call psb_errpush(info,name,i_err=ierr) + goto 9999 + end if + + else if (swap_sync) then + + pnti = 1 + snd_pt = 1 + rcv_pt = 1 + do i=1, totxch + proc_to_comm = idx%v(pnti+psb_proc_id_) + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + + if (proc_to_comm < me) then + if (nesd>0) call psb_snd(ictxt,& + & sndbuf(snd_pt:snd_pt+nesd-1), proc_to_comm) + if (nerv>0) call psb_rcv(ictxt,& + & rcvbuf(rcv_pt:rcv_pt+nerv-1), proc_to_comm) + else if (proc_to_comm > me) then + if (nerv>0) call psb_rcv(ictxt,& + & rcvbuf(rcv_pt:rcv_pt+nerv-1), proc_to_comm) + if (nesd>0) call psb_snd(ictxt,& + & sndbuf(snd_pt:snd_pt+nesd-1), proc_to_comm) + else if (proc_to_comm == me) then + if (nesd /= nerv) then + write(psb_err_unit,*) & + & 'Fatal error in swapdata: mismatch on self send',& + & nerv,nesd + end if + rcvbuf(rcv_pt:rcv_pt+nerv-1) = sndbuf(snd_pt:snd_pt+nesd-1) + end if + rcv_pt = rcv_pt + nerv + snd_pt = snd_pt + nesd + pnti = pnti + nerv + nesd + 3 + end do + + + else if (swap_send .and. swap_recv) then + + ! First I post all the non blocking receives + pnti = 1 + snd_pt = 1 + rcv_pt = 1 + do i=1, totxch + proc_to_comm = idx%v(pnti+psb_proc_id_) + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + + call psb_get_rank(prcid(i),ictxt,proc_to_comm) + if ((nerv>0).and.(proc_to_comm /= me)) then + p2ptag = psb_int_swap_tag + call mpi_irecv(rcvbuf(rcv_pt),nerv,& + & psb_mpi_ipk_integer,prcid(i),& + & p2ptag, icomm,rvhd(i),iret) + end if + rcv_pt = rcv_pt + nerv + snd_pt = snd_pt + nesd + pnti = pnti + nerv + nesd + 3 + end do + + + ! Then I post all the blocking sends + if (usersend) call mpi_barrier(icomm,iret) + + pnti = 1 + snd_pt = 1 + rcv_pt = 1 + do i=1, totxch + proc_to_comm = idx%v(pnti+psb_proc_id_) + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + + p2ptag = psb_int_swap_tag + + if ((nesd>0).and.(proc_to_comm /= me)) then + if (usersend) then + call mpi_rsend(sndbuf(snd_pt),nesd,& + & psb_mpi_ipk_integer,prcid(i),& + & p2ptag,icomm,iret) + else + call mpi_send(sndbuf(snd_pt),nesd,& + & psb_mpi_ipk_integer,prcid(i),& + & p2ptag,icomm,iret) + end if + + if(iret /= mpi_success) then + ierr(1) = iret + info=psb_err_mpi_error_ + call psb_errpush(info,name,i_err=ierr) + goto 9999 + end if + end if + rcv_pt = rcv_pt + nerv + snd_pt = snd_pt + nesd + pnti = pnti + nerv + nesd + 3 + end do + + + pnti = 1 + do i=1, totxch + proc_to_comm = idx%v(pnti+psb_proc_id_) + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + + p2ptag = psb_int_swap_tag + + if ((proc_to_comm /= me).and.(nerv>0)) then + call mpi_wait(rvhd(i),p2pstat,iret) + if(iret /= mpi_success) then + ierr(1) = iret + info=psb_err_mpi_error_ + call psb_errpush(info,name,i_err=ierr) + goto 9999 + end if + else if (proc_to_comm == me) then + if (nesd /= nerv) then + write(psb_err_unit,*) & + & 'Fatal error in swapdata: mismatch on self send',& + & nerv,nesd + end if + rcvbuf(rcv_pt:rcv_pt+nerv-1) = sndbuf(snd_pt:snd_pt+nesd-1) + end if + pnti = pnti + nerv + nesd + 3 + end do + + + else if (swap_send) then + + pnti = 1 + snd_pt = 1 + rcv_pt = 1 + do i=1, totxch + proc_to_comm = idx%v(pnti+psb_proc_id_) + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + if (nesd>0) call psb_snd(ictxt,& + & sndbuf(snd_pt:snd_pt+nesd-1), proc_to_comm) + rcv_pt = rcv_pt + nerv + snd_pt = snd_pt + nesd + pnti = pnti + nerv + nesd + 3 + end do + + else if (swap_recv) then + + pnti = 1 + snd_pt = 1 + rcv_pt = 1 + do i=1, totxch + proc_to_comm = idx%v(pnti+psb_proc_id_) + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + if (nerv>0) call psb_rcv(ictxt,& + & rcvbuf(rcv_pt:rcv_pt+nerv-1), proc_to_comm) + rcv_pt = rcv_pt + nerv + snd_pt = snd_pt + nesd + pnti = pnti + nerv + nesd + 3 + end do + + end if + + if (do_recv) then + + pnti = 1 + snd_pt = 1 + rcv_pt = 1 + do i=1, totxch + proc_to_comm = idx%v(pnti+psb_proc_id_) + nerv = idx%v(pnti+psb_n_elem_recv_) + nesd = idx%v(pnti+nerv+psb_n_elem_send_) + idx_pt = 1+pnti+psb_n_elem_recv_ + call y%sct(idx_pt,nerv,idx,& + & rcvbuf(rcv_pt:rcv_pt+nerv-1),beta) + rcv_pt = rcv_pt + nerv + snd_pt = snd_pt + nesd + pnti = pnti + nerv + nesd + 3 + end do + + end if + + if (swap_mpi) then + deallocate(sdsz,rvsz,bsdidx,brvidx,rvhd,prcid,sdhd,& + & stat=info) + else + deallocate(rvhd,prcid,stat=info) + end if + if(info /= psb_success_) then + call psb_errpush(psb_err_alloc_dealloc_,name) + goto 9999 + end if + if(albf) deallocate(sndbuf,rcvbuf,stat=info) + if(info /= psb_success_) then + call psb_errpush(psb_err_alloc_dealloc_,name) + goto 9999 + end if + + call psb_erractionrestore(err_act) return -end subroutine psi_iswapidx_vect + +9999 call psb_error_handler(ictxt,err_act) + + return +end subroutine psi_iswap_vidx_vect diff --git a/base/internals/psi_iswaptran.F90 b/base/internals/psi_iswaptran.F90 index 60985ed49..9b50ae7ca 100644 --- a/base/internals/psi_iswaptran.F90 +++ b/base/internals/psi_iswaptran.F90 @@ -152,13 +152,9 @@ subroutine psi_iswaptranm(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_iswaptranm subroutine psi_itranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -526,13 +522,9 @@ subroutine psi_itranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_itranidxm ! ! @@ -655,13 +647,9 @@ subroutine psi_iswaptranv(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_iswaptranv @@ -1031,13 +1019,9 @@ subroutine psi_itranidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_itranidxv @@ -1107,13 +1091,9 @@ subroutine psi_iswaptran_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_iswaptran_vect @@ -1480,13 +1460,9 @@ subroutine psi_itranidx_vect(iictxt,iicomm,flag,beta,y,idx,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_itranidx_vect diff --git a/base/internals/psi_ovrl_restr.f90 b/base/internals/psi_ovrl_restr.f90 index fe387c471..d34cebc1c 100644 --- a/base/internals/psi_ovrl_restr.f90 +++ b/base/internals/psi_ovrl_restr.f90 @@ -65,13 +65,8 @@ subroutine psi_sovrl_restrr1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_restrr1 @@ -118,13 +113,8 @@ subroutine psi_sovrl_restrr2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_restrr2 @@ -165,13 +155,8 @@ subroutine psi_dovrl_restrr1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_restrr1 @@ -219,13 +204,8 @@ subroutine psi_dovrl_restrr2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_restrr2 @@ -266,13 +246,8 @@ subroutine psi_covrl_restrr1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_restrr1 @@ -319,13 +294,8 @@ subroutine psi_covrl_restrr2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_restrr2 @@ -366,13 +336,8 @@ subroutine psi_zovrl_restrr1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_restrr1 @@ -419,13 +384,8 @@ subroutine psi_zovrl_restrr2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_restrr2 @@ -466,13 +426,8 @@ subroutine psi_iovrl_restrr1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_restrr1 @@ -519,13 +474,8 @@ subroutine psi_iovrl_restrr2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_restrr2 @@ -559,19 +509,14 @@ subroutine psi_iovrl_restr_vect(x,xs,desc_a,info) endif isz = size(desc_a%ovrlap_elem,1) - + call x%sct(isz,desc_a%ovrlap_elem(:,1),xs,izero) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_restr_vect @@ -604,19 +549,14 @@ subroutine psi_sovrl_restr_vect(x,xs,desc_a,info) endif isz = size(desc_a%ovrlap_elem,1) - + call x%sct(isz,desc_a%ovrlap_elem(:,1),xs,szero) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_restr_vect @@ -649,19 +589,14 @@ subroutine psi_dovrl_restr_vect(x,xs,desc_a,info) endif isz = size(desc_a%ovrlap_elem,1) - + call x%sct(isz,desc_a%ovrlap_elem(:,1),xs,dzero) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_restr_vect @@ -696,19 +631,14 @@ subroutine psi_covrl_restr_vect(x,xs,desc_a,info) endif isz = size(desc_a%ovrlap_elem,1) - + call x%sct(isz,desc_a%ovrlap_elem(:,1),xs,czero) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_restr_vect @@ -741,19 +671,14 @@ subroutine psi_zovrl_restr_vect(x,xs,desc_a,info) endif isz = size(desc_a%ovrlap_elem,1) - + call x%sct(isz,desc_a%ovrlap_elem(:,1),xs,zzero) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_restr_vect diff --git a/base/internals/psi_ovrl_save.f90 b/base/internals/psi_ovrl_save.f90 index e0489227c..36e6b0522 100644 --- a/base/internals/psi_ovrl_save.f90 +++ b/base/internals/psi_ovrl_save.f90 @@ -73,13 +73,8 @@ subroutine psi_sovrl_saver1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_saver1 @@ -127,13 +122,8 @@ subroutine psi_sovrl_saver2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_saver2 @@ -181,13 +171,8 @@ subroutine psi_dovrl_saver1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_saver1 @@ -236,13 +221,8 @@ subroutine psi_dovrl_saver2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_saver2 @@ -289,13 +269,8 @@ subroutine psi_covrl_saver1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_saver1 @@ -344,13 +319,8 @@ subroutine psi_covrl_saver2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_saver2 @@ -399,13 +369,8 @@ subroutine psi_zovrl_saver1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_saver1 @@ -455,13 +420,8 @@ subroutine psi_zovrl_saver2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_saver2 @@ -510,13 +470,8 @@ subroutine psi_iovrl_saver1(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_saver1 @@ -567,13 +522,8 @@ subroutine psi_iovrl_saver2(x,xs,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_saver2 @@ -614,19 +564,14 @@ subroutine psi_iovrl_save_vect(x,xs,desc_a,info) call psb_errpush(info,name) goto 9999 endif - + call x%gth(isz,desc_a%ovrlap_elem(:,1),xs) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_save_vect @@ -665,19 +610,14 @@ subroutine psi_sovrl_save_vect(x,xs,desc_a,info) call psb_errpush(info,name) goto 9999 endif - + call x%gth(isz,desc_a%ovrlap_elem(:,1),xs) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_save_vect @@ -716,19 +656,14 @@ subroutine psi_dovrl_save_vect(x,xs,desc_a,info) call psb_errpush(info,name) goto 9999 endif - + call x%gth(isz,desc_a%ovrlap_elem(:,1),xs) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_save_vect @@ -767,19 +702,14 @@ subroutine psi_covrl_save_vect(x,xs,desc_a,info) call psb_errpush(info,name) goto 9999 endif - + call x%gth(isz,desc_a%ovrlap_elem(:,1),xs) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_save_vect @@ -818,18 +748,13 @@ subroutine psi_zovrl_save_vect(x,xs,desc_a,info) call psb_errpush(info,name) goto 9999 endif - + call x%gth(isz,desc_a%ovrlap_elem(:,1),xs) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_save_vect diff --git a/base/internals/psi_ovrl_upd.f90 b/base/internals/psi_ovrl_upd.f90 index a3176cf2a..63c6cf4bd 100644 --- a/base/internals/psi_ovrl_upd.f90 +++ b/base/internals/psi_ovrl_upd.f90 @@ -91,13 +91,8 @@ subroutine psi_sovrl_updr1(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_updr1 @@ -163,13 +158,8 @@ subroutine psi_sovrl_updr2(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_updr2 @@ -234,13 +224,8 @@ subroutine psi_dovrl_updr1(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_updr1 @@ -306,13 +291,8 @@ subroutine psi_dovrl_updr2(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_updr2 @@ -377,13 +357,8 @@ subroutine psi_covrl_updr1(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_updr1 @@ -449,13 +424,8 @@ subroutine psi_covrl_updr2(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_updr2 @@ -520,13 +490,8 @@ subroutine psi_zovrl_updr1(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_updr1 @@ -592,13 +557,8 @@ subroutine psi_zovrl_updr2(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_updr2 @@ -664,13 +624,8 @@ subroutine psi_iovrl_updr1(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_updr1 @@ -737,13 +692,8 @@ subroutine psi_iovrl_updr2(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_updr2 @@ -822,13 +772,8 @@ subroutine psi_iovrl_upd_vect(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_iovrl_upd_vect @@ -906,13 +851,8 @@ subroutine psi_sovrl_upd_vect(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_sovrl_upd_vect @@ -990,13 +930,8 @@ subroutine psi_dovrl_upd_vect(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_dovrl_upd_vect @@ -1075,13 +1010,8 @@ subroutine psi_covrl_upd_vect(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_covrl_upd_vect @@ -1159,13 +1089,8 @@ subroutine psi_zovrl_upd_vect(x,desc_a,update,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psi_zovrl_upd_vect diff --git a/base/internals/psi_sort_dl.f90 b/base/internals/psi_sort_dl.f90 index ebac79d2a..114a855ed 100644 --- a/base/internals/psi_sort_dl.f90 +++ b/base/internals/psi_sort_dl.f90 @@ -83,14 +83,10 @@ subroutine psi_sort_dl(dep_list,l_dep_list,np,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psi_sort_dl diff --git a/base/internals/psi_sswapdata.F90 b/base/internals/psi_sswapdata.F90 index 75fc40243..9f8d5000f 100644 --- a/base/internals/psi_sswapdata.F90 +++ b/base/internals/psi_sswapdata.F90 @@ -147,13 +147,9 @@ subroutine psi_sswapdatam(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswapdatam subroutine psi_sswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -519,13 +515,9 @@ subroutine psi_sswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswapidxm ! @@ -645,13 +637,9 @@ subroutine psi_sswapdatav(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswapdatav @@ -1005,13 +993,9 @@ subroutine psi_sswapidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswapidxv subroutine psi_sswapdata_vect(flag,beta,y,desc_a,work,info,data) @@ -1082,13 +1066,9 @@ subroutine psi_sswapdata_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswapdata_vect @@ -1444,13 +1424,9 @@ subroutine psi_sswapidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv, call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswapidx_vect @@ -1807,12 +1783,8 @@ subroutine psi_sswap_vidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrc call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswap_vidx_vect diff --git a/base/internals/psi_sswaptran.F90 b/base/internals/psi_sswaptran.F90 index 5fd212437..26d391a50 100644 --- a/base/internals/psi_sswaptran.F90 +++ b/base/internals/psi_sswaptran.F90 @@ -152,13 +152,9 @@ subroutine psi_sswaptranm(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswaptranm subroutine psi_stranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -526,13 +522,9 @@ subroutine psi_stranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_stranidxm ! ! @@ -655,13 +647,9 @@ subroutine psi_sswaptranv(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswaptranv @@ -1031,13 +1019,9 @@ subroutine psi_stranidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_stranidxv @@ -1107,13 +1091,9 @@ subroutine psi_sswaptran_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_sswaptran_vect @@ -1480,13 +1460,9 @@ subroutine psi_stranidx_vect(iictxt,iicomm,flag,beta,y,idx,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_stranidx_vect diff --git a/base/internals/psi_zswapdata.F90 b/base/internals/psi_zswapdata.F90 index 379b02fd6..1234dbe42 100644 --- a/base/internals/psi_zswapdata.F90 +++ b/base/internals/psi_zswapdata.F90 @@ -147,13 +147,9 @@ subroutine psi_zswapdatam(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswapdatam subroutine psi_zswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -519,13 +515,9 @@ subroutine psi_zswapidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswapidxm ! @@ -645,13 +637,9 @@ subroutine psi_zswapdatav(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswapdatav @@ -1005,13 +993,9 @@ subroutine psi_zswapidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswapidxv subroutine psi_zswapdata_vect(flag,beta,y,desc_a,work,info,data) @@ -1082,13 +1066,9 @@ subroutine psi_zswapdata_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswapdata_vect @@ -1444,13 +1424,9 @@ subroutine psi_zswapidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv, call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswapidx_vect @@ -1807,12 +1783,8 @@ subroutine psi_zswap_vidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrc call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswap_vidx_vect diff --git a/base/internals/psi_zswaptran.F90 b/base/internals/psi_zswaptran.F90 index 2286761cb..5004aeddc 100644 --- a/base/internals/psi_zswaptran.F90 +++ b/base/internals/psi_zswaptran.F90 @@ -152,13 +152,9 @@ subroutine psi_zswaptranm(flag,n,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswaptranm subroutine psi_ztranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,work,info) @@ -526,13 +522,9 @@ subroutine psi_ztranidxm(iictxt,iicomm,flag,n,beta,y,idx,totxch,totsnd,totrcv,wo call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_ztranidxm ! ! @@ -655,13 +647,9 @@ subroutine psi_zswaptranv(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswaptranv @@ -1031,13 +1019,9 @@ subroutine psi_ztranidxv(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_ztranidxv @@ -1107,13 +1091,9 @@ subroutine psi_zswaptran_vect(flag,beta,y,desc_a,work,info,data) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_zswaptran_vect @@ -1480,13 +1460,9 @@ subroutine psi_ztranidx_vect(iictxt,iicomm,flag,beta,y,idx,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) +9999 call psb_error_handler(ictxt,err_act) + return - end if - return end subroutine psi_ztranidx_vect diff --git a/base/modules/parts.f90 b/base/modules/parts.f90 deleted file mode 100644 index 1245c2556..000000000 --- a/base/modules/parts.f90 +++ /dev/null @@ -1,8 +0,0 @@ -module psb_parts_mod - interface - subroutine psb_parts(glob_index,nrow,np,pv,nv) - integer(psb_ipk_), intent (in) :: glob_index,np,nrow - integer(psb_ipk_), intent (out) :: nv, pv(*) - end subroutine psb_parts - end interface -end module psb_parts_mod diff --git a/base/modules/parts.fh b/base/modules/parts.fh deleted file mode 100644 index 201bc79fa..000000000 --- a/base/modules/parts.fh +++ /dev/null @@ -1,8 +0,0 @@ -interface - !.....user passed subroutine..... - subroutine parts(glob_index,nrow,np,pv,nv) - import :: psb_ipk_ - integer(psb_ipk_), intent (in) :: glob_index,np,nrow - integer(psb_ipk_), intent (out) :: nv, pv(*) - end subroutine parts -end interface diff --git a/base/modules/psb_c_base_mat_mod.f90 b/base/modules/psb_c_base_mat_mod.f90 index cffb64557..7c564b3ae 100644 --- a/base/modules/psb_c_base_mat_mod.f90 +++ b/base/modules/psb_c_base_mat_mod.f90 @@ -153,7 +153,7 @@ module psb_c_base_mat_mod procedure, pass(a) :: mv_from_coo => psb_c_mv_coo_from_coo procedure, pass(a) :: mv_to_fmt => psb_c_mv_coo_to_fmt procedure, pass(a) :: mv_from_fmt => psb_c_mv_coo_from_fmt - procedure, pass(a) :: csput_a => psb_c_coo_csput_a + procedure, pass(a) :: csput_a => psb_c_coo_csput_a procedure, pass(a) :: get_diag => psb_c_coo_get_diag procedure, pass(a) :: csgetrow => psb_c_coo_csgetrow procedure, pass(a) :: csgetptn => psb_c_coo_csgetptn diff --git a/base/modules/psb_c_linmap_mod.f90 b/base/modules/psb_c_linmap_mod.f90 index 501552ee4..d4045ee99 100644 --- a/base/modules/psb_c_linmap_mod.f90 +++ b/base/modules/psb_c_linmap_mod.f90 @@ -247,10 +247,9 @@ contains ierr(1) = 2 info = psb_err_missing_override_method_ call psb_errpush(info,name,i_err=ierr) - call psb_get_erraction(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_erractionsave(err_act) + + call psb_error_handler(err_act) end select diff --git a/base/modules/psb_cd_tools_mod.f90 b/base/modules/psb_cd_tools_mod.f90 index d8641017d..650ca8771 100644 --- a/base/modules/psb_cd_tools_mod.f90 +++ b/base/modules/psb_cd_tools_mod.f90 @@ -182,7 +182,6 @@ module psb_cd_tools_mod subroutine psb_cd_switch_ovl_indxmap(desc,info) import :: psb_ipk_, psb_desc_type implicit None - include 'parts.fh' type(psb_desc_type), intent(inout) :: desc integer(psb_ipk_), intent(out) :: info end subroutine psb_cd_switch_ovl_indxmap diff --git a/base/modules/psb_check_mod.f90 b/base/modules/psb_check_mod.f90 index c3e418174..12fd8e24e 100644 --- a/base/modules/psb_check_mod.f90 +++ b/base/modules/psb_check_mod.f90 @@ -162,13 +162,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_chkvect @@ -282,13 +277,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_chkglobvect @@ -423,13 +413,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_chkmat diff --git a/base/modules/psb_d_base_mat_mod.f90 b/base/modules/psb_d_base_mat_mod.f90 index 4cede13b1..b208b97e9 100644 --- a/base/modules/psb_d_base_mat_mod.f90 +++ b/base/modules/psb_d_base_mat_mod.f90 @@ -153,7 +153,7 @@ module psb_d_base_mat_mod procedure, pass(a) :: mv_from_coo => psb_d_mv_coo_from_coo procedure, pass(a) :: mv_to_fmt => psb_d_mv_coo_to_fmt procedure, pass(a) :: mv_from_fmt => psb_d_mv_coo_from_fmt - procedure, pass(a) :: csput_a => psb_d_coo_csput_a + procedure, pass(a) :: csput_a => psb_d_coo_csput_a procedure, pass(a) :: get_diag => psb_d_coo_get_diag procedure, pass(a) :: csgetrow => psb_d_coo_csgetrow procedure, pass(a) :: csgetptn => psb_d_coo_csgetptn diff --git a/base/modules/psb_d_linmap_mod.f90 b/base/modules/psb_d_linmap_mod.f90 index 8f92fe5ce..8b7583ee4 100644 --- a/base/modules/psb_d_linmap_mod.f90 +++ b/base/modules/psb_d_linmap_mod.f90 @@ -247,10 +247,9 @@ contains ierr(1) = 2 info = psb_err_missing_override_method_ call psb_errpush(info,name,i_err=ierr) - call psb_get_erraction(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_erractionsave(err_act) + + call psb_error_handler(err_act) end select diff --git a/base/modules/psb_desc_mod.F90 b/base/modules/psb_desc_mod.F90 index cd3db063d..2e68b56a2 100644 --- a/base/modules/psb_desc_mod.F90 +++ b/base/modules/psb_desc_mod.F90 @@ -672,15 +672,11 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_cd_get_list @@ -752,15 +748,10 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return + end subroutine psb_cd_v_get_list ! @@ -792,18 +783,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_ret_) then - return - else - if (ictxt == -1) then - call psb_error() - else - call psb_error(ictxt) - end if - end if +9999 call psb_error_handler(err_act) return end subroutine psb_cdfree @@ -944,15 +925,10 @@ contains call psb_erractionrestore(err_act) return + -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_cdtransfer @@ -1053,14 +1029,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cd_clone @@ -1159,13 +1129,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if - Return +9999 call psb_error_handler(ictxt,err_act) + + return end Subroutine psb_cd_get_recv_idx @@ -1208,14 +1174,11 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + + return + end subroutine cd_l2gs1 subroutine cd_l2gs2(idxin,idxout,desc,info,mask,owned) @@ -1248,14 +1211,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + return end subroutine cd_l2gs2 @@ -1288,13 +1246,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + + return end subroutine cd_l2gv1 @@ -1327,13 +1281,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + + return end subroutine cd_l2gv2 @@ -1366,13 +1316,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + + return end subroutine cd_g2ls1 @@ -1406,14 +1352,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + return end subroutine cd_g2ls2 @@ -1446,14 +1387,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + return end subroutine cd_g2lv1 @@ -1488,14 +1424,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + return end subroutine cd_g2lv2 @@ -1529,14 +1460,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + return end subroutine cd_g2ls1_ins @@ -1571,14 +1497,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return - +9999 call psb_error_handler(err_act) + + return end subroutine cd_g2ls2_ins @@ -1613,14 +1534,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + return end subroutine cd_g2lv1_ins @@ -1655,13 +1571,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + + return end subroutine cd_g2lv2_ins @@ -1694,13 +1606,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - Return +9999 call psb_error_handler(err_act) + + return end subroutine cd_fnd_owner diff --git a/base/modules/psb_error_impl.F90 b/base/modules/psb_error_impl.F90 index 104750b31..b1ed0735b 100644 --- a/base/modules/psb_error_impl.F90 +++ b/base/modules/psb_error_impl.F90 @@ -9,6 +9,57 @@ subroutine psb_errcomm(ictxt, err) end subroutine psb_errcomm +subroutine psb_ser_error_handler(err_act) + use psb_error_mod, psb_protect_name => psb_ser_error_handler + use psb_penv_mod + implicit none + integer(psb_ipk_), intent(inout) :: err_act + + call psb_erractionrestore(err_act) + + if (err_act /= psb_act_ret_) & + & call psb_error() + if (err_act == psb_act_abort_) stop + + return +end subroutine psb_ser_error_handler + +subroutine psb_par_error_handler(ictxt,err_act) + use psb_error_mod, psb_protect_name => psb_par_error_handler + use psb_penv_mod + implicit none + integer(psb_mpik_), intent(in) :: ictxt + integer(psb_ipk_), intent(in) :: err_act + + call psb_erractionrestore(err_act) + + if (err_act == psb_act_print_) & + & call psb_error(ictxt, abrt=.false.) + if (err_act == psb_act_abort_) & + & call psb_error(ictxt, abrt=.true.) + + return + +end subroutine psb_par_error_handler + +subroutine psb_par_error_print_stack(ictxt) + use psb_error_mod, psb_protect_name => psb_par_error_print_stack + use psb_penv_mod + integer(psb_mpik_), intent(in) :: ictxt + + call psb_error(ictxt, abrt=.false.) + +end subroutine psb_par_error_print_stack + +subroutine psb_ser_error_print_stack() + use psb_error_mod, psb_protect_name => psb_ser_error_print_stack + + call psb_error() +end subroutine psb_ser_error_print_stack + + + + ! handles the occurence of an error in a serial routine subroutine psb_serror() use psb_const_mod @@ -25,21 +76,21 @@ subroutine psb_serror() do while (psb_get_numerr() > izero) write(psb_err_unit,'(50("="))') call psb_errpop(err_c, r_name, i_e_d, a_e_d) - call psb_errmsg(err_c, r_name, i_e_d, a_e_d) + call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d) ! write(psb_err_unit,'(50("="))') end do else call psb_errpop(err_c, r_name, i_e_d, a_e_d) - call psb_errmsg(err_c, r_name, i_e_d, a_e_d) + call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d) do while (psb_get_numerr() > 0) call psb_errpop(err_c, r_name, i_e_d, a_e_d) end do end if end if #if defined(HAVE_FLUSH_STMT) - flush(0) + flush(psb_err_unit) #endif @@ -47,18 +98,23 @@ end subroutine psb_serror ! handles the occurence of an error in a parallel routine -subroutine psb_perror(ictxt) +subroutine psb_perror(ictxt,abrt) use psb_const_mod use psb_error_mod use psb_penv_mod implicit none - integer(psb_mpik_), intent(in) :: ictxt - integer(psb_ipk_) :: err_c - character(len=20) :: r_name - character(len=40) :: a_e_d - integer(psb_ipk_) :: i_e_d(5) + integer(psb_mpik_), intent(in) :: ictxt + logical, intent(in), optional :: abrt + + integer(psb_ipk_) :: err_c + character(len=20) :: r_name + character(len=40) :: a_e_d + integer(psb_ipk_) :: i_e_d(5) integer(psb_mpik_) :: iam, np + logical :: abrt_ + abrt_=.true. + if (present(abrt)) abrt_=abrt call psb_info(ictxt,iam,np) if (psb_errstatus_fatal()) then @@ -67,27 +123,27 @@ subroutine psb_perror(ictxt) do while (psb_get_numerr() > izero) write(psb_err_unit,'(50("="))') call psb_errpop(err_c, r_name, i_e_d, a_e_d) - call psb_errmsg(err_c, r_name, i_e_d, a_e_d,iam) + call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d,iam) ! write(psb_err_unit,'(50("="))') end do #if defined(HAVE_FLUSH_STMT) - flush(0) + flush(psb_err_unit) #endif - - call psb_abort(ictxt,-1) - + + if (abrt_) call psb_abort(ictxt,-1) + else call psb_errpop(err_c, r_name, i_e_d, a_e_d) - call psb_errmsg(err_c, r_name, i_e_d, a_e_d,iam) + call psb_errmsg(psb_err_unit,err_c, r_name, i_e_d, a_e_d,iam) do while (psb_get_numerr() > 0) call psb_errpop(err_c, r_name, i_e_d, a_e_d) end do #if defined(HAVE_FLUSH_STMT) - flush(0) + flush(psb_err_unit) #endif - call psb_abort(ictxt,-1) + if (abrt_) call psb_abort(ictxt,-1) end if end if diff --git a/base/modules/psb_error_mod.F90 b/base/modules/psb_error_mod.F90 index fa3068809..11f63a0bb 100644 --- a/base/modules/psb_error_mod.F90 +++ b/base/modules/psb_error_mod.F90 @@ -32,7 +32,9 @@ module psb_error_mod use psb_const_mod - integer(psb_ipk_), parameter, public :: psb_act_ret_=0, psb_act_abort_=1 + integer(psb_ipk_), parameter, public :: psb_act_ret_=0 + integer(psb_ipk_), parameter, public :: psb_act_print_=1 + integer(psb_ipk_), parameter, public :: psb_act_abort_=2 integer(psb_ipk_), parameter, public :: psb_debug_ext_=1, psb_debug_outer_=2 integer(psb_ipk_), parameter, public :: psb_debug_comp_=3, psb_debug_inner_=4 integer(psb_ipk_), parameter, public :: psb_debug_serial_=8, psb_debug_serial_comp_=9 @@ -40,6 +42,8 @@ module psb_error_mod integer(psb_ipk_), parameter, public :: psb_no_err_ = 0 integer(psb_ipk_), parameter, public :: psb_err_warning_ = 1 integer(psb_ipk_), parameter, public :: psb_err_fatal_ = 2 + + integer(psb_ipk_), parameter, public :: psb_max_errmsg_len_ = 132 ! ! Error handling @@ -47,24 +51,53 @@ module psb_error_mod public psb_errpush, psb_error, psb_get_errstatus,& & psb_errstatus_fatal, psb_errstatus_warning,& & psb_errstatus_ok, psb_warning_push,& - & psb_errpop, psb_errmsg, psb_errcomm, psb_get_numerr, & + & psb_errpop, psb_errcomm, psb_get_numerr, & & psb_get_errverbosity, psb_set_errverbosity, & & psb_erractionsave, psb_erractionrestore, & & psb_get_erraction, psb_set_erraction, & + & psb_set_erract_return, psb_set_erract_print, psb_set_erract_abort,& + & psb_is_erract_return, psb_is_erract_print, psb_is_erract_abort,& & psb_get_debug_level, psb_set_debug_level,& & psb_get_debug_unit, psb_set_debug_unit,& - & psb_get_serial_debug_level, psb_set_serial_debug_level - + & psb_get_serial_debug_level, psb_set_serial_debug_level,& + & psb_clean_errstack, psb_error_handler, & + & psb_ser_error_handler, psb_par_error_handler, & + & psb_ser_error_print_stack, psb_par_error_print_stack,& + & psb_error_print_stack, psb_errmsg, psb_ach_errmsg + + + interface psb_error_handler + subroutine psb_ser_error_handler(err_act) + import :: psb_ipk_ + integer(psb_ipk_), intent(in) :: err_act + end subroutine psb_ser_error_handler + subroutine psb_par_error_handler(ictxt,err_act) + import :: psb_ipk_,psb_mpik_ + integer(psb_mpik_), intent(in) :: ictxt + integer(psb_ipk_), intent(in) :: err_act + end subroutine psb_par_error_handler + end interface interface psb_error subroutine psb_serror() end subroutine psb_serror - subroutine psb_perror(ictxt) + subroutine psb_perror(ictxt,abrt) import :: psb_mpik_ - integer(psb_mpik_), intent(in) :: ictxt + integer(psb_mpik_), intent(in) :: ictxt + logical, intent(in), optional :: abrt end subroutine psb_perror end interface + + interface psb_error_print_stack + subroutine psb_par_error_print_stack(ictxt) + import :: psb_ipk_,psb_mpik_ + integer(psb_mpik_), intent(in) :: ictxt + end subroutine psb_par_error_print_stack + subroutine psb_ser_error_print_stack() + end subroutine psb_ser_error_print_stack + end interface + interface psb_errcomm subroutine psb_errcomm(ictxt, err) import :: psb_mpik_, psb_ipk_ @@ -73,6 +106,14 @@ module psb_error_mod end subroutine psb_errcomm end interface psb_errcomm + interface psb_errpop + module procedure psb_errpop, psb_ach_errpop + end interface + + interface psb_errmsg + module procedure psb_errmsg, psb_ach_errmsg + end interface + #if defined(LONG_INTEGERS) interface psb_error module procedure psb_perror_ipk @@ -93,8 +134,10 @@ module psb_error_mod character(len=20) :: routine='' ! array of integer data to complete the error msg integer(psb_ipk_),dimension(5) :: i_err_data=0 - ! real(psb_dpk_)(dim=10) :: r_err_data=0.d0 ! array of real data to complete the error msg - ! complex(dim=10) :: c_err_data=0.c0 ! array of complex data to complete the error msg + ! real(psb_dpk_)(dim=10) :: r_err_data=0.d0 + ! array of real data to complete the error msg + ! complex(dim=10) :: c_err_data=0.c0 + ! array of complex data to complete the error msg ! array of character data to complete the error msg character(len=40) :: a_err_data='' ! pointer to the next element in the stack @@ -113,11 +156,11 @@ module psb_error_mod end type psb_errstack - type(psb_errstack), save :: error_stack - integer(psb_ipk_), save :: error_status = psb_no_err_ - integer(psb_ipk_), save :: verbosity_level = 1 - integer(psb_ipk_), save :: err_action = psb_act_abort_ - integer(psb_ipk_), save :: debug_level=0, debug_unit, serial_debug_level=0 + type(psb_errstack), save :: error_stack + integer(psb_ipk_), save :: error_status = psb_no_err_ + integer(psb_ipk_), save :: verbosity_level = 1 + integer(psb_ipk_), save :: err_action = psb_act_abort_ + integer(psb_ipk_), save :: debug_level = 0, debug_unit, serial_debug_level=0 contains @@ -158,6 +201,30 @@ contains err_action=err_act end subroutine psb_set_erraction + ! sets the action to take upon error occurrence + subroutine psb_set_erract_return() + err_action = psb_act_ret_ + end subroutine psb_set_erract_return + subroutine psb_set_erract_print() + err_action = psb_act_print_ + end subroutine psb_set_erract_print + subroutine psb_set_erract_abort() + err_action = psb_act_abort_ + end subroutine psb_set_erract_abort + + function psb_is_erract_return() result(res) + logical :: res + res = (err_action == psb_act_ret_) + end function psb_is_erract_return + function psb_is_erract_print() result(res) + logical :: res + res = (err_action == psb_act_print_) + end function psb_is_erract_print + function psb_is_erract_abort() result(res) + logical :: res + res = (err_action == psb_act_abort_) + end function psb_is_erract_abort + ! restores error action previously saved with psb_erractionsave subroutine psb_erractionrestore(err_act) @@ -322,323 +389,658 @@ contains end subroutine psb_warning_push + ! pops an error from the error stack + subroutine psb_ach_errpop(achmsg) + character(len=psb_max_errmsg_len_), allocatable, intent(out) :: achmsg(:) + integer(psb_ipk_) :: err_c + character(len=20) :: r_name + character(len=40) :: a_e_d + integer(psb_ipk_) :: i_e_d(5) + + type(psb_errstack_node), pointer :: old_node + + if (error_stack%n_elems > 0) then + err_c = error_stack%top%err_code + r_name = error_stack%top%routine + i_e_d = error_stack%top%i_err_data + a_e_d = error_stack%top%a_err_data + call psb_errmsg(achmsg,err_c, r_name, i_e_d, a_e_d) + old_node => error_stack%top + error_stack%top => old_node%next + error_stack%n_elems = error_stack%n_elems - 1 + deallocate(old_node) + end if + if (error_stack%n_elems == 0) error_status=0 + + + end subroutine psb_ach_errpop + ! pops an error from the error stack subroutine psb_errpop(err_c, r_name, i_e_d, a_e_d) - integer(psb_ipk_), intent(out) :: err_c + integer(psb_ipk_), intent(out) :: err_c character(len=20), intent(out) :: r_name character(len=40), intent(out) :: a_e_d - integer(psb_ipk_), intent(out) :: i_e_d(5) + integer(psb_ipk_), intent(out) :: i_e_d(5) type(psb_errstack_node), pointer :: old_node - err_c = error_stack%top%err_code - r_name = error_stack%top%routine - i_e_d = error_stack%top%i_err_data - a_e_d = error_stack%top%a_err_data + if (error_stack%n_elems > 0) then + err_c = error_stack%top%err_code + r_name = error_stack%top%routine + i_e_d = error_stack%top%i_err_data + a_e_d = error_stack%top%a_err_data + + old_node => error_stack%top + error_stack%top => old_node%next + error_stack%n_elems = error_stack%n_elems - 1 + deallocate(old_node) + end if + if (error_stack%n_elems == 0) error_status=psb_no_err_ + - old_node => error_stack%top - error_stack%top => old_node%next - error_stack%n_elems = error_stack%n_elems - 1 - if (error_stack%n_elems == 0) error_status=0 + end subroutine psb_errpop - deallocate(old_node) + ! Clean the error stack + subroutine psb_clean_errstack() - end subroutine psb_errpop + integer(psb_ipk_) :: err_c + character(len=20) :: r_name + character(len=40) :: a_e_d + integer(psb_ipk_) :: i_e_d(5) + + do while (psb_get_numerr() > 0) + call psb_errpop(err_c, r_name, i_e_d, a_e_d) + end do + + end subroutine psb_clean_errstack ! prints the error msg associated to a specific error code - subroutine psb_errmsg(err_c, r_name, i_e_d, a_e_d,me) + subroutine psb_ach_errmsg(achmsg,err_c, r_name, i_e_d, a_e_d,me) - integer(psb_ipk_), intent(in) :: err_c + character(len=psb_max_errmsg_len_), allocatable, intent(out) :: achmsg(:) + integer(psb_ipk_), intent(in) :: err_c character(len=20), intent(in) :: r_name character(len=40), intent(in) :: a_e_d - integer(psb_ipk_), intent(in) :: i_e_d(5) - integer(psb_mpik_), optional :: me + integer(psb_ipk_), intent(in) :: i_e_d(5) + integer(psb_mpik_), optional :: me + character(len=psb_max_errmsg_len_) :: tmpmsg + + + if(present(me)) then - write(psb_err_unit,& + write(tmpmsg,& & '("Process: ",i0,". PSBLAS Error (",i0,") in subroutine: ",a20)')& & me,err_c,trim(r_name) else - write(psb_err_unit,'("PSBLAS Error (",i0,") in subroutine: ",a)')& + write(tmpmsg,'("PSBLAS Error (",i0,") in subroutine: ",a)')& & err_c,trim(r_name) end if - + select case (err_c) case(:psb_success_) - write(psb_err_unit,'("error on calling sperror. err_c must be greater than 0")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("error on calling perror. err_c must be greater than 0")') + case(psb_err_pivot_too_small_) - write(psb_err_unit,'("pivot too small: ",i0,1x,a)')i_e_d(1),trim(a_e_d) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("pivot too small: ",i0,1x,a)')i_e_d(1),trim(a_e_d) + case(psb_err_invalid_ovr_num_) - write(psb_err_unit,'("Invalid number of ovr:",i0)')i_e_d(1) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid number of ovr:",i0)')i_e_d(1) + case(psb_err_invalid_input_) - write(psb_err_unit,'("Invalid input")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid input")') case(psb_err_iarg_neg_) - write(psb_err_unit,'("input argument n. ",i0," cannot be less than 0")')i_e_d(1) - write(psb_err_unit,'("current value is ",i0)')i_e_d(2) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument n. ",i0," cannot be less than 0")')i_e_d(1) + write(achmsg(3),'("current value is ",i0)')i_e_d(2) case(psb_err_iarg_pos_) - write(psb_err_unit,'("input argument n. ",i0," cannot be greater than 0")')i_e_d(1) - write(psb_err_unit,'("current value is ",i0)')i_e_d(2) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument n. ",i0," cannot be greater than 0")')i_e_d(1) + write(achmsg(3),'("current value is ",i0)')i_e_d(2) + case(psb_err_input_value_invalid_i_) - write(psb_err_unit,'("input argument n. ",i0," has an invalid value")')i_e_d(1) - write(psb_err_unit,'("current value is ",i0)')i_e_d(2) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument n. ",i0," has an invalid value")')i_e_d(1) + write(achmsg(3),'("current value is ",i0)')i_e_d(2) + case(psb_err_input_asize_invalid_i_) - write(psb_err_unit,'("Size of input array argument n. ",i0," is invalid.")')i_e_d(1) - write(psb_err_unit,'("Current value is ",i0)')i_e_d(2) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Size of input array argument n. ",i0," is invalid.")')i_e_d(1) + write(achmsg(3),'("Current value is ",i0)')i_e_d(2) + case(psb_err_input_asize_small_i_) - write(psb_err_unit,'("Size of input array argument n. ",i0," is too small.")')i_e_d(1) - write(psb_err_unit,'("Current value is ",i0," Should be at least ",i0)') i_e_d(2),i_e_d(3) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Size of input array argument n. ",i0," is too small.")')i_e_d(1) + write(achmsg(3),'("Current value is ",i0," Should be at least ",i0)') i_e_d(2),i_e_d(3) + case(psb_err_iarg_invalid_i_) - write(psb_err_unit,'("input argument n. ",i0," has an invalid value")')i_e_d(1) - write(psb_err_unit,'("current value is ",a)')a_e_d(2:2) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument n. ",i0," has an invalid value")')i_e_d(1) + write(achmsg(3),'("current value is ",a)')a_e_d(2:2) + case(psb_err_iarg_not_gtia_ii_) - write(psb_err_unit,& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("input argument n. ",i0," must be equal or greater than input argument n. ",i0)') & & i_e_d(1), i_e_d(3) - write(psb_err_unit,'("current values are ",i0," < ",i0)')& + write(achmsg(3),'("current values are ",i0," < ",i0)')& & i_e_d(2),i_e_d(5) + case(psb_err_iarg_not_gteia_ii_) - write(psb_err_unit,'("input argument n. ",i0," must be greater than or equal to ",i0)')& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument n. ",i0," must be greater than or equal to ",i0)')& & i_e_d(1),i_e_d(2) - write(psb_err_unit,'("current value is ",i0," < ",i0)')& + write(achmsg(3),'("current value is ",i0," < ",i0)')& & i_e_d(3), i_e_d(2) + case(psb_err_iarg_invalid_value_) - write(psb_err_unit,'("input argument n. ",i0," in entry # ",i0," has an invalid value")')& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument n. ",i0," in entry # ",i0," has an invalid value")')& & i_e_d(1:2) - write(psb_err_unit,'("current value is ",a)')trim(a_e_d) + write(achmsg(3),'("current value is ",a)')trim(a_e_d) + case(psb_err_asb_nrc_error_) - write(psb_err_unit,'("Impossible error in ASB: nrow>ncol,")') - write(psb_err_unit,'("Actual values are ",i0," > ",i0)')i_e_d(1:2) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Impossible error in ASB: nrow>ncol,")') + write(achmsg(3),'("Actual values are ",i0," > ",i0)')i_e_d(1:2) ! ... csr format error ... + case(psb_err_iarg2_neg_) - write(psb_err_unit,'("input argument ia2(1) is less than 0")') - write(psb_err_unit,'("current value is ",i0)')i_e_d(1) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument ia2(1) is less than 0")') + write(achmsg(3),'("current value is ",i0)')i_e_d(1) ! ... csr format error ... + case(psb_err_ia2_not_increasing_) - write(psb_err_unit,'("indices in ia2 array are not in increasing order")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("indices in ia2 array are not in increasing order")') + case(psb_err_ia1_not_increasing_) - write(psb_err_unit,'("indices in ia1 array are not in increasing order")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("indices in ia1 array are not in increasing order")') ! ... csr format error ... + case(psb_err_ia1_badindices_) - write(psb_err_unit,'("indices in ia1 array are not within problem dimension")') - write(psb_err_unit,'("problem dimension is ",i0)')i_e_d(1) + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("indices in ia1 array are not within problem dimension")') + write(achmsg(3),'("problem dimension is ",i0)')i_e_d(1) + case(psb_err_invalid_args_combination_) - write(psb_err_unit,'("invalid combination of input arguments")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("invalid combination of input arguments")') + case(psb_err_invalid_pid_arg_) - write(psb_err_unit,'("Invalid process identifier in input array argument n. ",i0,".")')& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid process identifier in input array argument n. ",i0,".")')& & i_e_d(1) - write(psb_err_unit,'("Current value is ",i0)')i_e_d(2) + write(achmsg(3),'("Current value is ",i0)')i_e_d(2) + case(psb_err_iarg_n_mbgtian_) - write(psb_err_unit,'("input argument n. ",i0," must be greater than input argument n. ",i0)')& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument n. ",i0," must be greater than input argument n. ",i0)')& & i_e_d(1:2) - write(psb_err_unit,'("current values are ",i0," < ",i0)') i_e_d(3:4) + write(achmsg(3),'("current values are ",i0," < ",i0)') i_e_d(3:4) + case(psb_err_dupl_cd_vl) - write(psb_err_unit,'("there are duplicated entries in vl (input to cdall)")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("there are duplicated entries in vl (input to cdall)")') ! ... coo format error ... ! ... coo format error ... + case(psb_err_duplicate_coo) - write(psb_err_unit,'("there are duplicated elements in coo format")') - write(psb_err_unit,'("and you have chosen psb_dupl_err_ ")') + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),'("there are duplicated elements in coo format")') + write(achmsg(3),'("and you have chosen psb_dupl_err_ ")') + case(psb_err_invalid_input_format_) - write(psb_err_unit,'("Invalid input format ",a3)')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid input format ",a3)')& & a_e_d(1:3) + case(psb_err_unsupported_format_) - write(psb_err_unit,'("Format ",a3," not yet supported here")')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Format ",a3," not yet supported here")')& &a_e_d(1:3) + case(psb_err_format_unknown_) - write(psb_err_unit,'("Format ",a3," is unknown")')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Format ",a3," is unknown")')& & a_e_d(1:3) + case(psb_err_iarray_outside_bounds_) - write(psb_err_unit,'("indices in input array are not within problem dimension ",2(i0,2x))')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("indices in input array are not within problem dimension ",2(i0,2x))')& &i_e_d(1:2) + case(psb_err_iarray_outside_process_) - write(psb_err_unit,'("indices in input array are not belonging to the calling process ",i0)')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("indices in input array are not belonging to the calling process ",i0)')& & i_e_d(1) + case(psb_err_forgot_geall_) - write(psb_err_unit,'("To call this routine you must first call psb_geall on the same matrix")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("To call this routine you must first call psb_geall on the same matrix")') + case(psb_err_forgot_spall_) - write(psb_err_unit,'("To call this routine you must first call psb_spall on the same matrix")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("To call this routine you must first call psb_spall on the same matrix")') + case(psb_err_wrong_ins_) - write(0,'("Something went wrong before this call to ",a,", probably in cdins/spins")')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("Something went wrong before this call to ",a,", probably in cdins/spins")')& & trim(r_name) + case(psb_err_iarg_mbeeiarra_i_) - write(psb_err_unit,& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Input argument n. ",i0," must be equal to entry n. ",i0," in array input argument n.",i0)') & & i_e_d(1),i_e_d(4),i_e_d(3) - write(psb_err_unit,'("Current values are ",i0," != ",i0)')i_e_d(2), i_e_d(5) + write(achmsg(3),'("Current values are ",i0," != ",i0)')i_e_d(2), i_e_d(5) + case(psb_err_mpi_error_) - write(psb_err_unit,'("MPI error:",i0)')i_e_d(1) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("MPI error:",i0)')i_e_d(1) + case(psb_err_parm_differs_among_procs_) - write(psb_err_unit,'("Parameter n. ",i0," must be equal on all processes. ",i0)')i_e_d(1) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("Parameter n. ",i0," must be equal on all processes. ",i0)')i_e_d(1) + case(psb_err_entry_out_of_bounds_) - write(psb_err_unit,'("Entry n. ",i0," out of ",i0," should be between 1 and ",i0," but is ",i0)')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("Entry n. ",i0," out of ",i0," should be between 1 and ",i0," but is ",i0)')& & i_e_d(1),i_e_d(3),i_e_d(4),i_e_d(2) + case(psb_err_inconsistent_index_lists_) - write(psb_err_unit,'("Index lists are inconsistent: some indices are orphans")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Index lists are inconsistent: some indices are orphans")') + case(psb_err_partfunc_toomuchprocs_) - write(psb_err_unit,& + allocate(achmsg(4)) + achmsg(1) = tmpmsg + write(achmsg(2),& &'("partition function passed as input argument n. ",i0," returns number of processes")')& &i_e_d(1) - write(psb_err_unit,& + write(achmsg(3),& & '("greater than No of grid s processes on global point ",i0,". Actual number of grid s ")')& &i_e_d(4) - write(psb_err_unit,'("processes is ",i0,", number returned is ",i0)')i_e_d(2),i_e_d(3) + write(achmsg(4),'("processes is ",i0,", number returned is ",i0)')i_e_d(2),i_e_d(3) + case(psb_err_partfunc_toofewprocs_) - write(psb_err_unit,'("partition function passed as input argument n. ",i0," returns number of processes")')& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("partition function passed as input argument n. ",i0," returns number of processes")')& &i_e_d(1) - write(psb_err_unit,'("less or equal to 0 on global point ",i0,". Number returned is ",i0)')& + write(achmsg(3),& + &'("less or equal to 0 on global point ",i0,". Number returned is ",i0)')& &i_e_d(3),i_e_d(2) + case(psb_err_partfunc_wrong_pid_) - write(psb_err_unit,& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),& &'("partition function passed as input argument n. ",i0," returns wrong processes identifier")')& & i_e_d(1) - write(psb_err_unit,'("on global point ",i0,". Current value returned is : ",i0)')& + write(achmsg(3),& + & '("on global point ",i0,". Current value returned is : ",i0)')& & i_e_d(3),i_e_d(2) + case(psb_err_no_optional_arg_) - write(psb_err_unit,'("One of the optional arguments ",a," must be present")')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& + &'("One of the optional arguments ",a," must be present")')& & trim(a_e_d) + case(psb_err_arg_m_required_) - write(psb_err_unit,'("Argument M is required when argument PARTS is specified")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Argument M is required when argument PARTS is specified")') + case(psb_err_spmat_invalid_state_) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Sparse Matrix and descriptors are in an invalid state for this subroutine call: ",i0)')& &i_e_d(1) + case(psb_err_missing_override_method_) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Base class method ",a," called: the class for ",a," is missing an overriding implementation")')& & trim(r_name), trim(a_e_d) + case(psb_err_invalid_dynamic_type_) - write(psb_err_unit,'("input argument n. ",i0," has a dynamic type not allowed here.")')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("input argument n. ",i0," has a dynamic type not allowed here.")')& & i_e_d(1) - case (psb_err_rectangular_mat_unsupported_) - write(psb_err_unit,& + case(psb_err_rectangular_mat_unsupported_) + write(achmsg(2),& &'("This routine does not support rectangular matrices: ",i0, " /= ",i0)') & & i_e_d(1), i_e_d(2) - case (psb_err_invalid_mat_state_) - write(psb_err_unit,'("Invalid state for sparse matrix")') - case (psb_err_invalid_cd_state_) - write(psb_err_unit,'("Invalid state for communication descriptor")') - case (psb_err_invalid_a_and_cd_state_) - write(psb_err_unit,'("Invalid combined state for A and DESC_A")') - case (psb_err_invalid_vect_state_) - write(psb_err_unit,'("Invalid state for vector")') + + case(psb_err_invalid_mat_state_) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid state for sparse matrix")') + + case(psb_err_invalid_cd_state_) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid state for communication descriptor")') + + case(psb_err_invalid_a_and_cd_state_) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid combined state for A and DESC_A")') + + case(psb_err_invalid_vect_state_) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid state for vector")') + case(1125:1999) - write(psb_err_unit,'("computational error. code: ",i0)')err_c + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("computational error. code: ",i0)')err_c + case(psb_err_context_error_) + allocate(achmsg(2)) + achmsg(1) = tmpmsg write(0,'("Parallel context error. Number of processes=-1")') + case(psb_err_initerror_neugh_procs_) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Initialization error: not enough processes available in the parallel environment")') + case(psb_err_invalid_matrix_input_state_) - write(psb_err_unit,'("Invalid input state for matrix.")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid input state for matrix.")') + case(psb_err_input_no_regen_) - write(psb_err_unit,'("Input state for matrix is not adequate for regeneration.")') - case (2233:2999) - write(psb_err_unit,'("resource error. code: ",i0)')err_c + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Input state for matrix is not adequate for regeneration.")') + + case(2233:2999) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("resource error. code: ",i0)')err_c + case(3000:3009) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("sparse matrix representation ",a3," not yet implemented")')& &a_e_d(1:3) + case(psb_err_lld_case_not_implemented_) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& &'("Case lld not equal matrix_data[N_COL_] is not yet implemented.")') + case(psb_err_transpose_unsupported_) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("transpose option for sparse matrix representation ",a3," not implemented")')& & a_e_d(1:3) + case(psb_err_transpose_c_unsupported_) - write(psb_err_unit,'("Case trans = C is not yet implemented.")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Case trans = C is not yet implemented.")') + case(psb_err_transpose_not_n_unsupported_) - write(psb_err_unit,'("Case trans /= N is not yet implemented.")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Case trans /= N is not yet implemented.")') + case(psb_err_only_unit_diag_) - write(psb_err_unit,'("Only unit diagonal so far for triangular matrices. ")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Only unit diagonal so far for triangular matrices. ")') + case(3023) - write(psb_err_unit,'("Cases DESCRA(1:1)=S DESCRA(1:1)=T not yet implemented. ")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Cases DESCRA(1:1)=S DESCRA(1:1)=T not yet implemented. ")') + case(3024) - write(psb_err_unit,'("Cases DESCRA(1:1)=G not yet implemented. ")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Cases DESCRA(1:1)=G not yet implemented. ")') + case(psb_err_ja_nix_ia_niy_unsupported_) - write(psb_err_unit,'("Case ja /= ix or ia/=iy is not yet implemented.")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Case ja /= ix or ia/=iy is not yet implemented.")') + case(psb_err_ix_n1_iy_n1_unsupported_) - write(psb_err_unit,'("Case ix /= 1 or iy /= 1 is not yet implemented.")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Case ix /= 1 or iy /= 1 is not yet implemented.")') + case(3050) - write(psb_err_unit,'("Case ix /= iy is not yet implemented.")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Case ix /= iy is not yet implemented.")') + case(3060) - write(psb_err_unit,'("Case ix /= 1 is not yet implemented.")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Case ix /= 1 is not yet implemented.")') + case(3070) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("This operation is only implemented with no overlap.")') + case(3080) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Decompostion type ",i0," not yet supported.")')& & i_e_d(1) + case(3090) - write(psb_err_unit,'("Insert matrix mode not yet implemented.")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Insert matrix mode not yet implemented.")') + case(3100) - write(psb_err_unit,& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Error on index. Element has not been inserted")') - write(psb_err_unit,& + write(achmsg(3),& & '("local index is: ",i0," and global index is:",i0)')& & i_e_d(1:2) + case(psb_err_input_matrix_unassembled_) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& &'("Before you call this routine, you must assembly sparse matrix")') + case(3111) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Before you call this routine, you must initialize the preconditioner")') + case(3112) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Before you call this routine, you must build the preconditioner")') + case(3113:3998) - write(psb_err_unit,'("miscellaneus error. code: ",i0)')err_c + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("miscellaneus error. code: ",i0)')err_c + case(psb_err_missing_aux_lib_) - write(psb_err_unit,& + allocate(achmsg(3)) + achmsg(1) = tmpmsg + write(achmsg(2),& &'("This method requires an external support library.")') - write(psb_err_unit,& + write(achmsg(3),& &'("Fix configure and rebuild the software.")') + case(psb_err_alloc_dealloc_) - write(psb_err_unit,'("Allocation/deallocation error")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Allocation/deallocation error")') + case(psb_err_internal_error_) - write(psb_err_unit,'("Internal error: ",a)') & + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Internal error: ",a)') & & trim(a_e_d) + case(psb_err_from_subroutine_) - write(psb_err_unit,'("Error from call to subroutine ",a)')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Error from call to subroutine ",a)')& & trim(a_e_d) + case(psb_err_from_subroutine_non_) - write(psb_err_unit,'("Error from call to a subroutine ")') + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Error from call to a subroutine ")') + case(psb_err_from_subroutine_i_) - write(psb_err_unit,'("Error ",i0," from call to a subroutine ")')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Error ",i0," from call to a subroutine ")')& & i_e_d(1) + case(psb_err_from_subroutine_ai_) - write(psb_err_unit,'("Error from call to subroutine ",a," ",i0)')& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Error from call to subroutine ",a," ",i0)')& & trim(a_e_d),i_e_d(1) + case(psb_err_alloc_request_) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Error on allocation request for ",i0," items of type ",a)')& & i_e_d(1),trim(a_e_d) + case(4110) - write(psb_err_unit,& + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),& & '("Error ",i0," from call to an external package in subroutine ",a)')& &i_e_d(1),trim(a_e_d) - case (psb_err_invalid_istop_) - write(psb_err_unit,'("Invalid ISTOP: ",i0)')i_e_d(1) - case (5002) - write(psb_err_unit,'("Invalid PREC: ",i0)')i_e_d(1) - case (5003) - write(psb_err_unit,'("Invalid PREC: ",a3)')a_e_d(1:3) + + case(psb_err_invalid_istop_) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid ISTOP: ",i0)')i_e_d(1) + + case(5002) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid PREC: ",i0)')i_e_d(1) + + case(5003) + allocate(achmsg(2)) + achmsg(1) = tmpmsg + write(achmsg(2),'("Invalid PREC: ",a3)')a_e_d(1:3) + case default - write(psb_err_unit,'("unknown error (",i0,") in subroutine ",a)')& + allocate(achmsg(4)) + achmsg(1) = tmpmsg + write(achmsg(2),'("unknown error (",i0,") in subroutine ",a)')& & err_c,trim(r_name) - write(psb_err_unit,'(5(i0,2x))') i_e_d - write(psb_err_unit,'(a)') trim(a_e_d) + write(achmsg(3),'(5(i0,2x))') i_e_d + write(achmsg(4),'(a)') trim(a_e_d) end select - end subroutine psb_errmsg + end subroutine psb_ach_errmsg + ! prints the error msg associated to a specific error code + subroutine psb_errmsg(iunit, err_c, r_name, i_e_d, a_e_d,me) + integer(psb_ipk_), intent(in) :: iunit + integer(psb_ipk_), intent(in) :: err_c + character(len=20), intent(in) :: r_name + character(len=40), intent(in) :: a_e_d + integer(psb_ipk_), intent(in) :: i_e_d(5) + integer(psb_mpik_), optional :: me + + integer(psb_ipk_) :: i + character(len=psb_max_errmsg_len_), allocatable :: achmsg(:) + + call psb_ach_errmsg(achmsg,err_c, r_name, i_e_d, a_e_d,me) + + do i=1,size(achmsg) + write(iunit,'(a)'),trim(achmsg(i)) + end do + + end subroutine psb_errmsg end module psb_error_mod diff --git a/base/modules/psb_gen_block_map_mod.f90 b/base/modules/psb_gen_block_map_mod.f90 index af9561990..3387f5ae5 100644 --- a/base/modules/psb_gen_block_map_mod.f90 +++ b/base/modules/psb_gen_block_map_mod.f90 @@ -1170,12 +1170,10 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + +9999 call psb_error_handler(err_act) + + return end subroutine block_clone @@ -1222,11 +1220,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine block_reinit @@ -1270,11 +1266,9 @@ contains !!$ call psb_erractionrestore(err_act) !!$ return !!$ -!!$9999 continue -!!$ call psb_erractionrestore(err_act) -!!$ if (err_act /= psb_act_ret_) then -!!$ call psb_error() -!!$ end if +!!$ +!!$9999 call psb_error_handler(err_act) +!!$ !!$ return !!$ end subroutine block_reinit !!$ diff --git a/base/modules/psb_glist_map_mod.f90 b/base/modules/psb_glist_map_mod.f90 index ad9fc69ee..4c1aa83f6 100644 --- a/base/modules/psb_glist_map_mod.f90 +++ b/base/modules/psb_glist_map_mod.f90 @@ -241,11 +241,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine glist_clone diff --git a/base/modules/psb_hash_map_mod.f90 b/base/modules/psb_hash_map_mod.f90 index 41723041d..ebd4cd8f1 100644 --- a/base/modules/psb_hash_map_mod.f90 +++ b/base/modules/psb_hash_map_mod.f90 @@ -715,14 +715,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine hash_g2lv1_ins @@ -1421,12 +1415,10 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + +9999 call psb_error_handler(err_act) + + return end subroutine hash_clone @@ -1485,7 +1477,7 @@ contains call idxmap%g2lip_ins(idx(nr+1:nc),info,lidx=lidx(nr+1:nc)) end if - + if (info /= psb_success_) then info = psb_err_from_subroutine_ call psb_errpush(info,name) @@ -1494,11 +1486,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine hash_reinit diff --git a/base/modules/psb_i_base_vect_mod.f90 b/base/modules/psb_i_base_vect_mod.f90 index 900b45f2c..4380efc90 100644 --- a/base/modules/psb_i_base_vect_mod.f90 +++ b/base/modules/psb_i_base_vect_mod.f90 @@ -75,7 +75,9 @@ module psb_i_base_vect_mod ! Assembly does almost nothing here, but is important ! in derived classes. ! - procedure, pass(x) :: ins => i_base_ins + procedure, pass(x) :: ins_a => i_base_ins_a + procedure, pass(x) :: ins_v => i_base_ins_v + generic, public :: ins => ins_a, ins_v procedure, pass(x) :: zero => i_base_zero procedure, pass(x) :: asb => i_base_asb procedure, pass(x) :: free => i_base_free @@ -295,7 +297,7 @@ contains !! \param info return code !! ! - subroutine i_base_ins(n,irl,val,dupl,x,info) + subroutine i_base_ins_a(n,irl,val,dupl,x,info) use psi_serial_mod implicit none class(psb_i_base_vect_type), intent(inout) :: x @@ -346,12 +348,41 @@ contains ! !$ goto 9999 end select end if + call x%set_host() if (info /= 0) then call psb_errpush(info,'base_vect_ins') return end if - end subroutine i_base_ins + end subroutine i_base_ins_a + + + subroutine i_base_ins_v(n,irl,val,dupl,x,info) + use psi_serial_mod + implicit none + class(psb_i_base_vect_type), intent(inout) :: x + integer(psb_ipk_), intent(in) :: n, dupl + class(psb_i_base_vect_type), intent(inout) :: irl + class(psb_i_base_vect_type), intent(inout) :: val + integer(psb_ipk_), intent(out) :: info + + integer(psb_ipk_) :: i, isz + + info = 0 + if (psb_errstatus_fatal()) return + + if (irl%is_dev()) call irl%sync() + if (val%is_dev()) call val%sync() + if (x%is_dev()) call x%sync() + call x%ins(n,irl%v,val%v,dupl,info) + + if (info /= 0) then + call psb_errpush(info,'base_vect_ins') + return + end if + + end subroutine i_base_ins_v + ! !> Function base_zero diff --git a/base/modules/psb_i_tools_mod.f90 b/base/modules/psb_i_tools_mod.f90 index 4ff63452a..b46da2f31 100644 --- a/base/modules/psb_i_tools_mod.f90 +++ b/base/modules/psb_i_tools_mod.f90 @@ -57,6 +57,14 @@ module psb_i_tools_mod integer(psb_ipk_),intent(out) :: info integer(psb_ipk_), optional, intent(in) :: n end subroutine psb_ialloc_vect + subroutine psb_ialloc_vect_r2(x, desc_a,info,n,lb) + import :: psb_desc_type, psb_ipk_, & + & psb_i_base_vect_type, psb_i_vect_type + type(psb_i_vect_type), allocatable, intent(out) :: x(:) + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_),intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: n, lb + end subroutine psb_ialloc_vect_r2 end interface @@ -82,6 +90,15 @@ module psb_i_tools_mod class(psb_i_base_vect_type), intent(in), optional :: mold logical, intent(in), optional :: scratch end subroutine psb_iasb_vect + subroutine psb_iasb_vect_r2(x, desc_a, info,mold, scratch) + import :: psb_desc_type, psb_ipk_, & + & psb_i_base_vect_type, psb_i_vect_type + type(psb_desc_type), intent(in) :: desc_a + type(psb_i_vect_type), intent(inout) :: x(:) + integer(psb_ipk_), intent(out) :: info + class(psb_i_base_vect_type), intent(in), optional :: mold + logical, intent(in), optional :: scratch + end subroutine psb_iasb_vect_r2 end interface @@ -105,6 +122,13 @@ module psb_i_tools_mod type(psb_i_vect_type), intent(inout) :: x integer(psb_ipk_), intent(out) :: info end subroutine psb_ifree_vect + subroutine psb_ifree_vect_r2(x, desc_a, info) + import :: psb_desc_type, psb_ipk_, & + & psb_i_base_vect_type, psb_i_vect_type + type(psb_desc_type), intent(in) :: desc_a + type(psb_i_vect_type), allocatable, intent(inout) :: x(:) + integer(psb_ipk_), intent(out) :: info + end subroutine psb_ifree_vect_r2 end interface interface psb_geins @@ -142,6 +166,30 @@ module psb_i_tools_mod integer(psb_ipk_), optional, intent(in) :: dupl logical, intent(in), optional :: local end subroutine psb_iins_vect + subroutine psb_iins_vect_v(m,irw,val,x,desc_a,info,dupl,local) + import :: psb_desc_type, psb_ipk_, & + & psb_i_base_vect_type, psb_i_vect_type + integer(psb_ipk_), intent(in) :: m + type(psb_desc_type), intent(in) :: desc_a + type(psb_i_vect_type), intent(inout) :: x + type(psb_i_vect_type), intent(inout) :: irw + type(psb_i_vect_type), intent(inout) :: val + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: dupl + logical, intent(in), optional :: local + end subroutine psb_iins_vect_v + subroutine psb_iins_vect_r2(m,irw,val,x,desc_a,info,dupl,local) + import :: psb_desc_type, psb_ipk_, & + & psb_i_base_vect_type, psb_i_vect_type + integer(psb_ipk_), intent(in) :: m + type(psb_desc_type), intent(in) :: desc_a + type(psb_i_vect_type), intent(inout) :: x(:) + integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_ipk_), intent(in) :: val(:,:) + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: dupl + logical, intent(in), optional :: local + end subroutine psb_iins_vect_r2 end interface diff --git a/base/modules/psb_i_vect_mod.F90 b/base/modules/psb_i_vect_mod.F90 index ae8c2a868..48059940c 100644 --- a/base/modules/psb_i_vect_mod.F90 +++ b/base/modules/psb_i_vect_mod.F90 @@ -76,7 +76,9 @@ module psb_i_vect_mod procedure, pass(y) :: sctb => i_vect_sctb generic, public :: sct => sctb procedure, pass(x) :: free => i_vect_free - procedure, pass(x) :: ins => i_vect_ins + procedure, pass(x) :: ins_a => i_vect_ins_a + procedure, pass(x) :: ins_v => i_vect_ins_v + generic, public :: ins => ins_v, ins_a procedure, pass(x) :: bld_x => i_vect_bld_x procedure, pass(x) :: bld_n => i_vect_bld_n generic, public :: bld => bld_x, bld_n @@ -609,7 +611,7 @@ contains end subroutine i_vect_free - subroutine i_vect_ins(n,irl,val,dupl,x,info) + subroutine i_vect_ins_a(n,irl,val,dupl,x,info) use psi_serial_mod implicit none class(psb_i_vect_type), intent(inout) :: x @@ -628,8 +630,28 @@ contains call x%v%ins(n,irl,val,dupl,info) - end subroutine i_vect_ins + end subroutine i_vect_ins_a + + subroutine i_vect_ins_v(n,irl,val,dupl,x,info) + use psi_serial_mod + implicit none + class(psb_i_vect_type), intent(inout) :: x + integer(psb_ipk_), intent(in) :: n, dupl + class(psb_i_vect_type), intent(inout) :: irl + class(psb_i_vect_type), intent(inout) :: val + integer(psb_ipk_), intent(out) :: info + + integer(psb_ipk_) :: i + + info = 0 + if (.not.(allocated(x%v).and.allocated(irl%v).and.allocated(val%v))) then + info = psb_err_invalid_vect_state_ + return + end if + + call x%v%ins(n,irl%v,val%v,dupl,info) + end subroutine i_vect_ins_v subroutine i_vect_cnv(x,mold) class(psb_i_vect_type), intent(inout) :: x diff --git a/base/modules/psb_indx_map_mod.f90 b/base/modules/psb_indx_map_mod.f90 index ebebba421..8cd47d71d 100644 --- a/base/modules/psb_indx_map_mod.f90 +++ b/base/modules/psb_indx_map_mod.f90 @@ -462,9 +462,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_l2gs1 @@ -490,10 +488,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine base_l2gs2 @@ -517,9 +512,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_l2gv1 @@ -543,9 +536,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_l2gv2 @@ -570,9 +561,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_g2ls1 @@ -598,9 +587,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_g2ls2 @@ -625,9 +612,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_g2lv1 @@ -653,9 +638,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return @@ -682,9 +665,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_g2ls1_ins @@ -710,9 +691,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_g2ls2_ins @@ -738,9 +717,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_g2lv1_ins @@ -766,9 +743,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_g2lv2_ins @@ -791,9 +766,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_asb @@ -849,9 +822,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_init_vl @@ -875,9 +846,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_clone @@ -901,9 +870,7 @@ contains call psb_errpush(psb_err_missing_override_method_,& & name,a_err=idxmap%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) return end subroutine base_reinit diff --git a/base/modules/psb_list_map_mod.f90 b/base/modules/psb_list_map_mod.f90 index 14326d97c..f1360182c 100644 --- a/base/modules/psb_list_map_mod.f90 +++ b/base/modules/psb_list_map_mod.f90 @@ -698,11 +698,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if +9999 call psb_error_handler(err_act) + return end subroutine list_clone diff --git a/base/modules/psb_realloc_mod.F90 b/base/modules/psb_realloc_mod.F90 index 5a2e4a8e8..e00e8176c 100644 --- a/base/modules/psb_realloc_mod.F90 +++ b/base/modules/psb_realloc_mod.F90 @@ -32,7 +32,7 @@ module psb_realloc_mod use psb_const_mod implicit none - + ! ! psb_realloc will reallocate the input array to have exactly ! the size specified, possibly shortening it. @@ -86,7 +86,7 @@ module psb_realloc_mod module procedure psb_rp1p2z2 #endif - end Interface + end Interface psb_realloc interface psb_move_alloc module procedure psb_smove_alloc1d @@ -106,7 +106,7 @@ module psb_realloc_mod module procedure psb_cmove_alloc2d module procedure psb_zmove_alloc1d module procedure psb_zmove_alloc2d - end interface + end interface psb_move_alloc Interface psb_safe_ab_cpy module procedure psb_i_ab_cpy1d,psb_i_ab_cpy2d, & @@ -114,7 +114,7 @@ module psb_realloc_mod & psb_c_ab_cpy1d, psb_c_ab_cpy2d,& & psb_d_ab_cpy1d, psb_d_ab_cpy2d,& & psb_z_ab_cpy1d, psb_z_ab_cpy2d - end Interface + end Interface psb_safe_ab_cpy Interface psb_safe_cpy module procedure psb_i_cpy1d,psb_i_cpy2d, & @@ -122,7 +122,7 @@ module psb_realloc_mod & psb_c_cpy1d, psb_c_cpy2d,& & psb_d_cpy1d, psb_d_cpy2d,& & psb_z_cpy1d, psb_z_cpy2d - end Interface + end Interface psb_safe_cpy ! ! psb_ensure_size will reallocate the input array if necessary @@ -136,7 +136,7 @@ module psb_realloc_mod #endif & psb_scksz1d, psb_ccksz1d, & & psb_dcksz1d, psb_zcksz1d - end Interface + end Interface psb_ensure_size interface psb_size module procedure psb_isize1d, psb_isize2d,& @@ -147,9 +147,9 @@ module psb_realloc_mod & psb_csize1d, psb_csize2d,& & psb_dsize1d, psb_dsize2d,& & psb_zsize1d, psb_zsize2d - end interface - - + end interface psb_size + + Contains subroutine psb_i_ab_cpy1d(vin,vout,info) @@ -191,14 +191,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_i_ab_cpy1d @@ -243,18 +237,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_i_ab_cpy2d - + subroutine psb_s_ab_cpy1d(vin,vout,info) use psb_error_mod @@ -293,18 +281,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_s_ab_cpy1d - + subroutine psb_s_ab_cpy2d(vin,vout,info) use psb_error_mod @@ -345,14 +327,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_s_ab_cpy2d @@ -395,18 +371,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_d_ab_cpy1d - + subroutine psb_d_ab_cpy2d(vin,vout,info) use psb_error_mod @@ -447,18 +417,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_d_ab_cpy2d - + subroutine psb_c_ab_cpy1d(vin,vout,info) use psb_error_mod @@ -497,18 +461,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_c_ab_cpy1d - + subroutine psb_c_ab_cpy2d(vin,vout,info) use psb_error_mod @@ -549,18 +507,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_c_ab_cpy2d - + subroutine psb_z_ab_cpy1d(vin,vout,info) use psb_error_mod @@ -598,18 +550,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_z_ab_cpy1d - + subroutine psb_z_ab_cpy2d(vin,vout,info) use psb_error_mod @@ -649,14 +595,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_z_ab_cpy2d @@ -697,14 +637,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_i_cpy1d @@ -747,18 +681,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_i_cpy2d - + subroutine psb_s_cpy1d(vin,vout,info) use psb_error_mod @@ -795,18 +723,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_s_cpy1d - + subroutine psb_s_cpy2d(vin,vout,info) use psb_error_mod @@ -845,18 +767,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_s_cpy2d - + subroutine psb_d_cpy1d(vin,vout,info) use psb_error_mod @@ -892,18 +808,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_d_cpy1d - + subroutine psb_d_cpy2d(vin,vout,info) use psb_error_mod @@ -942,18 +852,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_d_cpy2d - + subroutine psb_c_cpy1d(vin,vout,info) use psb_error_mod @@ -990,18 +894,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_c_cpy1d - + subroutine psb_c_cpy2d(vin,vout,info) use psb_error_mod @@ -1040,18 +938,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_c_cpy2d - + subroutine psb_z_cpy1d(vin,vout,info) use psb_error_mod @@ -1087,18 +979,12 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_z_cpy1d - + subroutine psb_z_cpy2d(vin,vout,info) use psb_error_mod @@ -1137,23 +1023,17 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_z_cpy2d - + function psb_isize1d(vin) integer(psb_ipk_) :: psb_isize1d integer(psb_ipk_), allocatable, intent(in) :: vin(:) - + if (.not.allocated(vin)) then psb_isize1d = 0 else @@ -1178,12 +1058,12 @@ Contains end if end if end function psb_isize2d - + #if !defined(LONG_INTEGERS) function psb_i8size1d(vin) integer(psb_ipk_) :: psb_i8size1d integer(psb_long_int_k_), allocatable, intent(in) :: vin(:) - + if (.not.allocated(vin)) then psb_i8size1d = 0 else @@ -1209,11 +1089,11 @@ Contains end if end function psb_i8size2d #endif - + function psb_ssize1d(vin) integer(psb_ipk_) :: psb_ssize1d real(psb_spk_), allocatable, intent(in) :: vin(:) - + if (.not.allocated(vin)) then psb_ssize1d = 0 else @@ -1243,7 +1123,7 @@ Contains function psb_dsize1d(vin) integer(psb_ipk_) :: psb_dsize1d real(psb_dpk_), allocatable, intent(in) :: vin(:) - + if (.not.allocated(vin)) then psb_dsize1d = 0 else @@ -1270,11 +1150,11 @@ Contains end if end function psb_dsize2d - + function psb_csize1d(vin) integer(psb_ipk_) :: psb_csize1d complex(psb_spk_), allocatable, intent(in) :: vin(:) - + if (.not.allocated(vin)) then psb_csize1d = 0 else @@ -1299,11 +1179,11 @@ Contains end if end if end function psb_csize2d - + function psb_zsize1d(vin) integer(psb_ipk_) :: psb_zsize1d complex(psb_dpk_), allocatable, intent(in) :: vin(:) - + if (.not.allocated(vin)) then psb_zsize1d = 0 else @@ -1352,7 +1232,7 @@ Contains info=psb_err_from_subroutine_ goto 9999 end if - + If (len > psb_size(v)) Then if (present(newsz)) then isz = (max(len+1,newsz)) @@ -1364,7 +1244,7 @@ Contains endif endif call psb_realloc(isz,v,info,pad=pad) - + if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') @@ -1375,14 +1255,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return @@ -1411,7 +1285,7 @@ Contains info=psb_err_from_subroutine_ goto 9999 end if - + If (len > psb_size(v)) Then if (present(newsz)) then isz = (max(len+1,newsz)) @@ -1423,7 +1297,7 @@ Contains endif endif call psb_realloc(isz,v,info,pad=pad) - + if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') @@ -1434,14 +1308,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return End Subroutine psb_i8cksz1d @@ -1469,7 +1337,7 @@ Contains info=psb_err_from_subroutine_ goto 9999 end if - + If (len > psb_size(v)) Then if (present(newsz)) then isz = (max(len+1,newsz)) @@ -1492,14 +1360,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return @@ -1527,7 +1389,7 @@ Contains info=psb_err_from_subroutine_ goto 9999 end if - + If (len > psb_size(v)) Then if (present(newsz)) then isz = (max(len+1,newsz)) @@ -1550,14 +1412,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return @@ -1586,7 +1442,7 @@ Contains info=psb_err_from_subroutine_ goto 9999 end if - + If (len > psb_size(v)) Then if (present(newsz)) then isz = (max(len+1,newsz)) @@ -1608,14 +1464,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return @@ -1644,7 +1494,7 @@ Contains info=psb_err_from_subroutine_ goto 9999 end if - + If (len > psb_size(v)) Then if (present(newsz)) then isz = (max(len+1,newsz)) @@ -1666,14 +1516,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return @@ -1754,15 +1598,10 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if - return + call psb_error_handler(err_act) + return End Subroutine psb_reallocate1i @@ -1832,13 +1671,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocate1s @@ -1909,13 +1742,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocate1d @@ -1986,13 +1813,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocate1c @@ -2062,13 +1883,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocate1z @@ -2159,13 +1974,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocates2 @@ -2255,13 +2064,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocated2 @@ -2352,13 +2155,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocatec2 @@ -2448,13 +2245,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocatez2 @@ -2543,13 +2334,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocatei2 @@ -2630,13 +2415,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return @@ -2725,13 +2504,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocatei8_2 @@ -2772,14 +2545,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return End Subroutine psb_reallocate2i @@ -2824,14 +2591,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return End Subroutine psb_reallocate2i1s @@ -2872,14 +2633,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return End Subroutine psb_reallocate2i1d @@ -2921,14 +2676,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return End Subroutine psb_reallocate2i1c @@ -2967,14 +2716,8 @@ Contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return End Subroutine psb_reallocate2i1z @@ -2986,13 +2729,13 @@ Contains ! info=psb_success_ #ifdef HAVE_MOVE_ALLOC - - call move_alloc(vin,vout) + + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) if (info /= psb_success_) return @@ -3010,14 +2753,14 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return - + allocate(vout(lbound(vin,1):ubound(vin,1),& & lbound(vin,2):ubound(vin,2)),stat=info) if (info /= psb_success_) return @@ -3034,13 +2777,13 @@ Contains ! info=psb_success_ #ifdef HAVE_MOVE_ALLOC - - call move_alloc(vin,vout) + + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) if (info /= psb_success_) return @@ -3058,14 +2801,14 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return - + allocate(vout(lbound(vin,1):ubound(vin,1),& & lbound(vin,2):ubound(vin,2)),stat=info) if (info /= psb_success_) return @@ -3083,12 +2826,12 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) if (info /= psb_success_) return @@ -3106,14 +2849,14 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return - + allocate(vout(lbound(vin,1):ubound(vin,1),& & lbound(vin,2):ubound(vin,2)),stat=info) if (info /= psb_success_) return @@ -3131,12 +2874,12 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) if (info /= psb_success_) return @@ -3154,14 +2897,14 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return - + allocate(vout(lbound(vin,1):ubound(vin,1),& & lbound(vin,2):ubound(vin,2)),stat=info) if (info /= psb_success_) return @@ -3179,12 +2922,12 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) if (info /= psb_success_) return @@ -3202,14 +2945,14 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return - + allocate(vout(lbound(vin,1):ubound(vin,1),& & lbound(vin,2):ubound(vin,2)),stat=info) if (info /= psb_success_) return @@ -3228,12 +2971,12 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) if (info /= psb_success_) return @@ -3251,14 +2994,14 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return - + allocate(vout(lbound(vin,1):ubound(vin,1),& & lbound(vin,2):ubound(vin,2)),stat=info) if (info /= psb_success_) return @@ -3278,12 +3021,12 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return allocate(vout(lbound(vin,1):ubound(vin,1)),stat=info) if (info /= psb_success_) return @@ -3301,14 +3044,14 @@ Contains info=psb_success_ #ifdef HAVE_MOVE_ALLOC - call move_alloc(vin,vout) + call move_alloc(vin,vout) #else if (allocated(vout)) then deallocate(vout,stat=info) - end if + end if if (.not.allocated(vin) ) return - + allocate(vout(lbound(vin,1):ubound(vin,1),& & lbound(vin,2):ubound(vin,2)),stat=info) if (info /= psb_success_) return @@ -3392,13 +3135,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return @@ -3484,13 +3221,7 @@ Contains 9999 continue info = err - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if + call psb_error_handler(err_act) return End Subroutine psb_reallocatei4_2 @@ -3828,7 +3559,7 @@ Contains integer(psb_ipk_), allocatable, intent(out) :: at(:,:) integer(psb_ipk_) :: i,j,ib, ii integer(psb_ipk_), parameter :: nb=32 - + nr = size(a,1) nc = size(a,2) allocate(at(nc,nr)) @@ -3849,7 +3580,7 @@ Contains real(psb_dpk_), allocatable, intent(out) :: at(:,:) integer(psb_ipk_) :: i,j,ib, ii integer(psb_ipk_), parameter :: nb=32 - + nr = size(a,1) nc = size(a,2) allocate(at(nc,nr)) diff --git a/base/modules/psb_repl_map_mod.f90 b/base/modules/psb_repl_map_mod.f90 index 45d260d42..050ce3a52 100644 --- a/base/modules/psb_repl_map_mod.f90 +++ b/base/modules/psb_repl_map_mod.f90 @@ -798,11 +798,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if +9999 call psb_error_handler(err_act) + return end subroutine repl_clone diff --git a/base/modules/psb_s_base_mat_mod.f90 b/base/modules/psb_s_base_mat_mod.f90 index caccad773..377a168c1 100644 --- a/base/modules/psb_s_base_mat_mod.f90 +++ b/base/modules/psb_s_base_mat_mod.f90 @@ -153,7 +153,7 @@ module psb_s_base_mat_mod procedure, pass(a) :: mv_from_coo => psb_s_mv_coo_from_coo procedure, pass(a) :: mv_to_fmt => psb_s_mv_coo_to_fmt procedure, pass(a) :: mv_from_fmt => psb_s_mv_coo_from_fmt - procedure, pass(a) :: csput_a => psb_s_coo_csput_a + procedure, pass(a) :: csput_a => psb_s_coo_csput_a procedure, pass(a) :: get_diag => psb_s_coo_get_diag procedure, pass(a) :: csgetrow => psb_s_coo_csgetrow procedure, pass(a) :: csgetptn => psb_s_coo_csgetptn diff --git a/base/modules/psb_s_linmap_mod.f90 b/base/modules/psb_s_linmap_mod.f90 index 0730fc119..341f3ac1a 100644 --- a/base/modules/psb_s_linmap_mod.f90 +++ b/base/modules/psb_s_linmap_mod.f90 @@ -247,10 +247,9 @@ contains ierr(1) = 2 info = psb_err_missing_override_method_ call psb_errpush(info,name,i_err=ierr) - call psb_get_erraction(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_erractionsave(err_act) + + call psb_error_handler(err_act) end select diff --git a/base/modules/psb_s_tools_mod.f90 b/base/modules/psb_s_tools_mod.f90 index 99ebdf539..b0612cc88 100644 --- a/base/modules/psb_s_tools_mod.f90 +++ b/base/modules/psb_s_tools_mod.f90 @@ -22,7 +22,7 @@ !!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS !!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR !!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSIESS !!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN !!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) !!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE diff --git a/base/modules/psb_serial_mod.f90 b/base/modules/psb_serial_mod.f90 index 3f6328ca5..2adfcd360 100644 --- a/base/modules/psb_serial_mod.f90 +++ b/base/modules/psb_serial_mod.f90 @@ -325,7 +325,6 @@ contains end do end if return - return end subroutine zrot ! ! diff --git a/base/modules/psb_z_base_mat_mod.f90 b/base/modules/psb_z_base_mat_mod.f90 index 0ef6a0216..b900bb949 100644 --- a/base/modules/psb_z_base_mat_mod.f90 +++ b/base/modules/psb_z_base_mat_mod.f90 @@ -153,7 +153,7 @@ module psb_z_base_mat_mod procedure, pass(a) :: mv_from_coo => psb_z_mv_coo_from_coo procedure, pass(a) :: mv_to_fmt => psb_z_mv_coo_to_fmt procedure, pass(a) :: mv_from_fmt => psb_z_mv_coo_from_fmt - procedure, pass(a) :: csput_a => psb_z_coo_csput_a + procedure, pass(a) :: csput_a => psb_z_coo_csput_a procedure, pass(a) :: get_diag => psb_z_coo_get_diag procedure, pass(a) :: csgetrow => psb_z_coo_csgetrow procedure, pass(a) :: csgetptn => psb_z_coo_csgetptn diff --git a/base/modules/psb_z_linmap_mod.f90 b/base/modules/psb_z_linmap_mod.f90 index 150bc99b4..abe87ad75 100644 --- a/base/modules/psb_z_linmap_mod.f90 +++ b/base/modules/psb_z_linmap_mod.f90 @@ -247,10 +247,9 @@ contains ierr(1) = 2 info = psb_err_missing_override_method_ call psb_errpush(info,name,i_err=ierr) - call psb_get_erraction(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_erractionsave(err_act) + + call psb_error_handler(err_act) end select diff --git a/base/modules/psi_i_mod.f90 b/base/modules/psi_i_mod.f90 index 6c836f249..50713627f 100644 --- a/base/modules/psi_i_mod.f90 +++ b/base/modules/psi_i_mod.f90 @@ -251,6 +251,16 @@ module psi_i_mod integer(psb_ipk_),target :: work(:) integer(psb_ipk_), intent(in) :: idx(:),totxch,totsnd,totrcv end subroutine psi_iswapidx_vect + subroutine psi_iswap_vidx_vect(iictxt,iicomm,flag,beta,y,idx,totxch,totsnd,totrcv,work,info) + import :: psb_desc_type, psb_ipk_, psb_i_base_vect_type + integer(psb_ipk_), intent(in) :: iictxt,iicomm,flag + integer(psb_ipk_), intent(out) :: info + class(psb_i_base_vect_type) :: y + integer(psb_ipk_) :: beta + integer(psb_ipk_), target :: work(:) + class(psb_i_base_vect_type), intent(in) :: idx + integer(psb_ipk_), intent(in) :: totxch,totsnd, totrcv + end subroutine psi_iswap_vidx_vect end interface diff --git a/base/psblas/psb_camax.f90 b/base/psblas/psb_camax.f90 index 19749dc10..6badf97fa 100644 --- a/base/psblas/psb_camax.f90 +++ b/base/psblas/psb_camax.f90 @@ -74,12 +74,12 @@ function psb_camax(x,desc_a, info, jx) result(res) call psb_errpush(info,name) goto 9999 endif - + ix = 1 if (present(jx)) then - ijx = jx + ijx = jx else - ijx = 1 + ijx = 1 endif m = desc_a%get_global_rows() @@ -87,16 +87,16 @@ function psb_camax(x,desc_a, info, jx) result(res) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -105,20 +105,15 @@ function psb_camax(x,desc_a, info, jx) result(res) else res = szero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_camax @@ -197,7 +192,7 @@ function psb_camaxv (x,desc_a, info) result(res) call psb_errpush(info,name) goto 9999 endif - + ix = 1 jx = 1 @@ -206,16 +201,16 @@ function psb_camaxv (x,desc_a, info) result(res) call psb_chkvect(m,ione,ldx,ix,jx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -224,20 +219,15 @@ function psb_camaxv (x,desc_a, info) result(res) else res = szero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_camaxv @@ -312,13 +302,8 @@ function psb_camax_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_camax_vect @@ -407,16 +392,16 @@ subroutine psb_camaxvs(res,x,desc_a, info) ldx=size(x,1) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -425,20 +410,15 @@ subroutine psb_camaxvs(res,x,desc_a, info) else res = szero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_camaxvs @@ -515,12 +495,12 @@ subroutine psb_cmamaxs(res,x,desc_a, info,jx) call psb_errpush(info,name) goto 9999 endif - + ix = 1 if (present(jx)) then - ijx = jx + ijx = jx else - ijx = 1 + ijx = 1 endif m = desc_a%get_global_rows() @@ -528,16 +508,16 @@ subroutine psb_cmamaxs(res,x,desc_a, info,jx) ldx = size(x,1) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if res(1:k) = szero @@ -547,19 +527,14 @@ subroutine psb_cmamaxs(res,x,desc_a, info,jx) res(i) = psb_amax(desc_a%get_local_rows()-iix+1,x(:,jjx+i-1)) end do end if - + ! compute global max call psb_amx(ictxt, res(1:k)) - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cmamaxs diff --git a/base/psblas/psb_casum.f90 b/base/psblas/psb_casum.f90 index df296991c..b81fff872 100644 --- a/base/psblas/psb_casum.f90 +++ b/base/psblas/psb_casum.f90 @@ -119,13 +119,8 @@ function psb_casum (x,desc_a, info, jx) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_casum @@ -197,13 +192,8 @@ function psb_casum_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_casum_vect @@ -322,13 +312,8 @@ function psb_casumv(x,desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_casumv @@ -447,12 +432,7 @@ subroutine psb_casumvs(res,x,desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_casumvs diff --git a/base/psblas/psb_caxpby.f90 b/base/psblas/psb_caxpby.f90 index 7cc80a240..82cb05dfd 100644 --- a/base/psblas/psb_caxpby.f90 +++ b/base/psblas/psb_caxpby.f90 @@ -105,13 +105,8 @@ subroutine psb_caxpby_vect(alpha, x, beta, y,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_caxpby_vect @@ -229,13 +224,8 @@ subroutine psb_caxpby(alpha, x, beta,y,desc_a,info, n, jx, jy) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_caxpby @@ -356,12 +346,7 @@ subroutine psb_caxpbyv(alpha, x, beta,y,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_caxpbyv diff --git a/base/psblas/psb_cdot.f90 b/base/psblas/psb_cdot.f90 index 0a34a0674..bebc1beb8 100644 --- a/base/psblas/psb_cdot.f90 +++ b/base/psblas/psb_cdot.f90 @@ -137,13 +137,8 @@ function psb_cdot_vect(x, y, desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_cdot_vect @@ -238,13 +233,8 @@ function psb_cdot(x, y,desc_a, info, jx, jy) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_cdot @@ -368,13 +358,8 @@ function psb_cdotv(x, y,desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_cdotv @@ -495,13 +480,8 @@ subroutine psb_cdotvs(res, x, y,desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cdotvs @@ -636,12 +616,7 @@ subroutine psb_cmdots(res, x, y, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cmdots diff --git a/base/psblas/psb_cnrm2.f90 b/base/psblas/psb_cnrm2.f90 index d710c0356..918b57984 100644 --- a/base/psblas/psb_cnrm2.f90 +++ b/base/psblas/psb_cnrm2.f90 @@ -119,13 +119,8 @@ function psb_cnrm2(x, desc_a, info, jx) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_cnrm2 @@ -237,20 +232,15 @@ function psb_cnrm2v(x, desc_a, info) result(res) else res = szero end if - + call psb_nrm2(ictxt,res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_cnrm2v @@ -333,13 +323,8 @@ function psb_cnrm2_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_cnrm2_vect @@ -442,7 +427,7 @@ subroutine psb_cnrm2vs(res, x, desc_a, info) if (desc_a%get_local_rows() > 0) then ndim = desc_a%get_local_rows() res = scnrm2( int(ndim,kind=psb_mpik_), x, int(ione,kind=psb_mpik_) ) - + ! adjust because overlapped elements are computed more than once do i=1,size(desc_a%ovrlap_elem,1) idx = desc_a%ovrlap_elem(i,1) @@ -460,12 +445,7 @@ subroutine psb_cnrm2vs(res, x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cnrm2vs diff --git a/base/psblas/psb_cnrmi.f90 b/base/psblas/psb_cnrmi.f90 index 959903ed9..15b2f94a3 100644 --- a/base/psblas/psb_cnrmi.f90 +++ b/base/psblas/psb_cnrmi.f90 @@ -106,12 +106,7 @@ function psb_cnrmi(a,desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_cnrmi diff --git a/base/psblas/psb_cspmm.f90 b/base/psblas/psb_cspmm.f90 index 5636eb082..8d0a3c479 100644 --- a/base/psblas/psb_cspmm.f90 +++ b/base/psblas/psb_cspmm.f90 @@ -348,13 +348,8 @@ subroutine psb_cspmm(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cspmm @@ -612,7 +607,7 @@ subroutine psb_cspmv(alpha,a,x,beta,y,desc_a,info,& call psi_ovrl_save(x,xvsave,desc_a,info) if (info == psb_success_) call psi_ovrl_upd(x,desc_a,psb_avg_,info) yp(nrow+1:ncol) = czero - + ! local Matrix-vector product if (info == psb_success_) call psb_csmm(alpha,a,x,beta,y,info,trans=trans_) @@ -626,13 +621,13 @@ subroutine psb_cspmv(alpha,a,x,beta,y,desc_a,info,& call psb_errpush(info,name,a_err=ch_err) goto 9999 end if - + if (doswap_) then call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & cone,yp,desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& & cone,yp,desc_a,iwork,info,data=psb_comm_ovr_) - + if (debug_level >= psb_debug_comp_) & & write(debug_unit,*) me,' ',trim(name),' swaptran ', info if(info /= psb_success_) then @@ -664,13 +659,8 @@ subroutine psb_cspmv(alpha,a,x,beta,y,desc_a,info,& endif return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cspmv @@ -825,7 +815,7 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,& !!! THIS SHOULD BE FIXED !!! But beta is almost never /= 0 !!$ yp(nrow+1:ncol) = czero - + ! local Matrix-vector product if (info == psb_success_) call psb_csmm(alpha,a,x,beta,y,info,trans=trans_) @@ -839,13 +829,13 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,& call psb_errpush(info,name,a_err=ch_err) goto 9999 end if - + if (doswap_) then call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & cone,y%v,desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& & cone,y%v,desc_a,iwork,info,data=psb_comm_ovr_) - + if (debug_level >= psb_debug_comp_) & & write(debug_unit,*) me,' ',trim(name),' swaptran ', info if(info /= psb_success_) then @@ -877,12 +867,7 @@ subroutine psb_cspmv_vect(alpha,a,x,beta,y,desc_a,info,& endif return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cspmv_vect diff --git a/base/psblas/psb_cspnrm1.f90 b/base/psblas/psb_cspnrm1.f90 index ec95af4d6..bc095c419 100644 --- a/base/psblas/psb_cspnrm1.f90 +++ b/base/psblas/psb_cspnrm1.f90 @@ -102,7 +102,7 @@ function psb_cspnrm1(a,desc_a,info) result(res) !!$ call psb_errpush(info,name,a_err=ch_err) !!$ goto 9999 !!$ end if - + if ((m /= 0).and.(n /= 0)) then v = a%aclsum(info) if (info == psb_success_) & @@ -124,12 +124,7 @@ function psb_cspnrm1(a,desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_cspnrm1 diff --git a/base/psblas/psb_cspsm.f90 b/base/psblas/psb_cspsm.f90 index af102d66b..4a5a5aaa8 100644 --- a/base/psblas/psb_cspsm.f90 +++ b/base/psblas/psb_cspsm.f90 @@ -276,16 +276,11 @@ subroutine psb_cspsm(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cspsm - + !!$ !!$ Parallel Sparse BLAS version 3.1 !!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013 @@ -539,17 +534,12 @@ subroutine psb_cspsv(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cspsv - - + + subroutine psb_cspsv_vect(alpha,a,x,beta,y,desc_a,info,& & trans, scale, choice, diag, work) use psb_base_mod, psb_protect_name => psb_cspsv_vect @@ -705,13 +695,8 @@ subroutine psb_cspsv_vect(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_cspsv_vect - + diff --git a/base/psblas/psb_damax.f90 b/base/psblas/psb_damax.f90 index b7a179cf9..267f83294 100644 --- a/base/psblas/psb_damax.f90 +++ b/base/psblas/psb_damax.f90 @@ -74,12 +74,12 @@ function psb_damax(x,desc_a, info, jx) result(res) call psb_errpush(info,name) goto 9999 endif - + ix = 1 if (present(jx)) then - ijx = jx + ijx = jx else - ijx = 1 + ijx = 1 endif m = desc_a%get_global_rows() @@ -87,16 +87,16 @@ function psb_damax(x,desc_a, info, jx) result(res) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -105,20 +105,15 @@ function psb_damax(x,desc_a, info, jx) result(res) else res = dzero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_damax @@ -197,7 +192,7 @@ function psb_damaxv (x,desc_a, info) result(res) call psb_errpush(info,name) goto 9999 endif - + ix = 1 jx = 1 @@ -206,16 +201,16 @@ function psb_damaxv (x,desc_a, info) result(res) call psb_chkvect(m,ione,ldx,ix,jx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -224,20 +219,15 @@ function psb_damaxv (x,desc_a, info) result(res) else res = dzero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_damaxv @@ -312,13 +302,8 @@ function psb_damax_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_damax_vect @@ -407,16 +392,16 @@ subroutine psb_damaxvs(res,x,desc_a, info) ldx=size(x,1) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -425,20 +410,15 @@ subroutine psb_damaxvs(res,x,desc_a, info) else res = dzero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_damaxvs @@ -515,12 +495,12 @@ subroutine psb_dmamaxs(res,x,desc_a, info,jx) call psb_errpush(info,name) goto 9999 endif - + ix = 1 if (present(jx)) then - ijx = jx + ijx = jx else - ijx = 1 + ijx = 1 endif m = desc_a%get_global_rows() @@ -528,16 +508,16 @@ subroutine psb_dmamaxs(res,x,desc_a, info,jx) ldx = size(x,1) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if res(1:k) = dzero @@ -547,19 +527,14 @@ subroutine psb_dmamaxs(res,x,desc_a, info,jx) res(i) = psb_amax(desc_a%get_local_rows()-iix+1,x(:,jjx+i-1)) end do end if - + ! compute global max call psb_amx(ictxt, res(1:k)) - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dmamaxs diff --git a/base/psblas/psb_dasum.f90 b/base/psblas/psb_dasum.f90 index 2e03aa56e..c4dc00c51 100644 --- a/base/psblas/psb_dasum.f90 +++ b/base/psblas/psb_dasum.f90 @@ -119,13 +119,8 @@ function psb_dasum (x,desc_a, info, jx) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_dasum @@ -197,13 +192,8 @@ function psb_dasum_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_dasum_vect @@ -322,13 +312,8 @@ function psb_dasumv(x,desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_dasumv @@ -447,12 +432,7 @@ subroutine psb_dasumvs(res,x,desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dasumvs diff --git a/base/psblas/psb_daxpby.f90 b/base/psblas/psb_daxpby.f90 index 27631b21e..2826420fd 100644 --- a/base/psblas/psb_daxpby.f90 +++ b/base/psblas/psb_daxpby.f90 @@ -105,13 +105,8 @@ subroutine psb_daxpby_vect(alpha, x, beta, y,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_daxpby_vect @@ -229,13 +224,8 @@ subroutine psb_daxpby(alpha, x, beta,y,desc_a,info, n, jx, jy) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_daxpby @@ -356,12 +346,7 @@ subroutine psb_daxpbyv(alpha, x, beta,y,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_daxpbyv diff --git a/base/psblas/psb_ddot.f90 b/base/psblas/psb_ddot.f90 index 17098115c..c7c3b2b9a 100644 --- a/base/psblas/psb_ddot.f90 +++ b/base/psblas/psb_ddot.f90 @@ -137,13 +137,8 @@ function psb_ddot_vect(x, y, desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_ddot_vect @@ -238,13 +233,8 @@ function psb_ddot(x, y,desc_a, info, jx, jy) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_ddot @@ -368,13 +358,8 @@ function psb_ddotv(x, y,desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_ddotv @@ -495,13 +480,8 @@ subroutine psb_ddotvs(res, x, y,desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_ddotvs @@ -636,12 +616,7 @@ subroutine psb_dmdots(res, x, y, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dmdots diff --git a/base/psblas/psb_dnrm2.f90 b/base/psblas/psb_dnrm2.f90 index 6471170eb..2fbf8da0b 100644 --- a/base/psblas/psb_dnrm2.f90 +++ b/base/psblas/psb_dnrm2.f90 @@ -119,13 +119,8 @@ function psb_dnrm2(x, desc_a, info, jx) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_dnrm2 @@ -237,20 +232,15 @@ function psb_dnrm2v(x, desc_a, info) result(res) else res = dzero end if - + call psb_nrm2(ictxt,res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_dnrm2v @@ -333,13 +323,8 @@ function psb_dnrm2_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_dnrm2_vect @@ -442,7 +427,7 @@ subroutine psb_dnrm2vs(res, x, desc_a, info) if (desc_a%get_local_rows() > 0) then ndim = desc_a%get_local_rows() res = dnrm2( int(ndim,kind=psb_mpik_), x, int(ione,kind=psb_mpik_) ) - + ! adjust because overlapped elements are computed more than once do i=1,size(desc_a%ovrlap_elem,1) idx = desc_a%ovrlap_elem(i,1) @@ -460,12 +445,7 @@ subroutine psb_dnrm2vs(res, x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dnrm2vs diff --git a/base/psblas/psb_dnrmi.f90 b/base/psblas/psb_dnrmi.f90 index 8f4b09db7..4f3a90ecf 100644 --- a/base/psblas/psb_dnrmi.f90 +++ b/base/psblas/psb_dnrmi.f90 @@ -106,12 +106,7 @@ function psb_dnrmi(a,desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_dnrmi diff --git a/base/psblas/psb_dspmm.f90 b/base/psblas/psb_dspmm.f90 index ec34195ed..e8eb35350 100644 --- a/base/psblas/psb_dspmm.f90 +++ b/base/psblas/psb_dspmm.f90 @@ -348,13 +348,8 @@ subroutine psb_dspmm(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dspmm @@ -612,7 +607,7 @@ subroutine psb_dspmv(alpha,a,x,beta,y,desc_a,info,& call psi_ovrl_save(x,xvsave,desc_a,info) if (info == psb_success_) call psi_ovrl_upd(x,desc_a,psb_avg_,info) yp(nrow+1:ncol) = dzero - + ! local Matrix-vector product if (info == psb_success_) call psb_csmm(alpha,a,x,beta,y,info,trans=trans_) @@ -626,13 +621,13 @@ subroutine psb_dspmv(alpha,a,x,beta,y,desc_a,info,& call psb_errpush(info,name,a_err=ch_err) goto 9999 end if - + if (doswap_) then call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & done,yp,desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& & done,yp,desc_a,iwork,info,data=psb_comm_ovr_) - + if (debug_level >= psb_debug_comp_) & & write(debug_unit,*) me,' ',trim(name),' swaptran ', info if(info /= psb_success_) then @@ -664,13 +659,8 @@ subroutine psb_dspmv(alpha,a,x,beta,y,desc_a,info,& endif return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dspmv @@ -825,7 +815,7 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,& !!! THIS SHOULD BE FIXED !!! But beta is almost never /= 0 !!$ yp(nrow+1:ncol) = dzero - + ! local Matrix-vector product if (info == psb_success_) call psb_csmm(alpha,a,x,beta,y,info,trans=trans_) @@ -839,13 +829,13 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,& call psb_errpush(info,name,a_err=ch_err) goto 9999 end if - + if (doswap_) then call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & done,y%v,desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& & done,y%v,desc_a,iwork,info,data=psb_comm_ovr_) - + if (debug_level >= psb_debug_comp_) & & write(debug_unit,*) me,' ',trim(name),' swaptran ', info if(info /= psb_success_) then @@ -877,12 +867,7 @@ subroutine psb_dspmv_vect(alpha,a,x,beta,y,desc_a,info,& endif return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dspmv_vect diff --git a/base/psblas/psb_dspnrm1.f90 b/base/psblas/psb_dspnrm1.f90 index 2ec5547ae..64e35999c 100644 --- a/base/psblas/psb_dspnrm1.f90 +++ b/base/psblas/psb_dspnrm1.f90 @@ -102,7 +102,7 @@ function psb_dspnrm1(a,desc_a,info) result(res) !!$ call psb_errpush(info,name,a_err=ch_err) !!$ goto 9999 !!$ end if - + if ((m /= 0).and.(n /= 0)) then v = a%aclsum(info) if (info == psb_success_) & @@ -124,12 +124,7 @@ function psb_dspnrm1(a,desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_dspnrm1 diff --git a/base/psblas/psb_dspsm.f90 b/base/psblas/psb_dspsm.f90 index 9d2f60436..74def4236 100644 --- a/base/psblas/psb_dspsm.f90 +++ b/base/psblas/psb_dspsm.f90 @@ -276,16 +276,11 @@ subroutine psb_dspsm(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dspsm - + !!$ !!$ Parallel Sparse BLAS version 3.1 !!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013 @@ -539,17 +534,12 @@ subroutine psb_dspsv(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dspsv - - + + subroutine psb_dspsv_vect(alpha,a,x,beta,y,desc_a,info,& & trans, scale, choice, diag, work) use psb_base_mod, psb_protect_name => psb_dspsv_vect @@ -705,13 +695,8 @@ subroutine psb_dspsv_vect(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_dspsv_vect - + diff --git a/base/psblas/psb_samax.f90 b/base/psblas/psb_samax.f90 index e523f9fe7..79a105ef4 100644 --- a/base/psblas/psb_samax.f90 +++ b/base/psblas/psb_samax.f90 @@ -74,12 +74,12 @@ function psb_samax(x,desc_a, info, jx) result(res) call psb_errpush(info,name) goto 9999 endif - + ix = 1 if (present(jx)) then - ijx = jx + ijx = jx else - ijx = 1 + ijx = 1 endif m = desc_a%get_global_rows() @@ -87,16 +87,16 @@ function psb_samax(x,desc_a, info, jx) result(res) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -105,20 +105,15 @@ function psb_samax(x,desc_a, info, jx) result(res) else res = szero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_samax @@ -197,7 +192,7 @@ function psb_samaxv (x,desc_a, info) result(res) call psb_errpush(info,name) goto 9999 endif - + ix = 1 jx = 1 @@ -206,16 +201,16 @@ function psb_samaxv (x,desc_a, info) result(res) call psb_chkvect(m,ione,ldx,ix,jx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -224,20 +219,15 @@ function psb_samaxv (x,desc_a, info) result(res) else res = szero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_samaxv @@ -312,13 +302,8 @@ function psb_samax_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_samax_vect @@ -407,16 +392,16 @@ subroutine psb_samaxvs(res,x,desc_a, info) ldx=size(x,1) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -425,20 +410,15 @@ subroutine psb_samaxvs(res,x,desc_a, info) else res = szero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_samaxvs @@ -515,12 +495,12 @@ subroutine psb_smamaxs(res,x,desc_a, info,jx) call psb_errpush(info,name) goto 9999 endif - + ix = 1 if (present(jx)) then - ijx = jx + ijx = jx else - ijx = 1 + ijx = 1 endif m = desc_a%get_global_rows() @@ -528,16 +508,16 @@ subroutine psb_smamaxs(res,x,desc_a, info,jx) ldx = size(x,1) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if res(1:k) = szero @@ -547,19 +527,14 @@ subroutine psb_smamaxs(res,x,desc_a, info,jx) res(i) = psb_amax(desc_a%get_local_rows()-iix+1,x(:,jjx+i-1)) end do end if - + ! compute global max call psb_amx(ictxt, res(1:k)) - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_smamaxs diff --git a/base/psblas/psb_sasum.f90 b/base/psblas/psb_sasum.f90 index 7182e0d75..3b629ad59 100644 --- a/base/psblas/psb_sasum.f90 +++ b/base/psblas/psb_sasum.f90 @@ -119,13 +119,8 @@ function psb_sasum (x,desc_a, info, jx) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_sasum @@ -197,13 +192,8 @@ function psb_sasum_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_sasum_vect @@ -322,13 +312,8 @@ function psb_sasumv(x,desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_sasumv @@ -447,12 +432,7 @@ subroutine psb_sasumvs(res,x,desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sasumvs diff --git a/base/psblas/psb_saxpby.f90 b/base/psblas/psb_saxpby.f90 index 1af47f436..f491e0fa9 100644 --- a/base/psblas/psb_saxpby.f90 +++ b/base/psblas/psb_saxpby.f90 @@ -105,13 +105,8 @@ subroutine psb_saxpby_vect(alpha, x, beta, y,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_saxpby_vect @@ -229,13 +224,8 @@ subroutine psb_saxpby(alpha, x, beta,y,desc_a,info, n, jx, jy) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_saxpby @@ -356,12 +346,7 @@ subroutine psb_saxpbyv(alpha, x, beta,y,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_saxpbyv diff --git a/base/psblas/psb_sdot.f90 b/base/psblas/psb_sdot.f90 index cec793b64..502087178 100644 --- a/base/psblas/psb_sdot.f90 +++ b/base/psblas/psb_sdot.f90 @@ -137,13 +137,8 @@ function psb_sdot_vect(x, y, desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_sdot_vect @@ -238,13 +233,8 @@ function psb_sdot(x, y,desc_a, info, jx, jy) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_sdot @@ -368,13 +358,8 @@ function psb_sdotv(x, y,desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_sdotv @@ -495,13 +480,8 @@ subroutine psb_sdotvs(res, x, y,desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sdotvs @@ -636,12 +616,7 @@ subroutine psb_smdots(res, x, y, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_smdots diff --git a/base/psblas/psb_snrm2.f90 b/base/psblas/psb_snrm2.f90 index b930d2d4f..620493e98 100644 --- a/base/psblas/psb_snrm2.f90 +++ b/base/psblas/psb_snrm2.f90 @@ -119,13 +119,8 @@ function psb_snrm2(x, desc_a, info, jx) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_snrm2 @@ -237,20 +232,15 @@ function psb_snrm2v(x, desc_a, info) result(res) else res = szero end if - + call psb_nrm2(ictxt,res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_snrm2v @@ -333,13 +323,8 @@ function psb_snrm2_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_snrm2_vect @@ -442,7 +427,7 @@ subroutine psb_snrm2vs(res, x, desc_a, info) if (desc_a%get_local_rows() > 0) then ndim = desc_a%get_local_rows() res = snrm2( int(ndim,kind=psb_mpik_), x, int(ione,kind=psb_mpik_) ) - + ! adjust because overlapped elements are computed more than once do i=1,size(desc_a%ovrlap_elem,1) idx = desc_a%ovrlap_elem(i,1) @@ -460,12 +445,7 @@ subroutine psb_snrm2vs(res, x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_snrm2vs diff --git a/base/psblas/psb_snrmi.f90 b/base/psblas/psb_snrmi.f90 index af830f1ce..8dfed849f 100644 --- a/base/psblas/psb_snrmi.f90 +++ b/base/psblas/psb_snrmi.f90 @@ -106,12 +106,7 @@ function psb_snrmi(a,desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_snrmi diff --git a/base/psblas/psb_sspmm.f90 b/base/psblas/psb_sspmm.f90 index 9e6523a5d..e3a01b7a0 100644 --- a/base/psblas/psb_sspmm.f90 +++ b/base/psblas/psb_sspmm.f90 @@ -348,13 +348,8 @@ subroutine psb_sspmm(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sspmm @@ -612,7 +607,7 @@ subroutine psb_sspmv(alpha,a,x,beta,y,desc_a,info,& call psi_ovrl_save(x,xvsave,desc_a,info) if (info == psb_success_) call psi_ovrl_upd(x,desc_a,psb_avg_,info) yp(nrow+1:ncol) = szero - + ! local Matrix-vector product if (info == psb_success_) call psb_csmm(alpha,a,x,beta,y,info,trans=trans_) @@ -626,13 +621,13 @@ subroutine psb_sspmv(alpha,a,x,beta,y,desc_a,info,& call psb_errpush(info,name,a_err=ch_err) goto 9999 end if - + if (doswap_) then call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & sone,yp,desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& & sone,yp,desc_a,iwork,info,data=psb_comm_ovr_) - + if (debug_level >= psb_debug_comp_) & & write(debug_unit,*) me,' ',trim(name),' swaptran ', info if(info /= psb_success_) then @@ -664,13 +659,8 @@ subroutine psb_sspmv(alpha,a,x,beta,y,desc_a,info,& endif return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sspmv @@ -825,7 +815,7 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,& !!! THIS SHOULD BE FIXED !!! But beta is almost never /= 0 !!$ yp(nrow+1:ncol) = szero - + ! local Matrix-vector product if (info == psb_success_) call psb_csmm(alpha,a,x,beta,y,info,trans=trans_) @@ -839,13 +829,13 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,& call psb_errpush(info,name,a_err=ch_err) goto 9999 end if - + if (doswap_) then call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & sone,y%v,desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& & sone,y%v,desc_a,iwork,info,data=psb_comm_ovr_) - + if (debug_level >= psb_debug_comp_) & & write(debug_unit,*) me,' ',trim(name),' swaptran ', info if(info /= psb_success_) then @@ -877,12 +867,7 @@ subroutine psb_sspmv_vect(alpha,a,x,beta,y,desc_a,info,& endif return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sspmv_vect diff --git a/base/psblas/psb_sspnrm1.f90 b/base/psblas/psb_sspnrm1.f90 index 082f19932..a9acde807 100644 --- a/base/psblas/psb_sspnrm1.f90 +++ b/base/psblas/psb_sspnrm1.f90 @@ -102,7 +102,7 @@ function psb_sspnrm1(a,desc_a,info) result(res) !!$ call psb_errpush(info,name,a_err=ch_err) !!$ goto 9999 !!$ end if - + if ((m /= 0).and.(n /= 0)) then v = a%aclsum(info) if (info == psb_success_) & @@ -124,12 +124,7 @@ function psb_sspnrm1(a,desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_sspnrm1 diff --git a/base/psblas/psb_sspsm.f90 b/base/psblas/psb_sspsm.f90 index be7cc6e4c..a60509e2c 100644 --- a/base/psblas/psb_sspsm.f90 +++ b/base/psblas/psb_sspsm.f90 @@ -276,16 +276,11 @@ subroutine psb_sspsm(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sspsm - + !!$ !!$ Parallel Sparse BLAS version 3.1 !!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013 @@ -539,17 +534,12 @@ subroutine psb_sspsv(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sspsv - - + + subroutine psb_sspsv_vect(alpha,a,x,beta,y,desc_a,info,& & trans, scale, choice, diag, work) use psb_base_mod, psb_protect_name => psb_sspsv_vect @@ -705,13 +695,8 @@ subroutine psb_sspsv_vect(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_sspsv_vect - + diff --git a/base/psblas/psb_zamax.f90 b/base/psblas/psb_zamax.f90 index dda0456cc..b9034e1c4 100644 --- a/base/psblas/psb_zamax.f90 +++ b/base/psblas/psb_zamax.f90 @@ -74,12 +74,12 @@ function psb_zamax(x,desc_a, info, jx) result(res) call psb_errpush(info,name) goto 9999 endif - + ix = 1 if (present(jx)) then - ijx = jx + ijx = jx else - ijx = 1 + ijx = 1 endif m = desc_a%get_global_rows() @@ -87,16 +87,16 @@ function psb_zamax(x,desc_a, info, jx) result(res) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -105,20 +105,15 @@ function psb_zamax(x,desc_a, info, jx) result(res) else res = dzero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zamax @@ -197,7 +192,7 @@ function psb_zamaxv (x,desc_a, info) result(res) call psb_errpush(info,name) goto 9999 endif - + ix = 1 jx = 1 @@ -206,16 +201,16 @@ function psb_zamaxv (x,desc_a, info) result(res) call psb_chkvect(m,ione,ldx,ix,jx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -224,20 +219,15 @@ function psb_zamaxv (x,desc_a, info) result(res) else res = dzero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zamaxv @@ -312,13 +302,8 @@ function psb_zamax_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zamax_vect @@ -407,16 +392,16 @@ subroutine psb_zamaxvs(res,x,desc_a, info) ldx=size(x,1) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if ! compute local max @@ -425,20 +410,15 @@ subroutine psb_zamaxvs(res,x,desc_a, info) else res = dzero end if - + ! compute global max call psb_amx(ictxt, res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zamaxvs @@ -515,12 +495,12 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx) call psb_errpush(info,name) goto 9999 endif - + ix = 1 if (present(jx)) then - ijx = jx + ijx = jx else - ijx = 1 + ijx = 1 endif m = desc_a%get_global_rows() @@ -528,16 +508,16 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx) ldx = size(x,1) call psb_chkvect(m,ione,ldx,ix,ijx,desc_a,info,iix,jjx) if(info /= psb_success_) then - info=psb_err_from_subroutine_ - ch_err='psb_chkvect' - call psb_errpush(info,name,a_err=ch_err) - goto 9999 + info=psb_err_from_subroutine_ + ch_err='psb_chkvect' + call psb_errpush(info,name,a_err=ch_err) + goto 9999 end if if (iix /= 1) then - info=psb_err_ix_n1_iy_n1_unsupported_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_ix_n1_iy_n1_unsupported_ + call psb_errpush(info,name) + goto 9999 end if res(1:k) = dzero @@ -547,19 +527,14 @@ subroutine psb_zmamaxs(res,x,desc_a, info,jx) res(i) = psb_amax(desc_a%get_local_rows()-iix+1,x(:,jjx+i-1)) end do end if - + ! compute global max call psb_amx(ictxt, res(1:k)) - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zmamaxs diff --git a/base/psblas/psb_zasum.f90 b/base/psblas/psb_zasum.f90 index 066636d18..9b44df545 100644 --- a/base/psblas/psb_zasum.f90 +++ b/base/psblas/psb_zasum.f90 @@ -119,13 +119,8 @@ function psb_zasum (x,desc_a, info, jx) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zasum @@ -197,13 +192,8 @@ function psb_zasum_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zasum_vect @@ -322,13 +312,8 @@ function psb_zasumv(x,desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zasumv @@ -447,12 +432,7 @@ subroutine psb_zasumvs(res,x,desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zasumvs diff --git a/base/psblas/psb_zaxpby.f90 b/base/psblas/psb_zaxpby.f90 index 45dece418..f725a273f 100644 --- a/base/psblas/psb_zaxpby.f90 +++ b/base/psblas/psb_zaxpby.f90 @@ -105,13 +105,8 @@ subroutine psb_zaxpby_vect(alpha, x, beta, y,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zaxpby_vect @@ -229,13 +224,8 @@ subroutine psb_zaxpby(alpha, x, beta,y,desc_a,info, n, jx, jy) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zaxpby @@ -356,12 +346,7 @@ subroutine psb_zaxpbyv(alpha, x, beta,y,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zaxpbyv diff --git a/base/psblas/psb_zdot.f90 b/base/psblas/psb_zdot.f90 index 81ba44b52..87907712d 100644 --- a/base/psblas/psb_zdot.f90 +++ b/base/psblas/psb_zdot.f90 @@ -137,13 +137,8 @@ function psb_zdot_vect(x, y, desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zdot_vect @@ -238,13 +233,8 @@ function psb_zdot(x, y,desc_a, info, jx, jy) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zdot @@ -368,13 +358,8 @@ function psb_zdotv(x, y,desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zdotv @@ -495,13 +480,8 @@ subroutine psb_zdotvs(res, x, y,desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zdotvs @@ -636,12 +616,7 @@ subroutine psb_zmdots(res, x, y, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zmdots diff --git a/base/psblas/psb_znrm2.f90 b/base/psblas/psb_znrm2.f90 index 02e55d4bb..9b059a951 100644 --- a/base/psblas/psb_znrm2.f90 +++ b/base/psblas/psb_znrm2.f90 @@ -119,13 +119,8 @@ function psb_znrm2(x, desc_a, info, jx) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_znrm2 @@ -237,20 +232,15 @@ function psb_znrm2v(x, desc_a, info) result(res) else res = dzero end if - + call psb_nrm2(ictxt,res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_znrm2v @@ -333,13 +323,8 @@ function psb_znrm2_vect(x, desc_a, info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_znrm2_vect @@ -442,7 +427,7 @@ subroutine psb_znrm2vs(res, x, desc_a, info) if (desc_a%get_local_rows() > 0) then ndim = desc_a%get_local_rows() res = dznrm2( int(ndim,kind=psb_mpik_), x, int(ione,kind=psb_mpik_) ) - + ! adjust because overlapped elements are computed more than once do i=1,size(desc_a%ovrlap_elem,1) idx = desc_a%ovrlap_elem(i,1) @@ -460,12 +445,7 @@ subroutine psb_znrm2vs(res, x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_znrm2vs diff --git a/base/psblas/psb_znrmi.f90 b/base/psblas/psb_znrmi.f90 index 7e2989847..1cea3b279 100644 --- a/base/psblas/psb_znrmi.f90 +++ b/base/psblas/psb_znrmi.f90 @@ -106,12 +106,7 @@ function psb_znrmi(a,desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_znrmi diff --git a/base/psblas/psb_zspmm.f90 b/base/psblas/psb_zspmm.f90 index 614c03392..4e8f700b6 100644 --- a/base/psblas/psb_zspmm.f90 +++ b/base/psblas/psb_zspmm.f90 @@ -348,13 +348,8 @@ subroutine psb_zspmm(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zspmm @@ -612,7 +607,7 @@ subroutine psb_zspmv(alpha,a,x,beta,y,desc_a,info,& call psi_ovrl_save(x,xvsave,desc_a,info) if (info == psb_success_) call psi_ovrl_upd(x,desc_a,psb_avg_,info) yp(nrow+1:ncol) = zzero - + ! local Matrix-vector product if (info == psb_success_) call psb_csmm(alpha,a,x,beta,y,info,trans=trans_) @@ -626,13 +621,13 @@ subroutine psb_zspmv(alpha,a,x,beta,y,desc_a,info,& call psb_errpush(info,name,a_err=ch_err) goto 9999 end if - + if (doswap_) then call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & zone,yp,desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& & zone,yp,desc_a,iwork,info,data=psb_comm_ovr_) - + if (debug_level >= psb_debug_comp_) & & write(debug_unit,*) me,' ',trim(name),' swaptran ', info if(info /= psb_success_) then @@ -664,13 +659,8 @@ subroutine psb_zspmv(alpha,a,x,beta,y,desc_a,info,& endif return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zspmv @@ -825,7 +815,7 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,& !!! THIS SHOULD BE FIXED !!! But beta is almost never /= 0 !!$ yp(nrow+1:ncol) = zzero - + ! local Matrix-vector product if (info == psb_success_) call psb_csmm(alpha,a,x,beta,y,info,trans=trans_) @@ -839,13 +829,13 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,& call psb_errpush(info,name,a_err=ch_err) goto 9999 end if - + if (doswap_) then call psi_swaptran(ior(psb_swap_send_,psb_swap_recv_),& & zone,y%v,desc_a,iwork,info) if (info == psb_success_) call psi_swapdata(ior(psb_swap_send_,psb_swap_recv_),& & zone,y%v,desc_a,iwork,info,data=psb_comm_ovr_) - + if (debug_level >= psb_debug_comp_) & & write(debug_unit,*) me,' ',trim(name),' swaptran ', info if(info /= psb_success_) then @@ -877,12 +867,7 @@ subroutine psb_zspmv_vect(alpha,a,x,beta,y,desc_a,info,& endif return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zspmv_vect diff --git a/base/psblas/psb_zspnrm1.f90 b/base/psblas/psb_zspnrm1.f90 index ee448632a..cccf257ea 100644 --- a/base/psblas/psb_zspnrm1.f90 +++ b/base/psblas/psb_zspnrm1.f90 @@ -102,7 +102,7 @@ function psb_zspnrm1(a,desc_a,info) result(res) !!$ call psb_errpush(info,name,a_err=ch_err) !!$ goto 9999 !!$ end if - + if ((m /= 0).and.(n /= 0)) then v = a%aclsum(info) if (info == psb_success_) & @@ -124,12 +124,7 @@ function psb_zspnrm1(a,desc_a,info) result(res) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end function psb_zspnrm1 diff --git a/base/psblas/psb_zspsm.f90 b/base/psblas/psb_zspsm.f90 index 363343afb..6509058a8 100644 --- a/base/psblas/psb_zspsm.f90 +++ b/base/psblas/psb_zspsm.f90 @@ -276,16 +276,11 @@ subroutine psb_zspsm(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zspsm - + !!$ !!$ Parallel Sparse BLAS version 3.1 !!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013 @@ -539,17 +534,12 @@ subroutine psb_zspsv(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zspsv - - + + subroutine psb_zspsv_vect(alpha,a,x,beta,y,desc_a,info,& & trans, scale, choice, diag, work) use psb_base_mod, psb_protect_name => psb_zspsv_vect @@ -705,13 +695,8 @@ subroutine psb_zspsv_vect(alpha,a,x,beta,y,desc_a,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if return end subroutine psb_zspsv_vect - + diff --git a/base/serial/aux/Makefile b/base/serial/aux/Makefile index 4379b732c..80f8e4077 100644 --- a/base/serial/aux/Makefile +++ b/base/serial/aux/Makefile @@ -4,9 +4,11 @@ include ../../../Make.inc # FOBJS = isr.o isrx.o iasr.o iasrx.o msort_up.o msort_dw.o\ - imsr.o imsrx.o imsru.o idot.o inrm2.o\ - dsr.o dsrx.o dasr.o dasrx.o dmsr.o dmsrx.o dmsort_up.o dmsort_dw.o \ - ssr.o ssrx.o sasr.o sasrx.o smsr.o smsrx.o smsort_up.o smsort_dw.o \ + imsr.o imsrx.o imsru.o iamsort_up.o iamsort_dw.o idot.o inrm2.o\ + dsr.o dsrx.o dasr.o dasrx.o dmsr.o dmsrx.o \ + dmsort_up.o dmsort_dw.o damsort_up.o damsort_dw.o \ + ssr.o ssrx.o sasr.o sasrx.o smsr.o smsrx.o \ + smsort_up.o smsort_dw.o samsort_up.o samsort_dw.o \ clcmp_mod.o clsr.o clsrx.o \ calcmp_mod.o calsr.o calsrx.o \ cacmp_mod.o casr.o casrx.o camsr.o camsrx.o camsort_up.o camsort_dw.o\ @@ -35,9 +37,12 @@ lib: $(OBJS) $(AR) $(LIBDIR)/$(LIBNAME) $(OBJS) $(RANLIB) $(LIBDIR)/$(LIBNAME) +clsr.o clsrx.o: clcmp_mod.o +calsr.o calsrx.o: calcmp_mod.o +camsort_up.o camsort_dw.o casr.o casrx.o: cacmp_mod.o zlsr.o zlsrx.o: zlcmp_mod.o zalsr.o zalsrx.o: zalcmp_mod.o -zasr.o zasrx.o: zacmp_mod.o +zamsort_up.o zamsort_dw.o zasr.o zasrx.o: zacmp_mod.o clean: /bin/rm -f $(OBJS) *$(.mod) diff --git a/base/serial/aux/damsort_dw.f90 b/base/serial/aux/damsort_dw.f90 new file mode 100644 index 000000000..767750b13 --- /dev/null +++ b/base/serial/aux/damsort_dw.f90 @@ -0,0 +1,173 @@ +! +! Parallel Sparse BLAS version 3.1 +! (C) Copyright 2006, 2007, 2008, 2009, 2010 +! Salvatore Filippone University of Rome Tor Vergata +! Alfredo Buttari CNRS-IRIT, Toulouse +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions, and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. The name of the PSBLAS group or the names of its contributors may +! not be used to endorse or promote products derived from this +! software without specific written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS +! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +! File: msort_dw.f90 +! +! Subroutine: msort_dw +! This subroutine sorts an integer array into ascending order. +! +! Arguments: +! n - integer Input: size of the array +! k - real(*) input: array of keys to be sorted +! l - integer(0:n+1) output: link list +! iret - integer output: 0 Normal termination +! 1 the array was already sorted +! * +! REFERENCES = (1) D. E. Knuth * +! The Art of Computer Programming, * +! vol.3: Sorting and Searching * +! Addison-Wesley, 1973 * +! * +! call msort_dw(n,x,iaux,iret) +! +! if (iret == 0) then +! lp = iaux(0) +! k = 1 +! do +! if ((lp == 0).or.(k>n)) exit +! do +! if (lp >= k) exit +! lp = iaux(lp) +! end do +! iswap = x(lp) +! x(lp) = x(k) +! x(k) = iswap +! lswap = iaux(lp) +! iaux(lp) = iaux(k) +! iaux(k) = lp +! lp = lswap +! k = k + 1 +! enddo +! end if +! +! +subroutine damsort_dw(n,k,l,iret) + use psb_const_mod + implicit none + integer(psb_ipk_) :: n, iret + real(psb_dpk_) :: k(n) + integer(psb_ipk_) :: l(0:n+1) + ! + integer(psb_ipk_) :: p,q,s,t + ! .. + iret = 0 + ! first step: we are preparing ordered sublists, exploiting + ! what order was already in the input data; negative links + ! mark the end of the sublists + l(0) = 1 + t = n + 1 + do p = 1,n - 1 + if (abs(k(p)) >= abs(k(p+1))) then + l(p) = p + 1 + else + l(t) = - (p+1) + t = p + end if + end do + l(t) = 0 + l(n) = 0 + ! see if the input was already sorted + if (l(n+1) == 0) then + iret = 1 + return + else + l(n+1) = abs(l(n+1)) + end if + + mergepass: do + ! otherwise, begin a pass through the list. + ! throughout all the subroutine we have: + ! p, q: pointing to the sublists being merged + ! s: pointing to the most recently processed record + ! t: pointing to the end of previously completed sublist + s = 0 + t = n + 1 + p = l(s) + q = l(t) + if (q == 0) exit mergepass + + outer: do + + if (abs(k(p)) < abs(k(q))) then + + l(s) = sign(q,l(s)) + s = q + q = l(q) + if (q > 0) then + do + if (abs(k(p)) >= abs(k(q))) cycle outer + s = q + q = l(q) + if (q <= 0) exit + end do + end if + l(s) = p + s = t + do + t = p + p = l(p) + if (p <= 0) exit + end do + + else + + l(s) = sign(p,l(s)) + s = p + p = l(p) + if (p>0) then + do + if (abs(k(p)) < abs(k(q))) cycle outer + s = p + p = l(p) + if (p <= 0) exit + end do + end if + ! otherwise, one sublist ended, and we append to it the rest + ! of the other one. + l(s) = q + s = t + do + t = q + q = l(q) + if (q <= 0) exit + end do + end if + + p = -p + q = -q + if (q == 0) then + l(s) = sign(p,l(s)) + l(t) = 0 + exit outer + end if + end do outer + end do mergepass + +end subroutine damsort_dw diff --git a/base/serial/aux/damsort_up.f90 b/base/serial/aux/damsort_up.f90 new file mode 100644 index 000000000..60a4cd06d --- /dev/null +++ b/base/serial/aux/damsort_up.f90 @@ -0,0 +1,173 @@ +! +! Parallel Sparse BLAS version 3.1 +! (C) Copyright 2006, 2007, 2008, 2009, 2010 +! Salvatore Filippone University of Rome Tor Vergata +! Alfredo Buttari CNRS-IRIT, Toulouse +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions, and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. The name of the PSBLAS group or the names of its contributors may +! not be used to endorse or promote products derived from this +! software without specific written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS +! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +! File: msort_up.f90 +! +! Subroutine: msort_up +! This subroutine sorts an integer array into ascending order. +! +! Arguments: +! n - integer Input: size of the array +! k - integer(*) input: array of keys to be sorted +! l - integer(0:n+1) output: link list +! iret - integer output: 0 Normal termination +! 1 the array was already sorted +! * +! REFERENCES = (1) D. E. Knuth * +! The Art of Computer Programming, * +! vol.3: Sorting and Searching * +! Addison-Wesley, 1973 * +! * +! call msort_up(n,x,iaux,iret) +! +! if (iret == 0) then +! lp = iaux(0) +! k = 1 +! do +! if ((lp == 0).or.(k>n)) exit +! do +! if (lp >= k) exit +! lp = iaux(lp) +! end do +! iswap = x(lp) +! x(lp) = x(k) +! x(k) = iswap +! lswap = iaux(lp) +! iaux(lp) = iaux(k) +! iaux(k) = lp +! lp = lswap +! k = k + 1 +! enddo +! end if +! +! +subroutine damsort_up(n,k,l,iret) + use psb_const_mod + implicit none + integer(psb_ipk_) :: n, iret + real(psb_dpk_) k(n) + integer(psb_ipk_) :: l(0:n+1) + ! + integer(psb_ipk_) :: p,q,s,t + ! .. + iret = 0 + ! first step: we are preparing ordered sublists, exploiting + ! what order was already in the input data; negative links + ! mark the end of the sublists + l(0) = 1 + t = n + 1 + do p = 1,n - 1 + if (abs(k(p)) <= abs(k(p+1))) then + l(p) = p + 1 + else + l(t) = - (p+1) + t = p + end if + end do + l(t) = 0 + l(n) = 0 + ! see if the input was already sorted + if (l(n+1) == 0) then + iret = 1 + return + else + l(n+1) = abs(l(n+1)) + end if + + mergepass: do + ! otherwise, begin a pass through the list. + ! throughout all the subroutine we have: + ! p, q: pointing to the sublists being merged + ! s: pointing to the most recently processed record + ! t: pointing to the end of previously completed sublist + s = 0 + t = n + 1 + p = l(s) + q = l(t) + if (q == 0) exit mergepass + + outer: do + + if (abs(k(p)) > abs(k(q))) then + + l(s) = sign(q,l(s)) + s = q + q = l(q) + if (q > 0) then + do + if (abs(k(p)) <= abs(k(q))) cycle outer + s = q + q = l(q) + if (q <= 0) exit + end do + end if + l(s) = p + s = t + do + t = p + p = l(p) + if (p <= 0) exit + end do + + else + + l(s) = sign(p,l(s)) + s = p + p = l(p) + if (p>0) then + do + if (abs(k(p)) > abs(k(q))) cycle outer + s = p + p = l(p) + if (p <= 0) exit + end do + end if + ! otherwise, one sublist ended, and we append to it the rest + ! of the other one. + l(s) = q + s = t + do + t = q + q = l(q) + if (q <= 0) exit + end do + end if + + p = -p + q = -q + if (q == 0) then + l(s) = sign(p,l(s)) + l(t) = 0 + exit outer + end if + end do outer + end do mergepass + +end subroutine damsort_up diff --git a/base/serial/aux/dmsr.f90 b/base/serial/aux/dmsr.f90 index 6c093f3c9..837f4b653 100644 --- a/base/serial/aux/dmsr.f90 +++ b/base/serial/aux/dmsr.f90 @@ -59,11 +59,16 @@ subroutine dmsr(n,x,idir) call psb_error() endif - if (idir == psb_sort_up_) then + select case(idir) + case (psb_sort_up_) call dmsort_up(n,x,iaux,iret) - else + case (psb_asort_up_) + call damsort_up(n,x,iaux,iret) + case (psb_asort_down_) + call damsort_dw(n,x,iaux,iret) + case (psb_sort_down_) call dmsort_dw(n,x,iaux,iret) - end if + end select if (iret == 0) call psb_ip_reord(n,x,iaux) diff --git a/base/serial/aux/dmsrx.f90 b/base/serial/aux/dmsrx.f90 index f527dc92d..b0f241a35 100644 --- a/base/serial/aux/dmsrx.f90 +++ b/base/serial/aux/dmsrx.f90 @@ -66,12 +66,17 @@ subroutine dmsrx(n,x,indx,idir,flag) call psb_error() endif - if (idir == psb_sort_up_) then + select case(idir) + case (psb_sort_up_) call dmsort_up(n,x,iaux,iret) - else + case (psb_asort_up_) + call damsort_up(n,x,iaux,iret) + case (psb_asort_down_) + call damsort_dw(n,x,iaux,iret) + case (psb_sort_down_) call dmsort_dw(n,x,iaux,iret) - end if - + end select + if (iret == 0) call psb_ip_reord(n,x,indx,iaux) deallocate(iaux,stat=info) diff --git a/base/serial/aux/iamsort_dw.f90 b/base/serial/aux/iamsort_dw.f90 new file mode 100644 index 000000000..cdbb6967f --- /dev/null +++ b/base/serial/aux/iamsort_dw.f90 @@ -0,0 +1,173 @@ +! +! Parallel Sparse BLAS version 3.1 +! (C) Copyright 2006, 2007, 2008, 2009, 2010 +! Salvatore Filippone University of Rome Tor Vergata +! Alfredo Buttari CNRS-IRIT, Toulouse +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions, and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. The name of the PSBLAS group or the names of its contributors may +! not be used to endorse or promote products derived from this +! software without specific written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS +! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +! File: msort_dw.f90 +! +! Subroutine: msort_dw +! This subroutine sorts an integer array into ascending order. +! +! Arguments: +! n - integer Input: size of the array +! k - real(*) input: array of keys to be sorted +! l - integer(0:n+1) output: link list +! iret - integer output: 0 Normal termination +! 1 the array was already sorted +! * +! REFERENCES = (1) D. E. Knuth * +! The Art of Computer Programming, * +! vol.3: Sorting and Searching * +! Addison-Wesley, 1973 * +! * +! call msort_dw(n,x,iaux,iret) +! +! if (iret == 0) then +! lp = iaux(0) +! k = 1 +! do +! if ((lp == 0).or.(k>n)) exit +! do +! if (lp >= k) exit +! lp = iaux(lp) +! end do +! iswap = x(lp) +! x(lp) = x(k) +! x(k) = iswap +! lswap = iaux(lp) +! iaux(lp) = iaux(k) +! iaux(k) = lp +! lp = lswap +! k = k + 1 +! enddo +! end if +! +! +subroutine iamsort_dw(n,k,l,iret) + use psb_const_mod + implicit none + integer(psb_ipk_) :: n, iret + integer(psb_ipk_) :: k(n) + integer(psb_ipk_) :: l(0:n+1) + ! + integer(psb_ipk_) :: p,q,s,t + ! .. + iret = 0 + ! first step: we are preparing ordered sublists, exploiting + ! what order was already in the input data; negative links + ! mark the end of the sublists + l(0) = 1 + t = n + 1 + do p = 1,n - 1 + if (abs(k(p)) >= abs(k(p+1))) then + l(p) = p + 1 + else + l(t) = - (p+1) + t = p + end if + end do + l(t) = 0 + l(n) = 0 + ! see if the input was already sorted + if (l(n+1) == 0) then + iret = 1 + return + else + l(n+1) = abs(l(n+1)) + end if + + mergepass: do + ! otherwise, begin a pass through the list. + ! throughout all the subroutine we have: + ! p, q: pointing to the sublists being merged + ! s: pointing to the most recently processed record + ! t: pointing to the end of previously completed sublist + s = 0 + t = n + 1 + p = l(s) + q = l(t) + if (q == 0) exit mergepass + + outer: do + + if (abs(k(p)) < abs(k(q))) then + + l(s) = sign(q,l(s)) + s = q + q = l(q) + if (q > 0) then + do + if (abs(k(p)) >= abs(k(q))) cycle outer + s = q + q = l(q) + if (q <= 0) exit + end do + end if + l(s) = p + s = t + do + t = p + p = l(p) + if (p <= 0) exit + end do + + else + + l(s) = sign(p,l(s)) + s = p + p = l(p) + if (p>0) then + do + if (abs(k(p)) < abs(k(q))) cycle outer + s = p + p = l(p) + if (p <= 0) exit + end do + end if + ! otherwise, one sublist ended, and we append to it the rest + ! of the other one. + l(s) = q + s = t + do + t = q + q = l(q) + if (q <= 0) exit + end do + end if + + p = -p + q = -q + if (q == 0) then + l(s) = sign(p,l(s)) + l(t) = 0 + exit outer + end if + end do outer + end do mergepass + +end subroutine iamsort_dw diff --git a/base/serial/aux/iamsort_up.f90 b/base/serial/aux/iamsort_up.f90 new file mode 100644 index 000000000..515d6331f --- /dev/null +++ b/base/serial/aux/iamsort_up.f90 @@ -0,0 +1,173 @@ +! +! Parallel Sparse BLAS version 3.1 +! (C) Copyright 2006, 2007, 2008, 2009, 2010 +! Salvatore Filippone University of Rome Tor Vergata +! Alfredo Buttari CNRS-IRIT, Toulouse +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions, and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. The name of the PSBLAS group or the names of its contributors may +! not be used to endorse or promote products derived from this +! software without specific written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS +! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +! File: msort_up.f90 +! +! Subroutine: msort_up +! This subroutine sorts an integer array into ascending order. +! +! Arguments: +! n - integer Input: size of the array +! k - integer(*) input: array of keys to be sorted +! l - integer(0:n+1) output: link list +! iret - integer output: 0 Normal termination +! 1 the array was already sorted +! * +! REFERENCES = (1) D. E. Knuth * +! The Art of Computer Programming, * +! vol.3: Sorting and Searching * +! Addison-Wesley, 1973 * +! * +! call msort_up(n,x,iaux,iret) +! +! if (iret == 0) then +! lp = iaux(0) +! k = 1 +! do +! if ((lp == 0).or.(k>n)) exit +! do +! if (lp >= k) exit +! lp = iaux(lp) +! end do +! iswap = x(lp) +! x(lp) = x(k) +! x(k) = iswap +! lswap = iaux(lp) +! iaux(lp) = iaux(k) +! iaux(k) = lp +! lp = lswap +! k = k + 1 +! enddo +! end if +! +! +subroutine iamsort_up(n,k,l,iret) + use psb_const_mod + implicit none + integer(psb_ipk_) :: n, iret + integer(psb_ipk_) k(n) + integer(psb_ipk_) :: l(0:n+1) + ! + integer(psb_ipk_) :: p,q,s,t + ! .. + iret = 0 + ! first step: we are preparing ordered sublists, exploiting + ! what order was already in the input data; negative links + ! mark the end of the sublists + l(0) = 1 + t = n + 1 + do p = 1,n - 1 + if (abs(k(p)) <= abs(k(p+1))) then + l(p) = p + 1 + else + l(t) = - (p+1) + t = p + end if + end do + l(t) = 0 + l(n) = 0 + ! see if the input was already sorted + if (l(n+1) == 0) then + iret = 1 + return + else + l(n+1) = abs(l(n+1)) + end if + + mergepass: do + ! otherwise, begin a pass through the list. + ! throughout all the subroutine we have: + ! p, q: pointing to the sublists being merged + ! s: pointing to the most recently processed record + ! t: pointing to the end of previously completed sublist + s = 0 + t = n + 1 + p = l(s) + q = l(t) + if (q == 0) exit mergepass + + outer: do + + if (abs(k(p)) > abs(k(q))) then + + l(s) = sign(q,l(s)) + s = q + q = l(q) + if (q > 0) then + do + if (abs(k(p)) <= abs(k(q))) cycle outer + s = q + q = l(q) + if (q <= 0) exit + end do + end if + l(s) = p + s = t + do + t = p + p = l(p) + if (p <= 0) exit + end do + + else + + l(s) = sign(p,l(s)) + s = p + p = l(p) + if (p>0) then + do + if (abs(k(p)) > abs(k(q))) cycle outer + s = p + p = l(p) + if (p <= 0) exit + end do + end if + ! otherwise, one sublist ended, and we append to it the rest + ! of the other one. + l(s) = q + s = t + do + t = q + q = l(q) + if (q <= 0) exit + end do + end if + + p = -p + q = -q + if (q == 0) then + l(s) = sign(p,l(s)) + l(t) = 0 + exit outer + end if + end do outer + end do mergepass + +end subroutine iamsort_up diff --git a/base/serial/aux/imsr.f90 b/base/serial/aux/imsr.f90 index 2304d24b3..3ad0c354d 100644 --- a/base/serial/aux/imsr.f90 +++ b/base/serial/aux/imsr.f90 @@ -58,11 +58,16 @@ subroutine imsr(n,x,idir) call psb_error() endif - if (idir == psb_sort_up_) then + select case(idir) + case (psb_sort_up_) call msort_up(n,x,iaux,iret) - else + case (psb_asort_up_) + call iamsort_up(n,x,iaux,iret) + case (psb_asort_down_) + call iamsort_dw(n,x,iaux,iret) + case (psb_sort_down_) call msort_dw(n,x,iaux,iret) - end if + end select if (iret == 0) call psb_ip_reord(n,x,iaux) diff --git a/base/serial/aux/imsrx.f90 b/base/serial/aux/imsrx.f90 index ff080ae13..675d3e639 100644 --- a/base/serial/aux/imsrx.f90 +++ b/base/serial/aux/imsrx.f90 @@ -65,12 +65,18 @@ subroutine imsrx(n,x,indx,idir,flag) call psb_error() endif - if (idir == psb_sort_up_) then + + select case(idir) + case (psb_sort_up_) call msort_up(n,x,iaux,iret) - else + case (psb_asort_up_) + call iamsort_up(n,x,iaux,iret) + case (psb_asort_down_) + call iamsort_dw(n,x,iaux,iret) + case (psb_sort_down_) call msort_dw(n,x,iaux,iret) - end if - + end select + if (iret == 0) call psb_ip_reord(n,x,indx,iaux) deallocate(iaux,stat=info) diff --git a/base/serial/aux/samsort_dw.f90 b/base/serial/aux/samsort_dw.f90 new file mode 100644 index 000000000..48dd8aa2f --- /dev/null +++ b/base/serial/aux/samsort_dw.f90 @@ -0,0 +1,173 @@ +! +! Parallel Sparse BLAS version 3.1 +! (C) Copyright 2006, 2007, 2008, 2009, 2010 +! Salvatore Filippone University of Rome Tor Vergata +! Alfredo Buttari CNRS-IRIT, Toulouse +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions, and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. The name of the PSBLAS group or the names of its contributors may +! not be used to endorse or promote products derived from this +! software without specific written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS +! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +! File: msort_dw.f90 +! +! Subroutine: msort_dw +! This subroutine sorts an integer array into ascending order. +! +! Arguments: +! n - integer Input: size of the array +! k - real(*) input: array of keys to be sorted +! l - integer(0:n+1) output: link list +! iret - integer output: 0 Normal termination +! 1 the array was already sorted +! * +! REFERENCES = (1) D. E. Knuth * +! The Art of Computer Programming, * +! vol.3: Sorting and Searching * +! Addison-Wesley, 1973 * +! * +! call msort_dw(n,x,iaux,iret) +! +! if (iret == 0) then +! lp = iaux(0) +! k = 1 +! do +! if ((lp == 0).or.(k>n)) exit +! do +! if (lp >= k) exit +! lp = iaux(lp) +! end do +! iswap = x(lp) +! x(lp) = x(k) +! x(k) = iswap +! lswap = iaux(lp) +! iaux(lp) = iaux(k) +! iaux(k) = lp +! lp = lswap +! k = k + 1 +! enddo +! end if +! +! +subroutine samsort_dw(n,k,l,iret) + use psb_const_mod + implicit none + integer(psb_ipk_) :: n, iret + real(psb_spk_) :: k(n) + integer(psb_ipk_) :: l(0:n+1) + ! + integer(psb_ipk_) :: p,q,s,t + ! .. + iret = 0 + ! first step: we are preparing ordered sublists, exploiting + ! what order was already in the input data; negative links + ! mark the end of the sublists + l(0) = 1 + t = n + 1 + do p = 1,n - 1 + if (abs(k(p)) >= abs(k(p+1))) then + l(p) = p + 1 + else + l(t) = - (p+1) + t = p + end if + end do + l(t) = 0 + l(n) = 0 + ! see if the input was already sorted + if (l(n+1) == 0) then + iret = 1 + return + else + l(n+1) = abs(l(n+1)) + end if + + mergepass: do + ! otherwise, begin a pass through the list. + ! throughout all the subroutine we have: + ! p, q: pointing to the sublists being merged + ! s: pointing to the most recently processed record + ! t: pointing to the end of previously completed sublist + s = 0 + t = n + 1 + p = l(s) + q = l(t) + if (q == 0) exit mergepass + + outer: do + + if (abs(k(p)) < abs(k(q))) then + + l(s) = sign(q,l(s)) + s = q + q = l(q) + if (q > 0) then + do + if (abs(k(p)) >= abs(k(q))) cycle outer + s = q + q = l(q) + if (q <= 0) exit + end do + end if + l(s) = p + s = t + do + t = p + p = l(p) + if (p <= 0) exit + end do + + else + + l(s) = sign(p,l(s)) + s = p + p = l(p) + if (p>0) then + do + if (abs(k(p)) < abs(k(q))) cycle outer + s = p + p = l(p) + if (p <= 0) exit + end do + end if + ! otherwise, one sublist ended, and we append to it the rest + ! of the other one. + l(s) = q + s = t + do + t = q + q = l(q) + if (q <= 0) exit + end do + end if + + p = -p + q = -q + if (q == 0) then + l(s) = sign(p,l(s)) + l(t) = 0 + exit outer + end if + end do outer + end do mergepass + +end subroutine samsort_dw diff --git a/base/serial/aux/samsort_up.f90 b/base/serial/aux/samsort_up.f90 new file mode 100644 index 000000000..1f43186d0 --- /dev/null +++ b/base/serial/aux/samsort_up.f90 @@ -0,0 +1,173 @@ +! +! Parallel Sparse BLAS version 3.1 +! (C) Copyright 2006, 2007, 2008, 2009, 2010 +! Salvatore Filippone University of Rome Tor Vergata +! Alfredo Buttari CNRS-IRIT, Toulouse +! +! Redistribution and use in source and binary forms, with or without +! modification, are permitted provided that the following conditions +! are met: +! 1. Redistributions of source code must retain the above copyright +! notice, this list of conditions and the following disclaimer. +! 2. Redistributions in binary form must reproduce the above copyright +! notice, this list of conditions, and the following disclaimer in the +! documentation and/or other materials provided with the distribution. +! 3. The name of the PSBLAS group or the names of its contributors may +! not be used to endorse or promote products derived from this +! software without specific written permission. +! +! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS +! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +! POSSIBILITY OF SUCH DAMAGE. +! +! File: msort_up.f90 +! +! Subroutine: msort_up +! This subroutine sorts an integer array into ascending order. +! +! Arguments: +! n - integer Input: size of the array +! k - integer(*) input: array of keys to be sorted +! l - integer(0:n+1) output: link list +! iret - integer output: 0 Normal termination +! 1 the array was already sorted +! * +! REFERENCES = (1) D. E. Knuth * +! The Art of Computer Programming, * +! vol.3: Sorting and Searching * +! Addison-Wesley, 1973 * +! * +! call msort_up(n,x,iaux,iret) +! +! if (iret == 0) then +! lp = iaux(0) +! k = 1 +! do +! if ((lp == 0).or.(k>n)) exit +! do +! if (lp >= k) exit +! lp = iaux(lp) +! end do +! iswap = x(lp) +! x(lp) = x(k) +! x(k) = iswap +! lswap = iaux(lp) +! iaux(lp) = iaux(k) +! iaux(k) = lp +! lp = lswap +! k = k + 1 +! enddo +! end if +! +! +subroutine samsort_up(n,k,l,iret) + use psb_const_mod + implicit none + integer(psb_ipk_) :: n, iret + real(psb_spk_) k(n) + integer(psb_ipk_) :: l(0:n+1) + ! + integer(psb_ipk_) :: p,q,s,t + ! .. + iret = 0 + ! first step: we are preparing ordered sublists, exploiting + ! what order was already in the input data; negative links + ! mark the end of the sublists + l(0) = 1 + t = n + 1 + do p = 1,n - 1 + if (abs(k(p)) <= abs(k(p+1))) then + l(p) = p + 1 + else + l(t) = - (p+1) + t = p + end if + end do + l(t) = 0 + l(n) = 0 + ! see if the input was already sorted + if (l(n+1) == 0) then + iret = 1 + return + else + l(n+1) = abs(l(n+1)) + end if + + mergepass: do + ! otherwise, begin a pass through the list. + ! throughout all the subroutine we have: + ! p, q: pointing to the sublists being merged + ! s: pointing to the most recently processed record + ! t: pointing to the end of previously completed sublist + s = 0 + t = n + 1 + p = l(s) + q = l(t) + if (q == 0) exit mergepass + + outer: do + + if (abs(k(p)) > abs(k(q))) then + + l(s) = sign(q,l(s)) + s = q + q = l(q) + if (q > 0) then + do + if (abs(k(p)) <= abs(k(q))) cycle outer + s = q + q = l(q) + if (q <= 0) exit + end do + end if + l(s) = p + s = t + do + t = p + p = l(p) + if (p <= 0) exit + end do + + else + + l(s) = sign(p,l(s)) + s = p + p = l(p) + if (p>0) then + do + if (abs(k(p)) > abs(k(q))) cycle outer + s = p + p = l(p) + if (p <= 0) exit + end do + end if + ! otherwise, one sublist ended, and we append to it the rest + ! of the other one. + l(s) = q + s = t + do + t = q + q = l(q) + if (q <= 0) exit + end do + end if + + p = -p + q = -q + if (q == 0) then + l(s) = sign(p,l(s)) + l(t) = 0 + exit outer + end if + end do outer + end do mergepass + +end subroutine samsort_up diff --git a/base/serial/aux/smsr.f90 b/base/serial/aux/smsr.f90 index 593676b41..7eef23e54 100644 --- a/base/serial/aux/smsr.f90 +++ b/base/serial/aux/smsr.f90 @@ -58,11 +58,16 @@ subroutine smsr(n,x,idir) call psb_error() endif - if (idir == psb_sort_up_) then + select case(idir) + case (psb_sort_up_) call smsort_up(n,x,iaux,iret) - else + case (psb_asort_up_) + call samsort_up(n,x,iaux,iret) + case (psb_asort_down_) + call samsort_dw(n,x,iaux,iret) + case (psb_sort_down_) call smsort_dw(n,x,iaux,iret) - end if + end select if (iret == 0) call psb_ip_reord(n,x,iaux) diff --git a/base/serial/aux/smsrx.f90 b/base/serial/aux/smsrx.f90 index c87fbac86..71d41d3f2 100644 --- a/base/serial/aux/smsrx.f90 +++ b/base/serial/aux/smsrx.f90 @@ -64,12 +64,17 @@ subroutine smsrx(n,x,indx,idir,flag) call psb_errpush(psb_err_alloc_dealloc_,r_name='smsrx') call psb_error() endif - - if (idir == psb_sort_up_) then + + select case(idir) + case (psb_sort_up_) call smsort_up(n,x,iaux,iret) - else + case (psb_asort_up_) + call samsort_up(n,x,iaux,iret) + case (psb_asort_down_) + call samsort_dw(n,x,iaux,iret) + case (psb_sort_down_) call smsort_dw(n,x,iaux,iret) - end if + end select if (iret == 0) call psb_ip_reord(n,x,indx,iaux) diff --git a/base/serial/impl/psb_base_mat_impl.f90 b/base/serial/impl/psb_base_mat_impl.f90 index 7ac4153a1..6cc9ff168 100644 --- a/base/serial/impl/psb_base_mat_impl.f90 +++ b/base/serial/impl/psb_base_mat_impl.f90 @@ -17,11 +17,7 @@ function psb_base_get_nz_row(idx,a) result(res) ! so we throw an error. call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end function psb_base_get_nz_row function psb_base_get_nzeros(a) result(res) @@ -42,11 +38,7 @@ function psb_base_get_nzeros(a) result(res) ! so we throw an error. call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end function psb_base_get_nzeros function psb_base_get_size(a) result(res) @@ -67,11 +59,7 @@ function psb_base_get_size(a) result(res) ! so we throw an error. call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end function psb_base_get_size subroutine psb_base_reinit(a,clear) @@ -93,11 +81,7 @@ subroutine psb_base_reinit(a,clear) ! so we throw an error. call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end subroutine psb_base_reinit subroutine psb_base_sparse_print(iout,a,iv,head,ivr,ivc) @@ -122,11 +106,7 @@ subroutine psb_base_sparse_print(iout,a,iv,head,ivr,ivc) ! so we throw an error. call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end subroutine psb_base_sparse_print subroutine psb_base_csgetptn(imin,imax,a,nz,ia,ja,info,& @@ -157,11 +137,7 @@ subroutine psb_base_csgetptn(imin,imax,a,nz,ia,ja,info,& info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end subroutine psb_base_csgetptn subroutine psb_base_get_neigh(a,idx,neigh,n,info,lev) @@ -234,11 +210,8 @@ subroutine psb_base_get_neigh(a,idx,neigh,n,info,lev) call psb_erractionrestore(err_act) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act /= psb_act_ret_) then - call psb_error() - end if return end subroutine psb_base_get_neigh @@ -260,11 +233,7 @@ subroutine psb_base_allocate_mnnz(m,n,a,nz) ! so we throw an error. call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end subroutine psb_base_allocate_mnnz subroutine psb_base_reallocate_nz(nz,a) @@ -283,11 +252,7 @@ subroutine psb_base_reallocate_nz(nz,a) ! so we throw an error. call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end subroutine psb_base_reallocate_nz subroutine psb_base_free(a) @@ -305,11 +270,7 @@ subroutine psb_base_free(a) ! so we throw an error. call psb_errpush(psb_err_missing_override_method_,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return - + call psb_error_handler(err_act) end subroutine psb_base_free subroutine psb_base_trim(a) diff --git a/base/serial/impl/psb_c_base_mat_impl.F90 b/base/serial/impl/psb_c_base_mat_impl.F90 index 40a953cab..d08112f47 100644 --- a/base/serial/impl/psb_c_base_mat_impl.F90 +++ b/base/serial/impl/psb_c_base_mat_impl.F90 @@ -55,17 +55,14 @@ subroutine psb_c_base_cp_to_coo(a,b,info) character(len=20) :: name='to_coo' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_cp_to_coo @@ -83,17 +80,14 @@ subroutine psb_c_base_cp_from_coo(a,b,info) character(len=20) :: name='from_coo' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_cp_from_coo @@ -131,14 +125,8 @@ subroutine psb_c_base_cp_to_fmt(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - return return end subroutine psb_c_base_cp_to_fmt @@ -177,13 +165,8 @@ subroutine psb_c_base_cp_from_fmt(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_cp_from_fmt @@ -221,13 +204,8 @@ subroutine psb_c_base_mv_to_coo(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_mv_to_coo @@ -263,13 +241,8 @@ subroutine psb_c_base_mv_from_coo(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_mv_from_coo @@ -342,17 +315,14 @@ subroutine psb_c_base_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) character(len=20) :: name='csput' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_csput_a @@ -394,13 +364,8 @@ subroutine psb_c_base_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_csput_v @@ -428,17 +393,14 @@ subroutine psb_c_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,& character(len=20) :: name='csget' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_csgetrow @@ -536,13 +498,8 @@ subroutine psb_c_base_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_csgetblk @@ -626,13 +583,8 @@ subroutine psb_c_base_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_csclip @@ -742,13 +694,8 @@ subroutine psb_c_base_tril(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_tril @@ -852,13 +799,8 @@ subroutine psb_c_base_triu(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_triu @@ -938,17 +880,14 @@ subroutine psb_c_base_mold(a,b,info) character(len=20) :: name='base_mold' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_mold @@ -984,10 +923,8 @@ subroutine psb_c_base_transp_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1024,10 +961,8 @@ subroutine psb_c_base_transc_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return end subroutine psb_c_base_transc_2mat @@ -1058,10 +993,8 @@ subroutine psb_c_base_transp_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1092,10 +1025,8 @@ subroutine psb_c_base_transc_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1131,17 +1062,14 @@ subroutine psb_c_base_csmm(alpha,a,x,beta,y,info,trans) character(len=20) :: name='c_base_csmm' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_csmm @@ -1161,17 +1089,14 @@ subroutine psb_c_base_csmv(alpha,a,x,beta,y,info,trans) character(len=20) :: name='c_base_csmv' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_csmv @@ -1192,17 +1117,14 @@ subroutine psb_c_base_inner_cssm(alpha,a,x,beta,y,info,trans) character(len=20) :: name='c_base_inner_cssm' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_inner_cssm @@ -1222,17 +1144,14 @@ subroutine psb_c_base_inner_cssv(alpha,a,x,beta,y,info,trans) character(len=20) :: name='c_base_inner_cssv' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_inner_cssv @@ -1365,13 +1284,8 @@ subroutine psb_c_base_cssm(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1501,13 +1415,8 @@ subroutine psb_c_base_cssv(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains subroutine inner_vscal(n,d,x,y) @@ -1551,17 +1460,14 @@ subroutine psb_c_base_scals(d,a,info) character(len=20) :: name='c_scals' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_scals @@ -1581,17 +1487,14 @@ subroutine psb_c_base_scal(d,a,info,side) character(len=20) :: name='c_scal' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_c_base_scal @@ -1611,19 +1514,15 @@ function psb_c_base_maxval(a) result(res) character(len=20) :: name='maxval' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) + res = szero ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - res = szero - - return + call psb_error_handler(err_act) end function psb_c_base_maxval @@ -1640,7 +1539,7 @@ function psb_c_base_csnmi(a) result(res) integer(psb_ipk_) :: err_act, info integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='csnm1' + character(len=20) :: name='csnmi' real(psb_spk_), allocatable :: vt(:) logical, parameter :: debug=.false. @@ -1661,13 +1560,8 @@ function psb_c_base_csnmi(a) result(res) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_c_base_csnmi @@ -1705,13 +1599,8 @@ function psb_c_base_csnm1(a) result(res) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_c_base_csnm1 @@ -1728,18 +1617,14 @@ subroutine psb_c_base_rowsum(d,a) character(len=20) :: name='rowsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_c_base_rowsum @@ -1755,18 +1640,14 @@ subroutine psb_c_base_arwsum(d,a) character(len=20) :: name='arwsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_c_base_arwsum @@ -1782,18 +1663,14 @@ subroutine psb_c_base_colsum(d,a) character(len=20) :: name='colsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_c_base_colsum @@ -1809,18 +1686,14 @@ subroutine psb_c_base_aclsum(d,a) character(len=20) :: name='aclsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_c_base_aclsum @@ -1840,18 +1713,14 @@ subroutine psb_c_base_get_diag(a,d,info) character(len=20) :: name='get_diag' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_c_base_get_diag @@ -2029,13 +1898,8 @@ subroutine psb_c_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_vect_cssv @@ -2072,15 +1936,9 @@ subroutine psb_c_base_inner_vect_sv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return + +9999 call psb_error_handler(err_act) - -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_base_inner_vect_sv diff --git a/base/serial/impl/psb_c_coo_impl.f90 b/base/serial/impl/psb_c_coo_impl.f90 index 5a6c27c34..37bbf080c 100644 --- a/base/serial/impl/psb_c_coo_impl.f90 +++ b/base/serial/impl/psb_c_coo_impl.f90 @@ -69,12 +69,8 @@ subroutine psb_c_coo_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_coo_get_diag @@ -143,12 +139,8 @@ subroutine psb_c_coo_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_coo_scal @@ -182,12 +174,8 @@ subroutine psb_c_coo_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_coo_scals @@ -217,13 +205,8 @@ subroutine psb_c_coo_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_reallocate_nz @@ -255,10 +238,9 @@ subroutine psb_c_coo_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine psb_c_coo_mold @@ -302,13 +284,8 @@ subroutine psb_c_coo_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_reinit @@ -337,13 +314,8 @@ subroutine psb_c_coo_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_trim @@ -405,13 +377,8 @@ subroutine psb_c_coo_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_allocate_mnnz @@ -645,13 +612,8 @@ subroutine psb_c_coo_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1004,13 +966,8 @@ subroutine psb_c_coo_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1435,13 +1392,8 @@ subroutine psb_c_coo_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_csmv @@ -1646,13 +1598,8 @@ subroutine psb_c_coo_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_csmm @@ -1824,13 +1771,8 @@ subroutine psb_c_coo_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_rowsum @@ -1876,13 +1818,8 @@ subroutine psb_c_coo_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_arwsum @@ -1929,13 +1866,8 @@ subroutine psb_c_coo_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_colsum @@ -1982,13 +1914,8 @@ subroutine psb_c_coo_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_coo_aclsum @@ -2096,13 +2023,8 @@ subroutine psb_c_coo_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2374,13 +2296,8 @@ subroutine psb_c_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2671,16 +2588,10 @@ subroutine psb_c_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return - contains subroutine psb_inner_ins(nz,ia,ja,val,nza,ia1,ia2,aspk,maxsz,& @@ -2990,14 +2901,8 @@ subroutine psb_c_cp_coo_to_coo(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - call psb_errpush(info,name) - - if (err_act /= psb_act_ret_) then - call psb_error() - end if return end subroutine psb_c_cp_coo_to_coo @@ -3037,13 +2942,10 @@ subroutine psb_c_cp_coo_from_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_cp_coo_from_coo @@ -3074,13 +2976,10 @@ subroutine psb_c_cp_coo_to_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_cp_coo_to_fmt @@ -3111,13 +3010,10 @@ subroutine psb_c_cp_coo_from_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_cp_coo_from_fmt @@ -3155,13 +3051,10 @@ subroutine psb_c_mv_coo_to_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_mv_coo_to_coo @@ -3198,13 +3091,10 @@ subroutine psb_c_mv_coo_from_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_mv_coo_from_coo @@ -3235,13 +3125,10 @@ subroutine psb_c_mv_coo_to_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_mv_coo_to_fmt @@ -3272,13 +3159,10 @@ subroutine psb_c_mv_coo_from_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_mv_coo_from_fmt @@ -3306,13 +3190,10 @@ subroutine psb_c_coo_cp_from(a,b) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_coo_cp_from @@ -3340,13 +3221,10 @@ subroutine psb_c_coo_mv_from(a,b) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_c_coo_mv_from @@ -3403,12 +3281,8 @@ subroutine psb_c_fix_coo(a,info,idir) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_fix_coo @@ -4120,12 +3994,8 @@ subroutine psb_c_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_fix_coo_inner diff --git a/base/serial/impl/psb_c_csc_impl.f90 b/base/serial/impl/psb_c_csc_impl.f90 index 7dc7195c2..a30508ca7 100644 --- a/base/serial/impl/psb_c_csc_impl.f90 +++ b/base/serial/impl/psb_c_csc_impl.f90 @@ -312,13 +312,9 @@ subroutine psb_c_csc_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_csc_csmv @@ -598,13 +594,9 @@ subroutine psb_c_csc_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_csc_csmm @@ -712,13 +704,8 @@ subroutine psb_c_csc_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -940,13 +927,8 @@ subroutine psb_c_csc_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1174,13 +1156,8 @@ subroutine psb_c_csc_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_colsum @@ -1233,13 +1210,8 @@ subroutine psb_c_csc_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_aclsum @@ -1287,13 +1259,8 @@ subroutine psb_c_csc_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_rowsum @@ -1341,13 +1308,8 @@ subroutine psb_c_csc_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_arwsum @@ -1398,12 +1360,8 @@ subroutine psb_c_csc_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_csc_get_diag @@ -1472,12 +1430,8 @@ subroutine psb_c_csc_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_csc_scal @@ -1511,12 +1465,8 @@ subroutine psb_c_csc_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_csc_scals @@ -1621,13 +1571,8 @@ subroutine psb_c_csc_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1815,13 +1760,8 @@ subroutine psb_c_csc_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2007,13 +1947,8 @@ subroutine psb_c_csc_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -2595,10 +2530,9 @@ subroutine psb_c_csc_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine psb_c_csc_mold @@ -2628,13 +2562,8 @@ subroutine psb_c_csc_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_reallocate_nz @@ -2690,13 +2619,8 @@ subroutine psb_c_csc_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_csgetblk @@ -2740,13 +2664,8 @@ subroutine psb_c_csc_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_reinit @@ -2774,13 +2693,8 @@ subroutine psb_c_csc_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_trim @@ -2840,13 +2754,8 @@ subroutine psb_c_csc_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csc_allocate_mnnz @@ -2968,12 +2877,8 @@ subroutine psb_ccscspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index b124adbd3..ea69b2ea9 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -112,13 +112,8 @@ subroutine psb_c_csr_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -467,13 +462,9 @@ subroutine psb_c_csr_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains @@ -846,13 +837,8 @@ subroutine psb_c_csr_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1105,13 +1091,8 @@ subroutine psb_c_csr_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1369,13 +1350,8 @@ subroutine psb_c_csr_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_rowsum @@ -1423,13 +1399,8 @@ subroutine psb_c_csr_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_arwsum @@ -1480,13 +1451,8 @@ subroutine psb_c_csr_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_colsum @@ -1537,13 +1503,8 @@ subroutine psb_c_csr_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_aclsum @@ -1762,13 +1723,8 @@ subroutine psb_c_csr_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_reallocate_nz @@ -1863,13 +1819,8 @@ subroutine psb_c_csr_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_allocate_mnnz @@ -1962,13 +1913,8 @@ subroutine psb_c_csr_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2142,13 +2088,8 @@ subroutine psb_c_csr_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2286,13 +2227,8 @@ subroutine psb_c_csr_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_csgetblk @@ -2383,13 +2319,8 @@ subroutine psb_c_csr_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -2607,13 +2538,8 @@ subroutine psb_c_csr_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_reinit @@ -2642,13 +2568,8 @@ subroutine psb_c_csr_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csr_trim @@ -2781,9 +2702,9 @@ subroutine psb_c_cp_csr_from_coo(a,b,info) ! Dirty trick: call move_alloc to have the new data allocated just once. call psb_safe_ab_cpy(b%ia,itemp,info) - if (info /= psb_success_) call psb_safe_ab_cpy(b%ja,a%ja,info) - if (info /= psb_success_) call psb_safe_ab_cpy(b%val,a%val,info) - if (info /= psb_success_) call psb_realloc(max(nr+1,nc+1),a%irp,info) + if (info == psb_success_) call psb_safe_ab_cpy(b%ja,a%ja,info) + if (info == psb_success_) call psb_safe_ab_cpy(b%val,a%val,info) + if (info == psb_success_) call psb_realloc(max(nr+1,nc+1),a%irp,info) endif @@ -3220,12 +3141,8 @@ subroutine psb_ccsrspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/impl/psb_c_mat_impl.F90 b/base/serial/impl/psb_c_mat_impl.F90 index 0db47146e..4a610c06b 100644 --- a/base/serial/impl/psb_c_mat_impl.F90 +++ b/base/serial/impl/psb_c_mat_impl.F90 @@ -77,14 +77,9 @@ subroutine psb_c_set_nrows(m,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_set_nrows @@ -110,14 +105,9 @@ subroutine psb_c_set_ncols(n,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_set_ncols @@ -152,14 +142,9 @@ subroutine psb_c_set_dupl(n,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_set_dupl @@ -189,14 +174,9 @@ subroutine psb_c_set_null(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_set_null @@ -222,13 +202,10 @@ subroutine psb_c_set_bld(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_set_bld @@ -254,13 +231,10 @@ subroutine psb_c_set_upd(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_set_upd @@ -287,13 +261,10 @@ subroutine psb_c_set_asb(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_set_asb @@ -320,13 +291,10 @@ subroutine psb_c_set_sorted(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_set_sorted @@ -353,13 +321,10 @@ subroutine psb_c_set_triangle(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_set_triangle @@ -386,13 +351,10 @@ subroutine psb_c_set_unit(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_set_unit @@ -419,13 +381,10 @@ subroutine psb_c_set_lower(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_set_lower @@ -452,13 +411,10 @@ subroutine psb_c_set_upper(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_set_upper @@ -504,12 +460,8 @@ subroutine psb_c_sparse_print(iout,a,iv,head,ivr,ivc) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_sparse_print @@ -559,12 +511,8 @@ subroutine psb_c_n_sparse_print(fname,a,iv,head,ivr,ivc) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_n_sparse_print @@ -600,13 +548,8 @@ subroutine psb_c_get_neigh(a,idx,neigh,n,info,lev) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_get_neigh @@ -643,12 +586,8 @@ subroutine psb_c_csall(nr,nc,a,info,nz) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csall @@ -675,13 +614,8 @@ subroutine psb_c_reallocate_nz(nz,a) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_reallocate_nz @@ -721,12 +655,8 @@ subroutine psb_c_trim(a) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_trim @@ -763,13 +693,10 @@ subroutine psb_c_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_csput_a @@ -810,13 +737,10 @@ subroutine psb_c_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_csput_v @@ -860,13 +784,10 @@ subroutine psb_c_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_csgetptn @@ -911,13 +832,10 @@ subroutine psb_c_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_csgetrow @@ -980,13 +898,10 @@ subroutine psb_c_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_csgetblk @@ -1033,13 +948,10 @@ subroutine psb_c_tril(a,b,info,diag,imin,imax,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_tril @@ -1087,13 +999,10 @@ subroutine psb_c_triu(a,b,info,diag,imin,imax,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_triu @@ -1142,13 +1051,10 @@ subroutine psb_c_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_csclip @@ -1187,13 +1093,10 @@ subroutine psb_c_b_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_b_csclip @@ -1296,13 +1199,10 @@ subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_cscnv @@ -1402,13 +1302,10 @@ subroutine psb_c_cscnv_ip(a,info,type,mold,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_cscnv_ip @@ -1457,13 +1354,10 @@ subroutine psb_c_cscnv_base(a,b,info,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_cscnv_base @@ -1520,13 +1414,10 @@ subroutine psb_c_clip_d(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_clip_d @@ -1582,13 +1473,10 @@ subroutine psb_c_clip_d_ip(a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_clip_d_ip @@ -1647,13 +1535,10 @@ subroutine psb_c_cp_from(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_cp_from @@ -1744,13 +1629,10 @@ subroutine psb_cspmat_clone(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_cspmat_clone @@ -1779,13 +1661,10 @@ subroutine psb_c_transp_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_transp_1mat @@ -1825,13 +1704,10 @@ subroutine psb_c_transp_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_transp_2mat @@ -1860,13 +1736,10 @@ subroutine psb_c_transc_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_transc_1mat @@ -1906,13 +1779,10 @@ subroutine psb_c_transc_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_transc_2mat @@ -1949,13 +1819,10 @@ subroutine psb_c_asb(a,mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_asb @@ -1987,13 +1854,10 @@ subroutine psb_c_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_c_reinit @@ -2040,13 +1904,8 @@ subroutine psb_c_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csmm @@ -2078,13 +1937,8 @@ subroutine psb_c_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csmv @@ -2128,13 +1982,8 @@ subroutine psb_c_csmv_vect(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_csmv_vect @@ -2169,13 +2018,8 @@ subroutine psb_c_cssm(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_cssm @@ -2210,13 +2054,8 @@ subroutine psb_c_cssv(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_cssv @@ -2271,13 +2110,8 @@ subroutine psb_c_cssv_vect(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_cssv_vect @@ -2306,12 +2140,9 @@ function psb_c_maxval(a) result(res) res = a%a%maxval() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_c_maxval @@ -2339,12 +2170,9 @@ function psb_c_csnmi(a) result(res) res = a%a%spnmi() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_c_csnmi @@ -2373,12 +2201,9 @@ function psb_c_csnm1(a) result(res) res = a%a%spnm1() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_c_csnm1 @@ -2411,13 +2236,8 @@ function psb_c_rowsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_c_rowsum @@ -2450,13 +2270,8 @@ function psb_c_arwsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_c_arwsum @@ -2489,13 +2304,8 @@ function psb_c_colsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_c_colsum @@ -2528,13 +2338,8 @@ function psb_c_aclsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_c_aclsum @@ -2572,13 +2377,8 @@ function psb_c_get_diag(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_c_get_diag @@ -2612,13 +2412,8 @@ subroutine psb_c_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_scal @@ -2651,13 +2446,8 @@ subroutine psb_c_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_c_scals diff --git a/base/serial/impl/psb_d_base_mat_impl.F90 b/base/serial/impl/psb_d_base_mat_impl.F90 index e6e872178..716e41684 100644 --- a/base/serial/impl/psb_d_base_mat_impl.F90 +++ b/base/serial/impl/psb_d_base_mat_impl.F90 @@ -55,17 +55,14 @@ subroutine psb_d_base_cp_to_coo(a,b,info) character(len=20) :: name='to_coo' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_cp_to_coo @@ -83,17 +80,14 @@ subroutine psb_d_base_cp_from_coo(a,b,info) character(len=20) :: name='from_coo' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_cp_from_coo @@ -131,14 +125,8 @@ subroutine psb_d_base_cp_to_fmt(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - return return end subroutine psb_d_base_cp_to_fmt @@ -177,13 +165,8 @@ subroutine psb_d_base_cp_from_fmt(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_cp_from_fmt @@ -221,13 +204,8 @@ subroutine psb_d_base_mv_to_coo(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_mv_to_coo @@ -263,13 +241,8 @@ subroutine psb_d_base_mv_from_coo(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_mv_from_coo @@ -342,17 +315,14 @@ subroutine psb_d_base_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) character(len=20) :: name='csput' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_csput_a @@ -394,13 +364,8 @@ subroutine psb_d_base_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_csput_v @@ -428,17 +393,14 @@ subroutine psb_d_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,& character(len=20) :: name='csget' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_csgetrow @@ -536,13 +498,8 @@ subroutine psb_d_base_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_csgetblk @@ -626,13 +583,8 @@ subroutine psb_d_base_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_csclip @@ -742,13 +694,8 @@ subroutine psb_d_base_tril(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_tril @@ -852,13 +799,8 @@ subroutine psb_d_base_triu(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_triu @@ -938,17 +880,14 @@ subroutine psb_d_base_mold(a,b,info) character(len=20) :: name='base_mold' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_mold @@ -984,10 +923,8 @@ subroutine psb_d_base_transp_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1024,10 +961,8 @@ subroutine psb_d_base_transc_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return end subroutine psb_d_base_transc_2mat @@ -1058,10 +993,8 @@ subroutine psb_d_base_transp_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1092,10 +1025,8 @@ subroutine psb_d_base_transc_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1131,17 +1062,14 @@ subroutine psb_d_base_csmm(alpha,a,x,beta,y,info,trans) character(len=20) :: name='d_base_csmm' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_csmm @@ -1161,17 +1089,14 @@ subroutine psb_d_base_csmv(alpha,a,x,beta,y,info,trans) character(len=20) :: name='d_base_csmv' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_csmv @@ -1192,17 +1117,14 @@ subroutine psb_d_base_inner_cssm(alpha,a,x,beta,y,info,trans) character(len=20) :: name='d_base_inner_cssm' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_inner_cssm @@ -1222,17 +1144,14 @@ subroutine psb_d_base_inner_cssv(alpha,a,x,beta,y,info,trans) character(len=20) :: name='d_base_inner_cssv' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_inner_cssv @@ -1365,13 +1284,8 @@ subroutine psb_d_base_cssm(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1501,13 +1415,8 @@ subroutine psb_d_base_cssv(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains subroutine inner_vscal(n,d,x,y) @@ -1551,17 +1460,14 @@ subroutine psb_d_base_scals(d,a,info) character(len=20) :: name='d_scals' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_scals @@ -1581,17 +1487,14 @@ subroutine psb_d_base_scal(d,a,info,side) character(len=20) :: name='d_scal' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_d_base_scal @@ -1611,19 +1514,15 @@ function psb_d_base_maxval(a) result(res) character(len=20) :: name='maxval' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) + res = dzero ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - res = dzero - - return + call psb_error_handler(err_act) end function psb_d_base_maxval @@ -1640,7 +1539,7 @@ function psb_d_base_csnmi(a) result(res) integer(psb_ipk_) :: err_act, info integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='csnm1' + character(len=20) :: name='csnmi' real(psb_dpk_), allocatable :: vt(:) logical, parameter :: debug=.false. @@ -1661,13 +1560,8 @@ function psb_d_base_csnmi(a) result(res) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_d_base_csnmi @@ -1705,13 +1599,8 @@ function psb_d_base_csnm1(a) result(res) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_d_base_csnm1 @@ -1728,18 +1617,14 @@ subroutine psb_d_base_rowsum(d,a) character(len=20) :: name='rowsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_d_base_rowsum @@ -1755,18 +1640,14 @@ subroutine psb_d_base_arwsum(d,a) character(len=20) :: name='arwsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_d_base_arwsum @@ -1782,18 +1663,14 @@ subroutine psb_d_base_colsum(d,a) character(len=20) :: name='colsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_d_base_colsum @@ -1809,18 +1686,14 @@ subroutine psb_d_base_aclsum(d,a) character(len=20) :: name='aclsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_d_base_aclsum @@ -1840,18 +1713,14 @@ subroutine psb_d_base_get_diag(a,d,info) character(len=20) :: name='get_diag' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_d_base_get_diag @@ -2029,13 +1898,8 @@ subroutine psb_d_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_vect_cssv @@ -2072,15 +1936,9 @@ subroutine psb_d_base_inner_vect_sv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return + +9999 call psb_error_handler(err_act) - -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_base_inner_vect_sv diff --git a/base/serial/impl/psb_d_coo_impl.f90 b/base/serial/impl/psb_d_coo_impl.f90 index f768927b2..897c919fd 100644 --- a/base/serial/impl/psb_d_coo_impl.f90 +++ b/base/serial/impl/psb_d_coo_impl.f90 @@ -69,12 +69,8 @@ subroutine psb_d_coo_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_coo_get_diag @@ -143,12 +139,8 @@ subroutine psb_d_coo_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_coo_scal @@ -182,12 +174,8 @@ subroutine psb_d_coo_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_coo_scals @@ -217,13 +205,8 @@ subroutine psb_d_coo_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_reallocate_nz @@ -255,10 +238,9 @@ subroutine psb_d_coo_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine psb_d_coo_mold @@ -302,13 +284,8 @@ subroutine psb_d_coo_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_reinit @@ -337,13 +314,8 @@ subroutine psb_d_coo_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_trim @@ -405,13 +377,8 @@ subroutine psb_d_coo_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_allocate_mnnz @@ -645,13 +612,8 @@ subroutine psb_d_coo_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1004,13 +966,8 @@ subroutine psb_d_coo_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1435,13 +1392,8 @@ subroutine psb_d_coo_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_csmv @@ -1646,13 +1598,8 @@ subroutine psb_d_coo_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_csmm @@ -1824,13 +1771,8 @@ subroutine psb_d_coo_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_rowsum @@ -1876,13 +1818,8 @@ subroutine psb_d_coo_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_arwsum @@ -1929,13 +1866,8 @@ subroutine psb_d_coo_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_colsum @@ -1982,13 +1914,8 @@ subroutine psb_d_coo_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_coo_aclsum @@ -2096,13 +2023,8 @@ subroutine psb_d_coo_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2374,13 +2296,8 @@ subroutine psb_d_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2671,16 +2588,10 @@ subroutine psb_d_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return - contains subroutine psb_inner_ins(nz,ia,ja,val,nza,ia1,ia2,aspk,maxsz,& @@ -2990,14 +2901,8 @@ subroutine psb_d_cp_coo_to_coo(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - call psb_errpush(info,name) - - if (err_act /= psb_act_ret_) then - call psb_error() - end if return end subroutine psb_d_cp_coo_to_coo @@ -3037,13 +2942,10 @@ subroutine psb_d_cp_coo_from_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_cp_coo_from_coo @@ -3074,13 +2976,10 @@ subroutine psb_d_cp_coo_to_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_cp_coo_to_fmt @@ -3111,13 +3010,10 @@ subroutine psb_d_cp_coo_from_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_cp_coo_from_fmt @@ -3155,13 +3051,10 @@ subroutine psb_d_mv_coo_to_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_mv_coo_to_coo @@ -3198,13 +3091,10 @@ subroutine psb_d_mv_coo_from_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_mv_coo_from_coo @@ -3235,13 +3125,10 @@ subroutine psb_d_mv_coo_to_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_mv_coo_to_fmt @@ -3272,13 +3159,10 @@ subroutine psb_d_mv_coo_from_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_mv_coo_from_fmt @@ -3306,13 +3190,10 @@ subroutine psb_d_coo_cp_from(a,b) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_coo_cp_from @@ -3340,13 +3221,10 @@ subroutine psb_d_coo_mv_from(a,b) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_d_coo_mv_from @@ -3403,12 +3281,8 @@ subroutine psb_d_fix_coo(a,info,idir) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_fix_coo @@ -4120,12 +3994,8 @@ subroutine psb_d_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_fix_coo_inner diff --git a/base/serial/impl/psb_d_csc_impl.f90 b/base/serial/impl/psb_d_csc_impl.f90 index c065eec45..c07b5b1bc 100644 --- a/base/serial/impl/psb_d_csc_impl.f90 +++ b/base/serial/impl/psb_d_csc_impl.f90 @@ -312,13 +312,9 @@ subroutine psb_d_csc_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_csc_csmv @@ -598,13 +594,9 @@ subroutine psb_d_csc_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_csc_csmm @@ -712,13 +704,8 @@ subroutine psb_d_csc_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -940,13 +927,8 @@ subroutine psb_d_csc_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1174,13 +1156,8 @@ subroutine psb_d_csc_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_colsum @@ -1233,13 +1210,8 @@ subroutine psb_d_csc_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_aclsum @@ -1287,13 +1259,8 @@ subroutine psb_d_csc_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_rowsum @@ -1341,13 +1308,8 @@ subroutine psb_d_csc_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_arwsum @@ -1398,12 +1360,8 @@ subroutine psb_d_csc_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_csc_get_diag @@ -1472,12 +1430,8 @@ subroutine psb_d_csc_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_csc_scal @@ -1511,12 +1465,8 @@ subroutine psb_d_csc_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_csc_scals @@ -1621,13 +1571,8 @@ subroutine psb_d_csc_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1815,13 +1760,8 @@ subroutine psb_d_csc_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2007,13 +1947,8 @@ subroutine psb_d_csc_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -2595,10 +2530,9 @@ subroutine psb_d_csc_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine psb_d_csc_mold @@ -2628,13 +2562,8 @@ subroutine psb_d_csc_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_reallocate_nz @@ -2690,13 +2619,8 @@ subroutine psb_d_csc_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_csgetblk @@ -2740,13 +2664,8 @@ subroutine psb_d_csc_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_reinit @@ -2774,13 +2693,8 @@ subroutine psb_d_csc_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_trim @@ -2840,13 +2754,8 @@ subroutine psb_d_csc_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csc_allocate_mnnz @@ -2968,12 +2877,8 @@ subroutine psb_dcscspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index 628d42d4d..e1728baf9 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -112,13 +112,8 @@ subroutine psb_d_csr_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -467,13 +462,9 @@ subroutine psb_d_csr_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains @@ -846,13 +837,8 @@ subroutine psb_d_csr_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1105,13 +1091,8 @@ subroutine psb_d_csr_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1369,13 +1350,8 @@ subroutine psb_d_csr_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_rowsum @@ -1423,13 +1399,8 @@ subroutine psb_d_csr_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_arwsum @@ -1480,13 +1451,8 @@ subroutine psb_d_csr_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_colsum @@ -1537,13 +1503,8 @@ subroutine psb_d_csr_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_aclsum @@ -1762,13 +1723,8 @@ subroutine psb_d_csr_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_reallocate_nz @@ -1863,13 +1819,8 @@ subroutine psb_d_csr_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_allocate_mnnz @@ -1962,13 +1913,8 @@ subroutine psb_d_csr_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2142,13 +2088,8 @@ subroutine psb_d_csr_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2286,13 +2227,8 @@ subroutine psb_d_csr_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_csgetblk @@ -2383,13 +2319,8 @@ subroutine psb_d_csr_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -2607,13 +2538,8 @@ subroutine psb_d_csr_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_reinit @@ -2642,13 +2568,8 @@ subroutine psb_d_csr_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csr_trim @@ -2781,9 +2702,9 @@ subroutine psb_d_cp_csr_from_coo(a,b,info) ! Dirty trick: call move_alloc to have the new data allocated just once. call psb_safe_ab_cpy(b%ia,itemp,info) - if (info /= psb_success_) call psb_safe_ab_cpy(b%ja,a%ja,info) - if (info /= psb_success_) call psb_safe_ab_cpy(b%val,a%val,info) - if (info /= psb_success_) call psb_realloc(max(nr+1,nc+1),a%irp,info) + if (info == psb_success_) call psb_safe_ab_cpy(b%ja,a%ja,info) + if (info == psb_success_) call psb_safe_ab_cpy(b%val,a%val,info) + if (info == psb_success_) call psb_realloc(max(nr+1,nc+1),a%irp,info) endif @@ -3220,12 +3141,8 @@ subroutine psb_dcsrspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/impl/psb_d_mat_impl.F90 b/base/serial/impl/psb_d_mat_impl.F90 index 29d1d32a3..c6a6c356e 100644 --- a/base/serial/impl/psb_d_mat_impl.F90 +++ b/base/serial/impl/psb_d_mat_impl.F90 @@ -77,14 +77,9 @@ subroutine psb_d_set_nrows(m,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_set_nrows @@ -110,14 +105,9 @@ subroutine psb_d_set_ncols(n,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_set_ncols @@ -152,14 +142,9 @@ subroutine psb_d_set_dupl(n,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_set_dupl @@ -189,14 +174,9 @@ subroutine psb_d_set_null(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_set_null @@ -222,13 +202,10 @@ subroutine psb_d_set_bld(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_set_bld @@ -254,13 +231,10 @@ subroutine psb_d_set_upd(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_set_upd @@ -287,13 +261,10 @@ subroutine psb_d_set_asb(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_set_asb @@ -320,13 +291,10 @@ subroutine psb_d_set_sorted(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_set_sorted @@ -353,13 +321,10 @@ subroutine psb_d_set_triangle(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_set_triangle @@ -386,13 +351,10 @@ subroutine psb_d_set_unit(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_set_unit @@ -419,13 +381,10 @@ subroutine psb_d_set_lower(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_set_lower @@ -452,13 +411,10 @@ subroutine psb_d_set_upper(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_set_upper @@ -504,12 +460,8 @@ subroutine psb_d_sparse_print(iout,a,iv,head,ivr,ivc) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_sparse_print @@ -559,12 +511,8 @@ subroutine psb_d_n_sparse_print(fname,a,iv,head,ivr,ivc) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_n_sparse_print @@ -600,13 +548,8 @@ subroutine psb_d_get_neigh(a,idx,neigh,n,info,lev) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_get_neigh @@ -643,12 +586,8 @@ subroutine psb_d_csall(nr,nc,a,info,nz) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csall @@ -675,13 +614,8 @@ subroutine psb_d_reallocate_nz(nz,a) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_reallocate_nz @@ -721,12 +655,8 @@ subroutine psb_d_trim(a) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_trim @@ -763,13 +693,10 @@ subroutine psb_d_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_csput_a @@ -810,13 +737,10 @@ subroutine psb_d_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_csput_v @@ -860,13 +784,10 @@ subroutine psb_d_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_csgetptn @@ -911,13 +832,10 @@ subroutine psb_d_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_csgetrow @@ -980,13 +898,10 @@ subroutine psb_d_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_csgetblk @@ -1033,13 +948,10 @@ subroutine psb_d_tril(a,b,info,diag,imin,imax,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_tril @@ -1087,13 +999,10 @@ subroutine psb_d_triu(a,b,info,diag,imin,imax,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_triu @@ -1142,13 +1051,10 @@ subroutine psb_d_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_csclip @@ -1187,13 +1093,10 @@ subroutine psb_d_b_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_b_csclip @@ -1296,13 +1199,10 @@ subroutine psb_d_cscnv(a,b,info,type,mold,upd,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_cscnv @@ -1402,13 +1302,10 @@ subroutine psb_d_cscnv_ip(a,info,type,mold,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_cscnv_ip @@ -1457,13 +1354,10 @@ subroutine psb_d_cscnv_base(a,b,info,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_cscnv_base @@ -1520,13 +1414,10 @@ subroutine psb_d_clip_d(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_clip_d @@ -1582,13 +1473,10 @@ subroutine psb_d_clip_d_ip(a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_clip_d_ip @@ -1647,13 +1535,10 @@ subroutine psb_d_cp_from(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_cp_from @@ -1744,13 +1629,10 @@ subroutine psb_dspmat_clone(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_dspmat_clone @@ -1779,13 +1661,10 @@ subroutine psb_d_transp_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_transp_1mat @@ -1825,13 +1704,10 @@ subroutine psb_d_transp_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_transp_2mat @@ -1860,13 +1736,10 @@ subroutine psb_d_transc_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_transc_1mat @@ -1906,13 +1779,10 @@ subroutine psb_d_transc_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_transc_2mat @@ -1949,13 +1819,10 @@ subroutine psb_d_asb(a,mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_asb @@ -1987,13 +1854,10 @@ subroutine psb_d_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_d_reinit @@ -2040,13 +1904,8 @@ subroutine psb_d_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csmm @@ -2078,13 +1937,8 @@ subroutine psb_d_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csmv @@ -2128,13 +1982,8 @@ subroutine psb_d_csmv_vect(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_csmv_vect @@ -2169,13 +2018,8 @@ subroutine psb_d_cssm(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_cssm @@ -2210,13 +2054,8 @@ subroutine psb_d_cssv(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_cssv @@ -2271,13 +2110,8 @@ subroutine psb_d_cssv_vect(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_cssv_vect @@ -2306,12 +2140,9 @@ function psb_d_maxval(a) result(res) res = a%a%maxval() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_d_maxval @@ -2339,12 +2170,9 @@ function psb_d_csnmi(a) result(res) res = a%a%spnmi() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_d_csnmi @@ -2373,12 +2201,9 @@ function psb_d_csnm1(a) result(res) res = a%a%spnm1() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_d_csnm1 @@ -2411,13 +2236,8 @@ function psb_d_rowsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_d_rowsum @@ -2450,13 +2270,8 @@ function psb_d_arwsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_d_arwsum @@ -2489,13 +2304,8 @@ function psb_d_colsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_d_colsum @@ -2528,13 +2338,8 @@ function psb_d_aclsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_d_aclsum @@ -2572,13 +2377,8 @@ function psb_d_get_diag(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_d_get_diag @@ -2612,13 +2412,8 @@ subroutine psb_d_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_scal @@ -2651,13 +2446,8 @@ subroutine psb_d_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_d_scals diff --git a/base/serial/impl/psb_s_base_mat_impl.F90 b/base/serial/impl/psb_s_base_mat_impl.F90 index cea210bb2..238a2e65e 100644 --- a/base/serial/impl/psb_s_base_mat_impl.F90 +++ b/base/serial/impl/psb_s_base_mat_impl.F90 @@ -55,17 +55,14 @@ subroutine psb_s_base_cp_to_coo(a,b,info) character(len=20) :: name='to_coo' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_cp_to_coo @@ -83,17 +80,14 @@ subroutine psb_s_base_cp_from_coo(a,b,info) character(len=20) :: name='from_coo' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_cp_from_coo @@ -131,14 +125,8 @@ subroutine psb_s_base_cp_to_fmt(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - return return end subroutine psb_s_base_cp_to_fmt @@ -177,13 +165,8 @@ subroutine psb_s_base_cp_from_fmt(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_cp_from_fmt @@ -221,13 +204,8 @@ subroutine psb_s_base_mv_to_coo(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_mv_to_coo @@ -263,13 +241,8 @@ subroutine psb_s_base_mv_from_coo(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_mv_from_coo @@ -342,17 +315,14 @@ subroutine psb_s_base_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) character(len=20) :: name='csput' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_csput_a @@ -394,13 +364,8 @@ subroutine psb_s_base_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_csput_v @@ -428,17 +393,14 @@ subroutine psb_s_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,& character(len=20) :: name='csget' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_csgetrow @@ -536,13 +498,8 @@ subroutine psb_s_base_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_csgetblk @@ -626,13 +583,8 @@ subroutine psb_s_base_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_csclip @@ -742,13 +694,8 @@ subroutine psb_s_base_tril(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_tril @@ -852,13 +799,8 @@ subroutine psb_s_base_triu(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_triu @@ -938,17 +880,14 @@ subroutine psb_s_base_mold(a,b,info) character(len=20) :: name='base_mold' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_mold @@ -984,10 +923,8 @@ subroutine psb_s_base_transp_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1024,10 +961,8 @@ subroutine psb_s_base_transc_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return end subroutine psb_s_base_transc_2mat @@ -1058,10 +993,8 @@ subroutine psb_s_base_transp_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1092,10 +1025,8 @@ subroutine psb_s_base_transc_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1131,17 +1062,14 @@ subroutine psb_s_base_csmm(alpha,a,x,beta,y,info,trans) character(len=20) :: name='s_base_csmm' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_csmm @@ -1161,17 +1089,14 @@ subroutine psb_s_base_csmv(alpha,a,x,beta,y,info,trans) character(len=20) :: name='s_base_csmv' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_csmv @@ -1192,17 +1117,14 @@ subroutine psb_s_base_inner_cssm(alpha,a,x,beta,y,info,trans) character(len=20) :: name='s_base_inner_cssm' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_inner_cssm @@ -1222,17 +1144,14 @@ subroutine psb_s_base_inner_cssv(alpha,a,x,beta,y,info,trans) character(len=20) :: name='s_base_inner_cssv' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_inner_cssv @@ -1365,13 +1284,8 @@ subroutine psb_s_base_cssm(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1501,13 +1415,8 @@ subroutine psb_s_base_cssv(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains subroutine inner_vscal(n,d,x,y) @@ -1551,17 +1460,14 @@ subroutine psb_s_base_scals(d,a,info) character(len=20) :: name='s_scals' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_scals @@ -1581,17 +1487,14 @@ subroutine psb_s_base_scal(d,a,info,side) character(len=20) :: name='s_scal' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_s_base_scal @@ -1611,19 +1514,15 @@ function psb_s_base_maxval(a) result(res) character(len=20) :: name='maxval' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) + res = szero ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - res = szero - - return + call psb_error_handler(err_act) end function psb_s_base_maxval @@ -1640,7 +1539,7 @@ function psb_s_base_csnmi(a) result(res) integer(psb_ipk_) :: err_act, info integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='csnm1' + character(len=20) :: name='csnmi' real(psb_spk_), allocatable :: vt(:) logical, parameter :: debug=.false. @@ -1661,13 +1560,8 @@ function psb_s_base_csnmi(a) result(res) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_s_base_csnmi @@ -1705,13 +1599,8 @@ function psb_s_base_csnm1(a) result(res) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_s_base_csnm1 @@ -1728,18 +1617,14 @@ subroutine psb_s_base_rowsum(d,a) character(len=20) :: name='rowsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_s_base_rowsum @@ -1755,18 +1640,14 @@ subroutine psb_s_base_arwsum(d,a) character(len=20) :: name='arwsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_s_base_arwsum @@ -1782,18 +1663,14 @@ subroutine psb_s_base_colsum(d,a) character(len=20) :: name='colsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_s_base_colsum @@ -1809,18 +1686,14 @@ subroutine psb_s_base_aclsum(d,a) character(len=20) :: name='aclsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_s_base_aclsum @@ -1840,18 +1713,14 @@ subroutine psb_s_base_get_diag(a,d,info) character(len=20) :: name='get_diag' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_s_base_get_diag @@ -2029,13 +1898,8 @@ subroutine psb_s_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_vect_cssv @@ -2072,15 +1936,9 @@ subroutine psb_s_base_inner_vect_sv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return + +9999 call psb_error_handler(err_act) - -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_base_inner_vect_sv diff --git a/base/serial/impl/psb_s_coo_impl.f90 b/base/serial/impl/psb_s_coo_impl.f90 index 9d5753c5c..f1436e0f8 100644 --- a/base/serial/impl/psb_s_coo_impl.f90 +++ b/base/serial/impl/psb_s_coo_impl.f90 @@ -69,12 +69,8 @@ subroutine psb_s_coo_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_coo_get_diag @@ -143,12 +139,8 @@ subroutine psb_s_coo_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_coo_scal @@ -182,12 +174,8 @@ subroutine psb_s_coo_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_coo_scals @@ -217,13 +205,8 @@ subroutine psb_s_coo_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_reallocate_nz @@ -255,10 +238,9 @@ subroutine psb_s_coo_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine psb_s_coo_mold @@ -302,13 +284,8 @@ subroutine psb_s_coo_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_reinit @@ -337,13 +314,8 @@ subroutine psb_s_coo_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_trim @@ -405,13 +377,8 @@ subroutine psb_s_coo_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_allocate_mnnz @@ -645,13 +612,8 @@ subroutine psb_s_coo_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1004,13 +966,8 @@ subroutine psb_s_coo_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1435,13 +1392,8 @@ subroutine psb_s_coo_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_csmv @@ -1646,13 +1598,8 @@ subroutine psb_s_coo_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_csmm @@ -1824,13 +1771,8 @@ subroutine psb_s_coo_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_rowsum @@ -1876,13 +1818,8 @@ subroutine psb_s_coo_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_arwsum @@ -1929,13 +1866,8 @@ subroutine psb_s_coo_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_colsum @@ -1982,13 +1914,8 @@ subroutine psb_s_coo_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_coo_aclsum @@ -2096,13 +2023,8 @@ subroutine psb_s_coo_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2374,13 +2296,8 @@ subroutine psb_s_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2671,16 +2588,10 @@ subroutine psb_s_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return - contains subroutine psb_inner_ins(nz,ia,ja,val,nza,ia1,ia2,aspk,maxsz,& @@ -2990,14 +2901,8 @@ subroutine psb_s_cp_coo_to_coo(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - call psb_errpush(info,name) - - if (err_act /= psb_act_ret_) then - call psb_error() - end if return end subroutine psb_s_cp_coo_to_coo @@ -3037,13 +2942,10 @@ subroutine psb_s_cp_coo_from_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_cp_coo_from_coo @@ -3074,13 +2976,10 @@ subroutine psb_s_cp_coo_to_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_cp_coo_to_fmt @@ -3111,13 +3010,10 @@ subroutine psb_s_cp_coo_from_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_cp_coo_from_fmt @@ -3155,13 +3051,10 @@ subroutine psb_s_mv_coo_to_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_mv_coo_to_coo @@ -3198,13 +3091,10 @@ subroutine psb_s_mv_coo_from_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_mv_coo_from_coo @@ -3235,13 +3125,10 @@ subroutine psb_s_mv_coo_to_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_mv_coo_to_fmt @@ -3272,13 +3159,10 @@ subroutine psb_s_mv_coo_from_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_mv_coo_from_fmt @@ -3306,13 +3190,10 @@ subroutine psb_s_coo_cp_from(a,b) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_coo_cp_from @@ -3340,13 +3221,10 @@ subroutine psb_s_coo_mv_from(a,b) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_s_coo_mv_from @@ -3403,12 +3281,8 @@ subroutine psb_s_fix_coo(a,info,idir) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_fix_coo @@ -4120,12 +3994,8 @@ subroutine psb_s_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_fix_coo_inner diff --git a/base/serial/impl/psb_s_csc_impl.f90 b/base/serial/impl/psb_s_csc_impl.f90 index c925defaf..d13020ed9 100644 --- a/base/serial/impl/psb_s_csc_impl.f90 +++ b/base/serial/impl/psb_s_csc_impl.f90 @@ -312,13 +312,9 @@ subroutine psb_s_csc_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_csc_csmv @@ -598,13 +594,9 @@ subroutine psb_s_csc_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_csc_csmm @@ -712,13 +704,8 @@ subroutine psb_s_csc_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -940,13 +927,8 @@ subroutine psb_s_csc_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1174,13 +1156,8 @@ subroutine psb_s_csc_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_colsum @@ -1233,13 +1210,8 @@ subroutine psb_s_csc_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_aclsum @@ -1287,13 +1259,8 @@ subroutine psb_s_csc_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_rowsum @@ -1341,13 +1308,8 @@ subroutine psb_s_csc_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_arwsum @@ -1398,12 +1360,8 @@ subroutine psb_s_csc_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_csc_get_diag @@ -1472,12 +1430,8 @@ subroutine psb_s_csc_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_csc_scal @@ -1511,12 +1465,8 @@ subroutine psb_s_csc_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_csc_scals @@ -1621,13 +1571,8 @@ subroutine psb_s_csc_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1815,13 +1760,8 @@ subroutine psb_s_csc_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2007,13 +1947,8 @@ subroutine psb_s_csc_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -2595,10 +2530,9 @@ subroutine psb_s_csc_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine psb_s_csc_mold @@ -2628,13 +2562,8 @@ subroutine psb_s_csc_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_reallocate_nz @@ -2690,13 +2619,8 @@ subroutine psb_s_csc_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_csgetblk @@ -2740,13 +2664,8 @@ subroutine psb_s_csc_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_reinit @@ -2774,13 +2693,8 @@ subroutine psb_s_csc_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_trim @@ -2840,13 +2754,8 @@ subroutine psb_s_csc_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csc_allocate_mnnz @@ -2968,12 +2877,8 @@ subroutine psb_scscspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index 338b57a6b..ed0a49824 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -112,13 +112,8 @@ subroutine psb_s_csr_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -467,13 +462,9 @@ subroutine psb_s_csr_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains @@ -846,13 +837,8 @@ subroutine psb_s_csr_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1105,13 +1091,8 @@ subroutine psb_s_csr_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1369,13 +1350,8 @@ subroutine psb_s_csr_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_rowsum @@ -1423,13 +1399,8 @@ subroutine psb_s_csr_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_arwsum @@ -1480,13 +1451,8 @@ subroutine psb_s_csr_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_colsum @@ -1537,13 +1503,8 @@ subroutine psb_s_csr_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_aclsum @@ -1762,13 +1723,8 @@ subroutine psb_s_csr_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_reallocate_nz @@ -1863,13 +1819,8 @@ subroutine psb_s_csr_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_allocate_mnnz @@ -1962,13 +1913,8 @@ subroutine psb_s_csr_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2142,13 +2088,8 @@ subroutine psb_s_csr_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2286,13 +2227,8 @@ subroutine psb_s_csr_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_csgetblk @@ -2383,13 +2319,8 @@ subroutine psb_s_csr_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -2607,13 +2538,8 @@ subroutine psb_s_csr_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_reinit @@ -2642,13 +2568,8 @@ subroutine psb_s_csr_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csr_trim @@ -2781,9 +2702,9 @@ subroutine psb_s_cp_csr_from_coo(a,b,info) ! Dirty trick: call move_alloc to have the new data allocated just once. call psb_safe_ab_cpy(b%ia,itemp,info) - if (info /= psb_success_) call psb_safe_ab_cpy(b%ja,a%ja,info) - if (info /= psb_success_) call psb_safe_ab_cpy(b%val,a%val,info) - if (info /= psb_success_) call psb_realloc(max(nr+1,nc+1),a%irp,info) + if (info == psb_success_) call psb_safe_ab_cpy(b%ja,a%ja,info) + if (info == psb_success_) call psb_safe_ab_cpy(b%val,a%val,info) + if (info == psb_success_) call psb_realloc(max(nr+1,nc+1),a%irp,info) endif @@ -3220,12 +3141,8 @@ subroutine psb_scsrspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/impl/psb_s_mat_impl.F90 b/base/serial/impl/psb_s_mat_impl.F90 index 694d8163e..11029af09 100644 --- a/base/serial/impl/psb_s_mat_impl.F90 +++ b/base/serial/impl/psb_s_mat_impl.F90 @@ -77,14 +77,9 @@ subroutine psb_s_set_nrows(m,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_set_nrows @@ -110,14 +105,9 @@ subroutine psb_s_set_ncols(n,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_set_ncols @@ -152,14 +142,9 @@ subroutine psb_s_set_dupl(n,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_set_dupl @@ -189,14 +174,9 @@ subroutine psb_s_set_null(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_set_null @@ -222,13 +202,10 @@ subroutine psb_s_set_bld(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_set_bld @@ -254,13 +231,10 @@ subroutine psb_s_set_upd(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_set_upd @@ -287,13 +261,10 @@ subroutine psb_s_set_asb(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_set_asb @@ -320,13 +291,10 @@ subroutine psb_s_set_sorted(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_set_sorted @@ -353,13 +321,10 @@ subroutine psb_s_set_triangle(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_set_triangle @@ -386,13 +351,10 @@ subroutine psb_s_set_unit(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_set_unit @@ -419,13 +381,10 @@ subroutine psb_s_set_lower(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_set_lower @@ -452,13 +411,10 @@ subroutine psb_s_set_upper(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_set_upper @@ -504,12 +460,8 @@ subroutine psb_s_sparse_print(iout,a,iv,head,ivr,ivc) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_sparse_print @@ -559,12 +511,8 @@ subroutine psb_s_n_sparse_print(fname,a,iv,head,ivr,ivc) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_n_sparse_print @@ -600,13 +548,8 @@ subroutine psb_s_get_neigh(a,idx,neigh,n,info,lev) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_get_neigh @@ -643,12 +586,8 @@ subroutine psb_s_csall(nr,nc,a,info,nz) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csall @@ -675,13 +614,8 @@ subroutine psb_s_reallocate_nz(nz,a) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_reallocate_nz @@ -721,12 +655,8 @@ subroutine psb_s_trim(a) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_trim @@ -763,13 +693,10 @@ subroutine psb_s_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_csput_a @@ -810,13 +737,10 @@ subroutine psb_s_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_csput_v @@ -860,13 +784,10 @@ subroutine psb_s_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_csgetptn @@ -911,13 +832,10 @@ subroutine psb_s_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_csgetrow @@ -980,13 +898,10 @@ subroutine psb_s_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_csgetblk @@ -1033,13 +948,10 @@ subroutine psb_s_tril(a,b,info,diag,imin,imax,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_tril @@ -1087,13 +999,10 @@ subroutine psb_s_triu(a,b,info,diag,imin,imax,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_triu @@ -1142,13 +1051,10 @@ subroutine psb_s_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_csclip @@ -1187,13 +1093,10 @@ subroutine psb_s_b_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_b_csclip @@ -1296,13 +1199,10 @@ subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_cscnv @@ -1402,13 +1302,10 @@ subroutine psb_s_cscnv_ip(a,info,type,mold,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_cscnv_ip @@ -1457,13 +1354,10 @@ subroutine psb_s_cscnv_base(a,b,info,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_cscnv_base @@ -1520,13 +1414,10 @@ subroutine psb_s_clip_d(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_clip_d @@ -1582,13 +1473,10 @@ subroutine psb_s_clip_d_ip(a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_clip_d_ip @@ -1647,13 +1535,10 @@ subroutine psb_s_cp_from(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_cp_from @@ -1744,13 +1629,10 @@ subroutine psb_sspmat_clone(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_sspmat_clone @@ -1779,13 +1661,10 @@ subroutine psb_s_transp_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_transp_1mat @@ -1825,13 +1704,10 @@ subroutine psb_s_transp_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_transp_2mat @@ -1860,13 +1736,10 @@ subroutine psb_s_transc_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_transc_1mat @@ -1906,13 +1779,10 @@ subroutine psb_s_transc_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_transc_2mat @@ -1949,13 +1819,10 @@ subroutine psb_s_asb(a,mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_asb @@ -1987,13 +1854,10 @@ subroutine psb_s_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_s_reinit @@ -2040,13 +1904,8 @@ subroutine psb_s_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csmm @@ -2078,13 +1937,8 @@ subroutine psb_s_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csmv @@ -2128,13 +1982,8 @@ subroutine psb_s_csmv_vect(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_csmv_vect @@ -2169,13 +2018,8 @@ subroutine psb_s_cssm(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_cssm @@ -2210,13 +2054,8 @@ subroutine psb_s_cssv(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_cssv @@ -2271,13 +2110,8 @@ subroutine psb_s_cssv_vect(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_cssv_vect @@ -2306,12 +2140,9 @@ function psb_s_maxval(a) result(res) res = a%a%maxval() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_s_maxval @@ -2339,12 +2170,9 @@ function psb_s_csnmi(a) result(res) res = a%a%spnmi() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_s_csnmi @@ -2373,12 +2201,9 @@ function psb_s_csnm1(a) result(res) res = a%a%spnm1() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_s_csnm1 @@ -2411,13 +2236,8 @@ function psb_s_rowsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_s_rowsum @@ -2450,13 +2270,8 @@ function psb_s_arwsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_s_arwsum @@ -2489,13 +2304,8 @@ function psb_s_colsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_s_colsum @@ -2528,13 +2338,8 @@ function psb_s_aclsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_s_aclsum @@ -2572,13 +2377,8 @@ function psb_s_get_diag(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_s_get_diag @@ -2612,13 +2412,8 @@ subroutine psb_s_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_scal @@ -2651,13 +2446,8 @@ subroutine psb_s_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_s_scals diff --git a/base/serial/impl/psb_z_base_mat_impl.F90 b/base/serial/impl/psb_z_base_mat_impl.F90 index a26ee37f0..27db9345d 100644 --- a/base/serial/impl/psb_z_base_mat_impl.F90 +++ b/base/serial/impl/psb_z_base_mat_impl.F90 @@ -55,17 +55,14 @@ subroutine psb_z_base_cp_to_coo(a,b,info) character(len=20) :: name='to_coo' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_cp_to_coo @@ -83,17 +80,14 @@ subroutine psb_z_base_cp_from_coo(a,b,info) character(len=20) :: name='from_coo' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_cp_from_coo @@ -131,14 +125,8 @@ subroutine psb_z_base_cp_to_fmt(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if - return return end subroutine psb_z_base_cp_to_fmt @@ -177,13 +165,8 @@ subroutine psb_z_base_cp_from_fmt(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_cp_from_fmt @@ -221,13 +204,8 @@ subroutine psb_z_base_mv_to_coo(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_mv_to_coo @@ -263,13 +241,8 @@ subroutine psb_z_base_mv_from_coo(a,b,info) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_mv_from_coo @@ -342,17 +315,14 @@ subroutine psb_z_base_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) character(len=20) :: name='csput' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_csput_a @@ -394,13 +364,8 @@ subroutine psb_z_base_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_csput_v @@ -428,17 +393,14 @@ subroutine psb_z_base_csgetrow(imin,imax,a,nz,ia,ja,val,info,& character(len=20) :: name='csget' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_csgetrow @@ -536,13 +498,8 @@ subroutine psb_z_base_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_csgetblk @@ -626,13 +583,8 @@ subroutine psb_z_base_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_csclip @@ -742,13 +694,8 @@ subroutine psb_z_base_tril(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_tril @@ -852,13 +799,8 @@ subroutine psb_z_base_triu(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_triu @@ -938,17 +880,14 @@ subroutine psb_z_base_mold(a,b,info) character(len=20) :: name='base_mold' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_mold @@ -984,10 +923,8 @@ subroutine psb_z_base_transp_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1024,10 +961,8 @@ subroutine psb_z_base_transc_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return end subroutine psb_z_base_transc_2mat @@ -1058,10 +993,8 @@ subroutine psb_z_base_transp_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1092,10 +1025,8 @@ subroutine psb_z_base_transc_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return @@ -1131,17 +1062,14 @@ subroutine psb_z_base_csmm(alpha,a,x,beta,y,info,trans) character(len=20) :: name='z_base_csmm' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_csmm @@ -1161,17 +1089,14 @@ subroutine psb_z_base_csmv(alpha,a,x,beta,y,info,trans) character(len=20) :: name='z_base_csmv' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_csmv @@ -1192,17 +1117,14 @@ subroutine psb_z_base_inner_cssm(alpha,a,x,beta,y,info,trans) character(len=20) :: name='z_base_inner_cssm' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_inner_cssm @@ -1222,17 +1144,14 @@ subroutine psb_z_base_inner_cssv(alpha,a,x,beta,y,info,trans) character(len=20) :: name='z_base_inner_cssv' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_inner_cssv @@ -1365,13 +1284,8 @@ subroutine psb_z_base_cssm(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1501,13 +1415,8 @@ subroutine psb_z_base_cssv(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains subroutine inner_vscal(n,d,x,y) @@ -1551,17 +1460,14 @@ subroutine psb_z_base_scals(d,a,info) character(len=20) :: name='z_scals' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_scals @@ -1581,17 +1487,14 @@ subroutine psb_z_base_scal(d,a,info,side) character(len=20) :: name='z_scal' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - return + call psb_error_handler(err_act) end subroutine psb_z_base_scal @@ -1611,19 +1514,15 @@ function psb_z_base_maxval(a) result(res) character(len=20) :: name='maxval' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) + res = dzero ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - res = dzero - - return + call psb_error_handler(err_act) end function psb_z_base_maxval @@ -1640,7 +1539,7 @@ function psb_z_base_csnmi(a) result(res) integer(psb_ipk_) :: err_act, info integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='csnm1' + character(len=20) :: name='csnmi' real(psb_dpk_), allocatable :: vt(:) logical, parameter :: debug=.false. @@ -1661,13 +1560,8 @@ function psb_z_base_csnmi(a) result(res) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_z_base_csnmi @@ -1705,13 +1599,8 @@ function psb_z_base_csnm1(a) result(res) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_z_base_csnm1 @@ -1728,18 +1617,14 @@ subroutine psb_z_base_rowsum(d,a) character(len=20) :: name='rowsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_z_base_rowsum @@ -1755,18 +1640,14 @@ subroutine psb_z_base_arwsum(d,a) character(len=20) :: name='arwsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_z_base_arwsum @@ -1782,18 +1663,14 @@ subroutine psb_z_base_colsum(d,a) character(len=20) :: name='colsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_z_base_colsum @@ -1809,18 +1686,14 @@ subroutine psb_z_base_aclsum(d,a) character(len=20) :: name='aclsum' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_z_base_aclsum @@ -1840,18 +1713,14 @@ subroutine psb_z_base_get_diag(a,d,info) character(len=20) :: name='get_diag' logical, parameter :: debug=.false. - call psb_get_erraction(err_act) + call psb_erractionsave(err_act) ! This is the base version. If we get here ! it means the derived class is incomplete, ! so we throw an error. info = psb_err_missing_override_method_ call psb_errpush(info,name,a_err=a%get_fmt()) - if (err_act /= psb_act_ret_) then - call psb_error() - end if - - return + call psb_error_handler(err_act) end subroutine psb_z_base_get_diag @@ -2029,13 +1898,8 @@ subroutine psb_z_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_vect_cssv @@ -2072,15 +1936,9 @@ subroutine psb_z_base_inner_vect_sv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return + +9999 call psb_error_handler(err_act) - -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_base_inner_vect_sv diff --git a/base/serial/impl/psb_z_coo_impl.f90 b/base/serial/impl/psb_z_coo_impl.f90 index 22c6565cf..a894eb648 100644 --- a/base/serial/impl/psb_z_coo_impl.f90 +++ b/base/serial/impl/psb_z_coo_impl.f90 @@ -69,12 +69,8 @@ subroutine psb_z_coo_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_coo_get_diag @@ -143,12 +139,8 @@ subroutine psb_z_coo_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_coo_scal @@ -182,12 +174,8 @@ subroutine psb_z_coo_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_coo_scals @@ -217,13 +205,8 @@ subroutine psb_z_coo_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_reallocate_nz @@ -255,10 +238,9 @@ subroutine psb_z_coo_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine psb_z_coo_mold @@ -302,13 +284,8 @@ subroutine psb_z_coo_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_reinit @@ -337,13 +314,8 @@ subroutine psb_z_coo_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_trim @@ -405,13 +377,8 @@ subroutine psb_z_coo_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_allocate_mnnz @@ -645,13 +612,8 @@ subroutine psb_z_coo_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1004,13 +966,8 @@ subroutine psb_z_coo_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1435,13 +1392,8 @@ subroutine psb_z_coo_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_csmv @@ -1646,13 +1598,8 @@ subroutine psb_z_coo_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_csmm @@ -1824,13 +1771,8 @@ subroutine psb_z_coo_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_rowsum @@ -1876,13 +1818,8 @@ subroutine psb_z_coo_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_arwsum @@ -1929,13 +1866,8 @@ subroutine psb_z_coo_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_colsum @@ -1982,13 +1914,8 @@ subroutine psb_z_coo_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_coo_aclsum @@ -2096,13 +2023,8 @@ subroutine psb_z_coo_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2374,13 +2296,8 @@ subroutine psb_z_coo_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2671,16 +2588,10 @@ subroutine psb_z_coo_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return - contains subroutine psb_inner_ins(nz,ia,ja,val,nza,ia1,ia2,aspk,maxsz,& @@ -2990,14 +2901,8 @@ subroutine psb_z_cp_coo_to_coo(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - call psb_errpush(info,name) - - if (err_act /= psb_act_ret_) then - call psb_error() - end if return end subroutine psb_z_cp_coo_to_coo @@ -3037,13 +2942,10 @@ subroutine psb_z_cp_coo_from_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_cp_coo_from_coo @@ -3074,13 +2976,10 @@ subroutine psb_z_cp_coo_to_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_cp_coo_to_fmt @@ -3111,13 +3010,10 @@ subroutine psb_z_cp_coo_from_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_cp_coo_from_fmt @@ -3155,13 +3051,10 @@ subroutine psb_z_mv_coo_to_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_mv_coo_to_coo @@ -3198,13 +3091,10 @@ subroutine psb_z_mv_coo_from_coo(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_mv_coo_from_coo @@ -3235,13 +3125,10 @@ subroutine psb_z_mv_coo_to_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_mv_coo_to_fmt @@ -3272,13 +3159,10 @@ subroutine psb_z_mv_coo_from_fmt(a,b,info) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_mv_coo_from_fmt @@ -3306,13 +3190,10 @@ subroutine psb_z_coo_cp_from(a,b) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_coo_cp_from @@ -3340,13 +3221,10 @@ subroutine psb_z_coo_mv_from(a,b) return 9999 continue - call psb_erractionrestore(err_act) - call psb_errpush(info,name) - if (err_act /= psb_act_ret_) then - call psb_error() - end if + call psb_error_handler(err_act) + return end subroutine psb_z_coo_mv_from @@ -3403,12 +3281,8 @@ subroutine psb_z_fix_coo(a,info,idir) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_fix_coo @@ -4120,12 +3994,8 @@ subroutine psb_z_fix_coo_inner(nr,nc,nzin,dupl,ia,ja,val,nzout,info,idir) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_fix_coo_inner diff --git a/base/serial/impl/psb_z_csc_impl.f90 b/base/serial/impl/psb_z_csc_impl.f90 index 802fc9b69..8dc1c8a27 100644 --- a/base/serial/impl/psb_z_csc_impl.f90 +++ b/base/serial/impl/psb_z_csc_impl.f90 @@ -312,13 +312,9 @@ subroutine psb_z_csc_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_csc_csmv @@ -598,13 +594,9 @@ subroutine psb_z_csc_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_csc_csmm @@ -712,13 +704,8 @@ subroutine psb_z_csc_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -940,13 +927,8 @@ subroutine psb_z_csc_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1174,13 +1156,8 @@ subroutine psb_z_csc_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_colsum @@ -1233,13 +1210,8 @@ subroutine psb_z_csc_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_aclsum @@ -1287,13 +1259,8 @@ subroutine psb_z_csc_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_rowsum @@ -1341,13 +1308,8 @@ subroutine psb_z_csc_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_arwsum @@ -1398,12 +1360,8 @@ subroutine psb_z_csc_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_csc_get_diag @@ -1472,12 +1430,8 @@ subroutine psb_z_csc_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_csc_scal @@ -1511,12 +1465,8 @@ subroutine psb_z_csc_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_csc_scals @@ -1621,13 +1571,8 @@ subroutine psb_z_csc_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1815,13 +1760,8 @@ subroutine psb_z_csc_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2007,13 +1947,8 @@ subroutine psb_z_csc_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -2595,10 +2530,9 @@ subroutine psb_z_csc_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) + return end subroutine psb_z_csc_mold @@ -2628,13 +2562,8 @@ subroutine psb_z_csc_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_reallocate_nz @@ -2690,13 +2619,8 @@ subroutine psb_z_csc_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_csgetblk @@ -2740,13 +2664,8 @@ subroutine psb_z_csc_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_reinit @@ -2774,13 +2693,8 @@ subroutine psb_z_csc_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_trim @@ -2840,13 +2754,8 @@ subroutine psb_z_csc_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csc_allocate_mnnz @@ -2968,12 +2877,8 @@ subroutine psb_zcscspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index bf0027add..d9e9cb89d 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -112,13 +112,8 @@ subroutine psb_z_csr_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -467,13 +462,9 @@ subroutine psb_z_csr_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains @@ -846,13 +837,8 @@ subroutine psb_z_csr_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -1105,13 +1091,8 @@ subroutine psb_z_csr_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -1369,13 +1350,8 @@ subroutine psb_z_csr_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_rowsum @@ -1423,13 +1399,8 @@ subroutine psb_z_csr_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_arwsum @@ -1480,13 +1451,8 @@ subroutine psb_z_csr_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_colsum @@ -1537,13 +1503,8 @@ subroutine psb_z_csr_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_aclsum @@ -1762,13 +1723,8 @@ subroutine psb_z_csr_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_reallocate_nz @@ -1863,13 +1819,8 @@ subroutine psb_z_csr_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_allocate_mnnz @@ -1962,13 +1913,8 @@ subroutine psb_z_csr_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2142,13 +2088,8 @@ subroutine psb_z_csr_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return contains @@ -2286,13 +2227,8 @@ subroutine psb_z_csr_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_csgetblk @@ -2383,13 +2319,8 @@ subroutine psb_z_csr_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return @@ -2607,13 +2538,8 @@ subroutine psb_z_csr_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_reinit @@ -2642,13 +2568,8 @@ subroutine psb_z_csr_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csr_trim @@ -2781,9 +2702,9 @@ subroutine psb_z_cp_csr_from_coo(a,b,info) ! Dirty trick: call move_alloc to have the new data allocated just once. call psb_safe_ab_cpy(b%ia,itemp,info) - if (info /= psb_success_) call psb_safe_ab_cpy(b%ja,a%ja,info) - if (info /= psb_success_) call psb_safe_ab_cpy(b%val,a%val,info) - if (info /= psb_success_) call psb_realloc(max(nr+1,nc+1),a%irp,info) + if (info == psb_success_) call psb_safe_ab_cpy(b%ja,a%ja,info) + if (info == psb_success_) call psb_safe_ab_cpy(b%val,a%val,info) + if (info == psb_success_) call psb_realloc(max(nr+1,nc+1),a%irp,info) endif @@ -3220,12 +3141,8 @@ subroutine psb_zcsrspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/impl/psb_z_mat_impl.F90 b/base/serial/impl/psb_z_mat_impl.F90 index dc1bfb3ef..c8554b8ab 100644 --- a/base/serial/impl/psb_z_mat_impl.F90 +++ b/base/serial/impl/psb_z_mat_impl.F90 @@ -77,14 +77,9 @@ subroutine psb_z_set_nrows(m,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_set_nrows @@ -110,14 +105,9 @@ subroutine psb_z_set_ncols(n,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_set_ncols @@ -152,14 +142,9 @@ subroutine psb_z_set_dupl(n,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_set_dupl @@ -189,14 +174,9 @@ subroutine psb_z_set_null(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_set_null @@ -222,13 +202,10 @@ subroutine psb_z_set_bld(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_set_bld @@ -254,13 +231,10 @@ subroutine psb_z_set_upd(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_set_upd @@ -287,13 +261,10 @@ subroutine psb_z_set_asb(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_set_asb @@ -320,13 +291,10 @@ subroutine psb_z_set_sorted(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_set_sorted @@ -353,13 +321,10 @@ subroutine psb_z_set_triangle(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_set_triangle @@ -386,13 +351,10 @@ subroutine psb_z_set_unit(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_set_unit @@ -419,13 +381,10 @@ subroutine psb_z_set_lower(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_set_lower @@ -452,13 +411,10 @@ subroutine psb_z_set_upper(a,val) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_set_upper @@ -504,12 +460,8 @@ subroutine psb_z_sparse_print(iout,a,iv,head,ivr,ivc) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_sparse_print @@ -559,12 +511,8 @@ subroutine psb_z_n_sparse_print(fname,a,iv,head,ivr,ivc) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_n_sparse_print @@ -600,13 +548,8 @@ subroutine psb_z_get_neigh(a,idx,neigh,n,info,lev) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_get_neigh @@ -643,12 +586,8 @@ subroutine psb_z_csall(nr,nc,a,info,nz) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csall @@ -675,13 +614,8 @@ subroutine psb_z_reallocate_nz(nz,a) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_reallocate_nz @@ -721,12 +655,8 @@ subroutine psb_z_trim(a) return -9999 continue +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_trim @@ -763,13 +693,10 @@ subroutine psb_z_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_csput_a @@ -810,13 +737,10 @@ subroutine psb_z_csput_v(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_csput_v @@ -860,13 +784,10 @@ subroutine psb_z_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_csgetptn @@ -911,13 +832,10 @@ subroutine psb_z_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_csgetrow @@ -980,13 +898,10 @@ subroutine psb_z_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_csgetblk @@ -1033,13 +948,10 @@ subroutine psb_z_tril(a,b,info,diag,imin,imax,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_tril @@ -1087,13 +999,10 @@ subroutine psb_z_triu(a,b,info,diag,imin,imax,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_triu @@ -1142,13 +1051,10 @@ subroutine psb_z_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_csclip @@ -1187,13 +1093,10 @@ subroutine psb_z_b_csclip(a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_b_csclip @@ -1296,13 +1199,10 @@ subroutine psb_z_cscnv(a,b,info,type,mold,upd,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_cscnv @@ -1402,13 +1302,10 @@ subroutine psb_z_cscnv_ip(a,info,type,mold,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_cscnv_ip @@ -1457,13 +1354,10 @@ subroutine psb_z_cscnv_base(a,b,info,dupl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_cscnv_base @@ -1520,13 +1414,10 @@ subroutine psb_z_clip_d(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_clip_d @@ -1582,13 +1473,10 @@ subroutine psb_z_clip_d_ip(a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_clip_d_ip @@ -1647,13 +1535,10 @@ subroutine psb_z_cp_from(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_cp_from @@ -1744,13 +1629,10 @@ subroutine psb_zspmat_clone(a,b,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_zspmat_clone @@ -1779,13 +1661,10 @@ subroutine psb_z_transp_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_transp_1mat @@ -1825,13 +1704,10 @@ subroutine psb_z_transp_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_transp_2mat @@ -1860,13 +1736,10 @@ subroutine psb_z_transc_1mat(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_transc_1mat @@ -1906,13 +1779,10 @@ subroutine psb_z_transc_2mat(a,b) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_transc_2mat @@ -1949,13 +1819,10 @@ subroutine psb_z_asb(a,mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_asb @@ -1987,13 +1854,10 @@ subroutine psb_z_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine psb_z_reinit @@ -2040,13 +1904,8 @@ subroutine psb_z_csmm(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csmm @@ -2078,13 +1937,8 @@ subroutine psb_z_csmv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csmv @@ -2128,13 +1982,8 @@ subroutine psb_z_csmv_vect(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_csmv_vect @@ -2169,13 +2018,8 @@ subroutine psb_z_cssm(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_cssm @@ -2210,13 +2054,8 @@ subroutine psb_z_cssv(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_cssv @@ -2271,13 +2110,8 @@ subroutine psb_z_cssv_vect(alpha,a,x,beta,y,info,trans,scale,d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_cssv_vect @@ -2306,12 +2140,9 @@ function psb_z_maxval(a) result(res) res = a%a%maxval() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_z_maxval @@ -2339,12 +2170,9 @@ function psb_z_csnmi(a) result(res) res = a%a%spnmi() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_z_csnmi @@ -2373,12 +2201,9 @@ function psb_z_csnm1(a) result(res) res = a%a%spnm1() return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end function psb_z_csnm1 @@ -2411,13 +2236,8 @@ function psb_z_rowsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_z_rowsum @@ -2450,13 +2270,8 @@ function psb_z_arwsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_z_arwsum @@ -2489,13 +2304,8 @@ function psb_z_colsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_z_colsum @@ -2528,13 +2338,8 @@ function psb_z_aclsum(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_z_aclsum @@ -2572,13 +2377,8 @@ function psb_z_get_diag(a,info) result(d) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end function psb_z_get_diag @@ -2612,13 +2412,8 @@ subroutine psb_z_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_scal @@ -2651,13 +2446,8 @@ subroutine psb_z_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psb_z_scals diff --git a/base/serial/psb_cgelp.f90 b/base/serial/psb_cgelp.f90 index e5b0feb8f..282819055 100644 --- a/base/serial/psb_cgelp.f90 +++ b/base/serial/psb_cgelp.f90 @@ -117,14 +117,8 @@ subroutine psb_cgelp(trans,iperm,x,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_cgelp @@ -210,7 +204,7 @@ subroutine psb_cgelpv(trans,iperm,x,info) goto 9999 end if itemp(:) = iperm(:) - + if (.not.psb_isaperm(i1sz,itemp)) then info=psb_err_iarg_invalid_value_ int_err(1) = 1 @@ -244,14 +238,8 @@ subroutine psb_cgelpv(trans,iperm,x,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_cgelpv diff --git a/base/serial/psb_cnumbmm.f90 b/base/serial/psb_cnumbmm.f90 index 0bfa7e346..3de7e5710 100644 --- a/base/serial/psb_cnumbmm.f90 +++ b/base/serial/psb_cnumbmm.f90 @@ -73,12 +73,8 @@ subroutine psb_cnumbmm(a,b,c) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_cnumbmm @@ -146,12 +142,8 @@ subroutine psb_cbase_numbmm(a,b,c) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/psb_cspspmm.f90 b/base/serial/psb_cspspmm.f90 index 8d39ea724..9b537320f 100644 --- a/base/serial/psb_cspspmm.f90 +++ b/base/serial/psb_cspspmm.f90 @@ -109,12 +109,8 @@ subroutine psb_cspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_cspspmm diff --git a/base/serial/psb_csymbmm.f90 b/base/serial/psb_csymbmm.f90 index 85df14eb3..17712077d 100644 --- a/base/serial/psb_csymbmm.f90 +++ b/base/serial/psb_csymbmm.f90 @@ -75,12 +75,8 @@ subroutine psb_csymbmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_csymbmm @@ -143,12 +139,8 @@ subroutine psb_cbase_symbmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/psb_dgelp.f90 b/base/serial/psb_dgelp.f90 index 6533358e2..26a3e9135 100644 --- a/base/serial/psb_dgelp.f90 +++ b/base/serial/psb_dgelp.f90 @@ -117,14 +117,8 @@ subroutine psb_dgelp(trans,iperm,x,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_dgelp @@ -210,7 +204,7 @@ subroutine psb_dgelpv(trans,iperm,x,info) goto 9999 end if itemp(:) = iperm(:) - + if (.not.psb_isaperm(i1sz,itemp)) then info=psb_err_iarg_invalid_value_ int_err(1) = 1 @@ -244,14 +238,8 @@ subroutine psb_dgelpv(trans,iperm,x,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_dgelpv diff --git a/base/serial/psb_dnumbmm.f90 b/base/serial/psb_dnumbmm.f90 index 22117398c..1924acdab 100644 --- a/base/serial/psb_dnumbmm.f90 +++ b/base/serial/psb_dnumbmm.f90 @@ -73,12 +73,8 @@ subroutine psb_dnumbmm(a,b,c) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_dnumbmm @@ -146,12 +142,8 @@ subroutine psb_dbase_numbmm(a,b,c) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/psb_dspspmm.f90 b/base/serial/psb_dspspmm.f90 index 251a2d2de..a8963d484 100644 --- a/base/serial/psb_dspspmm.f90 +++ b/base/serial/psb_dspspmm.f90 @@ -109,12 +109,8 @@ subroutine psb_dspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_dspspmm diff --git a/base/serial/psb_dsymbmm.f90 b/base/serial/psb_dsymbmm.f90 index 626ece114..7733077b1 100644 --- a/base/serial/psb_dsymbmm.f90 +++ b/base/serial/psb_dsymbmm.f90 @@ -75,12 +75,8 @@ subroutine psb_dsymbmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_dsymbmm @@ -143,12 +139,8 @@ subroutine psb_dbase_symbmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/psb_sgelp.f90 b/base/serial/psb_sgelp.f90 index 606e76470..6a04314a4 100644 --- a/base/serial/psb_sgelp.f90 +++ b/base/serial/psb_sgelp.f90 @@ -117,14 +117,8 @@ subroutine psb_sgelp(trans,iperm,x,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_sgelp @@ -245,14 +239,8 @@ subroutine psb_sgelpv(trans,iperm,x,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_sgelpv diff --git a/base/serial/psb_snumbmm.f90 b/base/serial/psb_snumbmm.f90 index 311c1b076..21a0af4e2 100644 --- a/base/serial/psb_snumbmm.f90 +++ b/base/serial/psb_snumbmm.f90 @@ -73,12 +73,8 @@ subroutine psb_snumbmm(a,b,c) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_snumbmm @@ -146,12 +142,8 @@ subroutine psb_sbase_numbmm(a,b,c) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/psb_sort_impl.f90 b/base/serial/psb_sort_impl.f90 index ff9938a2e..153023633 100644 --- a/base/serial/psb_sort_impl.f90 +++ b/base/serial/psb_sort_impl.f90 @@ -208,7 +208,7 @@ subroutine imsort(x,ix,dir,flag) dir_= psb_sort_up_ end if select case(dir_) - case( psb_sort_up_, psb_sort_down_) + case( psb_sort_up_, psb_sort_down_, psb_asort_up_, psb_asort_down_) ! OK keep going case default ierr(1) = 3; ierr(2) = dir_; @@ -242,12 +242,12 @@ subroutine imsort(x,ix,dir,flag) else call imsr(n,x,dir_) end if + + return -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + + return end subroutine imsort @@ -273,7 +273,7 @@ subroutine smsort(x,ix,dir,flag) dir_= psb_sort_up_ end if select case(dir_) - case( psb_sort_up_, psb_sort_down_) + case( psb_sort_up_, psb_sort_down_, psb_asort_up_, psb_asort_down_) ! OK keep going case default ierr(1) = 3; ierr(2) = dir_; @@ -308,11 +308,11 @@ subroutine smsort(x,ix,dir,flag) call smsr(n,x,dir_) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine smsort subroutine dmsort(x,ix,dir,flag) @@ -337,7 +337,7 @@ subroutine dmsort(x,ix,dir,flag) dir_= psb_sort_up_ end if select case(dir_) - case( psb_sort_up_, psb_sort_down_) + case( psb_sort_up_, psb_sort_down_, psb_asort_up_, psb_asort_down_) ! OK keep going case default ierr(1) = 3; ierr(2) = dir_; @@ -372,11 +372,11 @@ subroutine dmsort(x,ix,dir,flag) call dmsr(n,x,dir_) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine dmsort subroutine camsort(x,ix,dir,flag) @@ -436,11 +436,11 @@ subroutine camsort(x,ix,dir,flag) call camsr(n,x,dir_) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine camsort subroutine zamsort(x,ix,dir,flag) @@ -500,11 +500,11 @@ subroutine zamsort(x,ix,dir,flag) call zamsr(n,x,dir_) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine zamsort @@ -530,7 +530,7 @@ subroutine imsort_u(x,nout,dir) dir_= psb_sort_up_ end if select case(dir_) - case( psb_sort_up_, psb_sort_down_) + case( psb_sort_up_, psb_sort_down_, psb_asort_up_, psb_asort_down_) ! OK keep going case default ierr(1) = 3; ierr(2) = dir_; @@ -543,11 +543,11 @@ subroutine imsort_u(x,nout,dir) call imsru(n,x,dir_,nout) -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine imsort_u @@ -625,11 +625,11 @@ subroutine iqsort(x,ix,dir,flag) -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine iqsort @@ -707,11 +707,11 @@ subroutine sqsort(x,ix,dir,flag) -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine sqsort subroutine dqsort(x,ix,dir,flag) @@ -788,11 +788,11 @@ subroutine dqsort(x,ix,dir,flag) -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine dqsort @@ -884,11 +884,11 @@ subroutine cqsort(x,ix,dir,flag) -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine cqsort @@ -980,11 +980,11 @@ subroutine zqsort(x,ix,dir,flag) -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine zqsort @@ -1095,11 +1095,11 @@ subroutine ihsort(x,ix,dir,flag) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine ihsort @@ -1208,11 +1208,11 @@ subroutine shsort(x,ix,dir,flag) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine shsort @@ -1321,11 +1321,11 @@ subroutine dhsort(x,ix,dir,flag) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine dhsort @@ -1434,11 +1434,11 @@ subroutine chsort(x,ix,dir,flag) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine chsort @@ -1547,11 +1547,11 @@ subroutine zhsort(x,ix,dir,flag) end if -9999 continue - if (err_act == psb_act_abort_) then - call psb_error() - return - end if + return + +9999 call psb_error_handler(err_act) + + return end subroutine zhsort diff --git a/base/serial/psb_sspspmm.f90 b/base/serial/psb_sspspmm.f90 index 9c31bc17e..98552c705 100644 --- a/base/serial/psb_sspspmm.f90 +++ b/base/serial/psb_sspspmm.f90 @@ -109,12 +109,8 @@ subroutine psb_sspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_sspspmm diff --git a/base/serial/psb_ssymbmm.f90 b/base/serial/psb_ssymbmm.f90 index 1b47a5bfe..bc84c0085 100644 --- a/base/serial/psb_ssymbmm.f90 +++ b/base/serial/psb_ssymbmm.f90 @@ -75,12 +75,8 @@ subroutine psb_ssymbmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_ssymbmm @@ -143,12 +139,8 @@ subroutine psb_sbase_symbmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/psb_zgelp.f90 b/base/serial/psb_zgelp.f90 index 3ad4c71bc..04f078141 100644 --- a/base/serial/psb_zgelp.f90 +++ b/base/serial/psb_zgelp.f90 @@ -117,14 +117,8 @@ subroutine psb_zgelp(trans,iperm,x,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_zgelp @@ -210,7 +204,7 @@ subroutine psb_zgelpv(trans,iperm,x,info) goto 9999 end if itemp(:) = iperm(:) - + if (.not.psb_isaperm(i1sz,itemp)) then info=psb_err_iarg_invalid_value_ int_err(1) = 1 @@ -244,14 +238,8 @@ subroutine psb_zgelpv(trans,iperm,x,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_zgelpv diff --git a/base/serial/psb_znumbmm.f90 b/base/serial/psb_znumbmm.f90 index 7dad5adf8..ebc64f3bd 100644 --- a/base/serial/psb_znumbmm.f90 +++ b/base/serial/psb_znumbmm.f90 @@ -73,12 +73,8 @@ subroutine psb_znumbmm(a,b,c) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_znumbmm @@ -146,12 +142,8 @@ subroutine psb_zbase_numbmm(a,b,c) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/psb_zspspmm.f90 b/base/serial/psb_zspspmm.f90 index 7b7fd1a15..706dea614 100644 --- a/base/serial/psb_zspspmm.f90 +++ b/base/serial/psb_zspspmm.f90 @@ -109,12 +109,8 @@ subroutine psb_zspspmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_zspspmm diff --git a/base/serial/psb_zsymbmm.f90 b/base/serial/psb_zsymbmm.f90 index 3799d0ccc..6ae462cf7 100644 --- a/base/serial/psb_zsymbmm.f90 +++ b/base/serial/psb_zsymbmm.f90 @@ -75,12 +75,8 @@ subroutine psb_zsymbmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_zsymbmm @@ -143,12 +139,8 @@ subroutine psb_zbase_symbmm(a,b,c,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return contains diff --git a/base/serial/psi_serial_impl.f90 b/base/serial/psi_serial_impl.f90 index fb6243f33..fdcd1b862 100644 --- a/base/serial/psi_serial_impl.f90 +++ b/base/serial/psi_serial_impl.f90 @@ -891,13 +891,8 @@ subroutine psi_iaxpbyv(m,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_iaxpbyv @@ -952,13 +947,8 @@ subroutine psi_iaxpby(m,n,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_iaxpby @@ -1009,13 +999,8 @@ subroutine psi_saxpbyv(m,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_saxpbyv @@ -1070,13 +1055,8 @@ subroutine psi_saxpby(m,n,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_saxpby @@ -1126,13 +1106,8 @@ subroutine psi_daxpbyv(m,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_daxpbyv @@ -1187,13 +1162,8 @@ subroutine psi_daxpby(m,n,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_daxpby @@ -1242,13 +1212,8 @@ subroutine psi_caxpbyv(m,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_caxpbyv @@ -1303,13 +1268,8 @@ subroutine psi_caxpby(m,n,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_caxpby @@ -1358,13 +1318,8 @@ subroutine psi_zaxpbyv(m,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_zaxpbyv @@ -1419,13 +1374,8 @@ subroutine psi_zaxpby(m,n,alpha, x, beta, y, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if return end subroutine psi_zaxpby diff --git a/base/tools/Makefile b/base/tools/Makefile index 1a87195ed..c9d4cf8a7 100644 --- a/base/tools/Makefile +++ b/base/tools/Makefile @@ -11,7 +11,7 @@ FOBJS = psb_sallc.o psb_sasb.o \ psb_dspfree.o psb_dspins.o psb_dsprn.o \ psb_sspalloc.o psb_sspasb.o \ psb_sspfree.o psb_sspins.o psb_ssprn.o\ - psb_glob_to_loc.o psb_ialloc.o psb_iasb.o \ + psb_glob_to_loc.o psb_iallc.o psb_iasb.o \ psb_ifree.o psb_iins.o psb_loc_to_glob.o\ psb_zallc.o psb_zasb.o psb_zfree.o psb_zins.o \ psb_zspalloc.o psb_zspasb.o psb_zspfree.o\ diff --git a/base/tools/psb_callc.f90 b/base/tools/psb_callc.f90 index f0635d325..c3930961b 100644 --- a/base/tools/psb_callc.f90 +++ b/base/tools/psb_callc.f90 @@ -111,7 +111,7 @@ subroutine psb_calloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,n_,x,info,lb2=lb) if (info /= psb_success_) then info=psb_err_alloc_request_ @@ -119,18 +119,14 @@ subroutine psb_calloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='complex(psb_spk_)') goto 9999 endif - + x(:,:) = czero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_calloc @@ -228,7 +224,7 @@ subroutine psb_callocv(x, desc_a,info,n) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,x,info) if (info /= psb_success_) then info=psb_err_alloc_request_ @@ -236,22 +232,19 @@ subroutine psb_callocv(x, desc_a,info,n) call psb_errpush(info,name,int_err,a_err='complex(psb_spk_)') goto 9999 endif - + x(:) = czero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_callocv + subroutine psb_calloc_vect(x, desc_a,info,n) use psb_base_mod, psb_protect_name => psb_calloc_vect use psi_mod @@ -319,12 +312,8 @@ subroutine psb_calloc_vect(x, desc_a,info,n) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_calloc_vect @@ -426,12 +415,8 @@ subroutine psb_calloc_vect_r2(x, desc_a,info,n,lb) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_calloc_vect_r2 diff --git a/base/tools/psb_casb.f90 b/base/tools/psb_casb.f90 index 16c3ae879..ac6dddff1 100644 --- a/base/tools/psb_casb.f90 +++ b/base/tools/psb_casb.f90 @@ -83,8 +83,7 @@ subroutine psb_casb(x, desc_a, info) goto 9999 else if (.not.psb_is_asb_desc(desc_a)) then if (debug_level >= psb_debug_ext_) & - & write(debug_unit,*) me,' ',trim(name),' error ',& - & desc_a%get_dectype() + & write(debug_unit,*) me,' ',trim(name),' error ' info = psb_err_input_matrix_unassembled_ call psb_errpush(info,name) goto 9999 @@ -122,12 +121,8 @@ subroutine psb_casb(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_casb @@ -240,16 +235,13 @@ subroutine psb_casbv(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_casbv + subroutine psb_casb_vect(x, desc_a, info, mold, scratch) use psb_base_mod, psb_protect_name => psb_casb_vect implicit none @@ -319,12 +311,8 @@ subroutine psb_casb_vect(x, desc_a, info, mold, scratch) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_casb_vect @@ -385,7 +373,6 @@ subroutine psb_casb_vect_r2(x, desc_a, info, mold, scratch) end do else - do i=1, n call x(i)%asb(ncol,info) if (info /= 0) exit @@ -408,12 +395,8 @@ subroutine psb_casb_vect_r2(x, desc_a, info, mold, scratch) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_casb_vect_r2 diff --git a/base/tools/psb_ccdbldext.F90 b/base/tools/psb_ccdbldext.F90 index 817fdec42..a8898f239 100644 --- a/base/tools/psb_ccdbldext.F90 +++ b/base/tools/psb_ccdbldext.F90 @@ -433,7 +433,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype) call psb_errpush(info,name,a_err='csget') goto 9999 end if - + call psb_ensure_size((idxs+tot_elem+n_elem),works,info) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -527,7 +527,7 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype) end if if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': going for first idx_cnv', desc_ov%indxmap%get_state() + & ': going for first idx_cnv', desc_ov%indxmap%get_state() call desc_ov%indxmap%g2l(workr(1:iszr),maskr(1:iszr),info) iszs = count(maskr(1:iszr)<=0) @@ -541,21 +541,21 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype) end do ! Eliminate duplicates from request call psb_msort_unique(works(1:j),iszs) - + ! ! fnd_owner on desc_a because we want the procs who ! owned the rows from the beginning! ! if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': going for fnd_owner', desc_ov%indxmap%get_state() + & ': going for fnd_owner', desc_ov%indxmap%get_state() call desc_a%fnd_owner(works(1:iszs),temp,info) n_col = desc_ov%get_local_cols() if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': Done fnd_owner', desc_ov%indxmap%get_state() - + & ': Done fnd_owner', desc_ov%indxmap%get_state() + do i=1,iszs idx = works(i) n_col = desc_ov%get_local_cols() @@ -567,14 +567,14 @@ Subroutine psb_ccdbldext(a,desc_a,novr,desc_ov,info, extype) ! will be less than those for HALO(J) whenever I null() @@ -78,7 +78,7 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche if (.not.present(mg)) then info=psb_err_no_optional_arg_ call psb_errpush(info,name) - goto 999 + goto 9999 end if if (present(ng)) then n_ = ng @@ -92,12 +92,12 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche if (.not.present(mg)) then info=psb_err_no_optional_arg_ call psb_errpush(info,name) - goto 999 + goto 9999 end if if (.not.repl) then info=psb_err_no_optional_arg_ call psb_errpush(info,name) - goto 999 + goto 9999 end if call psb_cdrep(mg, ictxt, desc, info) @@ -145,21 +145,21 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche class default ! This cannot happen info = psb_err_internal_error_ - goto 999 + goto 9999 end select end if call psb_realloc(1,itmpsz, info) if (info /= 0) then write(0,*) 'Error reallocating itmspz' - goto 999 + goto 9999 end if itmpsz(:) = -1 call psi_bld_tmpovrl(itmpsz,desc,info) endif - if (info /= psb_success_) goto 999 + if (info /= psb_success_) goto 9999 ! Finish off lr = desc%indxmap%get_lr() @@ -168,23 +168,18 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche if (info /= psb_success_) then info=psb_err_from_subroutine_ call psb_errpush(info,name,a_err='psb_realloc') - Goto 999 + Goto 9999 end if desc%halo_index(:) = -1 desc%ext_index(:) = -1 call psb_cd_set_bld(desc,info) - if (info /= psb_success_) goto 999 + if (info /= psb_success_) goto 9999 call psb_erractionrestore(err_act) return -999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if - return +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cdall diff --git a/base/tools/psb_cdals.f90 b/base/tools/psb_cdals.f90 index bc03b0d1f..7fbdc0ae2 100644 --- a/base/tools/psb_cdals.f90 +++ b/base/tools/psb_cdals.f90 @@ -284,12 +284,8 @@ subroutine psb_cdals(m, n, parts, ictxt, desc, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cdals diff --git a/base/tools/psb_cdalv.f90 b/base/tools/psb_cdalv.f90 index a7be785d2..be1b99006 100644 --- a/base/tools/psb_cdalv.f90 +++ b/base/tools/psb_cdalv.f90 @@ -215,12 +215,8 @@ subroutine psb_cdalv(v, ictxt, desc, info, flag) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cdalv diff --git a/base/tools/psb_cdcpy.F90 b/base/tools/psb_cdcpy.F90 index 3112139aa..12a3240af 100644 --- a/base/tools/psb_cdcpy.F90 +++ b/base/tools/psb_cdcpy.F90 @@ -86,14 +86,8 @@ subroutine psb_cdcpy(desc_in, desc_out, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cdcpy diff --git a/base/tools/psb_cdins.f90 b/base/tools/psb_cdins.f90 index 71baa89a5..72eedd1da 100644 --- a/base/tools/psb_cdins.f90 +++ b/base/tools/psb_cdins.f90 @@ -142,14 +142,8 @@ subroutine psb_cdinsrc(nz,ia,ja,desc_a,info,ila,jla) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cdinsrc @@ -264,14 +258,8 @@ subroutine psb_cdinsc(nz,ja,desc,info,jla,mask,lidx) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cdinsc diff --git a/base/tools/psb_cdren.f90 b/base/tools/psb_cdren.f90 index 31c7e2d7a..d31f41fbe 100644 --- a/base/tools/psb_cdren.f90 +++ b/base/tools/psb_cdren.f90 @@ -153,14 +153,8 @@ subroutine psb_cdren(trans,iperm,desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cdren diff --git a/base/tools/psb_cdrep.f90 b/base/tools/psb_cdrep.f90 index e7b06fbdc..248ed4da1 100644 --- a/base/tools/psb_cdrep.f90 +++ b/base/tools/psb_cdrep.f90 @@ -216,12 +216,7 @@ subroutine psb_cdrep(m, ictxt, desc, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if - return +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cdrep diff --git a/base/tools/psb_cfree.f90 b/base/tools/psb_cfree.f90 index 5f0e6e16e..bdca90888 100644 --- a/base/tools/psb_cfree.f90 +++ b/base/tools/psb_cfree.f90 @@ -73,9 +73,9 @@ subroutine psb_cfree(x, desc_a, info) endif if (.not.allocated(x)) then - info=psb_err_forgot_spall_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + goto 9999 end if !deallocate x @@ -85,17 +85,13 @@ subroutine psb_cfree(x, desc_a, info) call psb_errpush(info,name) goto 9999 endif - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cfree @@ -129,44 +125,38 @@ subroutine psb_cfreev(x, desc_a, info) if (.not.psb_is_ok_desc(desc_a)) then - info=psb_err_forgot_spall_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + goto 9999 end if ictxt=desc_a%get_context() call psb_info(ictxt, me, np) if (np == -1) then - info = psb_err_context_error_ - call psb_errpush(info,name) - goto 9999 + info = psb_err_context_error_ + call psb_errpush(info,name) + goto 9999 endif if (.not.allocated(x)) then - info=psb_err_forgot_spall_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + goto 9999 end if !deallocate x deallocate(x,stat=info) if (info /= psb_no_err_) then - info=psb_err_alloc_dealloc_ - call psb_errpush(info,name) + info=psb_err_alloc_dealloc_ + call psb_errpush(info,name) endif - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cfreev @@ -219,12 +209,8 @@ subroutine psb_cfree_vect(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cfree_vect @@ -274,12 +260,8 @@ subroutine psb_cfree_vect_r2(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cfree_vect_r2 diff --git a/base/tools/psb_cins.f90 b/base/tools/psb_cins.f90 index 884c06600..95467c32f 100644 --- a/base/tools/psb_cins.f90 +++ b/base/tools/psb_cins.f90 @@ -171,14 +171,8 @@ subroutine psb_cinsvi(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cinsvi @@ -265,7 +259,7 @@ subroutine psb_cins_vect(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) goto 9999 endif - + if (present(dupl)) then dupl_ = dupl else @@ -292,14 +286,8 @@ subroutine psb_cins_vect(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cins_vect @@ -379,7 +367,7 @@ subroutine psb_cins_vect_v(m, irw, val, x, desc_a, info, dupl,local) endif - + if (present(dupl)) then dupl_ = dupl else @@ -408,14 +396,8 @@ subroutine psb_cins_vect_v(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cins_vect_v @@ -501,7 +483,7 @@ subroutine psb_cins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) goto 9999 endif - + if (present(dupl)) then dupl_ = dupl else @@ -518,7 +500,7 @@ subroutine psb_cins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) else call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) end if - + do i=1,n if (.not.allocated(x(i)%v)) info = psb_err_invalid_vect_state_ if (info == 0) call x(i)%ins(m,irl,val(:,i),dupl_,info) @@ -533,14 +515,8 @@ subroutine psb_cins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cins_vect_r2 @@ -687,7 +663,7 @@ subroutine psb_cinsi(m, irw, val, x, desc_a, info, dupl,local) else call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) end if - + select case(dupl_) case(psb_dupl_ovwrt_) do i = 1, m @@ -730,14 +706,8 @@ subroutine psb_cinsi(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cinsi diff --git a/base/tools/psb_cspalloc.f90 b/base/tools/psb_cspalloc.f90 index da9579116..a884cbd13 100644 --- a/base/tools/psb_cspalloc.f90 +++ b/base/tools/psb_cspalloc.f90 @@ -100,9 +100,8 @@ subroutine psb_cspalloc(a, desc_a, info, nnz) if (debug_level >= psb_debug_ext_) & & write(debug_unit,*) me,' ',trim(name),':allocating size:',length_ia1 - - !....allocate aspk, ia1, ia2..... call a%free() + !....allocate aspk, ia1, ia2..... call a%csall(loc_row,loc_col,info,nz=length_ia1) if(info /= psb_success_) then info=psb_err_from_subroutine_ @@ -120,14 +119,8 @@ subroutine psb_cspalloc(a, desc_a, info, nnz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_cspalloc diff --git a/base/tools/psb_cspasb.f90 b/base/tools/psb_cspasb.f90 index 98f45c1cc..0f0070080 100644 --- a/base/tools/psb_cspasb.f90 +++ b/base/tools/psb_cspasb.f90 @@ -140,12 +140,8 @@ subroutine psb_cspasb(a,desc_a, info, afmt, upd, dupl, mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cspasb diff --git a/base/tools/psb_cspfree.f90 b/base/tools/psb_cspfree.f90 index 87304f6b0..8f44dc75f 100644 --- a/base/tools/psb_cspfree.f90 +++ b/base/tools/psb_cspfree.f90 @@ -70,12 +70,8 @@ subroutine psb_cspfree(a, desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cspfree diff --git a/base/tools/psb_csphalo.F90 b/base/tools/psb_csphalo.F90 index 532def731..912f7dbc3 100644 --- a/base/tools/psb_csphalo.F90 +++ b/base/tools/psb_csphalo.F90 @@ -366,12 +366,8 @@ Subroutine psb_csphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return End Subroutine psb_csphalo diff --git a/base/tools/psb_cspins.f90 b/base/tools/psb_cspins.f90 index df687d7a8..961be5f99 100644 --- a/base/tools/psb_cspins.f90 +++ b/base/tools/psb_cspins.f90 @@ -193,12 +193,8 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cspins @@ -313,12 +309,8 @@ subroutine psb_cspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cspins_2desc @@ -394,9 +386,9 @@ subroutine psb_cspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) if (desc_a%is_bld()) then !!$ if (local_) then - info = psb_err_invalid_a_and_cd_state_ - call psb_errpush(info,name) - goto 9999 + info = psb_err_invalid_a_and_cd_state_ + call psb_errpush(info,name) + goto 9999 !!$ else !!$ allocate(ila(nz),jla(nz),stat=info) !!$ if (info /= psb_success_) then @@ -444,7 +436,7 @@ subroutine psb_cspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) goto 9999 end if else - info = psb_err_invalid_cd_state_ + info = psb_err_invalid_cd_state_ !!$ allocate(ila(nz),jla(nz),stat=info) !!$ if (info /= psb_success_) then @@ -472,12 +464,8 @@ subroutine psb_cspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_cspins_v diff --git a/base/tools/psb_csprn.f90 b/base/tools/psb_csprn.f90 index af6a1cf8f..98eb9bb2c 100644 --- a/base/tools/psb_csprn.f90 +++ b/base/tools/psb_csprn.f90 @@ -91,12 +91,8 @@ Subroutine psb_csprn(a, desc_a,info,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_csprn diff --git a/base/tools/psb_d_map.f90 b/base/tools/psb_d_map.f90 index 65b6330bc..0a0f67f98 100644 --- a/base/tools/psb_d_map.f90 +++ b/base/tools/psb_d_map.f90 @@ -137,12 +137,11 @@ subroutine psb_d_map_X2Y_vect(alpha,x,beta,y,map,info,work) select case(map_kind) case(psb_map_aggr_) - + ictxt = map%p_desc_Y%get_context() nr2 = map%p_desc_Y%get_global_rows() nc2 = map%p_desc_Y%get_local_cols() call yt%bld(nc2,mold=x%v) -!!$ write(0,*)'From map_aggr_X2Y apply: ',map%p_desc_X%v_halo_index%get_fmt() if (info == psb_success_) call psb_halo(x,map%p_desc_X,info,work=work) if (info == psb_success_) call psb_csmm(done,map%map_X2Y,x,dzero,yt,info) if ((info == psb_success_) .and. map%p_desc_Y%is_repl()) then @@ -308,7 +307,6 @@ subroutine psb_d_map_Y2X_vect(alpha,x,beta,y,map,info,work) nr2 = map%p_desc_X%get_global_rows() nc2 = map%p_desc_X%get_local_cols() call yt%bld(nc2,mold=y%v) -!!$ write(0,*)'From map_aggr_Y2X apply: ',map%p_desc_Y%v_halo_index%get_fmt() if (info == psb_success_) call psb_halo(x,map%p_desc_Y,info,work=work) if (info == psb_success_) call psb_csmm(done,map%map_Y2X,x,dzero,yt,info) if ((info == psb_success_) .and. map%p_desc_X%is_repl()) then diff --git a/base/tools/psb_dallc.f90 b/base/tools/psb_dallc.f90 index f4b9f91e3..c15974e29 100644 --- a/base/tools/psb_dallc.f90 +++ b/base/tools/psb_dallc.f90 @@ -48,7 +48,7 @@ subroutine psb_dalloc(x, desc_a, info, n, lb) implicit none !....parameters... - real(psb_dpk_), allocatable, intent(out) :: x(:,:) + real(psb_dpk_), allocatable, intent(out) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a integer(psb_ipk_),intent(out) :: info integer(psb_ipk_), optional, intent(in) :: n, lb @@ -56,7 +56,7 @@ subroutine psb_dalloc(x, desc_a, info, n, lb) !locals integer(psb_ipk_) :: np,me,err,nr,i,j,err_act integer(psb_ipk_) :: ictxt,n_ - integer(psb_ipk_) :: int_err(5), exch(3) + integer(psb_ipk_) :: int_err(5),exch(3) character(len=20) :: name name='psb_geall' @@ -76,7 +76,7 @@ subroutine psb_dalloc(x, desc_a, info, n, lb) endif !... check m and n parameters.... - if (.not.desc_a%is_ok()) then + if (.not.psb_is_ok_desc(desc_a)) then info = psb_err_input_matrix_unassembled_ call psb_errpush(info,name) goto 9999 @@ -111,7 +111,7 @@ subroutine psb_dalloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,n_,x,info,lb2=lb) if (info /= psb_success_) then info=psb_err_alloc_request_ @@ -119,18 +119,14 @@ subroutine psb_dalloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='real(psb_dpk_)') goto 9999 endif - + x(:,:) = dzero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dalloc @@ -167,9 +163,8 @@ end subroutine psb_dalloc !!$ !!$ ! -! ! Function: psb_dallocv -! Allocates dense matrix for PSBLAS routines. +! Allocates dense matrix for PSBLAS routines ! The descriptor may be in either the build or assembled state. ! ! Arguments: @@ -229,7 +224,7 @@ subroutine psb_dallocv(x, desc_a,info,n) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,x,info) if (info /= psb_success_) then info=psb_err_alloc_request_ @@ -237,22 +232,19 @@ subroutine psb_dallocv(x, desc_a,info,n) call psb_errpush(info,name,int_err,a_err='real(psb_dpk_)') goto 9999 endif - + x(:) = dzero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dallocv + subroutine psb_dalloc_vect(x, desc_a,info,n) use psb_base_mod, psb_protect_name => psb_dalloc_vect use psi_mod @@ -312,7 +304,7 @@ subroutine psb_dalloc_vect(x, desc_a,info,n) if (psb_errstatus_fatal()) then info=psb_err_alloc_request_ int_err(1)=nr - call psb_errpush(info,name,int_err,a_err='real(psb_dpk_)') + call psb_errpush(info,name,int_err,a_err='real(psb_spk_)') goto 9999 endif call x%zero() @@ -320,12 +312,8 @@ subroutine psb_dalloc_vect(x, desc_a,info,n) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dalloc_vect @@ -420,19 +408,15 @@ subroutine psb_dalloc_vect_r2(x, desc_a,info,n,lb) if (psb_errstatus_fatal()) then info=psb_err_alloc_request_ int_err(1)=nr - call psb_errpush(info,name,int_err,a_err='real(psb_dpk_)') + call psb_errpush(info,name,int_err,a_err='real(psb_spk_)') goto 9999 endif call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dalloc_vect_r2 diff --git a/base/tools/psb_dasb.f90 b/base/tools/psb_dasb.f90 index aa45f716d..a52482b42 100644 --- a/base/tools/psb_dasb.f90 +++ b/base/tools/psb_dasb.f90 @@ -32,14 +32,14 @@ ! File: psb_dasb.f90 ! ! Subroutine: psb_dasb -! Assembles a dense matrix for PSBLAS routines. +! Assembles a dense matrix for PSBLAS routines ! Since the allocation may have been called with the desciptor ! in the build state we make sure that X has a number of rows ! allowing for the halo indices, reallocating if necessary. ! We also call the halo routine for good measure. ! ! Arguments: -! x(:,:) - real,allocatable The matrix to be assembled. +! x(:,:) - real, allocatable The matrix to be assembled. ! desc_a - type(psb_desc_type). The communication descriptor. ! info - integer. return code subroutine psb_dasb(x, desc_a, info) @@ -47,7 +47,7 @@ subroutine psb_dasb(x, desc_a, info) implicit none type(psb_desc_type), intent(in) :: desc_a - real(psb_dpk_), allocatable, intent(inout) :: x(:,:) + real(psb_dpk_), allocatable, intent(inout) :: x(:,:) integer(psb_ipk_), intent(out) :: info ! local variables @@ -83,8 +83,7 @@ subroutine psb_dasb(x, desc_a, info) goto 9999 else if (.not.psb_is_asb_desc(desc_a)) then if (debug_level >= psb_debug_ext_) & - & write(debug_unit,*) me,' ',trim(name),' error ',& - & desc_a%get_dectype() + & write(debug_unit,*) me,' ',trim(name),' error ' info = psb_err_input_matrix_unassembled_ call psb_errpush(info,name) goto 9999 @@ -122,12 +121,8 @@ subroutine psb_dasb(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dasb @@ -172,15 +167,15 @@ end subroutine psb_dasb ! We also call the halo routine for good measure. ! ! Arguments: -! x(:) - real,allocatable The matrix to be assembled. +! x(:) - real, allocatable The matrix to be assembled. ! desc_a - type(psb_desc_type). The communication descriptor. -! info - integer. Return code +! info - integer. Return code subroutine psb_dasbv(x, desc_a, info) use psb_base_mod, psb_protect_name => psb_dasbv implicit none - type(psb_desc_type), intent(in) :: desc_a - real(psb_dpk_), allocatable, intent(inout) :: x(:) + type(psb_desc_type), intent(in) :: desc_a + real(psb_dpk_), allocatable, intent(inout) :: x(:) integer(psb_ipk_), intent(out) :: info ! local variables @@ -240,25 +235,22 @@ subroutine psb_dasbv(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dasbv -subroutine psb_dasb_vect(x, desc_a, info, mold, scratch) + +subroutine psb_dasb_vect(x, desc_a, info, mold, scratch) use psb_base_mod, psb_protect_name => psb_dasb_vect implicit none - type(psb_desc_type), intent(in) :: desc_a + type(psb_desc_type), intent(in) :: desc_a type(psb_d_vect_type), intent(inout) :: x - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info class(psb_d_base_vect_type), intent(in), optional :: mold - logical, intent(in), optional :: scratch + logical, intent(in), optional :: scratch ! local variables integer(psb_ipk_) :: ictxt,np,me @@ -312,18 +304,15 @@ subroutine psb_dasb_vect(x, desc_a, info, mold, scratch) if (present(mold)) then call x%cnv(mold) end if - if (debug_level >= psb_debug_ext_) & - & write(debug_unit,*) me,' ',trim(name),': end' - endif + end if + if (debug_level >= psb_debug_ext_) & + & write(debug_unit,*) me,' ',trim(name),': end' + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dasb_vect @@ -333,11 +322,11 @@ subroutine psb_dasb_vect_r2(x, desc_a, info, mold, scratch) use psb_base_mod, psb_protect_name => psb_dasb_vect_r2 implicit none - type(psb_desc_type), intent(in) :: desc_a + type(psb_desc_type), intent(in) :: desc_a type(psb_d_vect_type), intent(inout) :: x(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info class(psb_d_base_vect_type), intent(in), optional :: mold - logical, intent(in), optional :: scratch + logical, intent(in), optional :: scratch ! local variables integer(psb_ipk_) :: ictxt,np,me, i, n @@ -355,9 +344,9 @@ subroutine psb_dasb_vect_r2(x, desc_a, info, mold, scratch) ictxt = desc_a%get_context() debug_unit = psb_get_debug_unit() debug_level = psb_get_debug_level() + scratch_ = .false. if (present(scratch)) scratch_ = scratch - call psb_info(ictxt, me, np) ! ....verify blacs grid correctness.. @@ -406,12 +395,8 @@ subroutine psb_dasb_vect_r2(x, desc_a, info, mold, scratch) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dasb_vect_r2 diff --git a/base/tools/psb_dcdbldext.F90 b/base/tools/psb_dcdbldext.F90 index d1563db89..b1a549e08 100644 --- a/base/tools/psb_dcdbldext.F90 +++ b/base/tools/psb_dcdbldext.F90 @@ -433,7 +433,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype) call psb_errpush(info,name,a_err='csget') goto 9999 end if - + call psb_ensure_size((idxs+tot_elem+n_elem),works,info) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -527,7 +527,7 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype) end if if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': going for first idx_cnv', desc_ov%indxmap%get_state() + & ': going for first idx_cnv', desc_ov%indxmap%get_state() call desc_ov%indxmap%g2l(workr(1:iszr),maskr(1:iszr),info) iszs = count(maskr(1:iszr)<=0) @@ -541,21 +541,21 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype) end do ! Eliminate duplicates from request call psb_msort_unique(works(1:j),iszs) - + ! ! fnd_owner on desc_a because we want the procs who ! owned the rows from the beginning! ! if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': going for fnd_owner', desc_ov%indxmap%get_state() + & ': going for fnd_owner', desc_ov%indxmap%get_state() call desc_a%fnd_owner(works(1:iszs),temp,info) n_col = desc_ov%get_local_cols() if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': Done fnd_owner', desc_ov%indxmap%get_state() - + & ': Done fnd_owner', desc_ov%indxmap%get_state() + do i=1,iszs idx = works(i) n_col = desc_ov%get_local_cols() @@ -567,14 +567,14 @@ Subroutine psb_dcdbldext(a,desc_a,novr,desc_ov,info, extype) ! will be less than those for HALO(J) whenever I psb_dfree implicit none !....parameters... - real(psb_dpk_),allocatable, intent(inout) :: x(:,:) + real(psb_dpk_),allocatable, intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a integer(psb_ipk_), intent(out) :: info !...locals.... - integer(psb_ipk_) :: ictxt,np,me,err_act + integer(psb_ipk_) :: ictxt,np,me, err_act character(len=20) :: name @@ -57,12 +57,12 @@ subroutine psb_dfree(x, desc_a, info) call psb_erractionsave(err_act) name='psb_dfree' if (.not.psb_is_ok_desc(desc_a)) then - info=psb_err_forgot_spall_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + return end if - ictxt = desc_a%get_context() + ictxt=desc_a%get_context() call psb_info(ictxt, me, np) ! ....verify blacs grid correctness.. @@ -73,9 +73,9 @@ subroutine psb_dfree(x, desc_a, info) endif if (.not.allocated(x)) then - info=psb_err_forgot_spall_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + goto 9999 end if !deallocate x @@ -90,12 +90,8 @@ subroutine psb_dfree(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dfree @@ -106,7 +102,7 @@ end subroutine psb_dfree ! frees a dense matrix structure ! ! Arguments: -! x(:) - real, allocatable The dense matrix to be freed. +! x(:) - real, allocatable The dense matrix to be freed. ! desc_a - type(psb_desc_type). The communication descriptor. ! info - integer. Return code subroutine psb_dfreev(x, desc_a, info) @@ -115,9 +111,10 @@ subroutine psb_dfreev(x, desc_a, info) !....parameters... real(psb_dpk_),allocatable, intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info + !...locals.... - integer(psb_ipk_) :: ictxt,np,me,err_act + integer(psb_ipk_) :: ictxt,np,me, err_act character(len=20) :: name @@ -126,24 +123,26 @@ subroutine psb_dfreev(x, desc_a, info) call psb_erractionsave(err_act) name='psb_dfreev' + if (.not.psb_is_ok_desc(desc_a)) then - info=psb_err_forgot_spall_ - call psb_errpush(info,name) - return + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + goto 9999 end if - ictxt = desc_a%get_context() + ictxt=desc_a%get_context() call psb_info(ictxt, me, np) if (np == -1) then info = psb_err_context_error_ call psb_errpush(info,name) goto 9999 + endif if (.not.allocated(x)) then - info=psb_err_forgot_spall_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + goto 9999 end if !deallocate x @@ -156,12 +155,8 @@ subroutine psb_dfreev(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dfreev @@ -214,12 +209,8 @@ subroutine psb_dfree_vect(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dfree_vect @@ -269,12 +260,8 @@ subroutine psb_dfree_vect_r2(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dfree_vect_r2 diff --git a/base/tools/psb_dins.f90 b/base/tools/psb_dins.f90 index 0c14e8d42..54021b97c 100644 --- a/base/tools/psb_dins.f90 +++ b/base/tools/psb_dins.f90 @@ -171,14 +171,8 @@ subroutine psb_dinsvi(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_dinsvi @@ -265,7 +259,7 @@ subroutine psb_dins_vect(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) goto 9999 endif - + if (present(dupl)) then dupl_ = dupl else @@ -292,14 +286,8 @@ subroutine psb_dins_vect(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_dins_vect @@ -379,7 +367,7 @@ subroutine psb_dins_vect_v(m, irw, val, x, desc_a, info, dupl,local) endif - + if (present(dupl)) then dupl_ = dupl else @@ -408,14 +396,8 @@ subroutine psb_dins_vect_v(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_dins_vect_v @@ -501,7 +483,7 @@ subroutine psb_dins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) goto 9999 endif - + if (present(dupl)) then dupl_ = dupl else @@ -518,7 +500,7 @@ subroutine psb_dins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) else call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) end if - + do i=1,n if (.not.allocated(x(i)%v)) info = psb_err_invalid_vect_state_ if (info == 0) call x(i)%ins(m,irl,val(:,i),dupl_,info) @@ -533,14 +515,8 @@ subroutine psb_dins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_dins_vect_r2 @@ -687,7 +663,7 @@ subroutine psb_dinsi(m, irw, val, x, desc_a, info, dupl,local) else call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) end if - + select case(dupl_) case(psb_dupl_ovwrt_) do i = 1, m @@ -730,14 +706,8 @@ subroutine psb_dinsi(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_dinsi diff --git a/base/tools/psb_dspalloc.f90 b/base/tools/psb_dspalloc.f90 index 6cf9e1976..a2fe0819c 100644 --- a/base/tools/psb_dspalloc.f90 +++ b/base/tools/psb_dspalloc.f90 @@ -59,19 +59,13 @@ subroutine psb_dspalloc(a, desc_a, info, nnz) integer(psb_ipk_) :: debug_level, debug_unit character(len=20) :: name, ch_err + if(psb_get_errstatus() /= 0) return info=psb_success_ - if (psb_errstatus_fatal()) return call psb_erractionsave(err_act) name = 'psb_dspall' debug_unit = psb_get_debug_unit() debug_level = psb_get_debug_level() - if (.not.desc_a%is_ok()) then - info = psb_err_invalid_cd_state_ - call psb_errpush(info,name) - goto 9999 - end if - ictxt = desc_a%get_context() dectype = desc_a%get_dectype() @@ -107,11 +101,11 @@ subroutine psb_dspalloc(a, desc_a, info, nnz) if (debug_level >= psb_debug_ext_) & & write(debug_unit,*) me,' ',trim(name),':allocating size:',length_ia1 call a%free() - !....allocate aspk, ia1, ia2..... call a%csall(loc_row,loc_col,info,nz=length_ia1) - if (psb_errstatus_fatal()) then + if(info /= psb_success_) then info=psb_err_from_subroutine_ + ch_err='sp_all' call psb_errpush(info,name,int_err) goto 9999 end if @@ -125,14 +119,8 @@ subroutine psb_dspalloc(a, desc_a, info, nnz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_dspalloc diff --git a/base/tools/psb_dspasb.f90 b/base/tools/psb_dspasb.f90 index e691f7ae7..100b73c94 100644 --- a/base/tools/psb_dspasb.f90 +++ b/base/tools/psb_dspasb.f90 @@ -140,12 +140,8 @@ subroutine psb_dspasb(a,desc_a, info, afmt, upd, dupl, mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dspasb diff --git a/base/tools/psb_dspfree.f90 b/base/tools/psb_dspfree.f90 index 1352a72fd..604404781 100644 --- a/base/tools/psb_dspfree.f90 +++ b/base/tools/psb_dspfree.f90 @@ -44,11 +44,11 @@ subroutine psb_dspfree(a, desc_a,info) implicit none !....parameters... - type(psb_desc_type), intent(in) :: desc_a + type(psb_desc_type), intent(in) :: desc_a type(psb_dspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info !...locals.... - integer(psb_ipk_) :: ictxt,err_act + integer(psb_ipk_) :: ictxt, err_act character(len=20) :: name if(psb_get_errstatus() /= 0) return @@ -56,31 +56,22 @@ subroutine psb_dspfree(a, desc_a,info) name = 'psb_dspfree' call psb_erractionsave(err_act) - if (.not.desc_a%is_ok()) then - info = psb_err_invalid_cd_state_ + if (.not.psb_is_ok_desc(desc_a)) then + info = psb_err_forgot_spall_ call psb_errpush(info,name) - goto 9999 + return else ictxt = desc_a%get_context() end if !...deallocate a.... call a%free() - if (psb_errstatus_fatal()) then - info = psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%free') - goto 9999 - end if call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dspfree diff --git a/base/tools/psb_dsphalo.F90 b/base/tools/psb_dsphalo.F90 index a6788e3a0..12751577a 100644 --- a/base/tools/psb_dsphalo.F90 +++ b/base/tools/psb_dsphalo.F90 @@ -366,12 +366,8 @@ Subroutine psb_dsphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return End Subroutine psb_dsphalo diff --git a/base/tools/psb_dspins.f90 b/base/tools/psb_dspins.f90 index 53cba120b..5040cd810 100644 --- a/base/tools/psb_dspins.f90 +++ b/base/tools/psb_dspins.f90 @@ -193,12 +193,8 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dspins @@ -313,12 +309,8 @@ subroutine psb_dspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dspins_2desc @@ -394,9 +386,9 @@ subroutine psb_dspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) if (desc_a%is_bld()) then !!$ if (local_) then - info = psb_err_invalid_a_and_cd_state_ - call psb_errpush(info,name) - goto 9999 + info = psb_err_invalid_a_and_cd_state_ + call psb_errpush(info,name) + goto 9999 !!$ else !!$ allocate(ila(nz),jla(nz),stat=info) !!$ if (info /= psb_success_) then @@ -444,7 +436,7 @@ subroutine psb_dspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) goto 9999 end if else - info = psb_err_invalid_cd_state_ + info = psb_err_invalid_cd_state_ !!$ allocate(ila(nz),jla(nz),stat=info) !!$ if (info /= psb_success_) then @@ -472,12 +464,8 @@ subroutine psb_dspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dspins_v diff --git a/base/tools/psb_dsprn.f90 b/base/tools/psb_dsprn.f90 index 6ed21d3b6..c99189354 100644 --- a/base/tools/psb_dsprn.f90 +++ b/base/tools/psb_dsprn.f90 @@ -41,6 +41,7 @@ ! info - integer. Return code. ! clear - logical, optional Whether the coefficients should be zeroed ! default .true. +! Subroutine psb_dsprn(a, desc_a,info,clear) use psb_base_mod, psb_protect_name => psb_dsprn Implicit None @@ -59,29 +60,23 @@ Subroutine psb_dsprn(a, desc_a,info,clear) logical :: clear_ info = psb_success_ - if (psb_errstatus_fatal()) return err = 0 int_err(1)=0 name = 'psb_dsprn' call psb_erractionsave(err_act) debug_unit = psb_get_debug_unit() debug_level = psb_get_debug_level() - if (.not.desc_a%is_ok()) then - info = psb_err_invalid_cd_state_ - call psb_errpush(info,name) - goto 9999 - end if ictxt = desc_a%get_context() call psb_info(ictxt, me, np) if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),': start ' - if (a%is_bld()) then + if (psb_is_bld_desc(desc_a)) then ! Should do nothing, we are called redundantly return endif - if (.not.a%is_asb()) then + if (.not.psb_is_asb_desc(desc_a)) then info=590 call psb_errpush(info,name) goto 9999 @@ -89,19 +84,15 @@ Subroutine psb_dsprn(a, desc_a,info,clear) call a%reinit(clear=clear) - if (psb_errstatus_fatal()) goto 9999 + if (info /= psb_success_) goto 9999 if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),': done' call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_dsprn diff --git a/base/tools/psb_get_overlap.f90 b/base/tools/psb_get_overlap.f90 index 46a13ee03..6d529e6d1 100644 --- a/base/tools/psb_get_overlap.f90 +++ b/base/tools/psb_get_overlap.f90 @@ -92,12 +92,8 @@ subroutine psb_get_ovrlap(ovrel,desc,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_get_ovrlap diff --git a/base/tools/psb_glob_to_loc.f90 b/base/tools/psb_glob_to_loc.f90 index b2f3a3534..603710b0a 100644 --- a/base/tools/psb_glob_to_loc.f90 +++ b/base/tools/psb_glob_to_loc.f90 @@ -114,17 +114,10 @@ subroutine psb_glob_to_loc2v(x,y,desc_a,info,iact,owned) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return - end subroutine psb_glob_to_loc2v @@ -238,14 +231,8 @@ subroutine psb_glob_to_loc1v(x,desc_a,info,iact,owned) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_glob_to_loc1v diff --git a/base/tools/psb_ialloc.f90 b/base/tools/psb_iallc.f90 similarity index 74% rename from base/tools/psb_ialloc.f90 rename to base/tools/psb_iallc.f90 index c24f248e3..7c817b9e2 100644 --- a/base/tools/psb_ialloc.f90 +++ b/base/tools/psb_iallc.f90 @@ -29,32 +29,34 @@ !!$ POSSIBILITY OF SUCH DAMAGE. !!$ !!$ -! File: psb_ialloc.f90 +! +! File: psb_iallc.f90 ! ! Function: psb_ialloc -! Allocates dense integer matrix for PSBLAS routines +! Allocates dense matrix for PSBLAS routines. ! The descriptor may be in either the build or assembled state. ! ! Arguments: ! x - the matrix to be allocated. ! desc_a - the communication descriptor. -! info - possibly returns an error code +! info - Return code ! n - optional number of columns. ! lb - optional lower bound on column indices subroutine psb_ialloc(x, desc_a, info, n, lb) use psb_base_mod, psb_protect_name => psb_ialloc + use psi_mod implicit none - + !....parameters... integer(psb_ipk_), allocatable, intent(out) :: x(:,:) - type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: n, lb + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_),intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: n, lb !locals integer(psb_ipk_) :: np,me,err,nr,i,j,err_act integer(psb_ipk_) :: ictxt,n_ - integer(psb_ipk_) :: int_err(5), exch(3) + integer(psb_ipk_) :: int_err(5),exch(3) character(len=20) :: name name='psb_geall' @@ -63,7 +65,7 @@ subroutine psb_ialloc(x, desc_a, info, n, lb) err=0 int_err(1)=0 call psb_erractionsave(err_act) - + ictxt=desc_a%get_context() call psb_info(ictxt, me, np) @@ -109,32 +111,26 @@ subroutine psb_ialloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,n_,x,info,lb2=lb) if (info /= psb_success_) then info=psb_err_alloc_request_ int_err(1)=nr*n_ - call psb_errpush(info,name,int_err,a_err='integer') + call psb_errpush(info,name,int_err,a_err='integer(psb_ipk_)') goto 9999 endif - + x(:,:) = izero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_ialloc - - !!$ !!$ Parallel Sparse BLAS version 3.1 !!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013 @@ -166,6 +162,7 @@ end subroutine psb_ialloc !!$ POSSIBILITY OF SUCH DAMAGE. !!$ !!$ +! ! Function: psb_iallocv ! Allocates dense matrix for PSBLAS routines ! The descriptor may be in either the build or assembled state. @@ -174,15 +171,16 @@ end subroutine psb_ialloc ! x(:) - the matrix to be allocated. ! desc_a - the communication descriptor. ! info - return code -subroutine psb_iallocv(x, desc_a, info,n) +subroutine psb_iallocv(x, desc_a,info,n) use psb_base_mod, psb_protect_name => psb_iallocv + use psi_mod implicit none !....parameters... integer(psb_ipk_), allocatable, intent(out) :: x(:) - type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: n + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_),intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: n !locals integer(psb_ipk_) :: np,me,nr,i,err_act @@ -226,26 +224,22 @@ subroutine psb_iallocv(x, desc_a, info,n) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,x,info) if (info /= psb_success_) then info=psb_err_alloc_request_ int_err(1)=nr - call psb_errpush(info,name,int_err,a_err='integer') + call psb_errpush(info,name,int_err,a_err='integer(psb_ipk_)') goto 9999 endif - + x(:) = izero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_iallocv @@ -310,7 +304,7 @@ subroutine psb_ialloc_vect(x, desc_a,info,n) if (psb_errstatus_fatal()) then info=psb_err_alloc_request_ int_err(1)=nr - call psb_errpush(info,name,int_err,a_err='integer(psb_ipk_)') + call psb_errpush(info,name,int_err,a_err='real(psb_spk_)') goto 9999 endif call x%zero() @@ -318,13 +312,111 @@ subroutine psb_ialloc_vect(x, desc_a,info,n) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_ialloc_vect +subroutine psb_ialloc_vect_r2(x, desc_a,info,n,lb) + use psb_base_mod, psb_protect_name => psb_ialloc_vect_r2 + use psi_mod + implicit none + + !....parameters... + type(psb_i_vect_type), allocatable, intent(out) :: x(:) + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_),intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: n,lb + + !locals + integer(psb_ipk_) :: np,me,nr,i,err_act, n_, lb_ + integer(psb_ipk_) :: ictxt, int_err(5), exch(1) + integer(psb_ipk_) :: debug_level, debug_unit + character(len=20) :: name + + info=psb_success_ + if (psb_errstatus_fatal()) return + name='psb_geall' + call psb_erractionsave(err_act) + debug_unit = psb_get_debug_unit() + debug_level = psb_get_debug_level() + + ictxt=desc_a%get_context() + + call psb_info(ictxt, me, np) + ! ....verify blacs grid correctness.. + if (np == -1) then + info = psb_err_context_error_ + call psb_errpush(info,name) + goto 9999 + endif + + !... check m and n parameters.... + if (.not.desc_a%is_ok()) then + info = psb_err_invalid_cd_state_ + call psb_errpush(info,name) + goto 9999 + end if + + if (present(n)) then + n_ = n + else + n_ = 1 + endif + if (present(lb)) then + lb_ = lb + else + lb_ = 1 + endif + + !global check on n parameters + if (me == psb_root_) then + exch(1)=n_ + call psb_bcast(ictxt,exch(1),root=psb_root_) + else + call psb_bcast(ictxt,exch(1),root=psb_root_) + if (exch(1) /= n_) then + info=psb_err_parm_differs_among_procs_ + int_err(1)=1 + call psb_errpush(info,name,int_err) + goto 9999 + endif + endif + ! As this is a rank-1 array, optional parameter N is actually ignored. + + !....allocate x ..... + if (desc_a%is_asb().or.desc_a%is_upd()) then + nr = max(1,desc_a%get_local_cols()) + else if (desc_a%is_bld()) then + nr = max(1,desc_a%get_local_rows()) + else + info = psb_err_internal_error_ + call psb_errpush(info,name,int_err,a_err='Invalid desc_a') + goto 9999 + endif + + allocate(x(lb_:lb_+n_-1), stat=info) + if (info == 0) then + do i=lb_, lb_+n_-1 + allocate(psb_i_base_vect_type :: x(i)%v, stat=info) + if (info == 0) call x(i)%all(nr,info) + if (info == 0) call x(i)%zero() + if (info /= 0) exit + end do + end if + if (psb_errstatus_fatal()) then + info=psb_err_alloc_request_ + int_err(1)=nr + call psb_errpush(info,name,int_err,a_err='real(psb_spk_)') + goto 9999 + endif + + call psb_erractionrestore(err_act) + return + +9999 call psb_error_handler(ictxt,err_act) + + return + +end subroutine psb_ialloc_vect_r2 diff --git a/base/tools/psb_iasb.f90 b/base/tools/psb_iasb.f90 index 1f639f75e..3f6db8ab6 100644 --- a/base/tools/psb_iasb.f90 +++ b/base/tools/psb_iasb.f90 @@ -39,22 +39,22 @@ ! We also call the halo routine for good measure. ! ! Arguments: -! x(:,:) - integer(psb_ipk_),allocatable The matrix to be assembled. -! desc_a - type(psb_desc_type). The communication descriptor. -! info - integer. return code +! x(:,:) - integer, allocatable The matrix to be assembled. +! desc_a - type(psb_desc_type). The communication descriptor. +! info - integer. return code subroutine psb_iasb(x, desc_a, info) use psb_base_mod, psb_protect_name => psb_iasb implicit none - type(psb_desc_type), intent(in) :: desc_a + type(psb_desc_type), intent(in) :: desc_a integer(psb_ipk_), allocatable, intent(inout) :: x(:,:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info ! local variables - integer(psb_ipk_) :: ictxt,np,me,nrow,ncol,err_act - integer(psb_ipk_) :: int_err(5), i1sz, i2sz + integer(psb_ipk_) :: ictxt,np,me,nrow,ncol, err_act + integer(psb_ipk_) :: i1sz, i2sz integer(psb_ipk_) :: debug_level, debug_unit - character(len=20) :: name,ch_err + character(len=20) :: name, ch_err if(psb_get_errstatus() /= 0) return info=psb_success_ @@ -83,8 +83,7 @@ subroutine psb_iasb(x, desc_a, info) goto 9999 else if (.not.psb_is_asb_desc(desc_a)) then if (debug_level >= psb_debug_ext_) & - & write(debug_unit,*) me,' ',trim(name),' error ',& - & desc_a%get_dectype() + & write(debug_unit,*) me,' ',trim(name),' error ' info = psb_err_input_matrix_unassembled_ call psb_errpush(info,name) goto 9999 @@ -107,7 +106,7 @@ subroutine psb_iasb(x, desc_a, info) goto 9999 endif endif - + ! ..update halo elements.. call psb_halo(x,desc_a,info) if(info /= psb_success_) then @@ -122,16 +121,11 @@ subroutine psb_iasb(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return - -end subroutine psb_iasb +end subroutine psb_iasb !!$ @@ -165,7 +159,7 @@ end subroutine psb_iasb !!$ POSSIBILITY OF SUCH DAMAGE. !!$ !!$ -! Subroutine: psb_iasbv +! Subroutine: psb_iasb ! Assembles a dense matrix for PSBLAS routines ! Since the allocation may have been called with the desciptor ! in the build state we make sure that X has a number of rows @@ -173,16 +167,16 @@ end subroutine psb_iasb ! We also call the halo routine for good measure. ! ! Arguments: -! x(:) - integer(psb_ipk_),allocatable The matrix to be assembled. -! desc_a - type(psb_desc_type). The communication descriptor. -! info - integer. return code +! x(:) - integer, allocatable The matrix to be assembled. +! desc_a - type(psb_desc_type). The communication descriptor. +! info - integer. Return code subroutine psb_iasbv(x, desc_a, info) use psb_base_mod, psb_protect_name => psb_iasbv implicit none - type(psb_desc_type), intent(in) :: desc_a + type(psb_desc_type), intent(in) :: desc_a integer(psb_ipk_), allocatable, intent(inout) :: x(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info ! local variables integer(psb_ipk_) :: ictxt,np,me @@ -225,8 +219,8 @@ subroutine psb_iasbv(x, desc_a, info) call psb_errpush(info,name,a_err='psb_realloc') goto 9999 endif - endif - + endif + ! ..update halo elements.. call psb_halo(x,desc_a,info) if(info /= psb_success_) then @@ -241,14 +235,10 @@ subroutine psb_iasbv(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return - + end subroutine psb_iasbv @@ -321,12 +311,92 @@ subroutine psb_iasb_vect(x, desc_a, info, mold, scratch) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_iasb_vect + + +subroutine psb_iasb_vect_r2(x, desc_a, info, mold, scratch) + use psb_base_mod, psb_protect_name => psb_iasb_vect_r2 + implicit none + + type(psb_desc_type), intent(in) :: desc_a + type(psb_i_vect_type), intent(inout) :: x(:) + integer(psb_ipk_), intent(out) :: info + class(psb_i_base_vect_type), intent(in), optional :: mold + logical, intent(in), optional :: scratch + + ! local variables + integer(psb_ipk_) :: ictxt,np,me, i, n + integer(psb_ipk_) :: int_err(5), i1sz,nrow,ncol, err_act + logical :: scratch_ + integer(psb_ipk_) :: debug_level, debug_unit + character(len=20) :: name,ch_err + + info = psb_success_ + if (psb_errstatus_fatal()) return + + int_err(1) = 0 + name = 'psb_igeasb_v' + + ictxt = desc_a%get_context() + debug_unit = psb_get_debug_unit() + debug_level = psb_get_debug_level() + + scratch_ = .false. + if (present(scratch)) scratch_ = scratch + call psb_info(ictxt, me, np) + + ! ....verify blacs grid correctness.. + if (np == -1) then + info = psb_err_context_error_ + call psb_errpush(info,name) + goto 9999 + else if (.not.desc_a%is_ok()) then + info = psb_err_invalid_cd_state_ + call psb_errpush(info,name) + goto 9999 + end if + + nrow = desc_a%get_local_rows() + ncol = desc_a%get_local_cols() + n = size(x) + if (debug_level >= psb_debug_ext_) & + & write(debug_unit,*) me,' ',trim(name),': sizes: ',nrow,ncol + + if (scratch_) then + do i=1,n + call x(i)%free(info) + call x(i)%bld(ncol,mold=mold) + end do + + else + do i=1, n + call x(i)%asb(ncol,info) + if (info /= 0) exit + ! ..update halo elements.. + call psb_halo(x(i),desc_a,info) + if (info /= 0) exit + if (present(mold)) then + call x(i)%cnv(mold) + end if + end do + if(info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='psb_halo') + goto 9999 + end if + end if + if (debug_level >= psb_debug_ext_) & + & write(debug_unit,*) me,' ',trim(name),': end' + + call psb_erractionrestore(err_act) + return + +9999 call psb_error_handler(ictxt,err_act) + + return + +end subroutine psb_iasb_vect_r2 diff --git a/base/tools/psb_icdasb.F90 b/base/tools/psb_icdasb.F90 index ca0cb4d34..9622fca4d 100644 --- a/base/tools/psb_icdasb.F90 +++ b/base/tools/psb_icdasb.F90 @@ -168,14 +168,8 @@ subroutine psb_icdasb(desc,info,ext_hv,mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_icdasb diff --git a/base/tools/psb_ifree.f90 b/base/tools/psb_ifree.f90 index d709cb366..f205324d8 100644 --- a/base/tools/psb_ifree.f90 +++ b/base/tools/psb_ifree.f90 @@ -32,21 +32,21 @@ ! File: psb_ifree.f90 ! ! Subroutine: psb_ifree -! frees a dense integer matrix structure +! frees a dense matrix structure ! ! Arguments: -! x(:,:) - integer(psb_ipk_), allocatable The dense matrix to be freed. -! desc_a - type(psb_desc_type). The communication descriptor. -! info - integer. Eventually returns an error code +! x(:,:) - integer, allocatable The dense matrix to be freed. +! desc_a - type(psb_desc_type). The communication descriptor. +! info - integer. Return code subroutine psb_ifree(x, desc_a, info) use psb_base_mod, psb_protect_name => psb_ifree implicit none !....parameters... - integer(psb_ipk_), allocatable, intent(inout) :: x(:,:) - type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_), intent(out) :: info - + integer(psb_ipk_),allocatable, intent(inout) :: x(:,:) + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(out) :: info + !...locals.... integer(psb_ipk_) :: ictxt,np,me, err_act character(len=20) :: name @@ -55,12 +55,11 @@ subroutine psb_ifree(x, desc_a, info) if(psb_get_errstatus() /= 0) return info=psb_success_ call psb_erractionsave(err_act) - name = 'psb_ifree' - + name='psb_ifree' if (.not.psb_is_ok_desc(desc_a)) then - info=psb_err_forgot_spall_ - call psb_errpush(info,name) - return + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + return end if ictxt=desc_a%get_context() @@ -74,79 +73,46 @@ subroutine psb_ifree(x, desc_a, info) endif if (.not.allocated(x)) then - info=psb_err_forgot_geall_ - call psb_errpush(info,name) - goto 9999 + info=psb_err_forgot_spall_ + call psb_errpush(info,name) + goto 9999 end if - + !deallocate x deallocate(x,stat=info) - if (info /= psb_success_) then - info=2045 - call psb_errpush(info,name) - goto 9999 + if (info /= psb_no_err_) then + info=psb_err_alloc_dealloc_ + call psb_errpush(info,name) + goto 9999 endif - + + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_ifree -!!$ -!!$ Parallel Sparse BLAS version 3.1 -!!$ (C) Copyright 2006, 2007, 2008, 2009, 2010, 2012, 2013 -!!$ Salvatore Filippone University of Rome Tor Vergata -!!$ Alfredo Buttari CNRS-IRIT, Toulouse -!!$ -!!$ Redistribution and use in source and binary forms, with or without -!!$ modification, are permitted provided that the following conditions -!!$ are met: -!!$ 1. Redistributions of source code must retain the above copyright -!!$ notice, this list of conditions and the following disclaimer. -!!$ 2. Redistributions in binary form must reproduce the above copyright -!!$ notice, this list of conditions, and the following disclaimer in the -!!$ documentation and/or other materials provided with the distribution. -!!$ 3. The name of the PSBLAS group or the names of its contributors may -!!$ not be used to endorse or promote products derived from this -!!$ software without specific written permission. -!!$ -!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS -!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -!!$ POSSIBILITY OF SUCH DAMAGE. -!!$ -!!$ ! Subroutine: psb_ifreev -! frees a dense integer matrix structure +! frees a dense matrix structure ! ! Arguments: -! x(:) - integer(psb_ipk_), allocatable The dense matrix to be freed. -! desc_a - type(psb_desc_type). The communication descriptor. -! info - integer. Eventually returns an error code -subroutine psb_ifreev(x, desc_a,info) +! x(:) - integer, allocatable The dense matrix to be freed. +! desc_a - type(psb_desc_type). The communication descriptor. +! info - integer. Return code +subroutine psb_ifreev(x, desc_a, info) use psb_base_mod, psb_protect_name => psb_ifreev implicit none !....parameters... - integer(psb_ipk_), allocatable, intent(inout) :: x(:) - type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_),allocatable, intent(inout) :: x(:) + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(out) :: info + !...locals.... integer(psb_ipk_) :: ictxt,np,me, err_act character(len=20) :: name @@ -155,26 +121,26 @@ subroutine psb_ifreev(x, desc_a,info) if(psb_get_errstatus() /= 0) return info=psb_success_ call psb_erractionsave(err_act) - name = 'psb_ifreev' + name='psb_ifreev' if (.not.psb_is_ok_desc(desc_a)) then info=psb_err_forgot_spall_ call psb_errpush(info,name) - return + goto 9999 end if ictxt=desc_a%get_context() call psb_info(ictxt, me, np) - ! ....verify blacs grid correctness.. if (np == -1) then info = psb_err_context_error_ call psb_errpush(info,name) goto 9999 + endif if (.not.allocated(x)) then - info=psb_err_forgot_geall_ + info=psb_err_forgot_spall_ call psb_errpush(info,name) goto 9999 end if @@ -189,17 +155,12 @@ subroutine psb_ifreev(x, desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_ifreev - subroutine psb_ifree_vect(x, desc_a, info) use psb_base_mod, psb_protect_name => psb_ifree_vect implicit none @@ -248,13 +209,59 @@ subroutine psb_ifree_vect(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_ifree_vect +subroutine psb_ifree_vect_r2(x, desc_a, info) + use psb_base_mod, psb_protect_name => psb_ifree_vect_r2 + implicit none + !....parameters... + type(psb_i_vect_type), allocatable, intent(inout) :: x(:) + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(out) :: info + !...locals.... + integer(psb_ipk_) :: ictxt,np,me,err_act, i + character(len=20) :: name + + + info=psb_success_ + if (psb_errstatus_fatal()) return + call psb_erractionsave(err_act) + name='psb_ifreev' + + if (.not.desc_a%is_ok()) then + info = psb_err_invalid_cd_state_ + call psb_errpush(info,name) + goto 9999 + end if + ictxt = desc_a%get_context() + + call psb_info(ictxt, me, np) + if (np == -1) then + info = psb_err_context_error_ + call psb_errpush(info,name) + goto 9999 + endif + + + do i=lbound(x,1),ubound(x,1) + call x(i)%free(info) + if (info /= 0) exit + end do + if (info == 0) deallocate(x,stat=info) + if (info /= psb_no_err_) then + info=psb_err_alloc_dealloc_ + call psb_errpush(info,name) + endif + + call psb_erractionrestore(err_act) + return + +9999 call psb_error_handler(ictxt,err_act) + + return + +end subroutine psb_ifree_vect_r2 diff --git a/base/tools/psb_iins.f90 b/base/tools/psb_iins.f90 index 44b6f695b..472159965 100644 --- a/base/tools/psb_iins.f90 +++ b/base/tools/psb_iins.f90 @@ -51,17 +51,18 @@ subroutine psb_iinsvi(m, irw, val, x, desc_a, info, dupl,local) implicit none ! m rows number of submatrix belonging to val to be inserted + ! ix x global-row corresponding to position at which val submatrix ! must be inserted !....parameters... - integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) - integer(psb_ipk_), intent(in) :: val(:) - integer(psb_ipk_),intent(inout) :: x(:) - type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: dupl + integer(psb_ipk_), intent(in) :: m + integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_ipk_), intent(in) :: val(:) + integer(psb_ipk_),intent(inout) :: x(:) + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: dupl logical, intent(in), optional :: local !locals..... @@ -75,13 +76,14 @@ subroutine psb_iinsvi(m, irw, val, x, desc_a, info, dupl,local) if(psb_get_errstatus() /= 0) return info=psb_success_ call psb_erractionsave(err_act) - name = 'psb_insvi' + name = 'psb_iinsvi' if (.not.desc_a%is_ok()) then info = psb_err_invalid_cd_state_ call psb_errpush(info,name) return end if + ictxt=desc_a%get_context() call psb_info(ictxt, me, np) @@ -117,7 +119,7 @@ subroutine psb_iinsvi(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) goto 9999 endif - + if (present(dupl)) then dupl_ = dupl else @@ -153,8 +155,8 @@ subroutine psb_iinsvi(m, irw, val, x, desc_a, info, dupl,local) !loop over all val's rows if (irl(i) > 0) then - ! this row belongs to me - ! copy i-th row of block val in x + ! this row belongs to me + ! copy i-th row of block val in x x(irl(i)) = x(irl(i)) + val(i) end if enddo @@ -169,17 +171,356 @@ subroutine psb_iinsvi(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue +9999 call psb_error_handler(ictxt,err_act) + + return + +end subroutine psb_iinsvi + + +subroutine psb_iins_vect(m, irw, val, x, desc_a, info, dupl,local) + use psb_base_mod, psb_protect_name => psb_iins_vect + use psi_mod + implicit none + + ! m rows number of submatrix belonging to val to be inserted + ! ix x global-row corresponding to position at which val submatrix + ! must be inserted + + !....parameters... + integer(psb_ipk_), intent(in) :: m + integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_ipk_), intent(in) :: val(:) + type(psb_i_vect_type), intent(inout) :: x + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: dupl + logical, intent(in), optional :: local + + !locals..... + integer(psb_ipk_) :: ictxt,i,& + & loc_rows,loc_cols,mglob,err_act, int_err(5) + integer(psb_ipk_) :: np, me, dupl_ + integer(psb_ipk_), allocatable :: irl(:) + logical :: local_ + character(len=20) :: name + + if (psb_errstatus_fatal()) return + info=psb_success_ + call psb_erractionsave(err_act) + name = 'psb_iinsvi' + + if (.not.desc_a%is_ok()) then + info = psb_err_invalid_cd_state_ + call psb_errpush(info,name) + goto 9999 + end if + + ictxt = desc_a%get_context() + + call psb_info(ictxt, me, np) + if (np == -1) then + info = psb_err_context_error_ + call psb_errpush(info,name) + goto 9999 + endif + + !... check parameters.... + if (m < 0) then + info = psb_err_iarg_neg_ + int_err(1) = 1 + int_err(2) = m + call psb_errpush(info,name,int_err) + goto 9999 + else if (x%get_nrows() < desc_a%get_local_rows()) then + info = 310 + int_err(1) = 5 + int_err(2) = 4 + call psb_errpush(info,name,int_err) + goto 9999 + endif + + if (m == 0) return + loc_rows = desc_a%get_local_rows() + loc_cols = desc_a%get_local_cols() + mglob = desc_a%get_global_rows() + + if (.not.allocated(x%v)) then + info = psb_err_invalid_vect_state_ + call psb_errpush(info,name) + goto 9999 + endif + + + + allocate(irl(m),stat=info) + if (info /= psb_success_) then + info = psb_err_alloc_dealloc_ + call psb_errpush(info,name) + goto 9999 + endif + + if (present(dupl)) then + dupl_ = dupl + else + dupl_ = psb_dupl_ovwrt_ + endif + if (present(local)) then + local_ = local + else + local_ = .false. + endif + + if (local_) then + irl(1:m) = irw(1:m) + else + call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) + end if + call x%ins(m,irl,val,dupl_,info) + if (info /= 0) then + call psb_errpush(info,name) + goto 9999 + end if + deallocate(irl) + call psb_erractionrestore(err_act) + return - if (err_act == psb_act_ret_) then - return +9999 call psb_error_handler(ictxt,err_act) + + return + +end subroutine psb_iins_vect + +subroutine psb_iins_vect_v(m, irw, val, x, desc_a, info, dupl,local) + use psb_base_mod, psb_protect_name => psb_iins_vect_v + use psi_mod + implicit none + + ! m rows number of submatrix belonging to val to be inserted + ! ix x global-row corresponding to position at which val submatrix + ! must be inserted + + !....parameters... + integer(psb_ipk_), intent(in) :: m + type(psb_i_vect_type), intent(inout) :: irw + type(psb_i_vect_type), intent(inout) :: val + type(psb_i_vect_type), intent(inout) :: x + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: dupl + logical, intent(in), optional :: local + + !locals..... + integer(psb_ipk_) :: ictxt,i,& + & loc_rows,loc_cols,mglob,err_act, int_err(5) + integer(psb_ipk_) :: np, me, dupl_ + integer(psb_ipk_), allocatable :: irl(:) + integer(psb_ipk_), allocatable :: lval(:) + logical :: local_ + character(len=20) :: name + + if (psb_errstatus_fatal()) return + info=psb_success_ + call psb_erractionsave(err_act) + name = 'psb_iinsvi_vect_v' + + if (.not.desc_a%is_ok()) then + info = psb_err_invalid_cd_state_ + call psb_errpush(info,name) + goto 9999 + end if + + ictxt = desc_a%get_context() + + call psb_info(ictxt, me, np) + if (np == -1) then + info = psb_err_context_error_ + call psb_errpush(info,name) + goto 9999 + endif + + !... check parameters.... + if (m < 0) then + info = psb_err_iarg_neg_ + int_err(1) = 1 + int_err(2) = m + call psb_errpush(info,name,int_err) + goto 9999 + else if (x%get_nrows() < desc_a%get_local_rows()) then + info = 310 + int_err(1) = 5 + int_err(2) = 4 + call psb_errpush(info,name,int_err) + goto 9999 + endif + + if (m == 0) return + loc_rows = desc_a%get_local_rows() + loc_cols = desc_a%get_local_cols() + mglob = desc_a%get_global_rows() + + if (.not.allocated(x%v)) then + info = psb_err_invalid_vect_state_ + call psb_errpush(info,name) + goto 9999 + endif + + + + if (present(dupl)) then + dupl_ = dupl + else + dupl_ = psb_dupl_ovwrt_ + endif + if (present(local)) then + local_ = local + else + local_ = .false. + endif + + if (local_) then + call x%ins(m,irw,val,dupl_,info) else - call psb_error(ictxt) + irl = irw%get_vect() + lval = val%get_vect() + call desc_a%indxmap%g2lip(irl(1:m),info,owned=.true.) + call x%ins(m,irl,lval,dupl_,info) + end if + if (info /= 0) then + call psb_errpush(info,name) + goto 9999 + end if + + call psb_erractionrestore(err_act) return -end subroutine psb_iinsvi +9999 call psb_error_handler(ictxt,err_act) + + return + +end subroutine psb_iins_vect_v + +subroutine psb_iins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) + use psb_base_mod, psb_protect_name => psb_iins_vect_r2 + use psi_mod + implicit none + + ! m rows number of submatrix belonging to val to be inserted + ! ix x global-row corresponding to position at which val submatrix + ! must be inserted + + !....parameters... + integer(psb_ipk_), intent(in) :: m + integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_ipk_), intent(in) :: val(:,:) + type(psb_i_vect_type), intent(inout) :: x(:) + type(psb_desc_type), intent(in) :: desc_a + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), optional, intent(in) :: dupl + logical, intent(in), optional :: local + + !locals..... + integer(psb_ipk_) :: ictxt,i,& + & loc_rows,loc_cols,mglob,err_act, int_err(5), n + integer(psb_ipk_) :: np, me, dupl_ + integer(psb_ipk_), allocatable :: irl(:) + logical :: local_ + character(len=20) :: name + + if (psb_errstatus_fatal()) return + info=psb_success_ + call psb_erractionsave(err_act) + name = 'psb_iinsvi' + + if (.not.desc_a%is_ok()) then + info = psb_err_invalid_cd_state_ + call psb_errpush(info,name) + goto 9999 + end if + + ictxt = desc_a%get_context() + + call psb_info(ictxt, me, np) + if (np == -1) then + info = psb_err_context_error_ + call psb_errpush(info,name) + goto 9999 + endif + if (.not.allocated(x(1)%v)) then + info = psb_err_invalid_vect_state_ + call psb_errpush(info,name) + goto 9999 + endif + + !... check parameters.... + if (m < 0) then + info = psb_err_iarg_neg_ + int_err(1) = 1 + int_err(2) = m + call psb_errpush(info,name,int_err) + goto 9999 + else if (x(1)%get_nrows() < desc_a%get_local_rows()) then + info = 310 + int_err(1) = 5 + int_err(2) = 4 + call psb_errpush(info,name,int_err) + goto 9999 + endif + + if (m == 0) return + loc_rows = desc_a%get_local_rows() + loc_cols = desc_a%get_local_cols() + mglob = desc_a%get_global_rows() + + + + n = min(size(x),size(val,2)) + allocate(irl(m),stat=info) + if (info /= psb_success_) then + info = psb_err_alloc_dealloc_ + call psb_errpush(info,name) + goto 9999 + endif + + if (present(dupl)) then + dupl_ = dupl + else + dupl_ = psb_dupl_ovwrt_ + endif + if (present(local)) then + local_ = local + else + local_ = .false. + endif + + if (local_) then + irl(1:m) = irw(1:m) + else + call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) + end if + + do i=1,n + if (.not.allocated(x(i)%v)) info = psb_err_invalid_vect_state_ + if (info == 0) call x(i)%ins(m,irl,val(:,i),dupl_,info) + if (info /= 0) exit + end do + if (info /= 0) then + call psb_errpush(info,name) + goto 9999 + end if + deallocate(irl) + + call psb_erractionrestore(err_act) + return + +9999 call psb_error_handler(ictxt,err_act) + + return + +end subroutine psb_iins_vect_r2 + !!$ @@ -242,8 +583,8 @@ subroutine psb_iinsi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m integer(psb_ipk_), intent(in) :: irw(:) - integer(psb_ipk_), intent(in) :: val(:,:) - integer(psb_ipk_),intent(inout) :: x(:,:) + integer(psb_ipk_), intent(in) :: val(:,:) + integer(psb_ipk_),intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -267,6 +608,7 @@ subroutine psb_iinsi(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) return end if + ictxt=desc_a%get_context() call psb_info(ictxt, me, np) @@ -310,7 +652,6 @@ subroutine psb_iinsi(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) goto 9999 endif - if (present(local)) then local_ = local else @@ -365,137 +706,10 @@ subroutine psb_iinsi(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_iinsi - -subroutine psb_iins_vect(m, irw, val, x, desc_a, info, dupl,local) - use psb_base_mod, psb_protect_name => psb_iins_vect - use psi_mod - implicit none - - ! m rows number of submatrix belonging to val to be inserted - ! ix x global-row corresponding to position at which val submatrix - ! must be inserted - - !....parameters... - integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) - integer(psb_ipk_), intent(in) :: val(:) - type(psb_i_vect_type), intent(inout) :: x - type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: dupl - logical, intent(in), optional :: local - - !locals..... - integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) - integer(psb_ipk_) :: np, me, dupl_ - integer(psb_ipk_), allocatable :: irl(:) - logical :: local_ - character(len=20) :: name - - if (psb_errstatus_fatal()) return - info=psb_success_ - call psb_erractionsave(err_act) - name = 'psb_iinsvi' - - if (.not.desc_a%is_ok()) then - info = psb_err_invalid_cd_state_ - call psb_errpush(info,name) - goto 9999 - end if - - ictxt = desc_a%get_context() - - call psb_info(ictxt, me, np) - if (np == -1) then - info = psb_err_context_error_ - call psb_errpush(info,name) - goto 9999 - endif - - !... check parameters.... - if (m < 0) then - info = psb_err_iarg_neg_ - int_err(1) = 1 - int_err(2) = m - call psb_errpush(info,name,int_err) - goto 9999 - else if (x%get_nrows() < desc_a%get_local_rows()) then - info = 310 - int_err(1) = 5 - int_err(2) = 4 - call psb_errpush(info,name,int_err) - goto 9999 - endif - - if (m == 0) return - loc_rows = desc_a%get_local_rows() - loc_cols = desc_a%get_local_cols() - mglob = desc_a%get_global_rows() - - if (.not.allocated(x%v)) then - info = psb_err_invalid_vect_state_ - call psb_errpush(info,name) - goto 9999 - endif - - - - allocate(irl(m),stat=info) - if (info /= psb_success_) then - info = psb_err_alloc_dealloc_ - call psb_errpush(info,name) - goto 9999 - endif - - if (present(dupl)) then - dupl_ = dupl - else - dupl_ = psb_dupl_ovwrt_ - endif - if (present(local)) then - local_ = local - else - local_ = .false. - endif - - if (local_) then - irl(1:m) = irw(1:m) - else - call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) - end if - call x%ins(m,irl,val,dupl_,info) - if (info /= 0) then - call psb_errpush(info,name) - goto 9999 - end if - deallocate(irl) - - call psb_erractionrestore(err_act) - return - -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if - return - -end subroutine psb_iins_vect - diff --git a/base/tools/psb_loc_to_glob.f90 b/base/tools/psb_loc_to_glob.f90 index 67e074094..c87a65d03 100644 --- a/base/tools/psb_loc_to_glob.f90 +++ b/base/tools/psb_loc_to_glob.f90 @@ -99,14 +99,8 @@ subroutine psb_loc_to_glob2v(x,y,desc_a,info,iact) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_loc_to_glob2v @@ -209,14 +203,8 @@ subroutine psb_loc_to_glob1v(x,desc_a,info,iact) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error() - end if return end subroutine psb_loc_to_glob1v diff --git a/base/tools/psb_sallc.f90 b/base/tools/psb_sallc.f90 index 73d27bb79..5c775cb28 100644 --- a/base/tools/psb_sallc.f90 +++ b/base/tools/psb_sallc.f90 @@ -48,7 +48,7 @@ subroutine psb_salloc(x, desc_a, info, n, lb) implicit none !....parameters... - real(psb_spk_), allocatable, intent(out) :: x(:,:) + real(psb_spk_), allocatable, intent(out) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a integer(psb_ipk_),intent(out) :: info integer(psb_ipk_), optional, intent(in) :: n, lb @@ -56,7 +56,7 @@ subroutine psb_salloc(x, desc_a, info, n, lb) !locals integer(psb_ipk_) :: np,me,err,nr,i,j,err_act integer(psb_ipk_) :: ictxt,n_ - integer(psb_ipk_) :: int_err(5), exch(3) + integer(psb_ipk_) :: int_err(5),exch(3) character(len=20) :: name name='psb_geall' @@ -111,7 +111,7 @@ subroutine psb_salloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,n_,x,info,lb2=lb) if (info /= psb_success_) then info=psb_err_alloc_request_ @@ -119,18 +119,14 @@ subroutine psb_salloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='real(psb_spk_)') goto 9999 endif - + x(:,:) = szero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_salloc @@ -167,9 +163,8 @@ end subroutine psb_salloc !!$ !!$ ! -! ! Function: psb_sallocv -! Allocates dense matrix for PSBLAS routines. +! Allocates dense matrix for PSBLAS routines ! The descriptor may be in either the build or assembled state. ! ! Arguments: @@ -229,7 +224,7 @@ subroutine psb_sallocv(x, desc_a,info,n) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,x,info) if (info /= psb_success_) then info=psb_err_alloc_request_ @@ -237,22 +232,19 @@ subroutine psb_sallocv(x, desc_a,info,n) call psb_errpush(info,name,int_err,a_err='real(psb_spk_)') goto 9999 endif - + x(:) = szero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sallocv + subroutine psb_salloc_vect(x, desc_a,info,n) use psb_base_mod, psb_protect_name => psb_salloc_vect use psi_mod @@ -320,12 +312,8 @@ subroutine psb_salloc_vect(x, desc_a,info,n) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_salloc_vect @@ -427,12 +415,8 @@ subroutine psb_salloc_vect_r2(x, desc_a,info,n,lb) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_salloc_vect_r2 diff --git a/base/tools/psb_sasb.f90 b/base/tools/psb_sasb.f90 index 980659216..e390eefe1 100644 --- a/base/tools/psb_sasb.f90 +++ b/base/tools/psb_sasb.f90 @@ -32,14 +32,14 @@ ! File: psb_sasb.f90 ! ! Subroutine: psb_sasb -! Assembles a dense matrix for PSBLAS routines. +! Assembles a dense matrix for PSBLAS routines ! Since the allocation may have been called with the desciptor ! in the build state we make sure that X has a number of rows ! allowing for the halo indices, reallocating if necessary. ! We also call the halo routine for good measure. ! ! Arguments: -! x(:,:) - real,allocatable The matrix to be assembled. +! x(:,:) - real, allocatable The matrix to be assembled. ! desc_a - type(psb_desc_type). The communication descriptor. ! info - integer. return code subroutine psb_sasb(x, desc_a, info) @@ -47,7 +47,7 @@ subroutine psb_sasb(x, desc_a, info) implicit none type(psb_desc_type), intent(in) :: desc_a - real(psb_spk_), allocatable, intent(inout) :: x(:,:) + real(psb_spk_), allocatable, intent(inout) :: x(:,:) integer(psb_ipk_), intent(out) :: info ! local variables @@ -83,8 +83,7 @@ subroutine psb_sasb(x, desc_a, info) goto 9999 else if (.not.psb_is_asb_desc(desc_a)) then if (debug_level >= psb_debug_ext_) & - & write(debug_unit,*) me,' ',trim(name),' error ',& - & desc_a%get_dectype() + & write(debug_unit,*) me,' ',trim(name),' error ' info = psb_err_input_matrix_unassembled_ call psb_errpush(info,name) goto 9999 @@ -122,12 +121,8 @@ subroutine psb_sasb(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sasb @@ -172,15 +167,15 @@ end subroutine psb_sasb ! We also call the halo routine for good measure. ! ! Arguments: -! x(:) - real,allocatable The matrix to be assembled. +! x(:) - real, allocatable The matrix to be assembled. ! desc_a - type(psb_desc_type). The communication descriptor. -! info - integer. Return code +! info - integer. Return code subroutine psb_sasbv(x, desc_a, info) use psb_base_mod, psb_protect_name => psb_sasbv implicit none - type(psb_desc_type), intent(in) :: desc_a - real(psb_spk_), allocatable, intent(inout) :: x(:) + type(psb_desc_type), intent(in) :: desc_a + real(psb_spk_), allocatable, intent(inout) :: x(:) integer(psb_ipk_), intent(out) :: info ! local variables @@ -240,16 +235,13 @@ subroutine psb_sasbv(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sasbv + subroutine psb_sasb_vect(x, desc_a, info, mold, scratch) use psb_base_mod, psb_protect_name => psb_sasb_vect implicit none @@ -319,12 +311,8 @@ subroutine psb_sasb_vect(x, desc_a, info, mold, scratch) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sasb_vect @@ -407,12 +395,8 @@ subroutine psb_sasb_vect_r2(x, desc_a, info, mold, scratch) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sasb_vect_r2 diff --git a/base/tools/psb_scdbldext.F90 b/base/tools/psb_scdbldext.F90 index fae47496c..dc85bfa9e 100644 --- a/base/tools/psb_scdbldext.F90 +++ b/base/tools/psb_scdbldext.F90 @@ -433,7 +433,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype) call psb_errpush(info,name,a_err='csget') goto 9999 end if - + call psb_ensure_size((idxs+tot_elem+n_elem),works,info) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -527,7 +527,7 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype) end if if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': going for first idx_cnv', desc_ov%indxmap%get_state() + & ': going for first idx_cnv', desc_ov%indxmap%get_state() call desc_ov%indxmap%g2l(workr(1:iszr),maskr(1:iszr),info) iszs = count(maskr(1:iszr)<=0) @@ -541,21 +541,21 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype) end do ! Eliminate duplicates from request call psb_msort_unique(works(1:j),iszs) - + ! ! fnd_owner on desc_a because we want the procs who ! owned the rows from the beginning! ! if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': going for fnd_owner', desc_ov%indxmap%get_state() + & ': going for fnd_owner', desc_ov%indxmap%get_state() call desc_a%fnd_owner(works(1:iszs),temp,info) n_col = desc_ov%get_local_cols() if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': Done fnd_owner', desc_ov%indxmap%get_state() - + & ': Done fnd_owner', desc_ov%indxmap%get_state() + do i=1,iszs idx = works(i) n_col = desc_ov%get_local_cols() @@ -567,14 +567,14 @@ Subroutine psb_scdbldext(a,desc_a,novr,desc_ov,info, extype) ! will be less than those for HALO(J) whenever I psb_sfree implicit none !....parameters... - real(psb_spk_),allocatable, intent(inout) :: x(:,:) + real(psb_spk_),allocatable, intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_),intent(out) :: info + integer(psb_ipk_), intent(out) :: info !...locals.... - integer(psb_ipk_) :: ictxt,np,me,err_act + integer(psb_ipk_) :: ictxt,np,me, err_act character(len=20) :: name @@ -59,10 +59,10 @@ subroutine psb_sfree(x, desc_a, info) if (.not.psb_is_ok_desc(desc_a)) then info=psb_err_forgot_spall_ call psb_errpush(info,name) - goto 9999 + return end if - ictxt = desc_a%get_context() + ictxt=desc_a%get_context() call psb_info(ictxt, me, np) ! ....verify blacs grid correctness.. @@ -90,12 +90,8 @@ subroutine psb_sfree(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sfree @@ -106,18 +102,19 @@ end subroutine psb_sfree ! frees a dense matrix structure ! ! Arguments: -! x():) - real, allocatable The dense matrix to be freed. -! desc_a - type(psb_desc_type). The communication descriptor. -! info - integer. Return code +! x(:) - real, allocatable The dense matrix to be freed. +! desc_a - type(psb_desc_type). The communication descriptor. +! info - integer. Return code subroutine psb_sfreev(x, desc_a, info) use psb_base_mod, psb_protect_name => psb_sfreev implicit none !....parameters... real(psb_spk_),allocatable, intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info + !...locals.... - integer(psb_ipk_) :: ictxt,np,me,err_act + integer(psb_ipk_) :: ictxt,np,me, err_act character(len=20) :: name @@ -126,18 +123,20 @@ subroutine psb_sfreev(x, desc_a, info) call psb_erractionsave(err_act) name='psb_sfreev' + if (.not.psb_is_ok_desc(desc_a)) then info=psb_err_forgot_spall_ call psb_errpush(info,name) - return + goto 9999 end if - ictxt = desc_a%get_context() + ictxt=desc_a%get_context() call psb_info(ictxt, me, np) if (np == -1) then info = psb_err_context_error_ call psb_errpush(info,name) goto 9999 + endif if (.not.allocated(x)) then @@ -156,12 +155,8 @@ subroutine psb_sfreev(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sfreev @@ -214,12 +209,8 @@ subroutine psb_sfree_vect(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sfree_vect @@ -269,12 +260,8 @@ subroutine psb_sfree_vect_r2(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sfree_vect_r2 diff --git a/base/tools/psb_sins.f90 b/base/tools/psb_sins.f90 index 4c2820400..b1f18cb80 100644 --- a/base/tools/psb_sins.f90 +++ b/base/tools/psb_sins.f90 @@ -171,14 +171,8 @@ subroutine psb_sinsvi(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_sinsvi @@ -265,7 +259,7 @@ subroutine psb_sins_vect(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) goto 9999 endif - + if (present(dupl)) then dupl_ = dupl else @@ -292,14 +286,8 @@ subroutine psb_sins_vect(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_sins_vect @@ -379,7 +367,7 @@ subroutine psb_sins_vect_v(m, irw, val, x, desc_a, info, dupl,local) endif - + if (present(dupl)) then dupl_ = dupl else @@ -408,14 +396,8 @@ subroutine psb_sins_vect_v(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_sins_vect_v @@ -501,7 +483,7 @@ subroutine psb_sins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) call psb_errpush(info,name) goto 9999 endif - + if (present(dupl)) then dupl_ = dupl else @@ -518,7 +500,7 @@ subroutine psb_sins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) else call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) end if - + do i=1,n if (.not.allocated(x(i)%v)) info = psb_err_invalid_vect_state_ if (info == 0) call x(i)%ins(m,irl,val(:,i),dupl_,info) @@ -533,14 +515,8 @@ subroutine psb_sins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_sins_vect_r2 @@ -687,7 +663,7 @@ subroutine psb_sinsi(m, irw, val, x, desc_a, info, dupl,local) else call desc_a%indxmap%g2l(irw(1:m),irl(1:m),info,owned=.true.) end if - + select case(dupl_) case(psb_dupl_ovwrt_) do i = 1, m @@ -730,14 +706,8 @@ subroutine psb_sinsi(m, irw, val, x, desc_a, info, dupl,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_sinsi diff --git a/base/tools/psb_sspalloc.f90 b/base/tools/psb_sspalloc.f90 index 73d6cb0df..52762c06e 100644 --- a/base/tools/psb_sspalloc.f90 +++ b/base/tools/psb_sspalloc.f90 @@ -119,14 +119,8 @@ subroutine psb_sspalloc(a, desc_a, info, nnz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) +9999 call psb_error_handler(ictxt,err_act) - if (err_act == psb_act_ret_) then - return - else - call psb_error(ictxt) - end if return end subroutine psb_sspalloc diff --git a/base/tools/psb_sspasb.f90 b/base/tools/psb_sspasb.f90 index c1f45abc4..3022d374f 100644 --- a/base/tools/psb_sspasb.f90 +++ b/base/tools/psb_sspasb.f90 @@ -140,12 +140,8 @@ subroutine psb_sspasb(a,desc_a, info, afmt, upd, dupl, mold) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sspasb diff --git a/base/tools/psb_sspfree.f90 b/base/tools/psb_sspfree.f90 index d64246eef..33fc47205 100644 --- a/base/tools/psb_sspfree.f90 +++ b/base/tools/psb_sspfree.f90 @@ -44,11 +44,11 @@ subroutine psb_sspfree(a, desc_a,info) implicit none !....parameters... - type(psb_desc_type), intent(in) :: desc_a + type(psb_desc_type), intent(in) :: desc_a type(psb_sspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info !...locals.... - integer(psb_ipk_) :: ictxt,err_act + integer(psb_ipk_) :: ictxt, err_act character(len=20) :: name if(psb_get_errstatus() /= 0) return @@ -57,7 +57,7 @@ subroutine psb_sspfree(a, desc_a,info) call psb_erractionsave(err_act) if (.not.psb_is_ok_desc(desc_a)) then - info=psb_err_forgot_spall_ + info = psb_err_forgot_spall_ call psb_errpush(info,name) return else @@ -70,12 +70,8 @@ subroutine psb_sspfree(a, desc_a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sspfree diff --git a/base/tools/psb_ssphalo.F90 b/base/tools/psb_ssphalo.F90 index e6b8ab252..3d80fb810 100644 --- a/base/tools/psb_ssphalo.F90 +++ b/base/tools/psb_ssphalo.F90 @@ -366,12 +366,8 @@ Subroutine psb_ssphalo(a,desc_a,blk,info,rowcnv,colcnv,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return End Subroutine psb_ssphalo diff --git a/base/tools/psb_sspins.f90 b/base/tools/psb_sspins.f90 index 2decc20cf..62e2da099 100644 --- a/base/tools/psb_sspins.f90 +++ b/base/tools/psb_sspins.f90 @@ -193,12 +193,8 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sspins @@ -313,12 +309,8 @@ subroutine psb_sspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sspins_2desc @@ -394,9 +386,9 @@ subroutine psb_sspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) if (desc_a%is_bld()) then !!$ if (local_) then - info = psb_err_invalid_a_and_cd_state_ - call psb_errpush(info,name) - goto 9999 + info = psb_err_invalid_a_and_cd_state_ + call psb_errpush(info,name) + goto 9999 !!$ else !!$ allocate(ila(nz),jla(nz),stat=info) !!$ if (info /= psb_success_) then @@ -444,7 +436,7 @@ subroutine psb_sspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) goto 9999 end if else - info = psb_err_invalid_cd_state_ + info = psb_err_invalid_cd_state_ !!$ allocate(ila(nz),jla(nz),stat=info) !!$ if (info /= psb_success_) then @@ -472,12 +464,8 @@ subroutine psb_sspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_sspins_v diff --git a/base/tools/psb_ssprn.f90 b/base/tools/psb_ssprn.f90 index 77d2905be..c6c2a2148 100644 --- a/base/tools/psb_ssprn.f90 +++ b/base/tools/psb_ssprn.f90 @@ -41,6 +41,7 @@ ! info - integer. Return code. ! clear - logical, optional Whether the coefficients should be zeroed ! default .true. +! Subroutine psb_ssprn(a, desc_a,info,clear) use psb_base_mod, psb_protect_name => psb_ssprn Implicit None @@ -90,12 +91,8 @@ Subroutine psb_ssprn(a, desc_a,info,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_ssprn diff --git a/base/tools/psb_zallc.f90 b/base/tools/psb_zallc.f90 index 09cb1496c..94ea47c6f 100644 --- a/base/tools/psb_zallc.f90 +++ b/base/tools/psb_zallc.f90 @@ -111,7 +111,7 @@ subroutine psb_zalloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,n_,x,info,lb2=lb) if (info /= psb_success_) then info=psb_err_alloc_request_ @@ -119,18 +119,14 @@ subroutine psb_zalloc(x, desc_a, info, n, lb) call psb_errpush(info,name,int_err,a_err='complex(psb_dpk_)') goto 9999 endif - + x(:,:) = zzero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_zalloc @@ -228,7 +224,7 @@ subroutine psb_zallocv(x, desc_a,info,n) call psb_errpush(info,name,int_err,a_err='Invalid desc_a') goto 9999 endif - + call psb_realloc(nr,x,info) if (info /= psb_success_) then info=psb_err_alloc_request_ @@ -236,18 +232,14 @@ subroutine psb_zallocv(x, desc_a,info,n) call psb_errpush(info,name,int_err,a_err='complex(psb_dpk_)') goto 9999 endif - + x(:) = zzero call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_zallocv @@ -320,12 +312,8 @@ subroutine psb_zalloc_vect(x, desc_a,info,n) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_zalloc_vect @@ -427,12 +415,8 @@ subroutine psb_zalloc_vect_r2(x, desc_a,info,n,lb) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_zalloc_vect_r2 diff --git a/base/tools/psb_zasb.f90 b/base/tools/psb_zasb.f90 index da72735f9..eba4a58e2 100644 --- a/base/tools/psb_zasb.f90 +++ b/base/tools/psb_zasb.f90 @@ -121,12 +121,8 @@ subroutine psb_zasb(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_zasb @@ -239,12 +235,8 @@ subroutine psb_zasbv(x, desc_a, info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_zasbv @@ -319,12 +311,8 @@ subroutine psb_zasb_vect(x, desc_a, info, mold, scratch) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_zasb_vect @@ -407,12 +395,8 @@ subroutine psb_zasb_vect_r2(x, desc_a, info, mold, scratch) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_zasb_vect_r2 diff --git a/base/tools/psb_zcdbldext.F90 b/base/tools/psb_zcdbldext.F90 index 782113991..fb87466d6 100644 --- a/base/tools/psb_zcdbldext.F90 +++ b/base/tools/psb_zcdbldext.F90 @@ -433,7 +433,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype) call psb_errpush(info,name,a_err='csget') goto 9999 end if - + call psb_ensure_size((idxs+tot_elem+n_elem),works,info) if (info /= psb_success_) then info=psb_err_from_subroutine_ @@ -527,7 +527,7 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype) end if if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': going for first idx_cnv', desc_ov%indxmap%get_state() + & ': going for first idx_cnv', desc_ov%indxmap%get_state() call desc_ov%indxmap%g2l(workr(1:iszr),maskr(1:iszr),info) iszs = count(maskr(1:iszr)<=0) @@ -541,21 +541,21 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype) end do ! Eliminate duplicates from request call psb_msort_unique(works(1:j),iszs) - + ! ! fnd_owner on desc_a because we want the procs who ! owned the rows from the beginning! ! if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': going for fnd_owner', desc_ov%indxmap%get_state() + & ': going for fnd_owner', desc_ov%indxmap%get_state() call desc_a%fnd_owner(works(1:iszs),temp,info) n_col = desc_ov%get_local_cols() if (debug_level >= psb_debug_outer_) & & write(debug_unit,*) me,' ',trim(name),& - & ': Done fnd_owner', desc_ov%indxmap%get_state() - + & ': Done fnd_owner', desc_ov%indxmap%get_state() + do i=1,iszs idx = works(i) n_col = desc_ov%get_local_cols() @@ -567,14 +567,14 @@ Subroutine psb_zcdbldext(a,desc_a,novr,desc_ov,info, extype) ! will be less than those for HALO(J) whenever I precout) type is (psb_c_bjac_prec_type) @@ -289,7 +281,7 @@ contains allocate(pout%dv,stat=info) if (info == 0) call prec%dv%clone(pout%dv,info) end if - class default + class default info = psb_err_internal_error_ end select if (info /= 0) goto 9999 @@ -297,12 +289,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_bjac_clone diff --git a/prec/psb_c_diagprec.f90 b/prec/psb_c_diagprec.f90 index 1919b245a..c2cc325cf 100644 --- a/prec/psb_c_diagprec.f90 +++ b/prec/psb_c_diagprec.f90 @@ -114,7 +114,7 @@ contains subroutine psb_c_diag_precinit(prec,info) Implicit None - + class(psb_c_diag_prec_type),intent(inout) :: prec integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: err_act, nrow @@ -124,47 +124,39 @@ contains info = psb_success_ - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_diag_precinit subroutine psb_c_diag_precfree(prec,info) - + Implicit None class(psb_c_diag_prec_type), intent(inout) :: prec integer(psb_ipk_), intent(out) :: info - + integer(psb_ipk_) :: err_act, nrow character(len=20) :: name='c_diag_precset' - + call psb_erractionsave(err_act) - + info = psb_success_ if (allocated(prec%dv)) call prec%dv%free(info) - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return - + end subroutine psb_c_diag_precfree @@ -182,7 +174,7 @@ contains call psb_erractionsave(err_act) info = psb_success_ - + if (present(iout)) then iout_ = iout else @@ -194,18 +186,14 @@ contains call psb_erractionsave(err_act) info = psb_success_ - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return - + end subroutine psb_c_diag_precdescr function psb_c_diag_sizeof(prec) result(val) @@ -247,7 +235,7 @@ contains if (info == psb_success_) deallocate(precout, stat=info) end if if (info == psb_success_) & - & allocate(psb_c_diag_prec_type :: precout, stat=info) + & allocate(psb_c_diag_prec_type :: precout, stat=info) if (info /= 0) goto 9999 select type(pout => precout) type is (psb_c_diag_prec_type) @@ -258,7 +246,7 @@ contains if (info == 0) call prec%dv%clone(pout%dv,info) end if if (info == 0) call psb_safe_ab_cpy(prec%d,pout%d,info) - class default + class default info = psb_err_internal_error_ end select if (info /= 0) goto 9999 @@ -266,12 +254,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_diag_clone diff --git a/prec/psb_c_nullprec.f90 b/prec/psb_c_nullprec.f90 index ba8c6b41e..db58d2c4a 100644 --- a/prec/psb_c_nullprec.f90 +++ b/prec/psb_c_nullprec.f90 @@ -99,12 +99,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_null_precinit @@ -131,12 +127,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_null_precbld @@ -157,12 +149,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_null_precfree @@ -194,12 +182,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_null_precdescr @@ -295,12 +279,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_c_null_clone diff --git a/prec/psb_c_prec_type.f90 b/prec/psb_c_prec_type.f90 index 0d44beb8c..0734fe41d 100644 --- a/prec/psb_c_prec_type.f90 +++ b/prec/psb_c_prec_type.f90 @@ -121,6 +121,8 @@ module psb_c_prec_type contains subroutine psb_cfile_prec_descr(p,iout) + use psb_base_mod + implicit none type(psb_cprec_type), intent(in) :: p integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_) :: iout_,info @@ -162,6 +164,8 @@ contains subroutine psb_c_precfree(p,info) + use psb_base_mod + implicit none type(psb_cprec_type), intent(inout) :: p integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: me, err_act,i @@ -178,16 +182,15 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_c_precfree subroutine psb_c_prec_free(prec,info) + use psb_base_mod + implicit none class(psb_cprec_type), intent(inout) :: prec integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: me, err_act,i @@ -208,13 +211,10 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_c_prec_free function psb_cprec_sizeof(prec) result(val) diff --git a/prec/psb_d_bjacprec.f90 b/prec/psb_d_bjacprec.f90 index 43d8921c0..a432eec5e 100644 --- a/prec/psb_d_bjacprec.f90 +++ b/prec/psb_d_bjacprec.f90 @@ -134,8 +134,8 @@ module psb_d_bjacprec contains subroutine psb_d_bjac_precdescr(prec,iout) - - Implicit None + use psb_error_mod + implicit none class(psb_d_bjac_prec_type), intent(in) :: prec integer(psb_ipk_), intent(in), optional :: iout @@ -166,12 +166,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_bjac_precdescr @@ -239,12 +235,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_bjac_precfree @@ -270,7 +262,7 @@ contains if (info == psb_success_) deallocate(precout, stat=info) end if if (info == psb_success_) & - & allocate(psb_d_bjac_prec_type :: precout, stat=info) + & allocate(psb_d_bjac_prec_type :: precout, stat=info) if (info /= 0) goto 9999 select type(pout => precout) type is (psb_d_bjac_prec_type) @@ -289,7 +281,7 @@ contains allocate(pout%dv,stat=info) if (info == 0) call prec%dv%clone(pout%dv,info) end if - class default + class default info = psb_err_internal_error_ end select if (info /= 0) goto 9999 @@ -297,12 +289,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_bjac_clone diff --git a/prec/psb_d_diagprec.f90 b/prec/psb_d_diagprec.f90 index 614db633d..b57dcbb27 100644 --- a/prec/psb_d_diagprec.f90 +++ b/prec/psb_d_diagprec.f90 @@ -114,7 +114,7 @@ contains subroutine psb_d_diag_precinit(prec,info) Implicit None - + class(psb_d_diag_prec_type),intent(inout) :: prec integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: err_act, nrow @@ -124,47 +124,39 @@ contains info = psb_success_ - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_diag_precinit subroutine psb_d_diag_precfree(prec,info) - + Implicit None class(psb_d_diag_prec_type), intent(inout) :: prec integer(psb_ipk_), intent(out) :: info - + integer(psb_ipk_) :: err_act, nrow character(len=20) :: name='d_diag_precset' - + call psb_erractionsave(err_act) - + info = psb_success_ if (allocated(prec%dv)) call prec%dv%free(info) - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return - + end subroutine psb_d_diag_precfree @@ -182,7 +174,7 @@ contains call psb_erractionsave(err_act) info = psb_success_ - + if (present(iout)) then iout_ = iout else @@ -194,18 +186,14 @@ contains call psb_erractionsave(err_act) info = psb_success_ - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return - + end subroutine psb_d_diag_precdescr function psb_d_diag_sizeof(prec) result(val) @@ -247,7 +235,7 @@ contains if (info == psb_success_) deallocate(precout, stat=info) end if if (info == psb_success_) & - & allocate(psb_d_diag_prec_type :: precout, stat=info) + & allocate(psb_d_diag_prec_type :: precout, stat=info) if (info /= 0) goto 9999 select type(pout => precout) type is (psb_d_diag_prec_type) @@ -258,7 +246,7 @@ contains if (info == 0) call prec%dv%clone(pout%dv,info) end if if (info == 0) call psb_safe_ab_cpy(prec%d,pout%d,info) - class default + class default info = psb_err_internal_error_ end select if (info /= 0) goto 9999 @@ -266,12 +254,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_diag_clone diff --git a/prec/psb_d_nullprec.f90 b/prec/psb_d_nullprec.f90 index 7fabd1e4c..7b8cbb327 100644 --- a/prec/psb_d_nullprec.f90 +++ b/prec/psb_d_nullprec.f90 @@ -99,12 +99,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_null_precinit @@ -131,12 +127,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_null_precbld @@ -157,12 +149,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_null_precfree @@ -194,12 +182,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_null_precdescr @@ -295,12 +279,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_d_null_clone diff --git a/prec/psb_d_prec_type.f90 b/prec/psb_d_prec_type.f90 index eda3c9a4d..7da7c3ee8 100644 --- a/prec/psb_d_prec_type.f90 +++ b/prec/psb_d_prec_type.f90 @@ -121,6 +121,8 @@ module psb_d_prec_type contains subroutine psb_dfile_prec_descr(p,iout) + use psb_base_mod + implicit none type(psb_dprec_type), intent(in) :: p integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_) :: iout_,info @@ -162,6 +164,8 @@ contains subroutine psb_d_precfree(p,info) + use psb_base_mod + implicit none type(psb_dprec_type), intent(inout) :: p integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: me, err_act,i @@ -178,16 +182,15 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_d_precfree subroutine psb_d_prec_free(prec,info) + use psb_base_mod + implicit none class(psb_dprec_type), intent(inout) :: prec integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: me, err_act,i @@ -208,13 +211,10 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_d_prec_free function psb_dprec_sizeof(prec) result(val) diff --git a/prec/psb_s_bjacprec.f90 b/prec/psb_s_bjacprec.f90 index fb7793ec0..dd2e7dfac 100644 --- a/prec/psb_s_bjacprec.f90 +++ b/prec/psb_s_bjacprec.f90 @@ -134,8 +134,8 @@ module psb_s_bjacprec contains subroutine psb_s_bjac_precdescr(prec,iout) - - Implicit None + use psb_error_mod + implicit none class(psb_s_bjac_prec_type), intent(in) :: prec integer(psb_ipk_), intent(in), optional :: iout @@ -166,12 +166,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_bjac_precdescr @@ -239,12 +235,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_bjac_precfree @@ -270,7 +262,7 @@ contains if (info == psb_success_) deallocate(precout, stat=info) end if if (info == psb_success_) & - & allocate(psb_s_bjac_prec_type :: precout, stat=info) + & allocate(psb_s_bjac_prec_type :: precout, stat=info) if (info /= 0) goto 9999 select type(pout => precout) type is (psb_s_bjac_prec_type) @@ -289,7 +281,7 @@ contains allocate(pout%dv,stat=info) if (info == 0) call prec%dv%clone(pout%dv,info) end if - class default + class default info = psb_err_internal_error_ end select if (info /= 0) goto 9999 @@ -297,12 +289,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_bjac_clone diff --git a/prec/psb_s_diagprec.f90 b/prec/psb_s_diagprec.f90 index 2dfa401f2..7bffea029 100644 --- a/prec/psb_s_diagprec.f90 +++ b/prec/psb_s_diagprec.f90 @@ -114,7 +114,7 @@ contains subroutine psb_s_diag_precinit(prec,info) Implicit None - + class(psb_s_diag_prec_type),intent(inout) :: prec integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: err_act, nrow @@ -124,47 +124,39 @@ contains info = psb_success_ - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_diag_precinit subroutine psb_s_diag_precfree(prec,info) - + Implicit None class(psb_s_diag_prec_type), intent(inout) :: prec integer(psb_ipk_), intent(out) :: info - + integer(psb_ipk_) :: err_act, nrow character(len=20) :: name='s_diag_precset' - + call psb_erractionsave(err_act) - + info = psb_success_ if (allocated(prec%dv)) call prec%dv%free(info) - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return - + end subroutine psb_s_diag_precfree @@ -182,7 +174,7 @@ contains call psb_erractionsave(err_act) info = psb_success_ - + if (present(iout)) then iout_ = iout else @@ -194,18 +186,14 @@ contains call psb_erractionsave(err_act) info = psb_success_ - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return - + end subroutine psb_s_diag_precdescr function psb_s_diag_sizeof(prec) result(val) @@ -247,7 +235,7 @@ contains if (info == psb_success_) deallocate(precout, stat=info) end if if (info == psb_success_) & - & allocate(psb_s_diag_prec_type :: precout, stat=info) + & allocate(psb_s_diag_prec_type :: precout, stat=info) if (info /= 0) goto 9999 select type(pout => precout) type is (psb_s_diag_prec_type) @@ -258,7 +246,7 @@ contains if (info == 0) call prec%dv%clone(pout%dv,info) end if if (info == 0) call psb_safe_ab_cpy(prec%d,pout%d,info) - class default + class default info = psb_err_internal_error_ end select if (info /= 0) goto 9999 @@ -266,12 +254,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_diag_clone diff --git a/prec/psb_s_nullprec.f90 b/prec/psb_s_nullprec.f90 index 17f717970..af5da86e6 100644 --- a/prec/psb_s_nullprec.f90 +++ b/prec/psb_s_nullprec.f90 @@ -99,12 +99,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_null_precinit @@ -131,12 +127,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_null_precbld @@ -157,12 +149,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_null_precfree @@ -194,12 +182,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_null_precdescr @@ -295,12 +279,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_s_null_clone diff --git a/prec/psb_s_prec_type.f90 b/prec/psb_s_prec_type.f90 index 149faed0d..2d58e4644 100644 --- a/prec/psb_s_prec_type.f90 +++ b/prec/psb_s_prec_type.f90 @@ -121,6 +121,8 @@ module psb_s_prec_type contains subroutine psb_sfile_prec_descr(p,iout) + use psb_base_mod + implicit none type(psb_sprec_type), intent(in) :: p integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_) :: iout_,info @@ -162,6 +164,8 @@ contains subroutine psb_s_precfree(p,info) + use psb_base_mod + implicit none type(psb_sprec_type), intent(inout) :: p integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: me, err_act,i @@ -178,16 +182,15 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_s_precfree subroutine psb_s_prec_free(prec,info) + use psb_base_mod + implicit none class(psb_sprec_type), intent(inout) :: prec integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: me, err_act,i @@ -208,13 +211,10 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_s_prec_free function psb_sprec_sizeof(prec) result(val) diff --git a/prec/psb_z_bjacprec.f90 b/prec/psb_z_bjacprec.f90 index 01a8b06ea..7ef251525 100644 --- a/prec/psb_z_bjacprec.f90 +++ b/prec/psb_z_bjacprec.f90 @@ -134,8 +134,8 @@ module psb_z_bjacprec contains subroutine psb_z_bjac_precdescr(prec,iout) - - Implicit None + use psb_error_mod + implicit none class(psb_z_bjac_prec_type), intent(in) :: prec integer(psb_ipk_), intent(in), optional :: iout @@ -166,12 +166,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_bjac_precdescr @@ -239,12 +235,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_bjac_precfree @@ -270,7 +262,7 @@ contains if (info == psb_success_) deallocate(precout, stat=info) end if if (info == psb_success_) & - & allocate(psb_z_bjac_prec_type :: precout, stat=info) + & allocate(psb_z_bjac_prec_type :: precout, stat=info) if (info /= 0) goto 9999 select type(pout => precout) type is (psb_z_bjac_prec_type) @@ -289,7 +281,7 @@ contains allocate(pout%dv,stat=info) if (info == 0) call prec%dv%clone(pout%dv,info) end if - class default + class default info = psb_err_internal_error_ end select if (info /= 0) goto 9999 @@ -297,12 +289,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_bjac_clone diff --git a/prec/psb_z_diagprec.f90 b/prec/psb_z_diagprec.f90 index dc562aec7..13732fa35 100644 --- a/prec/psb_z_diagprec.f90 +++ b/prec/psb_z_diagprec.f90 @@ -114,7 +114,7 @@ contains subroutine psb_z_diag_precinit(prec,info) Implicit None - + class(psb_z_diag_prec_type),intent(inout) :: prec integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: err_act, nrow @@ -124,47 +124,39 @@ contains info = psb_success_ - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_diag_precinit subroutine psb_z_diag_precfree(prec,info) - + Implicit None class(psb_z_diag_prec_type), intent(inout) :: prec integer(psb_ipk_), intent(out) :: info - + integer(psb_ipk_) :: err_act, nrow character(len=20) :: name='z_diag_precset' - + call psb_erractionsave(err_act) - + info = psb_success_ if (allocated(prec%dv)) call prec%dv%free(info) - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return - + end subroutine psb_z_diag_precfree @@ -182,7 +174,7 @@ contains call psb_erractionsave(err_act) info = psb_success_ - + if (present(iout)) then iout_ = iout else @@ -194,18 +186,14 @@ contains call psb_erractionsave(err_act) info = psb_success_ - + call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return - + end subroutine psb_z_diag_precdescr function psb_z_diag_sizeof(prec) result(val) @@ -247,7 +235,7 @@ contains if (info == psb_success_) deallocate(precout, stat=info) end if if (info == psb_success_) & - & allocate(psb_z_diag_prec_type :: precout, stat=info) + & allocate(psb_z_diag_prec_type :: precout, stat=info) if (info /= 0) goto 9999 select type(pout => precout) type is (psb_z_diag_prec_type) @@ -258,7 +246,7 @@ contains if (info == 0) call prec%dv%clone(pout%dv,info) end if if (info == 0) call psb_safe_ab_cpy(prec%d,pout%d,info) - class default + class default info = psb_err_internal_error_ end select if (info /= 0) goto 9999 @@ -266,12 +254,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_diag_clone diff --git a/prec/psb_z_nullprec.f90 b/prec/psb_z_nullprec.f90 index 6ba730b92..43ec0ecf6 100644 --- a/prec/psb_z_nullprec.f90 +++ b/prec/psb_z_nullprec.f90 @@ -99,12 +99,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_null_precinit @@ -131,12 +127,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_null_precbld @@ -157,12 +149,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_null_precfree @@ -194,12 +182,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_null_precdescr @@ -295,12 +279,8 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return end subroutine psb_z_null_clone diff --git a/prec/psb_z_prec_type.f90 b/prec/psb_z_prec_type.f90 index 1199b159d..37eb1ffab 100644 --- a/prec/psb_z_prec_type.f90 +++ b/prec/psb_z_prec_type.f90 @@ -121,6 +121,8 @@ module psb_z_prec_type contains subroutine psb_zfile_prec_descr(p,iout) + use psb_base_mod + implicit none type(psb_zprec_type), intent(in) :: p integer(psb_ipk_), intent(in), optional :: iout integer(psb_ipk_) :: iout_,info @@ -162,6 +164,8 @@ contains subroutine psb_z_precfree(p,info) + use psb_base_mod + implicit none type(psb_zprec_type), intent(inout) :: p integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: me, err_act,i @@ -178,16 +182,15 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_z_precfree subroutine psb_z_prec_free(prec,info) + use psb_base_mod + implicit none class(psb_zprec_type), intent(inout) :: prec integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: me, err_act,i @@ -208,13 +211,10 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) + return + end subroutine psb_z_prec_free function psb_zprec_sizeof(prec) result(val) diff --git a/test/fileread/cf_sample.f90 b/test/fileread/cf_sample.f90 index 4bd3547a9..29ec215b6 100644 --- a/test/fileread/cf_sample.f90 +++ b/test/fileread/cf_sample.f90 @@ -70,7 +70,7 @@ program cf_sample integer(psb_ipk_) :: iparm(20) ! other variables - integer(psb_ipk_) :: i,info,j,m_problem + integer(psb_ipk_) :: i,info,j,m_problem, err_act integer(psb_ipk_) :: internal, m,ii,nnzero real(psb_dpk_) :: t1, t2, tprec real(psb_spk_) :: r_amax, b_amax, scale,resmx,resmxp @@ -314,14 +314,12 @@ program cf_sample call psb_spfree(a, desc_a,info) call psb_precfree(prec,info) call psb_cdfree(desc_a,info) - -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop - + +9999 call psb_error(ictxt) + + stop end program cf_sample diff --git a/test/fileread/df_sample.f90 b/test/fileread/df_sample.f90 index 993422cfb..0143a8389 100644 --- a/test/fileread/df_sample.f90 +++ b/test/fileread/df_sample.f90 @@ -326,13 +326,12 @@ program df_sample call psb_precfree(prec,info) call psb_cdfree(desc_a,info) -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop end program df_sample diff --git a/test/fileread/sf_sample.f90 b/test/fileread/sf_sample.f90 index 0e26cc414..32ffc12a9 100644 --- a/test/fileread/sf_sample.f90 +++ b/test/fileread/sf_sample.f90 @@ -319,13 +319,12 @@ program sf_sample call psb_precfree(prec,info) call psb_cdfree(desc_a,info) -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop end program sf_sample diff --git a/test/fileread/zf_sample.f90 b/test/fileread/zf_sample.f90 index e2060b96b..c3d217ea6 100644 --- a/test/fileread/zf_sample.f90 +++ b/test/fileread/zf_sample.f90 @@ -314,13 +314,12 @@ program zf_sample call psb_spfree(a, desc_a,info) call psb_precfree(prec,info) call psb_cdfree(desc_a,info) - -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop + +9999 call psb_error(ictxt) + + stop end program zf_sample diff --git a/test/kernel/d_file_spmv.f90 b/test/kernel/d_file_spmv.f90 index 4db2d0a6e..1198c4390 100644 --- a/test/kernel/d_file_spmv.f90 +++ b/test/kernel/d_file_spmv.f90 @@ -283,14 +283,13 @@ program d_file_spmv call psb_gefree(x_col, desc_a,info) call psb_spfree(a, desc_a,info) call psb_cdfree(desc_a,info) - -9999 continue - if(info /= 0) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop + end program d_file_spmv diff --git a/test/kernel/pdgenspmv.f90 b/test/kernel/pdgenspmv.f90 index e252d5f57..405cff97c 100644 --- a/test/kernel/pdgenspmv.f90 +++ b/test/kernel/pdgenspmv.f90 @@ -189,13 +189,13 @@ program pdgenspmv goto 9999 end if -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop + contains ! ! get iteration parameters from standard input diff --git a/test/kernel/s_file_spmv.f90 b/test/kernel/s_file_spmv.f90 index 51e1e523d..1f0961f48 100644 --- a/test/kernel/s_file_spmv.f90 +++ b/test/kernel/s_file_spmv.f90 @@ -283,13 +283,13 @@ program s_file_spmv call psb_spfree(a, desc_a,info) call psb_cdfree(desc_a,info) -9999 continue - if(info /= 0) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop + end program s_file_spmv diff --git a/test/pargen/ppde2d.f90 b/test/pargen/ppde2d.f90 index 02d9031b5..c25ff2b22 100644 --- a/test/pargen/ppde2d.f90 +++ b/test/pargen/ppde2d.f90 @@ -262,13 +262,13 @@ program ppde2d goto 9999 end if -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop + contains ! ! get iteration parameters from standard input diff --git a/test/pargen/ppde3d.f90 b/test/pargen/ppde3d.f90 index 7fb33f9d0..c5059ae02 100644 --- a/test/pargen/ppde3d.f90 +++ b/test/pargen/ppde3d.f90 @@ -275,13 +275,13 @@ program ppde3d goto 9999 end if -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop + contains ! ! get iteration parameters from standard input diff --git a/test/pargen/runs/ppde.inp b/test/pargen/runs/ppde.inp index 87d51541a..d0dc36f5f 100644 --- a/test/pargen/runs/ppde.inp +++ b/test/pargen/runs/ppde.inp @@ -2,7 +2,7 @@ BICGSTAB Iterative method BICGSTAB CGS BICG BICGSTABL RGMRES BJAC Preconditioner NONE DIAG BJAC CSR Storage format for matrix A: CSR COO JAD -160 Domain size (acutal system is this**3) +100 Domain size (acutal system is this**3) 2 Stopping criterion 1000 MAXIT -1 ITRACE diff --git a/test/pargen/spde2d.f90 b/test/pargen/spde2d.f90 index 27dc18b3c..b0878fe57 100644 --- a/test/pargen/spde2d.f90 +++ b/test/pargen/spde2d.f90 @@ -261,13 +261,13 @@ program spde2d goto 9999 end if -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop + contains ! ! get iteration parameters from standard input diff --git a/test/pargen/spde3d.f90 b/test/pargen/spde3d.f90 index 8c30a7dfd..07c817d73 100644 --- a/test/pargen/spde3d.f90 +++ b/test/pargen/spde3d.f90 @@ -275,13 +275,13 @@ program spde3d goto 9999 end if -9999 continue - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop +9999 call psb_error(ictxt) + + stop + contains ! ! get iteration parameters from standard input diff --git a/test/serial/Makefile b/test/serial/Makefile index 89bf21d8d..9ffb37cec 100644 --- a/test/serial/Makefile +++ b/test/serial/Makefile @@ -16,10 +16,10 @@ EXEDIR=./runs all: d_matgen -psb_d_cxx_impl.o d_matgen.o: psb_d_cxx_mat_mod.o +psb_d_xyz_impl.o d_matgen.o: psb_d_xyz_mat_mod.o -d_matgen: d_matgen.o psb_d_cxx_mat_mod.o psb_d_cxx_impl.o - $(F90LINK) $(LINKOPT) d_matgen.o psb_d_cxx_mat_mod.o psb_d_cxx_impl.o \ +d_matgen: d_matgen.o psb_d_xyz_mat_mod.o psb_d_xyz_impl.o + $(F90LINK) $(LINKOPT) d_matgen.o psb_d_xyz_mat_mod.o psb_d_xyz_impl.o \ -o d_matgen $(PSBLAS_LIB) $(LDLIBS) /bin/cp -p $(CPUPDFLAG) d_matgen $(EXEDIR) # /bin/mv d_matgen $(EXEDIR) @@ -29,7 +29,7 @@ check: all clean: /bin/rm -f d_matgen.o \ - psb_d_cxx_mat_mod.o psb_d_cxx_impl.o *$(.mod) + psb_d_xyz_mat_mod.o psb_d_xyz_impl.o *$(.mod) verycleanlib: (cd ../..; make veryclean) lib: diff --git a/test/serial/d_matgen.F90 b/test/serial/d_matgen.F90 index 16134efbf..139ddea6e 100644 --- a/test/serial/d_matgen.F90 +++ b/test/serial/d_matgen.F90 @@ -2,7 +2,7 @@ program d_matgen use psb_base_mod use psb_util_mod - use psb_d_cxx_mat_mod + use psb_d_xyz_mat_mod implicit none ! input parameters @@ -29,7 +29,7 @@ program d_matgen integer(psb_long_int_k_) :: amatsize, precsize, descsize real(psb_dpk_) :: err, eps type(psb_d_csr_sparse_mat) :: acsr - type(psb_d_cxx_sparse_mat) :: acxx + type(psb_d_xyz_sparse_mat) :: axyz ! other variables integer(psb_ipk_) :: info, err_act @@ -64,24 +64,18 @@ program d_matgen & a1,a2,a3,b1,b2,b3,c,g,info,amold=acsr) else if (.false.) then call psb_gen_pde3d(ictxt,idim,a,b,x,desc_a,afmt,& - & a1,a2,a3,b1,b2,b3,c,g,info,amold=acxx) + & a1,a2,a3,b1,b2,b3,c,g,info,amold=axyz) end if call psb_barrier(ictxt) t2 = psb_wtime() - t1 - if(info /= psb_success_) then - call psb_error(ictxt) - end if call psb_exit(ictxt) stop -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - end if +9999 call psb_error(ictxt) + stop contains diff --git a/test/serial/psb_d_cxx_impl.f90 b/test/serial/psb_d_xyz_impl.f90 similarity index 86% rename from test/serial/psb_d_cxx_impl.f90 rename to test/serial/psb_d_xyz_impl.f90 index b0c4f691b..ffec703d6 100644 --- a/test/serial/psb_d_cxx_impl.f90 +++ b/test/serial/psb_d_xyz_impl.f90 @@ -43,12 +43,12 @@ ! ! == =================================== -subroutine psb_d_cxx_csmv(alpha,a,x,beta,y,info,trans) +subroutine psb_d_xyz_csmv(alpha,a,x,beta,y,info,trans) use psb_error_mod use psb_string_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_csmv + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_csmv implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) real(psb_dpk_), intent(inout) :: y(:) integer(psb_ipk_), intent(out) :: info @@ -60,7 +60,7 @@ subroutine psb_d_cxx_csmv(alpha,a,x,beta,y,info,trans) logical :: tra, ctra integer(psb_ipk_) :: err_act integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_csmv' + character(len=20) :: name='d_xyz_csmv' logical, parameter :: debug=.false. call psb_erractionsave(err_act) @@ -105,24 +105,18 @@ subroutine psb_d_cxx_csmv(alpha,a,x,beta,y,info,trans) end if - call psb_d_cxx_csmv_inner(m,n,alpha,a%irp,a%ja,a%val,& + call psb_d_xyz_csmv_inner(m,n,alpha,a%irp,a%ja,a%val,& & a%is_triangle(),a%is_unit(),& & x,beta,y,tra,ctra) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains - subroutine psb_d_cxx_csmv_inner(m,n,alpha,irp,ja,val,is_triangle,is_unit,& + subroutine psb_d_xyz_csmv_inner(m,n,alpha,irp,ja,val,is_triangle,is_unit,& & x,beta,y,tra,ctra) integer(psb_ipk_), intent(in) :: m,n,irp(*),ja(*) real(psb_dpk_), intent(in) :: alpha, beta, x(*),val(*) @@ -387,17 +381,17 @@ contains end if - end subroutine psb_d_cxx_csmv_inner + end subroutine psb_d_xyz_csmv_inner -end subroutine psb_d_cxx_csmv +end subroutine psb_d_xyz_csmv -subroutine psb_d_cxx_csmm(alpha,a,x,beta,y,info,trans) +subroutine psb_d_xyz_csmm(alpha,a,x,beta,y,info,trans) use psb_error_mod use psb_string_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_csmm + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_csmm implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:,:) real(psb_dpk_), intent(inout) :: y(:,:) integer(psb_ipk_), intent(out) :: info @@ -409,7 +403,7 @@ subroutine psb_d_cxx_csmm(alpha,a,x,beta,y,info,trans) logical :: tra, ctra integer(psb_ipk_) :: err_act integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_csmm' + character(len=20) :: name='d_xyz_csmm' logical, parameter :: debug=.false. info = psb_success_ @@ -460,24 +454,18 @@ subroutine psb_d_cxx_csmm(alpha,a,x,beta,y,info,trans) goto 9999 end if - call psb_d_cxx_csmm_inner(m,n,nc,alpha,a%irp,a%ja,a%val, & + call psb_d_xyz_csmm_inner(m,n,nc,alpha,a%irp,a%ja,a%val, & & a%is_triangle(),a%is_unit(),x,size(x,1,kind=psb_ipk_), & & beta,y,size(y,1,kind=psb_ipk_),tra,ctra,acc) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains - subroutine psb_d_cxx_csmm_inner(m,n,nc,alpha,irp,ja,val,& + subroutine psb_d_xyz_csmm_inner(m,n,nc,alpha,irp,ja,val,& & is_triangle,is_unit,x,ldx,beta,y,ldy,tra,ctra,acc) integer(psb_ipk_), intent(in) :: m,n,ldx,ldy,nc,irp(*),ja(*) real(psb_dpk_), intent(in) :: alpha, beta, x(ldx,*),val(*) @@ -739,17 +727,17 @@ contains end do end if - end subroutine psb_d_cxx_csmm_inner + end subroutine psb_d_xyz_csmm_inner -end subroutine psb_d_cxx_csmm +end subroutine psb_d_xyz_csmm -subroutine psb_d_cxx_cssv(alpha,a,x,beta,y,info,trans) +subroutine psb_d_xyz_cssv(alpha,a,x,beta,y,info,trans) use psb_error_mod use psb_string_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_cssv + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_cssv implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) real(psb_dpk_), intent(inout) :: y(:) integer(psb_ipk_), intent(out) :: info @@ -762,7 +750,7 @@ subroutine psb_d_cxx_cssv(alpha,a,x,beta,y,info,trans) logical :: tra,ctra integer(psb_ipk_) :: err_act integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_cssv' + character(len=20) :: name='d_xyz_cssv' logical, parameter :: debug=.false. info = psb_success_ @@ -817,7 +805,7 @@ subroutine psb_d_cxx_cssv(alpha,a,x,beta,y,info,trans) if (beta == dzero) then - call inner_cxxsv(tra,ctra,a%is_lower(),a%is_unit(),a%get_nrows(),& + call inner_xyzsv(tra,ctra,a%is_lower(),a%is_unit(),a%get_nrows(),& & a%irp,a%ja,a%val,x,y) if (alpha == done) then ! do nothing @@ -836,7 +824,7 @@ subroutine psb_d_cxx_cssv(alpha,a,x,beta,y,info,trans) return end if - call inner_cxxsv(tra,ctra,a%is_lower(),a%is_unit(),a%get_nrows(),& + call inner_xyzsv(tra,ctra,a%is_lower(),a%is_unit(),a%get_nrows(),& & a%irp,a%ja,a%val,x,tmp) call psb_geaxpby(m,alpha,tmp,beta,y,info) @@ -846,18 +834,12 @@ subroutine psb_d_cxx_cssv(alpha,a,x,beta,y,info,trans) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains - subroutine inner_cxxsv(tra,ctra,lower,unit,n,irp,ja,val,x,y) + subroutine inner_xyzsv(tra,ctra,lower,unit,n,irp,ja,val,x,y) implicit none logical, intent(in) :: tra,ctra,lower,unit integer(psb_ipk_), intent(in) :: irp(*), ja(*),n @@ -1006,18 +988,18 @@ contains end if end if - end subroutine inner_cxxsv + end subroutine inner_xyzsv -end subroutine psb_d_cxx_cssv +end subroutine psb_d_xyz_cssv -subroutine psb_d_cxx_cssm(alpha,a,x,beta,y,info,trans) +subroutine psb_d_xyz_cssm(alpha,a,x,beta,y,info,trans) use psb_error_mod use psb_string_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_cssm + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_cssm implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:,:) real(psb_dpk_), intent(inout) :: y(:,:) integer(psb_ipk_), intent(out) :: info @@ -1030,7 +1012,7 @@ subroutine psb_d_cxx_cssm(alpha,a,x,beta,y,info,trans) logical :: tra, ctra integer(psb_ipk_) :: err_act integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_cssm' + character(len=20) :: name='d_xyz_cssm' logical, parameter :: debug=.false. info = psb_success_ @@ -1075,7 +1057,7 @@ subroutine psb_d_cxx_cssm(alpha,a,x,beta,y,info,trans) end if if (beta == dzero) then - call inner_cxxsm(tra,ctra,a%is_lower(),a%is_unit(),a%get_nrows(),nc,& + call inner_xyzsm(tra,ctra,a%is_lower(),a%is_unit(),a%get_nrows(),nc,& & a%irp,a%ja,a%val,x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info) do i = 1, m y(i,1:nc) = alpha*y(i,1:nc) @@ -1088,7 +1070,7 @@ subroutine psb_d_cxx_cssm(alpha,a,x,beta,y,info,trans) goto 9999 end if - call inner_cxxsm(tra,ctra,a%is_lower(),a%is_unit(),a%get_nrows(),nc,& + call inner_xyzsm(tra,ctra,a%is_lower(),a%is_unit(),a%get_nrows(),nc,& & a%irp,a%ja,a%val,x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info) do i = 1, m y(i,1:nc) = alpha*tmp(i,1:nc) + beta*y(i,1:nc) @@ -1097,7 +1079,7 @@ subroutine psb_d_cxx_cssm(alpha,a,x,beta,y,info,trans) if(info /= psb_success_) then info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='inner_cxxsm') + call psb_errpush(info,name,a_err='inner_xyzsm') goto 9999 end if @@ -1105,19 +1087,13 @@ subroutine psb_d_cxx_cssm(alpha,a,x,beta,y,info,trans) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains - subroutine inner_cxxsm(tra,ctra,lower,unit,nr,nc,& + subroutine inner_xyzsm(tra,ctra,lower,unit,nr,nc,& & irp,ja,val,x,ldx,y,ldy,info) implicit none logical, intent(in) :: tra,ctra,lower,unit @@ -1273,20 +1249,20 @@ contains end if end if - end subroutine inner_cxxsm + end subroutine inner_xyzsm -end subroutine psb_d_cxx_cssm +end subroutine psb_d_xyz_cssm -function psb_d_cxx_maxval(a) result(res) +function psb_d_xyz_maxval(a) result(res) use psb_error_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_maxval + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_maxval implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_) :: res integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc, info integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_maxval' + character(len=20) :: name='d_xyz_maxval' logical, parameter :: debug=.false. @@ -1296,13 +1272,13 @@ function psb_d_cxx_maxval(a) result(res) nnz = min(nnz,size(a%val)) res = maxval(abs(a%val(1:nnz))) end if -end function psb_d_cxx_maxval +end function psb_d_xyz_maxval -function psb_d_cxx_csnmi(a) result(res) +function psb_d_xyz_csnmi(a) result(res) use psb_error_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_csnmi + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_csnmi implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_) :: res integer(psb_ipk_) :: i,j,k,m,n, nr, ir, jc, nc @@ -1324,15 +1300,15 @@ function psb_d_cxx_csnmi(a) result(res) res = max(res,acc) end do -end function psb_d_cxx_csnmi +end function psb_d_xyz_csnmi -function psb_d_cxx_csnm1(a) result(res) +function psb_d_xyz_csnm1(a) result(res) use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_csnm1 + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_csnm1 implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_) :: res integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc, info @@ -1341,7 +1317,7 @@ function psb_d_cxx_csnm1(a) result(res) logical :: tra integer(psb_ipk_) :: err_act integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_csnm1' + character(len=20) :: name='d_xyz_csnm1' logical, parameter :: debug=.false. @@ -1363,13 +1339,13 @@ function psb_d_cxx_csnm1(a) result(res) return -end function psb_d_cxx_csnm1 +end function psb_d_xyz_csnm1 -subroutine psb_d_cxx_rowsum(d,a) +subroutine psb_d_xyz_rowsum(d,a) use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_rowsum - class(psb_d_cxx_sparse_mat), intent(in) :: a + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_rowsum + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc @@ -1408,22 +1384,16 @@ subroutine psb_d_cxx_rowsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_rowsum +end subroutine psb_d_xyz_rowsum -subroutine psb_d_cxx_arwsum(d,a) +subroutine psb_d_xyz_arwsum(d,a) use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_arwsum - class(psb_d_cxx_sparse_mat), intent(in) :: a + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_arwsum + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc @@ -1462,22 +1432,16 @@ subroutine psb_d_cxx_arwsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_arwsum +end subroutine psb_d_xyz_arwsum -subroutine psb_d_cxx_colsum(d,a) +subroutine psb_d_xyz_colsum(d,a) use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_colsum - class(psb_d_cxx_sparse_mat), intent(in) :: a + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_colsum + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc @@ -1519,22 +1483,16 @@ subroutine psb_d_cxx_colsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_colsum +end subroutine psb_d_xyz_colsum -subroutine psb_d_cxx_aclsum(d,a) +subroutine psb_d_xyz_aclsum(d,a) use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_aclsum - class(psb_d_cxx_sparse_mat), intent(in) :: a + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_aclsum + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) integer(psb_ipk_) :: i,j,k,m,n, nnz, ir, jc, nc @@ -1576,23 +1534,17 @@ subroutine psb_d_cxx_aclsum(d,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_aclsum +end subroutine psb_d_xyz_aclsum -subroutine psb_d_cxx_get_diag(a,d,info) +subroutine psb_d_xyz_get_diag(a,d,info) use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_get_diag + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_get_diag implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) integer(psb_ipk_), intent(out) :: info @@ -1633,24 +1585,19 @@ subroutine psb_d_cxx_get_diag(a,d,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_get_diag +end subroutine psb_d_xyz_get_diag -subroutine psb_d_cxx_scal(d,a,info,side) +subroutine psb_d_xyz_scal(d,a,info,side) use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_scal + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_scal use psb_string_mod implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d(:) integer(psb_ipk_), intent(out) :: info character, intent(in), optional :: side @@ -1710,23 +1657,18 @@ subroutine psb_d_cxx_scal(d,a,info,side) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_scal +end subroutine psb_d_xyz_scal -subroutine psb_d_cxx_scals(d,a,info) +subroutine psb_d_xyz_scals(d,a,info) use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_scals + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_scals implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d integer(psb_ipk_), intent(out) :: info @@ -1749,15 +1691,10 @@ subroutine psb_d_cxx_scals(d,a,info) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_scals +end subroutine psb_d_xyz_scals @@ -1775,16 +1712,16 @@ end subroutine psb_d_cxx_scals ! == =================================== -subroutine psb_d_cxx_reallocate_nz(nz,a) +subroutine psb_d_xyz_reallocate_nz(nz,a) use psb_error_mod use psb_realloc_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_reallocate_nz + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_reallocate_nz implicit none integer(psb_ipk_), intent(in) :: nz - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a integer(psb_ipk_) :: err_act, info integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_reallocate_nz' + character(len=20) :: name='d_xyz_reallocate_nz' logical, parameter :: debug=.false. call psb_erractionsave(err_act) @@ -1801,27 +1738,21 @@ subroutine psb_d_cxx_reallocate_nz(nz,a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_reallocate_nz +end subroutine psb_d_xyz_reallocate_nz -subroutine psb_d_cxx_mold(a,b,info) - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_mold +subroutine psb_d_xyz_mold(a,b,info) + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_mold use psb_error_mod implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a class(psb_d_base_sparse_mat), intent(inout), allocatable :: b integer(psb_ipk_), intent(out) :: info integer(psb_ipk_) :: err_act integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='cxx_mold' + character(len=20) :: name='xyz_mold' logical, parameter :: debug=.false. call psb_get_erraction(err_act) @@ -1831,7 +1762,7 @@ subroutine psb_d_cxx_mold(a,b,info) call b%free() deallocate(b,stat=info) end if - if (info == 0) allocate(psb_d_cxx_sparse_mat :: b, stat=info) + if (info == 0) allocate(psb_d_xyz_sparse_mat :: b, stat=info) if (info /= 0) then info = psb_err_alloc_dealloc_ @@ -1839,21 +1770,19 @@ subroutine psb_d_cxx_mold(a,b,info) goto 9999 end if return -9999 continue - if (err_act /= psb_act_ret_) then - call psb_error() - end if + +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_mold +end subroutine psb_d_xyz_mold -subroutine psb_d_cxx_allocate_mnnz(m,n,a,nz) +subroutine psb_d_xyz_allocate_mnnz(m,n,a,nz) use psb_error_mod use psb_realloc_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_allocate_mnnz + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_allocate_mnnz implicit none integer(psb_ipk_), intent(in) :: m,n - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(in), optional :: nz integer(psb_ipk_) :: err_act, info, nz_ integer(psb_ipk_) :: ierr(5) @@ -1902,29 +1831,23 @@ subroutine psb_d_cxx_allocate_mnnz(m,n,a,nz) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_allocate_mnnz +end subroutine psb_d_xyz_allocate_mnnz -subroutine psb_d_cxx_csgetptn(imin,imax,a,nz,ia,ja,info,& +subroutine psb_d_xyz_csgetptn(imin,imax,a,nz,ia,ja,info,& & jmin,jmax,iren,append,nzin,rscale,cscale) ! Output is always in COO format use psb_error_mod use psb_const_mod use psb_error_mod use psb_d_base_mat_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_csgetptn + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_csgetptn implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_), intent(out) :: nz integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:) @@ -1985,7 +1908,7 @@ subroutine psb_d_cxx_csgetptn(imin,imax,a,nz,ia,ja,info,& goto 9999 end if - call cxx_getptn(imin,imax,jmin_,jmax_,a,nz,ia,ja,nzin_,append_,info,iren) + call xyz_getptn(imin,imax,jmin_,jmax_,a,nz,ia,ja,nzin_,append_,info,iren) if (rscale_) then do i=nzin_+1, nzin_+nz @@ -2003,18 +1926,12 @@ subroutine psb_d_cxx_csgetptn(imin,imax,a,nz,ia,ja,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains - subroutine cxx_getptn(imin,imax,jmin,jmax,a,nz,ia,ja,nzin,append,info,& + subroutine xyz_getptn(imin,imax,jmin,jmax,a,nz,ia,ja,nzin,append,info,& & iren) use psb_const_mod @@ -2023,7 +1940,7 @@ contains use psb_sort_mod implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_) :: imin,imax,jmin,jmax integer(psb_ipk_), intent(out) :: nz integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:) @@ -2033,7 +1950,7 @@ contains integer(psb_ipk_), optional :: iren(:) integer(psb_ipk_) :: nzin_, nza, idx,i,j,k, nzt, irw, lrw integer(psb_ipk_) :: debug_level, debug_unit - character(len=20) :: name='cxx_getptn' + character(len=20) :: name='xyz_getptn' debug_unit = psb_get_debug_unit() debug_level = psb_get_debug_level() @@ -2085,22 +2002,22 @@ contains end do end if - end subroutine cxx_getptn + end subroutine xyz_getptn -end subroutine psb_d_cxx_csgetptn +end subroutine psb_d_xyz_csgetptn -subroutine psb_d_cxx_csgetrow(imin,imax,a,nz,ia,ja,val,info,& +subroutine psb_d_xyz_csgetrow(imin,imax,a,nz,ia,ja,val,info,& & jmin,jmax,iren,append,nzin,rscale,cscale) ! Output is always in COO format use psb_error_mod use psb_const_mod use psb_error_mod use psb_d_base_mat_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_csgetrow + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_csgetrow implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_), intent(out) :: nz integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:) @@ -2162,7 +2079,7 @@ subroutine psb_d_cxx_csgetrow(imin,imax,a,nz,ia,ja,val,info,& goto 9999 end if - call cxx_getrow(imin,imax,jmin_,jmax_,a,nz,ia,ja,val,nzin_,append_,info,& + call xyz_getrow(imin,imax,jmin_,jmax_,a,nz,ia,ja,val,nzin_,append_,info,& & iren) if (rscale_) then @@ -2181,18 +2098,12 @@ subroutine psb_d_cxx_csgetrow(imin,imax,a,nz,ia,ja,val,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains - subroutine cxx_getrow(imin,imax,jmin,jmax,a,nz,ia,ja,val,nzin,append,info,& + subroutine xyz_getrow(imin,imax,jmin,jmax,a,nz,ia,ja,val,nzin,append,info,& & iren) use psb_const_mod @@ -2201,7 +2112,7 @@ contains use psb_sort_mod implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_) :: imin,imax,jmin,jmax integer(psb_ipk_), intent(out) :: nz integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:) @@ -2267,19 +2178,19 @@ contains end do end if - end subroutine cxx_getrow + end subroutine xyz_getrow -end subroutine psb_d_cxx_csgetrow +end subroutine psb_d_xyz_csgetrow -subroutine psb_d_cxx_csgetblk(imin,imax,a,b,info,& +subroutine psb_d_xyz_csgetblk(imin,imax,a,b,info,& & jmin,jmax,iren,append,rscale,cscale) ! Output is always in COO format use psb_error_mod use psb_const_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_csgetblk + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_csgetblk implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a class(psb_d_coo_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info @@ -2320,26 +2231,20 @@ subroutine psb_d_cxx_csgetblk(imin,imax,a,b,info,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_csgetblk +end subroutine psb_d_xyz_csgetblk -subroutine psb_d_cxx_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) +subroutine psb_d_xyz_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) use psb_error_mod use psb_realloc_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_csput_a + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_csput_a implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: val(:) integer(psb_ipk_), intent(in) :: nz, ia(:), ja(:), imin,imax,jmin,jmax integer(psb_ipk_), intent(out) :: info @@ -2348,7 +2253,7 @@ subroutine psb_d_cxx_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) integer(psb_ipk_) :: err_act integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_csput' + character(len=20) :: name='d_xyz_csput' logical, parameter :: debug=.false. integer(psb_ipk_) :: nza, i,j,k, nzl, isza @@ -2391,7 +2296,7 @@ subroutine psb_d_cxx_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) info = psb_err_invalid_mat_state_ else if (a%is_upd()) then - call psb_d_cxx_srch_upd(nz,ia,ja,val,a,& + call psb_d_xyz_srch_upd(nz,ia,ja,val,a,& & imin,imax,jmin,jmax,info,gtl) if (info /= psb_success_) then @@ -2411,19 +2316,13 @@ subroutine psb_d_cxx_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains - subroutine psb_d_cxx_srch_upd(nz,ia,ja,val,a,& + subroutine psb_d_xyz_srch_upd(nz,ia,ja,val,a,& & imin,imax,jmin,jmax,info,gtl) use psb_const_mod @@ -2432,7 +2331,7 @@ contains use psb_sort_mod implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz, imin,imax,jmin,jmax integer(psb_ipk_), intent(in) :: ia(:),ja(:) real(psb_dpk_), intent(in) :: val(:) @@ -2441,7 +2340,7 @@ contains integer(psb_ipk_) :: i,ir,ic, ilr, ilc, ip, & & i1,i2,nr,nc,nnz,dupl,ng integer(psb_ipk_) :: debug_level, debug_unit - character(len=20) :: name='d_cxx_srch_upd' + character(len=20) :: name='d_xyz_srch_upd' info = psb_success_ debug_unit = psb_get_debug_unit() @@ -2616,17 +2515,17 @@ contains end if - end subroutine psb_d_cxx_srch_upd + end subroutine psb_d_xyz_srch_upd -end subroutine psb_d_cxx_csput_a +end subroutine psb_d_xyz_csput_a -subroutine psb_d_cxx_reinit(a,clear) +subroutine psb_d_xyz_reinit(a,clear) use psb_error_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_reinit + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_reinit implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a logical, intent(in), optional :: clear integer(psb_ipk_) :: err_act, info @@ -2660,23 +2559,17 @@ subroutine psb_d_cxx_reinit(a,clear) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_reinit +end subroutine psb_d_xyz_reinit -subroutine psb_d_cxx_trim(a) +subroutine psb_d_xyz_trim(a) use psb_realloc_mod use psb_error_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_trim + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_trim implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a integer(psb_ipk_) :: err_act, info, nz, m integer(psb_ipk_) :: ierr(5) character(len=20) :: name='trim' @@ -2695,31 +2588,25 @@ subroutine psb_d_cxx_trim(a) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return -end subroutine psb_d_cxx_trim +end subroutine psb_d_xyz_trim -subroutine psb_d_cxx_print(iout,a,iv,head,ivr,ivc) +subroutine psb_d_xyz_print(iout,a,iv,head,ivr,ivc) use psb_string_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cxx_print + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_xyz_print implicit none integer(psb_ipk_), intent(in) :: iout - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_), intent(in), optional :: iv(:) character(len=*), optional :: head integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:) integer(psb_ipk_) :: err_act integer(psb_ipk_) :: ierr(5) - character(len=20) :: name='d_cxx_print' + character(len=20) :: name='d_xyz_print' logical, parameter :: debug=.false. character(len=*), parameter :: datatype='real' character(len=80) :: frmtv @@ -2778,17 +2665,17 @@ subroutine psb_d_cxx_print(iout,a,iv,head,ivr,ivc) endif endif -end subroutine psb_d_cxx_print +end subroutine psb_d_xyz_print -subroutine psb_d_cp_cxx_from_coo(a,b,info) +subroutine psb_d_cp_xyz_from_coo(a,b,info) use psb_const_mod use psb_realloc_mod use psb_d_base_mat_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cp_cxx_from_coo + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_cp_xyz_from_coo implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_coo_sparse_mat), intent(in) :: b integer(psb_ipk_), intent(out) :: info @@ -2806,17 +2693,17 @@ subroutine psb_d_cp_cxx_from_coo(a,b,info) call tmp%cp_from_coo(b,info) if (info == psb_success_) call a%mv_from_coo(tmp,info) -end subroutine psb_d_cp_cxx_from_coo +end subroutine psb_d_cp_xyz_from_coo -subroutine psb_d_cp_cxx_to_coo(a,b,info) +subroutine psb_d_cp_xyz_to_coo(a,b,info) use psb_const_mod use psb_d_base_mat_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cp_cxx_to_coo + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_cp_xyz_to_coo implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a class(psb_d_coo_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info @@ -2848,17 +2735,17 @@ subroutine psb_d_cp_cxx_to_coo(a,b,info) call b%fix(info) -end subroutine psb_d_cp_cxx_to_coo +end subroutine psb_d_cp_xyz_to_coo -subroutine psb_d_mv_cxx_to_coo(a,b,info) +subroutine psb_d_mv_xyz_to_coo(a,b,info) use psb_const_mod use psb_realloc_mod use psb_d_base_mat_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_mv_cxx_to_coo + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_mv_xyz_to_coo implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_coo_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info @@ -2891,19 +2778,19 @@ subroutine psb_d_mv_cxx_to_coo(a,b,info) call b%fix(info) -end subroutine psb_d_mv_cxx_to_coo +end subroutine psb_d_mv_xyz_to_coo -subroutine psb_d_mv_cxx_from_coo(a,b,info) +subroutine psb_d_mv_xyz_from_coo(a,b,info) use psb_const_mod use psb_realloc_mod use psb_error_mod use psb_d_base_mat_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_mv_cxx_from_coo + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_mv_xyz_from_coo implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_coo_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info @@ -2986,16 +2873,16 @@ subroutine psb_d_mv_cxx_from_coo(a,b,info) endif -end subroutine psb_d_mv_cxx_from_coo +end subroutine psb_d_mv_xyz_from_coo -subroutine psb_d_mv_cxx_to_fmt(a,b,info) +subroutine psb_d_mv_xyz_to_fmt(a,b,info) use psb_const_mod use psb_d_base_mat_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_mv_cxx_to_fmt + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_mv_xyz_to_fmt implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info @@ -3013,7 +2900,7 @@ subroutine psb_d_mv_cxx_to_fmt(a,b,info) type is (psb_d_coo_sparse_mat) call a%mv_to_coo(b,info) ! Need to fix trivial copies! - type is (psb_d_cxx_sparse_mat) + type is (psb_d_xyz_sparse_mat) b%psb_d_base_sparse_mat = a%psb_d_base_sparse_mat call move_alloc(a%irp, b%irp) call move_alloc(a%ja, b%ja) @@ -3025,17 +2912,17 @@ subroutine psb_d_mv_cxx_to_fmt(a,b,info) if (info == psb_success_) call b%mv_from_coo(tmp,info) end select -end subroutine psb_d_mv_cxx_to_fmt +end subroutine psb_d_mv_xyz_to_fmt -subroutine psb_d_cp_cxx_to_fmt(a,b,info) +subroutine psb_d_cp_xyz_to_fmt(a,b,info) use psb_const_mod use psb_d_base_mat_mod use psb_realloc_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cp_cxx_to_fmt + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_cp_xyz_to_fmt implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a class(psb_d_base_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info @@ -3054,7 +2941,7 @@ subroutine psb_d_cp_cxx_to_fmt(a,b,info) type is (psb_d_coo_sparse_mat) call a%cp_to_coo(b,info) - type is (psb_d_cxx_sparse_mat) + type is (psb_d_xyz_sparse_mat) b%psb_d_base_sparse_mat = a%psb_d_base_sparse_mat if (info == 0) call psb_safe_cpy( a%irp, b%irp , info) if (info == 0) call psb_safe_cpy( a%ja , b%ja , info) @@ -3065,16 +2952,16 @@ subroutine psb_d_cp_cxx_to_fmt(a,b,info) if (info == psb_success_) call b%mv_from_coo(tmp,info) end select -end subroutine psb_d_cp_cxx_to_fmt +end subroutine psb_d_cp_xyz_to_fmt -subroutine psb_d_mv_cxx_from_fmt(a,b,info) +subroutine psb_d_mv_xyz_from_fmt(a,b,info) use psb_const_mod use psb_d_base_mat_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_mv_cxx_from_fmt + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_mv_xyz_from_fmt implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info @@ -3092,7 +2979,7 @@ subroutine psb_d_mv_cxx_from_fmt(a,b,info) type is (psb_d_coo_sparse_mat) call a%mv_from_coo(b,info) - type is (psb_d_cxx_sparse_mat) + type is (psb_d_xyz_sparse_mat) a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat call move_alloc(b%irp, a%irp) call move_alloc(b%ja, a%ja) @@ -3104,18 +2991,18 @@ subroutine psb_d_mv_cxx_from_fmt(a,b,info) if (info == psb_success_) call a%mv_from_coo(tmp,info) end select -end subroutine psb_d_mv_cxx_from_fmt +end subroutine psb_d_mv_xyz_from_fmt -subroutine psb_d_cp_cxx_from_fmt(a,b,info) +subroutine psb_d_cp_xyz_from_fmt(a,b,info) use psb_const_mod use psb_d_base_mat_mod use psb_realloc_mod - use psb_d_cxx_mat_mod, psb_protect_name => psb_d_cp_cxx_from_fmt + use psb_d_xyz_mat_mod, psb_protect_name => psb_d_cp_xyz_from_fmt implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(in) :: b integer(psb_ipk_), intent(out) :: info @@ -3133,7 +3020,7 @@ subroutine psb_d_cp_cxx_from_fmt(a,b,info) type is (psb_d_coo_sparse_mat) call a%cp_from_coo(b,info) - type is (psb_d_cxx_sparse_mat) + type is (psb_d_xyz_sparse_mat) a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat if (info == 0) call psb_safe_cpy( b%irp, a%irp , info) if (info == 0) call psb_safe_cpy( b%ja , a%ja , info) @@ -3143,4 +3030,4 @@ subroutine psb_d_cp_cxx_from_fmt(a,b,info) call b%cp_to_coo(tmp,info) if (info == psb_success_) call a%mv_from_coo(tmp,info) end select -end subroutine psb_d_cp_cxx_from_fmt +end subroutine psb_d_cp_xyz_from_fmt diff --git a/test/serial/psb_d_cxx_mat_mod.f90 b/test/serial/psb_d_xyz_mat_mod.f90 similarity index 50% rename from test/serial/psb_d_cxx_mat_mod.f90 rename to test/serial/psb_d_xyz_mat_mod.f90 index 1cf43e463..2567d8e17 100644 --- a/test/serial/psb_d_cxx_mat_mod.f90 +++ b/test/serial/psb_d_xyz_mat_mod.f90 @@ -30,26 +30,26 @@ !!$ !!$ ! -! package: psb_d_cxx_mat_mod +! package: psb_d_xyz_mat_mod ! -! This module contains the definition of the psb_d_cxx_sparse_mat type +! This module contains the definition of the psb_d_xyz_sparse_mat type ! which is just an example of how to build a new storage format. ! Indeed this is simply CSR under a new name. ! ! Please refere to psb_d_base_mat_mod for a detailed description -! of the various methods, and to psb_d_cxx_impl for implementation details. +! of the various methods, and to psb_d_xyz_impl for implementation details. ! -module psb_d_cxx_mat_mod +module psb_d_xyz_mat_mod use psb_d_base_mat_mod - !> \namespace psb_base_mod \class psb_d_cxx_sparse_mat + !> \namespace psb_base_mod \class psb_d_xyz_sparse_mat !! \extends psb_d_base_mat_mod::psb_d_base_sparse_mat !! - !! psb_d_cxx_sparse_mat type and the related methods. + !! psb_d_xyz_sparse_mat type and the related methods. !! This is a very common storage type, and is the default for assembled !! matrices in our library - type, extends(psb_d_base_sparse_mat) :: psb_d_cxx_sparse_mat + type, extends(psb_d_base_sparse_mat) :: psb_d_xyz_sparse_mat !> Pointers to beginning of rows in JA and VAL. integer(psb_ipk_), allocatable :: irp(:) @@ -59,245 +59,245 @@ module psb_d_cxx_mat_mod real(psb_dpk_), allocatable :: val(:) contains - procedure, pass(a) :: get_size => d_cxx_get_size - procedure, pass(a) :: get_nzeros => d_cxx_get_nzeros - procedure, nopass :: get_fmt => d_cxx_get_fmt - procedure, pass(a) :: sizeof => d_cxx_sizeof - procedure, pass(a) :: csmm => psb_d_cxx_csmm - procedure, pass(a) :: csmv => psb_d_cxx_csmv - procedure, pass(a) :: inner_cssm => psb_d_cxx_cssm - procedure, pass(a) :: inner_cssv => psb_d_cxx_cssv - procedure, pass(a) :: scals => psb_d_cxx_scals - procedure, pass(a) :: scalv => psb_d_cxx_scal - procedure, pass(a) :: maxval => psb_d_cxx_maxval - procedure, pass(a) :: spnmi => psb_d_cxx_csnmi - procedure, pass(a) :: spnm1 => psb_d_cxx_csnm1 - procedure, pass(a) :: rowsum => psb_d_cxx_rowsum - procedure, pass(a) :: arwsum => psb_d_cxx_arwsum - procedure, pass(a) :: colsum => psb_d_cxx_colsum - procedure, pass(a) :: aclsum => psb_d_cxx_aclsum - procedure, pass(a) :: reallocate_nz => psb_d_cxx_reallocate_nz - procedure, pass(a) :: allocate_mnnz => psb_d_cxx_allocate_mnnz - procedure, pass(a) :: cp_to_coo => psb_d_cp_cxx_to_coo - procedure, pass(a) :: cp_from_coo => psb_d_cp_cxx_from_coo - procedure, pass(a) :: cp_to_fmt => psb_d_cp_cxx_to_fmt - procedure, pass(a) :: cp_from_fmt => psb_d_cp_cxx_from_fmt - procedure, pass(a) :: mv_to_coo => psb_d_mv_cxx_to_coo - procedure, pass(a) :: mv_from_coo => psb_d_mv_cxx_from_coo - procedure, pass(a) :: mv_to_fmt => psb_d_mv_cxx_to_fmt - procedure, pass(a) :: mv_from_fmt => psb_d_mv_cxx_from_fmt - procedure, pass(a) :: csput_a => psb_d_cxx_csput_a - procedure, pass(a) :: get_diag => psb_d_cxx_get_diag - procedure, pass(a) :: csgetptn => psb_d_cxx_csgetptn - procedure, pass(a) :: csgetrow => psb_d_cxx_csgetrow - procedure, pass(a) :: get_nz_row => d_cxx_get_nz_row - procedure, pass(a) :: reinit => psb_d_cxx_reinit - procedure, pass(a) :: trim => psb_d_cxx_trim - procedure, pass(a) :: print => psb_d_cxx_print - procedure, pass(a) :: free => d_cxx_free - procedure, pass(a) :: mold => psb_d_cxx_mold - - end type psb_d_cxx_sparse_mat - - private :: d_cxx_get_nzeros, d_cxx_free, d_cxx_get_fmt, & - & d_cxx_get_size, d_cxx_sizeof, d_cxx_get_nz_row - - !> \memberof psb_d_cxx_sparse_mat + procedure, pass(a) :: get_size => d_xyz_get_size + procedure, pass(a) :: get_nzeros => d_xyz_get_nzeros + procedure, nopass :: get_fmt => d_xyz_get_fmt + procedure, pass(a) :: sizeof => d_xyz_sizeof + procedure, pass(a) :: csmm => psb_d_xyz_csmm + procedure, pass(a) :: csmv => psb_d_xyz_csmv + procedure, pass(a) :: inner_cssm => psb_d_xyz_cssm + procedure, pass(a) :: inner_cssv => psb_d_xyz_cssv + procedure, pass(a) :: scals => psb_d_xyz_scals + procedure, pass(a) :: scalv => psb_d_xyz_scal + procedure, pass(a) :: maxval => psb_d_xyz_maxval + procedure, pass(a) :: spnmi => psb_d_xyz_csnmi + procedure, pass(a) :: spnm1 => psb_d_xyz_csnm1 + procedure, pass(a) :: rowsum => psb_d_xyz_rowsum + procedure, pass(a) :: arwsum => psb_d_xyz_arwsum + procedure, pass(a) :: colsum => psb_d_xyz_colsum + procedure, pass(a) :: aclsum => psb_d_xyz_aclsum + procedure, pass(a) :: reallocate_nz => psb_d_xyz_reallocate_nz + procedure, pass(a) :: allocate_mnnz => psb_d_xyz_allocate_mnnz + procedure, pass(a) :: cp_to_coo => psb_d_cp_xyz_to_coo + procedure, pass(a) :: cp_from_coo => psb_d_cp_xyz_from_coo + procedure, pass(a) :: cp_to_fmt => psb_d_cp_xyz_to_fmt + procedure, pass(a) :: cp_from_fmt => psb_d_cp_xyz_from_fmt + procedure, pass(a) :: mv_to_coo => psb_d_mv_xyz_to_coo + procedure, pass(a) :: mv_from_coo => psb_d_mv_xyz_from_coo + procedure, pass(a) :: mv_to_fmt => psb_d_mv_xyz_to_fmt + procedure, pass(a) :: mv_from_fmt => psb_d_mv_xyz_from_fmt + procedure, pass(a) :: csput_a => psb_d_xyz_csput_a + procedure, pass(a) :: get_diag => psb_d_xyz_get_diag + procedure, pass(a) :: csgetptn => psb_d_xyz_csgetptn + procedure, pass(a) :: csgetrow => psb_d_xyz_csgetrow + procedure, pass(a) :: get_nz_row => d_xyz_get_nz_row + procedure, pass(a) :: reinit => psb_d_xyz_reinit + procedure, pass(a) :: trim => psb_d_xyz_trim + procedure, pass(a) :: print => psb_d_xyz_print + procedure, pass(a) :: free => d_xyz_free + procedure, pass(a) :: mold => psb_d_xyz_mold + + end type psb_d_xyz_sparse_mat + + private :: d_xyz_get_nzeros, d_xyz_free, d_xyz_get_fmt, & + & d_xyz_get_size, d_xyz_sizeof, d_xyz_get_nz_row + + !> \memberof psb_d_xyz_sparse_mat !| \see psb_base_mat_mod::psb_base_reallocate_nz interface - subroutine psb_d_cxx_reallocate_nz(nz,a) - import :: psb_ipk_, psb_d_cxx_sparse_mat + subroutine psb_d_xyz_reallocate_nz(nz,a) + import :: psb_ipk_, psb_d_xyz_sparse_mat integer(psb_ipk_), intent(in) :: nz - class(psb_d_cxx_sparse_mat), intent(inout) :: a - end subroutine psb_d_cxx_reallocate_nz + class(psb_d_xyz_sparse_mat), intent(inout) :: a + end subroutine psb_d_xyz_reallocate_nz end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !| \see psb_base_mat_mod::psb_base_reinit interface - subroutine psb_d_cxx_reinit(a,clear) - import :: psb_ipk_, psb_d_cxx_sparse_mat - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_xyz_reinit(a,clear) + import :: psb_ipk_, psb_d_xyz_sparse_mat + class(psb_d_xyz_sparse_mat), intent(inout) :: a logical, intent(in), optional :: clear - end subroutine psb_d_cxx_reinit + end subroutine psb_d_xyz_reinit end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !| \see psb_base_mat_mod::psb_base_trim interface - subroutine psb_d_cxx_trim(a) - import :: psb_ipk_, psb_d_cxx_sparse_mat - class(psb_d_cxx_sparse_mat), intent(inout) :: a - end subroutine psb_d_cxx_trim + subroutine psb_d_xyz_trim(a) + import :: psb_ipk_, psb_d_xyz_sparse_mat + class(psb_d_xyz_sparse_mat), intent(inout) :: a + end subroutine psb_d_xyz_trim end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !| \see psb_base_mat_mod::psb_base_mold interface - subroutine psb_d_cxx_mold(a,b,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_d_base_sparse_mat, psb_long_int_k_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_mold(a,b,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat, psb_long_int_k_ + class(psb_d_xyz_sparse_mat), intent(in) :: a class(psb_d_base_sparse_mat), intent(inout), allocatable :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cxx_mold + end subroutine psb_d_xyz_mold end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !| \see psb_base_mat_mod::psb_base_allocate_mnnz interface - subroutine psb_d_cxx_allocate_mnnz(m,n,a,nz) - import :: psb_ipk_, psb_d_cxx_sparse_mat + subroutine psb_d_xyz_allocate_mnnz(m,n,a,nz) + import :: psb_ipk_, psb_d_xyz_sparse_mat integer(psb_ipk_), intent(in) :: m,n - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a integer(psb_ipk_), intent(in), optional :: nz - end subroutine psb_d_cxx_allocate_mnnz + end subroutine psb_d_xyz_allocate_mnnz end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_print interface - subroutine psb_d_cxx_print(iout,a,iv,head,ivr,ivc) - import :: psb_ipk_, psb_d_cxx_sparse_mat + subroutine psb_d_xyz_print(iout,a,iv,head,ivr,ivc) + import :: psb_ipk_, psb_d_xyz_sparse_mat integer(psb_ipk_), intent(in) :: iout - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_), intent(in), optional :: iv(:) character(len=*), optional :: head integer(psb_ipk_), intent(in), optional :: ivr(:), ivc(:) - end subroutine psb_d_cxx_print + end subroutine psb_d_xyz_print end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cp_to_coo interface - subroutine psb_d_cp_cxx_to_coo(a,b,info) - import :: psb_ipk_, psb_d_coo_sparse_mat, psb_d_cxx_sparse_mat - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_cp_xyz_to_coo(a,b,info) + import :: psb_ipk_, psb_d_coo_sparse_mat, psb_d_xyz_sparse_mat + class(psb_d_xyz_sparse_mat), intent(in) :: a class(psb_d_coo_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cp_cxx_to_coo + end subroutine psb_d_cp_xyz_to_coo end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cp_from_coo interface - subroutine psb_d_cp_cxx_from_coo(a,b,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_d_coo_sparse_mat - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_cp_xyz_from_coo(a,b,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_coo_sparse_mat + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_coo_sparse_mat), intent(in) :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cp_cxx_from_coo + end subroutine psb_d_cp_xyz_from_coo end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cp_to_fmt interface - subroutine psb_d_cp_cxx_to_fmt(a,b,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_d_base_sparse_mat - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_cp_xyz_to_fmt(a,b,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat + class(psb_d_xyz_sparse_mat), intent(in) :: a class(psb_d_base_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cp_cxx_to_fmt + end subroutine psb_d_cp_xyz_to_fmt end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cp_from_fmt interface - subroutine psb_d_cp_cxx_from_fmt(a,b,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_d_base_sparse_mat - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_cp_xyz_from_fmt(a,b,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(in) :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cp_cxx_from_fmt + end subroutine psb_d_cp_xyz_from_fmt end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_mv_to_coo interface - subroutine psb_d_mv_cxx_to_coo(a,b,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_d_coo_sparse_mat - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_mv_xyz_to_coo(a,b,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_coo_sparse_mat + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_coo_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_mv_cxx_to_coo + end subroutine psb_d_mv_xyz_to_coo end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_mv_from_coo interface - subroutine psb_d_mv_cxx_from_coo(a,b,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_d_coo_sparse_mat - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_mv_xyz_from_coo(a,b,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_coo_sparse_mat + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_coo_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_mv_cxx_from_coo + end subroutine psb_d_mv_xyz_from_coo end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_mv_to_fmt interface - subroutine psb_d_mv_cxx_to_fmt(a,b,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_d_base_sparse_mat - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_mv_xyz_to_fmt(a,b,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_mv_cxx_to_fmt + end subroutine psb_d_mv_xyz_to_fmt end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_mv_from_fmt interface - subroutine psb_d_mv_cxx_from_fmt(a,b,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_d_base_sparse_mat - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_mv_xyz_from_fmt(a,b,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_d_base_sparse_mat + class(psb_d_xyz_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_mv_cxx_from_fmt + end subroutine psb_d_mv_xyz_from_fmt end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cp_from interface - subroutine psb_d_cxx_cp_from(a,b) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(inout) :: a - type(psb_d_cxx_sparse_mat), intent(in) :: b - end subroutine psb_d_cxx_cp_from + subroutine psb_d_xyz_cp_from(a,b) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(inout) :: a + type(psb_d_xyz_sparse_mat), intent(in) :: b + end subroutine psb_d_xyz_cp_from end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_mv_from interface - subroutine psb_d_cxx_mv_from(a,b) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(inout) :: a - type(psb_d_cxx_sparse_mat), intent(inout) :: b - end subroutine psb_d_cxx_mv_from + subroutine psb_d_xyz_mv_from(a,b) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(inout) :: a + type(psb_d_xyz_sparse_mat), intent(inout) :: b + end subroutine psb_d_xyz_mv_from end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_csput interface - subroutine psb_d_cxx_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_xyz_csput_a(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: val(:) integer(psb_ipk_), intent(in) :: nz,ia(:), ja(:),& & imin,imax,jmin,jmax integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(in), optional :: gtl(:) - end subroutine psb_d_cxx_csput_a + end subroutine psb_d_xyz_csput_a end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_base_mat_mod::psb_base_csgetptn interface - subroutine psb_d_cxx_csgetptn(imin,imax,a,nz,ia,ja,info,& + subroutine psb_d_xyz_csgetptn(imin,imax,a,nz,ia,ja,info,& & jmin,jmax,iren,append,nzin,rscale,cscale) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_), intent(out) :: nz integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:) @@ -306,16 +306,16 @@ module psb_d_cxx_mat_mod integer(psb_ipk_), intent(in), optional :: iren(:) integer(psb_ipk_), intent(in), optional :: jmin,jmax, nzin logical, intent(in), optional :: rscale,cscale - end subroutine psb_d_cxx_csgetptn + end subroutine psb_d_xyz_csgetptn end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_csgetrow interface - subroutine psb_d_cxx_csgetrow(imin,imax,a,nz,ia,ja,val,info,& + subroutine psb_d_xyz_csgetrow(imin,imax,a,nz,ia,ja,val,info,& & jmin,jmax,iren,append,nzin,rscale,cscale) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_), intent(out) :: nz integer(psb_ipk_), allocatable, intent(inout) :: ia(:), ja(:) @@ -325,16 +325,16 @@ module psb_d_cxx_mat_mod integer(psb_ipk_), intent(in), optional :: iren(:) integer(psb_ipk_), intent(in), optional :: jmin,jmax, nzin logical, intent(in), optional :: rscale,cscale - end subroutine psb_d_cxx_csgetrow + end subroutine psb_d_xyz_csgetrow end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_csgetblk interface - subroutine psb_d_cxx_csgetblk(imin,imax,a,b,info,& + subroutine psb_d_xyz_csgetblk(imin,imax,a,b,info,& & jmin,jmax,iren,append,rscale,cscale) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_, psb_d_coo_sparse_mat - class(psb_d_cxx_sparse_mat), intent(in) :: a + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_, psb_d_coo_sparse_mat + class(psb_d_xyz_sparse_mat), intent(in) :: a class(psb_d_coo_sparse_mat), intent(inout) :: b integer(psb_ipk_), intent(in) :: imin,imax integer(psb_ipk_),intent(out) :: info @@ -342,163 +342,163 @@ module psb_d_cxx_mat_mod integer(psb_ipk_), intent(in), optional :: iren(:) integer(psb_ipk_), intent(in), optional :: jmin,jmax logical, intent(in), optional :: rscale,cscale - end subroutine psb_d_cxx_csgetblk + end subroutine psb_d_xyz_csgetblk end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cssv interface - subroutine psb_d_cxx_cssv(alpha,a,x,beta,y,info,trans) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_cssv(alpha,a,x,beta,y,info,trans) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) real(psb_dpk_), intent(inout) :: y(:) integer(psb_ipk_), intent(out) :: info character, optional, intent(in) :: trans - end subroutine psb_d_cxx_cssv + end subroutine psb_d_xyz_cssv end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_cssm interface - subroutine psb_d_cxx_cssm(alpha,a,x,beta,y,info,trans) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_cssm(alpha,a,x,beta,y,info,trans) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:,:) real(psb_dpk_), intent(inout) :: y(:,:) integer(psb_ipk_), intent(out) :: info character, optional, intent(in) :: trans - end subroutine psb_d_cxx_cssm + end subroutine psb_d_xyz_cssm end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_csmv interface - subroutine psb_d_cxx_csmv(alpha,a,x,beta,y,info,trans) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_csmv(alpha,a,x,beta,y,info,trans) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:) real(psb_dpk_), intent(inout) :: y(:) integer(psb_ipk_), intent(out) :: info character, optional, intent(in) :: trans - end subroutine psb_d_cxx_csmv + end subroutine psb_d_xyz_csmv end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_csmm interface - subroutine psb_d_cxx_csmm(alpha,a,x,beta,y,info,trans) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_csmm(alpha,a,x,beta,y,info,trans) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(in) :: alpha, beta, x(:,:) real(psb_dpk_), intent(inout) :: y(:,:) integer(psb_ipk_), intent(out) :: info character, optional, intent(in) :: trans - end subroutine psb_d_cxx_csmm + end subroutine psb_d_xyz_csmm end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_maxval interface - function psb_d_cxx_maxval(a) result(res) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + function psb_d_xyz_maxval(a) result(res) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_) :: res - end function psb_d_cxx_maxval + end function psb_d_xyz_maxval end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_csnmi interface - function psb_d_cxx_csnmi(a) result(res) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + function psb_d_xyz_csnmi(a) result(res) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_) :: res - end function psb_d_cxx_csnmi + end function psb_d_xyz_csnmi end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_csnm1 interface - function psb_d_cxx_csnm1(a) result(res) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + function psb_d_xyz_csnm1(a) result(res) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_) :: res - end function psb_d_cxx_csnm1 + end function psb_d_xyz_csnm1 end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_rowsum interface - subroutine psb_d_cxx_rowsum(d,a) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_rowsum(d,a) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) - end subroutine psb_d_cxx_rowsum + end subroutine psb_d_xyz_rowsum end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_arwsum interface - subroutine psb_d_cxx_arwsum(d,a) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_arwsum(d,a) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) - end subroutine psb_d_cxx_arwsum + end subroutine psb_d_xyz_arwsum end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_colsum interface - subroutine psb_d_cxx_colsum(d,a) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_colsum(d,a) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) - end subroutine psb_d_cxx_colsum + end subroutine psb_d_xyz_colsum end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_aclsum interface - subroutine psb_d_cxx_aclsum(d,a) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_aclsum(d,a) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) - end subroutine psb_d_cxx_aclsum + end subroutine psb_d_xyz_aclsum end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_get_diag interface - subroutine psb_d_cxx_get_diag(a,d,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(in) :: a + subroutine psb_d_xyz_get_diag(a,d,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(in) :: a real(psb_dpk_), intent(out) :: d(:) integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cxx_get_diag + end subroutine psb_d_xyz_get_diag end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_scal interface - subroutine psb_d_cxx_scal(d,a,info,side) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_xyz_scal(d,a,info,side) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d(:) integer(psb_ipk_), intent(out) :: info character, intent(in), optional :: side - end subroutine psb_d_cxx_scal + end subroutine psb_d_xyz_scal end interface - !> \memberof psb_d_cxx_sparse_mat + !> \memberof psb_d_xyz_sparse_mat !! \see psb_d_base_mat_mod::psb_d_base_scals interface - subroutine psb_d_cxx_scals(d,a,info) - import :: psb_ipk_, psb_d_cxx_sparse_mat, psb_dpk_ - class(psb_d_cxx_sparse_mat), intent(inout) :: a + subroutine psb_d_xyz_scals(d,a,info) + import :: psb_ipk_, psb_d_xyz_sparse_mat, psb_dpk_ + class(psb_d_xyz_sparse_mat), intent(inout) :: a real(psb_dpk_), intent(in) :: d integer(psb_ipk_), intent(out) :: info - end subroutine psb_d_cxx_scals + end subroutine psb_d_xyz_scals end interface @@ -518,33 +518,33 @@ contains ! == =================================== - function d_cxx_sizeof(a) result(res) + function d_xyz_sizeof(a) result(res) implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_long_int_k_) :: res res = 8 res = res + psb_sizeof_dp * size(a%val) res = res + psb_sizeof_int * size(a%irp) res = res + psb_sizeof_int * size(a%ja) - end function d_cxx_sizeof + end function d_xyz_sizeof - function d_cxx_get_fmt() result(res) + function d_xyz_get_fmt() result(res) implicit none character(len=5) :: res - res = 'CXX' - end function d_cxx_get_fmt + res = 'XYZ' + end function d_xyz_get_fmt - function d_cxx_get_nzeros(a) result(res) + function d_xyz_get_nzeros(a) result(res) implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_) :: res res = a%irp(a%get_nrows()+1)-1 - end function d_cxx_get_nzeros + end function d_xyz_get_nzeros - function d_cxx_get_size(a) result(res) + function d_xyz_get_size(a) result(res) implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_) :: res res = -1 @@ -560,15 +560,15 @@ contains end if end if - end function d_cxx_get_size + end function d_xyz_get_size - function d_cxx_get_nz_row(idx,a) result(res) + function d_xyz_get_nz_row(idx,a) result(res) implicit none - class(psb_d_cxx_sparse_mat), intent(in) :: a + class(psb_d_xyz_sparse_mat), intent(in) :: a integer(psb_ipk_), intent(in) :: idx integer(psb_ipk_) :: res @@ -578,7 +578,7 @@ contains res = a%irp(idx+1)-a%irp(idx) end if - end function d_cxx_get_nz_row + end function d_xyz_get_nz_row @@ -594,10 +594,10 @@ contains ! ! == =================================== - subroutine d_cxx_free(a) + subroutine d_xyz_free(a) implicit none - class(psb_d_cxx_sparse_mat), intent(inout) :: a + class(psb_d_xyz_sparse_mat), intent(inout) :: a if (allocated(a%irp)) deallocate(a%irp) if (allocated(a%ja)) deallocate(a%ja) @@ -608,7 +608,7 @@ contains return - end subroutine d_cxx_free + end subroutine d_xyz_free -end module psb_d_cxx_mat_mod +end module psb_d_xyz_mat_mod diff --git a/util/psb_c_mat_dist_impl.f90 b/util/psb_c_mat_dist_impl.f90 index ffc427331..953904b0c 100644 --- a/util/psb_c_mat_dist_impl.f90 +++ b/util/psb_c_mat_dist_impl.f90 @@ -450,12 +450,8 @@ subroutine cmatdist(a_glob, a, ictxt, desc_a,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine cmatdist diff --git a/util/psb_c_mmio_impl.f90 b/util/psb_c_mmio_impl.f90 index b30acf8df..a11196c04 100644 --- a/util/psb_c_mmio_impl.f90 +++ b/util/psb_c_mmio_impl.f90 @@ -76,7 +76,7 @@ subroutine mm_cvet_read(b, info, iunit, filename) read(line,fmt=*)nrow,ncol - if ((psb_tolower(type) == 'real').and.(psb_tolower(sym) == 'general')) then + if ((psb_tolower(type) == 'complex').and.(psb_tolower(sym) == 'general')) then allocate(b(nrow),stat = ircode) if (ircode /= 0) goto 993 do i=1, nrow @@ -210,18 +210,14 @@ subroutine mm_cvet2_write(b, header, info, iunit, filename) endif endif - write(outfile,'(a)') '%%MatrixMarket matrix array real general' + write(outfile,'(a)') '%%MatrixMarket matrix array complex general' write(outfile,'(a)') '% '//trim(header) write(outfile,'(a)') '% ' nrow = size(b,1) ncol = size(b,2) write(outfile,*) nrow,ncol - write(frmtv,'(a,i0,a)') '(',2*ncol,'(es26.18,1x))' - - do i=1,size(b,1) - write(outfile,frmtv) b(i,1:ncol) - end do + write(outfile,fmt='(2(es26.18,1x))') ((b(i,j), i=1,nrow),j=1,ncol) if (outfile /= 6) close(outfile) @@ -266,7 +262,7 @@ subroutine mm_cvet1_write(b, header, info, iunit, filename) endif endif - write(outfile,'(a)') '%%MatrixMarket matrix array real general' + write(outfile,'(a)') '%%MatrixMarket matrix array complex general' write(outfile,'(a)') '% '//trim(header) write(outfile,'(a)') '% ' nrow = size(b,1) diff --git a/util/psb_c_renum_impl.F90 b/util/psb_c_renum_impl.F90 index b9d97fb77..0529f0495 100644 --- a/util/psb_c_renum_impl.F90 +++ b/util/psb_c_renum_impl.F90 @@ -69,12 +69,7 @@ subroutine psb_c_mat_renums(alg,mat,info,perm) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return end subroutine psb_c_mat_renums @@ -142,12 +137,7 @@ subroutine psb_c_mat_renum(alg,mat,info,perm) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains @@ -235,13 +225,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return + end subroutine psb_mat_renum_gps @@ -343,13 +329,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return + end subroutine psb_mat_renum_amd end subroutine psb_c_mat_renum diff --git a/util/psb_d_genpde_impl.f90 b/util/psb_d_genpde_impl.f90 index 23b4fd992..183ab3b1b 100644 --- a/util/psb_d_genpde_impl.f90 +++ b/util/psb_d_genpde_impl.f90 @@ -349,12 +349,8 @@ subroutine psb_d_gen_pde3d(ictxt,idim,a,bv,xv,desc_a,afmt,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_d_gen_pde3d @@ -655,11 +651,7 @@ subroutine psb_d_gen_pde2d(ictxt,idim,a,bv,xv,desc_a,afmt,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_d_gen_pde2d diff --git a/util/psb_d_mat_dist_impl.f90 b/util/psb_d_mat_dist_impl.f90 index 7b6b0cee6..458cd0da4 100644 --- a/util/psb_d_mat_dist_impl.f90 +++ b/util/psb_d_mat_dist_impl.f90 @@ -452,12 +452,8 @@ subroutine dmatdist(a_glob, a, ictxt, desc_a,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine dmatdist diff --git a/util/psb_d_mmio_impl.f90 b/util/psb_d_mmio_impl.f90 index f912ed4ae..439030316 100644 --- a/util/psb_d_mmio_impl.f90 +++ b/util/psb_d_mmio_impl.f90 @@ -208,13 +208,9 @@ subroutine mm_dvet2_write(b, header, info, iunit, filename) write(outfile,'(a)') '% ' nrow = size(b,1) ncol = size(b,2) - write(outfile,*) nrow,ncol - - write(frmtv,'(a,i0,a)') '(',ncol,'(es26.18,1x))' + write(outfile,*) nrow, ncol - do i=1,size(b,1) - write(outfile,frmtv) b(i,1:ncol) - end do + write(outfile,fmt='(es26.18,1x)') ((b(i,j), i=1,nrow),j=1,ncol) if (outfile /= 6) close(outfile) diff --git a/util/psb_d_renum_impl.F90 b/util/psb_d_renum_impl.F90 index 01c2b3dd9..ef86d3eec 100644 --- a/util/psb_d_renum_impl.F90 +++ b/util/psb_d_renum_impl.F90 @@ -69,12 +69,7 @@ subroutine psb_d_mat_renums(alg,mat,info,perm) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return end subroutine psb_d_mat_renums @@ -142,12 +137,7 @@ subroutine psb_d_mat_renum(alg,mat,info,perm) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains @@ -235,13 +225,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return + end subroutine psb_mat_renum_gps @@ -343,12 +329,7 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return end subroutine psb_mat_renum_amd diff --git a/util/psb_s_genpde_impl.f90 b/util/psb_s_genpde_impl.f90 index 3c4e5721f..c68f0adf7 100644 --- a/util/psb_s_genpde_impl.f90 +++ b/util/psb_s_genpde_impl.f90 @@ -334,12 +334,8 @@ subroutine psb_s_gen_pde3d(ictxt,idim,a,bv,xv,desc_a,afmt,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_s_gen_pde3d @@ -625,11 +621,7 @@ subroutine psb_s_gen_pde2d(ictxt,idim,a,bv,xv,desc_a,afmt,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine psb_s_gen_pde2d diff --git a/util/psb_s_mat_dist_impl.f90 b/util/psb_s_mat_dist_impl.f90 index 7dc97284c..7ad858535 100644 --- a/util/psb_s_mat_dist_impl.f90 +++ b/util/psb_s_mat_dist_impl.f90 @@ -450,12 +450,8 @@ subroutine smatdist(a_glob, a, ictxt, desc_a,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine smatdist diff --git a/util/psb_s_mmio_impl.f90 b/util/psb_s_mmio_impl.f90 index 7085a207c..a50b122d3 100644 --- a/util/psb_s_mmio_impl.f90 +++ b/util/psb_s_mmio_impl.f90 @@ -212,11 +212,7 @@ subroutine mm_svet2_write(b, header, info, iunit, filename) ncol = size(b,2) write(outfile,*) nrow,ncol - write(frmtv,'(a,i0,a)') '(',ncol,'(es26.18,1x))' - - do i=1,size(b,1) - write(outfile,frmtv) b(i,1:ncol) - end do + write(outfile,fmt='(es26.18,1x)') ((b(i,j), i=1,nrow),j=1,ncol) if (outfile /= 6) close(outfile) diff --git a/util/psb_s_renum_impl.F90 b/util/psb_s_renum_impl.F90 index 681396bdf..13211c8b1 100644 --- a/util/psb_s_renum_impl.F90 +++ b/util/psb_s_renum_impl.F90 @@ -69,13 +69,9 @@ subroutine psb_s_mat_renums(alg,mat,info,perm) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return + end subroutine psb_s_mat_renums subroutine psb_s_mat_renum(alg,mat,info,perm) @@ -142,12 +138,7 @@ subroutine psb_s_mat_renum(alg,mat,info,perm) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains @@ -235,13 +226,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return + end subroutine psb_mat_renum_gps @@ -343,13 +330,9 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return + end subroutine psb_mat_renum_amd end subroutine psb_s_mat_renum diff --git a/util/psb_z_mat_dist_impl.f90 b/util/psb_z_mat_dist_impl.f90 index e79b36f54..cf774659c 100644 --- a/util/psb_z_mat_dist_impl.f90 +++ b/util/psb_z_mat_dist_impl.f90 @@ -450,12 +450,8 @@ subroutine zmatdist(a_glob, a, ictxt, desc_a,& call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error(ictxt) - return - end if +9999 call psb_error_handler(ictxt,err_act) + return end subroutine zmatdist diff --git a/util/psb_z_mmio_impl.f90 b/util/psb_z_mmio_impl.f90 index 6b58a6f1a..2fe55226a 100644 --- a/util/psb_z_mmio_impl.f90 +++ b/util/psb_z_mmio_impl.f90 @@ -76,7 +76,7 @@ subroutine mm_zvet_read(b, info, iunit, filename) read(line,fmt=*)nrow,ncol - if ((psb_tolower(type) == 'real').and.(psb_tolower(sym) == 'general')) then + if ((psb_tolower(type) == 'complex').and.(psb_tolower(sym) == 'general')) then allocate(b(nrow),stat = ircode) if (ircode /= 0) goto 993 do i=1, nrow @@ -149,7 +149,7 @@ subroutine mm_zvet2_read(b, info, iunit, filename) read(line,fmt=*)nrow,ncol - if ((psb_tolower(type) == 'real').and.(psb_tolower(sym) == 'general')) then + if ((psb_tolower(type) == 'complex').and.(psb_tolower(sym) == 'general')) then allocate(b(nrow,ncol),stat = ircode) if (ircode /= 0) goto 993 do j=1, ncol @@ -210,18 +210,14 @@ subroutine mm_zvet2_write(b, header, info, iunit, filename) endif endif - write(outfile,'(a)') '%%MatrixMarket matrix array real general' + write(outfile,'(a)') '%%MatrixMarket matrix array complex general' write(outfile,'(a)') '% '//trim(header) write(outfile,'(a)') '% ' nrow = size(b,1) ncol = size(b,2) write(outfile,*) nrow,ncol - write(frmtv,'(a,i0,a)') '(',2*ncol,'(es26.18,1x))' - - do i=1,size(b,1) - write(outfile,frmtv) b(i,1:ncol) - end do + write(outfile,fmt='(2(es26.18,1x))') ((b(i,j), i=1,nrow),j=1,ncol) if (outfile /= 6) close(outfile) diff --git a/util/psb_z_renum_impl.F90 b/util/psb_z_renum_impl.F90 index 638ee4062..d7ea8feac 100644 --- a/util/psb_z_renum_impl.F90 +++ b/util/psb_z_renum_impl.F90 @@ -69,13 +69,9 @@ subroutine psb_z_mat_renums(alg,mat,info,perm) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return + end subroutine psb_z_mat_renums subroutine psb_z_mat_renum(alg,mat,info,perm) @@ -142,12 +138,7 @@ subroutine psb_z_mat_renum(alg,mat,info,perm) call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return contains @@ -235,12 +226,7 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return end subroutine psb_mat_renum_gps @@ -343,12 +329,7 @@ contains call psb_erractionrestore(err_act) return -9999 continue - call psb_erractionrestore(err_act) - if (err_act == psb_act_abort_) then - call psb_error() - return - end if +9999 call psb_error_handler(err_act) return end subroutine psb_mat_renum_amd