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)