From 4aef3f2a803f6ee5d73e0336ea03d2d9ac5d144d Mon Sep 17 00:00:00 2001 From: sfilippone Date: Wed, 14 May 2025 12:27:41 +0200 Subject: [PATCH] New argument IMOLD in mat_dist --- util/psb_c_mat_dist_impl.f90 | 18 ++++++++++-------- util/psb_c_mat_dist_mod.f90 | 12 +++++++----- util/psb_d_mat_dist_impl.f90 | 18 ++++++++++-------- util/psb_d_mat_dist_mod.f90 | 12 +++++++----- util/psb_s_mat_dist_impl.f90 | 18 ++++++++++-------- util/psb_s_mat_dist_mod.f90 | 12 +++++++----- util/psb_z_mat_dist_impl.f90 | 18 ++++++++++-------- util/psb_z_mat_dist_mod.f90 | 12 +++++++----- 8 files changed, 68 insertions(+), 52 deletions(-) diff --git a/util/psb_c_mat_dist_impl.f90 b/util/psb_c_mat_dist_impl.f90 index e358bf25..081252dd 100644 --- a/util/psb_c_mat_dist_impl.f90 +++ b/util/psb_c_mat_dist_impl.f90 @@ -30,7 +30,7 @@ ! ! subroutine psb_cmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -81,7 +81,8 @@ subroutine psb_cmatdist(a_glob, a, ctxt, desc_a,& integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_c_base_sparse_mat), optional :: mold + class(psb_c_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) @@ -321,7 +322,7 @@ subroutine psb_cmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t0 = psb_wtime() - call psb_cdasb(desc_a,info) + call psb_cdasb(desc_a,info,mold=imold) t1 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -332,7 +333,7 @@ subroutine psb_cmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t2 = psb_wtime() - call psb_spasb(a,desc_a,info,afmt=fmt,mold=mold) + call psb_spasb(a,desc_a,info,afmt=fmt,mold=amold) t3 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -371,7 +372,7 @@ end subroutine psb_cmatdist subroutine psb_lcmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -422,7 +423,8 @@ subroutine psb_lcmatdist(a_glob, a, ctxt, desc_a,& integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_c_base_sparse_mat), optional :: mold + class(psb_c_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) @@ -660,7 +662,7 @@ subroutine psb_lcmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t0 = psb_wtime() - call psb_cdasb(desc_a,info) + call psb_cdasb(desc_a,info,mold=imold) t1 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -671,7 +673,7 @@ subroutine psb_lcmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t2 = psb_wtime() - call psb_spasb(a,desc_a,info,afmt=fmt,mold=mold) + call psb_spasb(a,desc_a,info,afmt=fmt,mold=amold) t3 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ diff --git a/util/psb_c_mat_dist_mod.f90 b/util/psb_c_mat_dist_mod.f90 index de48dabf..c0fa0031 100644 --- a/util/psb_c_mat_dist_mod.f90 +++ b/util/psb_c_mat_dist_mod.f90 @@ -32,11 +32,11 @@ module psb_c_mat_dist_mod use psb_base_mod, only : psb_ipk_, psb_spk_, psb_desc_type, psb_parts, & & psb_cspmat_type, psb_c_base_sparse_mat, psb_c_vect_type, & - & psb_lcspmat_type, psb_ctxt_type + & psb_lcspmat_type, psb_ctxt_type, psb_i_base_vect_type interface psb_matdist subroutine psb_cmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -87,13 +87,14 @@ module psb_c_mat_dist_mod integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_c_base_sparse_mat), optional :: mold + class(psb_c_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) end subroutine psb_cmatdist subroutine psb_lcmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -144,7 +145,8 @@ module psb_c_mat_dist_mod integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_c_base_sparse_mat), optional :: mold + class(psb_c_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) diff --git a/util/psb_d_mat_dist_impl.f90 b/util/psb_d_mat_dist_impl.f90 index 3c683254..e85dc773 100644 --- a/util/psb_d_mat_dist_impl.f90 +++ b/util/psb_d_mat_dist_impl.f90 @@ -30,7 +30,7 @@ ! ! subroutine psb_dmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -81,7 +81,8 @@ subroutine psb_dmatdist(a_glob, a, ctxt, desc_a,& integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_d_base_sparse_mat), optional :: mold + class(psb_d_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) @@ -321,7 +322,7 @@ subroutine psb_dmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t0 = psb_wtime() - call psb_cdasb(desc_a,info) + call psb_cdasb(desc_a,info,mold=imold) t1 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -332,7 +333,7 @@ subroutine psb_dmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t2 = psb_wtime() - call psb_spasb(a,desc_a,info,afmt=fmt,mold=mold) + call psb_spasb(a,desc_a,info,afmt=fmt,mold=amold) t3 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -371,7 +372,7 @@ end subroutine psb_dmatdist subroutine psb_ldmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -422,7 +423,8 @@ subroutine psb_ldmatdist(a_glob, a, ctxt, desc_a,& integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_d_base_sparse_mat), optional :: mold + class(psb_d_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) @@ -660,7 +662,7 @@ subroutine psb_ldmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t0 = psb_wtime() - call psb_cdasb(desc_a,info) + call psb_cdasb(desc_a,info,mold=imold) t1 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -671,7 +673,7 @@ subroutine psb_ldmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t2 = psb_wtime() - call psb_spasb(a,desc_a,info,afmt=fmt,mold=mold) + call psb_spasb(a,desc_a,info,afmt=fmt,mold=amold) t3 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ diff --git a/util/psb_d_mat_dist_mod.f90 b/util/psb_d_mat_dist_mod.f90 index 2c7f9290..978c62dd 100644 --- a/util/psb_d_mat_dist_mod.f90 +++ b/util/psb_d_mat_dist_mod.f90 @@ -32,11 +32,11 @@ module psb_d_mat_dist_mod use psb_base_mod, only : psb_ipk_, psb_dpk_, psb_desc_type, psb_parts, & & psb_dspmat_type, psb_d_base_sparse_mat, psb_d_vect_type, & - & psb_ldspmat_type, psb_ctxt_type + & psb_ldspmat_type, psb_ctxt_type, psb_i_base_vect_type interface psb_matdist subroutine psb_dmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -87,13 +87,14 @@ module psb_d_mat_dist_mod integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_d_base_sparse_mat), optional :: mold + class(psb_d_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) end subroutine psb_dmatdist subroutine psb_ldmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -144,7 +145,8 @@ module psb_d_mat_dist_mod integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_d_base_sparse_mat), optional :: mold + class(psb_d_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) diff --git a/util/psb_s_mat_dist_impl.f90 b/util/psb_s_mat_dist_impl.f90 index 6c8bd792..9299998f 100644 --- a/util/psb_s_mat_dist_impl.f90 +++ b/util/psb_s_mat_dist_impl.f90 @@ -30,7 +30,7 @@ ! ! subroutine psb_smatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -81,7 +81,8 @@ subroutine psb_smatdist(a_glob, a, ctxt, desc_a,& integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_s_base_sparse_mat), optional :: mold + class(psb_s_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) @@ -321,7 +322,7 @@ subroutine psb_smatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t0 = psb_wtime() - call psb_cdasb(desc_a,info) + call psb_cdasb(desc_a,info,mold=imold) t1 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -332,7 +333,7 @@ subroutine psb_smatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t2 = psb_wtime() - call psb_spasb(a,desc_a,info,afmt=fmt,mold=mold) + call psb_spasb(a,desc_a,info,afmt=fmt,mold=amold) t3 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -371,7 +372,7 @@ end subroutine psb_smatdist subroutine psb_lsmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -422,7 +423,8 @@ subroutine psb_lsmatdist(a_glob, a, ctxt, desc_a,& integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_s_base_sparse_mat), optional :: mold + class(psb_s_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) @@ -660,7 +662,7 @@ subroutine psb_lsmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t0 = psb_wtime() - call psb_cdasb(desc_a,info) + call psb_cdasb(desc_a,info,mold=imold) t1 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -671,7 +673,7 @@ subroutine psb_lsmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t2 = psb_wtime() - call psb_spasb(a,desc_a,info,afmt=fmt,mold=mold) + call psb_spasb(a,desc_a,info,afmt=fmt,mold=amold) t3 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ diff --git a/util/psb_s_mat_dist_mod.f90 b/util/psb_s_mat_dist_mod.f90 index 47f6381f..9cb48058 100644 --- a/util/psb_s_mat_dist_mod.f90 +++ b/util/psb_s_mat_dist_mod.f90 @@ -32,11 +32,11 @@ module psb_s_mat_dist_mod use psb_base_mod, only : psb_ipk_, psb_spk_, psb_desc_type, psb_parts, & & psb_sspmat_type, psb_s_base_sparse_mat, psb_s_vect_type, & - & psb_lsspmat_type, psb_ctxt_type + & psb_lsspmat_type, psb_ctxt_type, psb_i_base_vect_type interface psb_matdist subroutine psb_smatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -87,13 +87,14 @@ module psb_s_mat_dist_mod integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_s_base_sparse_mat), optional :: mold + class(psb_s_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) end subroutine psb_smatdist subroutine psb_lsmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -144,7 +145,8 @@ module psb_s_mat_dist_mod integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_s_base_sparse_mat), optional :: mold + class(psb_s_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) diff --git a/util/psb_z_mat_dist_impl.f90 b/util/psb_z_mat_dist_impl.f90 index 5c83c66c..360cb991 100644 --- a/util/psb_z_mat_dist_impl.f90 +++ b/util/psb_z_mat_dist_impl.f90 @@ -30,7 +30,7 @@ ! ! subroutine psb_zmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -81,7 +81,8 @@ subroutine psb_zmatdist(a_glob, a, ctxt, desc_a,& integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_z_base_sparse_mat), optional :: mold + class(psb_z_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) @@ -321,7 +322,7 @@ subroutine psb_zmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t0 = psb_wtime() - call psb_cdasb(desc_a,info) + call psb_cdasb(desc_a,info,mold=imold) t1 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -332,7 +333,7 @@ subroutine psb_zmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t2 = psb_wtime() - call psb_spasb(a,desc_a,info,afmt=fmt,mold=mold) + call psb_spasb(a,desc_a,info,afmt=fmt,mold=amold) t3 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -371,7 +372,7 @@ end subroutine psb_zmatdist subroutine psb_lzmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -422,7 +423,8 @@ subroutine psb_lzmatdist(a_glob, a, ctxt, desc_a,& integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_z_base_sparse_mat), optional :: mold + class(psb_z_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) @@ -660,7 +662,7 @@ subroutine psb_lzmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t0 = psb_wtime() - call psb_cdasb(desc_a,info) + call psb_cdasb(desc_a,info,mold=imold) t1 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ @@ -671,7 +673,7 @@ subroutine psb_lzmatdist(a_glob, a, ctxt, desc_a,& call psb_barrier(ctxt) t2 = psb_wtime() - call psb_spasb(a,desc_a,info,afmt=fmt,mold=mold) + call psb_spasb(a,desc_a,info,afmt=fmt,mold=amold) t3 = psb_wtime() if(info /= psb_success_)then info=psb_err_from_subroutine_ diff --git a/util/psb_z_mat_dist_mod.f90 b/util/psb_z_mat_dist_mod.f90 index 2f62899e..3be4f947 100644 --- a/util/psb_z_mat_dist_mod.f90 +++ b/util/psb_z_mat_dist_mod.f90 @@ -32,11 +32,11 @@ module psb_z_mat_dist_mod use psb_base_mod, only : psb_ipk_, psb_dpk_, psb_desc_type, psb_parts, & & psb_zspmat_type, psb_z_base_sparse_mat, psb_z_vect_type, & - & psb_lzspmat_type, psb_ctxt_type + & psb_lzspmat_type, psb_ctxt_type, psb_i_base_vect_type interface psb_matdist subroutine psb_zmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -87,13 +87,14 @@ module psb_z_mat_dist_mod integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_z_base_sparse_mat), optional :: mold + class(psb_z_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:) end subroutine psb_zmatdist subroutine psb_lzmatdist(a_glob, a, ctxt, desc_a,& - & info, parts, vg, vsz, inroot,fmt,mold) + & info, parts, vg, vsz, inroot,fmt,amold,imold) ! ! an utility subroutine to distribute a matrix among processors ! according to a user defined data distribution, using @@ -144,7 +145,8 @@ module psb_z_mat_dist_mod integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional :: inroot character(len=*), optional :: fmt - class(psb_z_base_sparse_mat), optional :: mold + class(psb_z_base_sparse_mat), optional :: amold + class(psb_i_base_vect_type), optional, intent(in) :: imold procedure(psb_parts), optional :: parts integer(psb_ipk_), optional :: vg(:) integer(psb_ipk_), optional :: vsz(:)