From a3496d8cb517aa04fcda8a45f618279c99f0a722 Mon Sep 17 00:00:00 2001 From: sfilippone Date: Thu, 27 Mar 2025 12:39:50 +0100 Subject: [PATCH] Add error handling after CDALL in samples --- base/tools/psb_cd_inloc.f90 | 4 +--- test/pdegen/psb_d_pde2d.F90 | 3 +++ test/pdegen/psb_d_pde3d.F90 | 3 +++ test/pdegen/psb_s_pde2d.F90 | 3 +++ test/pdegen/psb_s_pde3d.F90 | 3 +++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/base/tools/psb_cd_inloc.f90 b/base/tools/psb_cd_inloc.f90 index 3f2b2e08..7315f376 100644 --- a/base/tools/psb_cd_inloc.f90 +++ b/base/tools/psb_cd_inloc.f90 @@ -247,7 +247,6 @@ subroutine psb_cd_inloc(v, ctxt, desc, info, globalcheck,idx,usehash) if (check_) then ! Sort, eliminate duplicates, then ! scramble back into original position. - ix(1) = -1 if (present(idx)) then if (size(idx) >= loc_row) then !$omp parallel do private(i) @@ -255,8 +254,7 @@ subroutine psb_cd_inloc(v, ctxt, desc, info, globalcheck,idx,usehash) ix(i) = idx(i) end do end if - end if - if (ix(1) == -1) then + else !$omp parallel do private(i) do i=1, loc_row ix(i) = i diff --git a/test/pdegen/psb_d_pde2d.F90 b/test/pdegen/psb_d_pde2d.F90 index 49c339d6..ee7cb7f6 100644 --- a/test/pdegen/psb_d_pde2d.F90 +++ b/test/pdegen/psb_d_pde2d.F90 @@ -281,6 +281,7 @@ contains ! contiguous rows ! call psb_cdall(ctxt,desc_a,info,nl=nr) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -308,6 +309,7 @@ contains ! process that owns it ! call psb_cdall(ctxt,desc_a,info,vg=iv) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -357,6 +359,7 @@ contains ! the set of global indices it owns. ! call psb_cdall(ctxt,desc_a,info,vl=myidx) + if (info /=0) goto 9999 ! ! Specify process topology diff --git a/test/pdegen/psb_d_pde3d.F90 b/test/pdegen/psb_d_pde3d.F90 index b45856fa..1f323a46 100644 --- a/test/pdegen/psb_d_pde3d.F90 +++ b/test/pdegen/psb_d_pde3d.F90 @@ -297,6 +297,7 @@ contains ! contiguous rows ! call psb_cdall(ctxt,desc_a,info,nl=nr) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -324,6 +325,7 @@ contains ! process that owns it ! call psb_cdall(ctxt,desc_a,info,vg=iv) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -378,6 +380,7 @@ contains ! the set of global indices it owns. ! call psb_cdall(ctxt,desc_a,info,vl=myidx) + if (info /=0) goto 9999 ! ! Specify process topology diff --git a/test/pdegen/psb_s_pde2d.F90 b/test/pdegen/psb_s_pde2d.F90 index 4df1c05c..c27d2ebe 100644 --- a/test/pdegen/psb_s_pde2d.F90 +++ b/test/pdegen/psb_s_pde2d.F90 @@ -281,6 +281,7 @@ contains ! contiguous rows ! call psb_cdall(ctxt,desc_a,info,nl=nr) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -308,6 +309,7 @@ contains ! process that owns it ! call psb_cdall(ctxt,desc_a,info,vg=iv) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -357,6 +359,7 @@ contains ! the set of global indices it owns. ! call psb_cdall(ctxt,desc_a,info,vl=myidx) + if (info /=0) goto 9999 ! ! Specify process topology diff --git a/test/pdegen/psb_s_pde3d.F90 b/test/pdegen/psb_s_pde3d.F90 index f2e2f500..a80d94f8 100644 --- a/test/pdegen/psb_s_pde3d.F90 +++ b/test/pdegen/psb_s_pde3d.F90 @@ -297,6 +297,7 @@ contains ! contiguous rows ! call psb_cdall(ctxt,desc_a,info,nl=nr) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -324,6 +325,7 @@ contains ! process that owns it ! call psb_cdall(ctxt,desc_a,info,vg=iv) + if (info /=0) goto 9999 myidx = desc_a%get_global_indices() nlr = size(myidx) @@ -378,6 +380,7 @@ contains ! the set of global indices it owns. ! call psb_cdall(ctxt,desc_a,info,vl=myidx) + if (info /=0) goto 9999 ! ! Specify process topology