From 6bb7725102ce3c0fc4cc031f8055627572237b06 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Mon, 29 Sep 2025 16:15:25 +0200 Subject: [PATCH] Minor change to mat_dist_impl --- util/psb_c_mat_dist_impl.f90 | 10 ++++------ util/psb_d_mat_dist_impl.f90 | 10 ++++------ util/psb_s_mat_dist_impl.f90 | 10 ++++------ util/psb_z_mat_dist_impl.f90 | 10 ++++------ 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/util/psb_c_mat_dist_impl.f90 b/util/psb_c_mat_dist_impl.f90 index 26d04041..b4b4c13e 100644 --- a/util/psb_c_mat_dist_impl.f90 +++ b/util/psb_c_mat_dist_impl.f90 @@ -238,6 +238,10 @@ subroutine psb_cmatdist(a_glob, a, ctxt, desc_a,& if (j_count > nrow) exit if (j_count > lastigp) exit end do + if (j_count > lastigp) then + iproc = iproc + 1 + lastigp = lastigp + vsz(iproc+1) + end if end if ! now we should insert rows i_count..j_count-1 @@ -313,12 +317,6 @@ subroutine psb_cmatdist(a_glob, a, ctxt, desc_a,& end do endif i_count = j_count - if ((use_vsz).and.(j_count <= nrow)) then - if (j_count > lastigp) then - iproc = iproc + 1 - lastigp = lastigp + vsz(iproc+1) - end if - end if end do call psb_barrier(ctxt) diff --git a/util/psb_d_mat_dist_impl.f90 b/util/psb_d_mat_dist_impl.f90 index 44d853e4..0b0db2cd 100644 --- a/util/psb_d_mat_dist_impl.f90 +++ b/util/psb_d_mat_dist_impl.f90 @@ -238,6 +238,10 @@ subroutine psb_dmatdist(a_glob, a, ctxt, desc_a,& if (j_count > nrow) exit if (j_count > lastigp) exit end do + if (j_count > lastigp) then + iproc = iproc + 1 + lastigp = lastigp + vsz(iproc+1) + end if end if ! now we should insert rows i_count..j_count-1 @@ -313,12 +317,6 @@ subroutine psb_dmatdist(a_glob, a, ctxt, desc_a,& end do endif i_count = j_count - if ((use_vsz).and.(j_count <= nrow)) then - if (j_count > lastigp) then - iproc = iproc + 1 - lastigp = lastigp + vsz(iproc+1) - end if - end if end do call psb_barrier(ctxt) diff --git a/util/psb_s_mat_dist_impl.f90 b/util/psb_s_mat_dist_impl.f90 index 126938bf..941906a8 100644 --- a/util/psb_s_mat_dist_impl.f90 +++ b/util/psb_s_mat_dist_impl.f90 @@ -238,6 +238,10 @@ subroutine psb_smatdist(a_glob, a, ctxt, desc_a,& if (j_count > nrow) exit if (j_count > lastigp) exit end do + if (j_count > lastigp) then + iproc = iproc + 1 + lastigp = lastigp + vsz(iproc+1) + end if end if ! now we should insert rows i_count..j_count-1 @@ -313,12 +317,6 @@ subroutine psb_smatdist(a_glob, a, ctxt, desc_a,& end do endif i_count = j_count - if ((use_vsz).and.(j_count <= nrow)) then - if (j_count > lastigp) then - iproc = iproc + 1 - lastigp = lastigp + vsz(iproc+1) - end if - end if end do call psb_barrier(ctxt) diff --git a/util/psb_z_mat_dist_impl.f90 b/util/psb_z_mat_dist_impl.f90 index 48abe46d..e96f50b3 100644 --- a/util/psb_z_mat_dist_impl.f90 +++ b/util/psb_z_mat_dist_impl.f90 @@ -238,6 +238,10 @@ subroutine psb_zmatdist(a_glob, a, ctxt, desc_a,& if (j_count > nrow) exit if (j_count > lastigp) exit end do + if (j_count > lastigp) then + iproc = iproc + 1 + lastigp = lastigp + vsz(iproc+1) + end if end if ! now we should insert rows i_count..j_count-1 @@ -313,12 +317,6 @@ subroutine psb_zmatdist(a_glob, a, ctxt, desc_a,& end do endif i_count = j_count - if ((use_vsz).and.(j_count <= nrow)) then - if (j_count > lastigp) then - iproc = iproc + 1 - lastigp = lastigp + vsz(iproc+1) - end if - end if end do call psb_barrier(ctxt)