From 1bb802328b7bd92ad5360f0a3752617746986d26 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Thu, 12 Apr 2018 12:08:37 +0100 Subject: [PATCH] Now base compiles cleanly. --- base/modules/Makefile | 12 ++-- base/modules/tools/psb_c_tools_a_mod.f90 | 4 +- base/modules/tools/psb_c_tools_mod.f90 | 25 ++++--- base/modules/tools/psb_d_tools_a_mod.f90 | 4 +- base/modules/tools/psb_d_tools_mod.f90 | 25 ++++--- base/modules/tools/psb_e_tools_a_mod.f90 | 4 +- base/modules/tools/psb_i_tools_mod.f90 | 9 +-- base/modules/tools/psb_l_tools_mod.f90 | 11 +-- base/modules/tools/psb_m_tools_a_mod.f90 | 4 +- base/modules/tools/psb_s_tools_a_mod.f90 | 4 +- base/modules/tools/psb_s_tools_mod.f90 | 25 ++++--- base/modules/tools/psb_z_tools_a_mod.f90 | 4 +- base/modules/tools/psb_z_tools_mod.f90 | 25 ++++--- base/tools/psb_cd_switch_ovl_indxmap.f90 | 2 +- base/tools/psb_cdall.f90 | 2 +- base/tools/psb_cdrep.f90 | 3 +- base/tools/psb_cins.f90 | 31 ++++---- base/tools/psb_cins_a.f90 | 10 +-- base/tools/psb_cspins.f90 | 92 +++++++++++------------- base/tools/psb_dins.f90 | 31 ++++---- base/tools/psb_dins_a.f90 | 10 +-- base/tools/psb_dspins.f90 | 92 +++++++++++------------- base/tools/psb_eins_a.f90 | 10 +-- base/tools/psb_iins.f90 | 31 ++++---- base/tools/psb_lins.f90 | 31 ++++---- base/tools/psb_mins_a.f90 | 10 +-- base/tools/psb_sins.f90 | 31 ++++---- base/tools/psb_sins_a.f90 | 10 +-- base/tools/psb_sspins.f90 | 92 +++++++++++------------- base/tools/psb_zins.f90 | 31 ++++---- base/tools/psb_zins_a.f90 | 10 +-- base/tools/psb_zspins.f90 | 92 +++++++++++------------- 32 files changed, 395 insertions(+), 382 deletions(-) diff --git a/base/modules/Makefile b/base/modules/Makefile index bf79025d3..ee652272d 100644 --- a/base/modules/Makefile +++ b/base/modules/Makefile @@ -212,12 +212,12 @@ serial/psb_c_csc_mat_mod.o serial/psb_c_csr_mat_mod.o: serial/psb_c_base_mat_mod serial/psb_z_csc_mat_mod.o serial/psb_z_csr_mat_mod.o: serial/psb_z_base_mat_mod.o serial/psb_mat_mod.o: serial/psb_vect_mod.o serial/psb_s_mat_mod.o serial/psb_d_mat_mod.o serial/psb_c_mat_mod.o serial/psb_z_mat_mod.o serial/psb_serial_mod.o: serial/psb_s_serial_mod.o serial/psb_d_serial_mod.o serial/psb_c_serial_mod.o serial/psb_z_serial_mod.o -serial/psb_i_vect_mod.o: serial/psb_i_base_vect_mod.o -serial/psb_l_vect_mod.o: serial/psb_l_base_vect_mod.o serial/psb_i_vect_mod.o -serial/psb_s_vect_mod.o: serial/psb_s_base_vect_mod.o serial/psb_i_vect_mod.o -serial/psb_d_vect_mod.o: serial/psb_d_base_vect_mod.o serial/psb_i_vect_mod.o -serial/psb_c_vect_mod.o: serial/psb_c_base_vect_mod.o serial/psb_i_vect_mod.o -serial/psb_z_vect_mod.o: serial/psb_z_base_vect_mod.o serial/psb_i_vect_mod.o +serial/psb_i_vect_mod.o: serial/psb_i_base_vect_mod.o serial/psb_l_vect_mod.o +serial/psb_l_vect_mod.o: serial/psb_l_base_vect_mod.o +serial/psb_s_vect_mod.o: serial/psb_s_base_vect_mod.o serial/psb_l_vect_mod.o +serial/psb_d_vect_mod.o: serial/psb_d_base_vect_mod.o serial/psb_l_vect_mod.o +serial/psb_c_vect_mod.o: serial/psb_c_base_vect_mod.o serial/psb_l_vect_mod.o +serial/psb_z_vect_mod.o: serial/psb_z_base_vect_mod.o serial/psb_l_vect_mod.o serial/psb_s_serial_mod.o serial/psb_d_serial_mod.o serial/psb_c_serial_mod.o serial/psb_z_serial_mod.o: serial/psb_mat_mod.o auxil/psb_string_mod.o auxil/psb_sort_mod.o auxil/psi_serial_mod.o serial/psb_vect_mod.o: serial/psb_i_vect_mod.o serial/psb_l_vect_mod.o serial/psb_d_vect_mod.o serial/psb_s_vect_mod.o serial/psb_c_vect_mod.o serial/psb_z_vect_mod.o diff --git a/base/modules/tools/psb_c_tools_a_mod.f90 b/base/modules/tools/psb_c_tools_a_mod.f90 index 20f8eb54f..6c864eadf 100644 --- a/base/modules/tools/psb_c_tools_a_mod.f90 +++ b/base/modules/tools/psb_c_tools_a_mod.f90 @@ -96,7 +96,7 @@ Module psb_c_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a complex(psb_spk_),intent(inout) :: x(:,:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -108,7 +108,7 @@ Module psb_c_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a complex(psb_spk_),intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl diff --git a/base/modules/tools/psb_c_tools_mod.f90 b/base/modules/tools/psb_c_tools_mod.f90 index 42f4461fa..49542ba24 100644 --- a/base/modules/tools/psb_c_tools_mod.f90 +++ b/base/modules/tools/psb_c_tools_mod.f90 @@ -30,9 +30,10 @@ ! ! Module psb_c_tools_mod - use psb_desc_mod, only : psb_desc_type, psb_spk_, psb_ipk_ - use psb_c_vect_mod, only : psb_c_base_vect_type, psb_c_vect_type, psb_i_vect_type + use psb_desc_mod, only : psb_desc_type, psb_spk_, psb_ipk_, psb_lpk_ + use psb_c_vect_mod, only : psb_c_base_vect_type, psb_c_vect_type use psb_c_mat_mod, only : psb_cspmat_type, psb_c_base_sparse_mat + use psb_l_vect_mod, only : psb_l_vect_type use psb_c_multivect_mod, only : psb_c_base_multivect_type, psb_c_multivect_type interface psb_geall @@ -126,7 +127,7 @@ Module psb_c_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_c_vect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -138,7 +139,7 @@ Module psb_c_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_c_vect_type), intent(inout) :: x - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_c_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -150,7 +151,7 @@ Module psb_c_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_c_vect_type), intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -162,7 +163,7 @@ Module psb_c_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_c_multivect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -240,9 +241,10 @@ Module psb_c_tools_mod implicit none type(psb_desc_type), intent(inout) :: desc_a type(psb_cspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) complex(psb_spk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild logical, intent(in), optional :: local end subroutine psb_cspins @@ -253,7 +255,7 @@ Module psb_c_tools_mod type(psb_desc_type), intent(inout) :: desc_a type(psb_cspmat_type), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz - type(psb_i_vect_type), intent(inout) :: ia,ja + type(psb_l_vect_type), intent(inout) :: ia,ja type(psb_c_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild @@ -265,9 +267,10 @@ Module psb_c_tools_mod type(psb_desc_type), intent(in) :: desc_ar type(psb_desc_type), intent(inout) :: desc_ac type(psb_cspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) complex(psb_spk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info end subroutine psb_cspins_2desc end interface diff --git a/base/modules/tools/psb_d_tools_a_mod.f90 b/base/modules/tools/psb_d_tools_a_mod.f90 index 93a7154f0..1ce3d7749 100644 --- a/base/modules/tools/psb_d_tools_a_mod.f90 +++ b/base/modules/tools/psb_d_tools_a_mod.f90 @@ -96,7 +96,7 @@ Module psb_d_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a real(psb_dpk_),intent(inout) :: x(:,:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -108,7 +108,7 @@ Module psb_d_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a real(psb_dpk_),intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl diff --git a/base/modules/tools/psb_d_tools_mod.f90 b/base/modules/tools/psb_d_tools_mod.f90 index 5d12ba226..7f2dbee29 100644 --- a/base/modules/tools/psb_d_tools_mod.f90 +++ b/base/modules/tools/psb_d_tools_mod.f90 @@ -30,9 +30,10 @@ ! ! Module psb_d_tools_mod - use psb_desc_mod, only : psb_desc_type, psb_dpk_, psb_ipk_ - use psb_d_vect_mod, only : psb_d_base_vect_type, psb_d_vect_type, psb_i_vect_type + use psb_desc_mod, only : psb_desc_type, psb_dpk_, psb_ipk_, psb_lpk_ + use psb_d_vect_mod, only : psb_d_base_vect_type, psb_d_vect_type use psb_d_mat_mod, only : psb_dspmat_type, psb_d_base_sparse_mat + use psb_l_vect_mod, only : psb_l_vect_type use psb_d_multivect_mod, only : psb_d_base_multivect_type, psb_d_multivect_type interface psb_geall @@ -126,7 +127,7 @@ Module psb_d_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_d_vect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -138,7 +139,7 @@ Module psb_d_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_d_vect_type), intent(inout) :: x - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_d_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -150,7 +151,7 @@ Module psb_d_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_d_vect_type), intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -162,7 +163,7 @@ Module psb_d_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_d_multivect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -240,9 +241,10 @@ Module psb_d_tools_mod implicit none type(psb_desc_type), intent(inout) :: desc_a type(psb_dspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) real(psb_dpk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild logical, intent(in), optional :: local end subroutine psb_dspins @@ -253,7 +255,7 @@ Module psb_d_tools_mod type(psb_desc_type), intent(inout) :: desc_a type(psb_dspmat_type), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz - type(psb_i_vect_type), intent(inout) :: ia,ja + type(psb_l_vect_type), intent(inout) :: ia,ja type(psb_d_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild @@ -265,9 +267,10 @@ Module psb_d_tools_mod type(psb_desc_type), intent(in) :: desc_ar type(psb_desc_type), intent(inout) :: desc_ac type(psb_dspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) real(psb_dpk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info end subroutine psb_dspins_2desc end interface diff --git a/base/modules/tools/psb_e_tools_a_mod.f90 b/base/modules/tools/psb_e_tools_a_mod.f90 index aa126621d..bce8cb404 100644 --- a/base/modules/tools/psb_e_tools_a_mod.f90 +++ b/base/modules/tools/psb_e_tools_a_mod.f90 @@ -96,7 +96,7 @@ Module psb_e_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a integer(psb_epk_),intent(inout) :: x(:,:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_epk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -108,7 +108,7 @@ Module psb_e_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a integer(psb_epk_),intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_epk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl diff --git a/base/modules/tools/psb_i_tools_mod.f90 b/base/modules/tools/psb_i_tools_mod.f90 index 8ba9ff1d3..8378dcfbe 100644 --- a/base/modules/tools/psb_i_tools_mod.f90 +++ b/base/modules/tools/psb_i_tools_mod.f90 @@ -32,6 +32,7 @@ Module psb_i_tools_mod use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_lpk_, psb_success_ use psb_i_vect_mod, only : psb_i_base_vect_type, psb_i_vect_type + use psb_l_vect_mod, only : psb_l_vect_type use psb_i_multivect_mod, only : psb_i_base_multivect_type, psb_i_multivect_type interface psb_geall @@ -125,7 +126,7 @@ Module psb_i_tools_mod 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_lpk_), intent(in) :: irw(:) integer(psb_ipk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -137,7 +138,7 @@ Module psb_i_tools_mod 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_l_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 @@ -149,7 +150,7 @@ Module psb_i_tools_mod 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_lpk_), intent(in) :: irw(:) integer(psb_ipk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -161,7 +162,7 @@ Module psb_i_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_i_multivect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_ipk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl diff --git a/base/modules/tools/psb_l_tools_mod.f90 b/base/modules/tools/psb_l_tools_mod.f90 index 54f860180..4eca54f3e 100644 --- a/base/modules/tools/psb_l_tools_mod.f90 +++ b/base/modules/tools/psb_l_tools_mod.f90 @@ -31,7 +31,8 @@ ! Module psb_l_tools_mod use psb_desc_mod, only : psb_desc_type, psb_ipk_, psb_lpk_, psb_success_ - use psb_l_vect_mod, only : psb_l_base_vect_type, psb_l_vect_type, psb_i_vect_type + use psb_l_vect_mod, only : psb_l_base_vect_type, psb_l_vect_type +! use psb_i_vect_mod, only : psb_i_vect_type use psb_l_multivect_mod, only : psb_l_base_multivect_type, psb_l_multivect_type interface psb_geall @@ -125,7 +126,7 @@ Module psb_l_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_l_vect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_lpk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -137,7 +138,7 @@ Module psb_l_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_l_vect_type), intent(inout) :: x - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_l_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -149,7 +150,7 @@ Module psb_l_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_l_vect_type), intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_lpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -161,7 +162,7 @@ Module psb_l_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_l_multivect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_lpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl diff --git a/base/modules/tools/psb_m_tools_a_mod.f90 b/base/modules/tools/psb_m_tools_a_mod.f90 index a55483248..a5dfdd72d 100644 --- a/base/modules/tools/psb_m_tools_a_mod.f90 +++ b/base/modules/tools/psb_m_tools_a_mod.f90 @@ -96,7 +96,7 @@ Module psb_m_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a integer(psb_mpk_),intent(inout) :: x(:,:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_mpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -108,7 +108,7 @@ Module psb_m_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a integer(psb_mpk_),intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_mpk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl diff --git a/base/modules/tools/psb_s_tools_a_mod.f90 b/base/modules/tools/psb_s_tools_a_mod.f90 index bf047164d..32f445cb2 100644 --- a/base/modules/tools/psb_s_tools_a_mod.f90 +++ b/base/modules/tools/psb_s_tools_a_mod.f90 @@ -96,7 +96,7 @@ Module psb_s_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a real(psb_spk_),intent(inout) :: x(:,:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -108,7 +108,7 @@ Module psb_s_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a real(psb_spk_),intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl diff --git a/base/modules/tools/psb_s_tools_mod.f90 b/base/modules/tools/psb_s_tools_mod.f90 index ed49e2039..8fd29c04d 100644 --- a/base/modules/tools/psb_s_tools_mod.f90 +++ b/base/modules/tools/psb_s_tools_mod.f90 @@ -30,9 +30,10 @@ ! ! Module psb_s_tools_mod - use psb_desc_mod, only : psb_desc_type, psb_spk_, psb_ipk_ - use psb_s_vect_mod, only : psb_s_base_vect_type, psb_s_vect_type, psb_i_vect_type + use psb_desc_mod, only : psb_desc_type, psb_spk_, psb_ipk_, psb_lpk_ + use psb_s_vect_mod, only : psb_s_base_vect_type, psb_s_vect_type use psb_s_mat_mod, only : psb_sspmat_type, psb_s_base_sparse_mat + use psb_l_vect_mod, only : psb_l_vect_type use psb_s_multivect_mod, only : psb_s_base_multivect_type, psb_s_multivect_type interface psb_geall @@ -126,7 +127,7 @@ Module psb_s_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_s_vect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -138,7 +139,7 @@ Module psb_s_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_s_vect_type), intent(inout) :: x - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_s_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -150,7 +151,7 @@ Module psb_s_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_s_vect_type), intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -162,7 +163,7 @@ Module psb_s_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_s_multivect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -240,9 +241,10 @@ Module psb_s_tools_mod implicit none type(psb_desc_type), intent(inout) :: desc_a type(psb_sspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) real(psb_spk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild logical, intent(in), optional :: local end subroutine psb_sspins @@ -253,7 +255,7 @@ Module psb_s_tools_mod type(psb_desc_type), intent(inout) :: desc_a type(psb_sspmat_type), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz - type(psb_i_vect_type), intent(inout) :: ia,ja + type(psb_l_vect_type), intent(inout) :: ia,ja type(psb_s_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild @@ -265,9 +267,10 @@ Module psb_s_tools_mod type(psb_desc_type), intent(in) :: desc_ar type(psb_desc_type), intent(inout) :: desc_ac type(psb_sspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) real(psb_spk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info end subroutine psb_sspins_2desc end interface diff --git a/base/modules/tools/psb_z_tools_a_mod.f90 b/base/modules/tools/psb_z_tools_a_mod.f90 index 905de21f8..21f7ff0ff 100644 --- a/base/modules/tools/psb_z_tools_a_mod.f90 +++ b/base/modules/tools/psb_z_tools_a_mod.f90 @@ -96,7 +96,7 @@ Module psb_z_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a complex(psb_dpk_),intent(inout) :: x(:,:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -108,7 +108,7 @@ Module psb_z_tools_a_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a complex(psb_dpk_),intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl diff --git a/base/modules/tools/psb_z_tools_mod.f90 b/base/modules/tools/psb_z_tools_mod.f90 index cdf19d121..79e630f12 100644 --- a/base/modules/tools/psb_z_tools_mod.f90 +++ b/base/modules/tools/psb_z_tools_mod.f90 @@ -30,9 +30,10 @@ ! ! Module psb_z_tools_mod - use psb_desc_mod, only : psb_desc_type, psb_dpk_, psb_ipk_ - use psb_z_vect_mod, only : psb_z_base_vect_type, psb_z_vect_type, psb_i_vect_type + use psb_desc_mod, only : psb_desc_type, psb_dpk_, psb_ipk_, psb_lpk_ + use psb_z_vect_mod, only : psb_z_base_vect_type, psb_z_vect_type use psb_z_mat_mod, only : psb_zspmat_type, psb_z_base_sparse_mat + use psb_l_vect_mod, only : psb_l_vect_type use psb_z_multivect_mod, only : psb_z_base_multivect_type, psb_z_multivect_type interface psb_geall @@ -126,7 +127,7 @@ Module psb_z_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_z_vect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -138,7 +139,7 @@ Module psb_z_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_z_vect_type), intent(inout) :: x - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_z_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -150,7 +151,7 @@ Module psb_z_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_z_vect_type), intent(inout) :: x(:) - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -162,7 +163,7 @@ Module psb_z_tools_mod integer(psb_ipk_), intent(in) :: m type(psb_desc_type), intent(in) :: desc_a type(psb_z_multivect_type), intent(inout) :: x - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:,:) integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), optional, intent(in) :: dupl @@ -240,9 +241,10 @@ Module psb_z_tools_mod implicit none type(psb_desc_type), intent(inout) :: desc_a type(psb_zspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) complex(psb_dpk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild logical, intent(in), optional :: local end subroutine psb_zspins @@ -253,7 +255,7 @@ Module psb_z_tools_mod type(psb_desc_type), intent(inout) :: desc_a type(psb_zspmat_type), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz - type(psb_i_vect_type), intent(inout) :: ia,ja + type(psb_l_vect_type), intent(inout) :: ia,ja type(psb_z_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild @@ -265,9 +267,10 @@ Module psb_z_tools_mod type(psb_desc_type), intent(in) :: desc_ar type(psb_desc_type), intent(inout) :: desc_ac type(psb_zspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) complex(psb_dpk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info end subroutine psb_zspins_2desc end interface diff --git a/base/tools/psb_cd_switch_ovl_indxmap.f90 b/base/tools/psb_cd_switch_ovl_indxmap.f90 index e7a40b57a..ea8aabcfc 100644 --- a/base/tools/psb_cd_switch_ovl_indxmap.f90 +++ b/base/tools/psb_cd_switch_ovl_indxmap.f90 @@ -45,7 +45,7 @@ Subroutine psb_cd_switch_ovl_indxmap(desc,info) integer(psb_ipk_), intent(out) :: info ! .. Local Scalars .. - integer(psb_ipk_) :: i, j, np, me, mglob, ictxt, n_row, n_col + integer(psb_ipk_) :: i, j, np, me, ictxt, n_row, n_col integer(psb_lpk_) :: mglob integer(psb_ipk_) :: err_act diff --git a/base/tools/psb_cdall.f90 b/base/tools/psb_cdall.f90 index d79f1f210..9125ebe9a 100644 --- a/base/tools/psb_cdall.f90 +++ b/base/tools/psb_cdall.f90 @@ -54,7 +54,7 @@ subroutine psb_cdall(ictxt, desc, info,mg,ng,parts,vg,vl,flag,nl,repl, globalche character(len=20) :: name integer(psb_ipk_) :: err_act, flag_, i, me, np, nlp, nnv, lr integer(psb_lpk_) :: n_ - integer(psb_ipk_), allocatable :: itmpsz(:) + integer(psb_lpk_), allocatable :: itmpsz(:) integer(psb_mpk_) :: iictxt diff --git a/base/tools/psb_cdrep.f90 b/base/tools/psb_cdrep.f90 index 8485c5901..b3a52fdab 100644 --- a/base/tools/psb_cdrep.f90 +++ b/base/tools/psb_cdrep.f90 @@ -115,7 +115,8 @@ subroutine psb_cdrep(m, ictxt, desc, info) !locals integer(psb_ipk_) :: i,np,me,err,err_act integer(psb_lpk_) :: n - integer(psb_ipk_) :: int_err(5),exch(2), thalo(1), tovr(1), text(1) + integer(psb_ipk_) :: int_err(5),exch(2) + integer(psb_lpk_) :: thalo(1), tovr(1), text(1) integer(psb_ipk_) :: debug_level, debug_unit integer(psb_mpk_) :: iictxt character(len=20) :: name diff --git a/base/tools/psb_cins.f90 b/base/tools/psb_cins.f90 index a7d86c994..1308f61f1 100644 --- a/base/tools/psb_cins.f90 +++ b/base/tools/psb_cins.f90 @@ -56,7 +56,7 @@ subroutine psb_cins_vect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:) type(psb_c_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -66,7 +66,8 @@ subroutine psb_cins_vect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -170,7 +171,7 @@ subroutine psb_cins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_c_vect_type), intent(inout) :: val type(psb_c_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -180,7 +181,8 @@ subroutine psb_cins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) complex(psb_spk_), allocatable :: lval(:) @@ -246,15 +248,14 @@ subroutine psb_cins_vect_v(m, irw, val, x, desc_a, info, dupl,local) local_ = .false. endif + if (irw%is_dev()) call irw%sync() if (local_) then - call x%ins(m,irw,val,dupl_,info) + irl(1:m) = irw%v%v(1:m) else - 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) - + call desc_a%indxmap%g2l(irw%v%v(1:m),irl(1:m),info,owned=.true.) end if + + call x%ins(m,irl,lval,dupl_,info) if (info /= 0) then call psb_errpush(info,name) goto 9999 @@ -280,7 +281,7 @@ subroutine psb_cins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:,:) type(psb_c_vect_type), intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -290,7 +291,8 @@ subroutine psb_cins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5), n + & loc_rows,loc_cols,err_act, int_err(5), n + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -401,7 +403,7 @@ subroutine psb_cins_multivect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:,:) type(psb_c_multivect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -411,7 +413,8 @@ subroutine psb_cins_multivect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_cins_a.f90 b/base/tools/psb_cins_a.f90 index e22abc064..60d31419b 100644 --- a/base/tools/psb_cins_a.f90 +++ b/base/tools/psb_cins_a.f90 @@ -57,7 +57,7 @@ subroutine psb_cinsvi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:) complex(psb_spk_),intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -67,7 +67,8 @@ subroutine psb_cinsvi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -239,7 +240,7 @@ subroutine psb_cinsi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_spk_), intent(in) :: val(:,:) complex(psb_spk_),intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a @@ -249,7 +250,8 @@ subroutine psb_cinsi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,loc_row,j,n,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np,me,dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_cspins.f90 b/base/tools/psb_cspins.f90 index 5b343b8f9..bb432adcc 100644 --- a/base/tools/psb_cspins.f90 +++ b/base/tools/psb_cspins.f90 @@ -56,10 +56,11 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !....parameters... type(psb_desc_type), intent(inout) :: desc_a type(psb_cspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) complex(psb_spk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info - logical, intent(in), optional :: rebuild, local + integer(psb_ipk_), intent(out) :: info + logical, intent(in), optional :: rebuild, local !locals..... integer(psb_ipk_) :: nrow, err_act, ncol, spstate @@ -159,31 +160,25 @@ subroutine psb_cspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() + allocate(ila(nz),jla(nz),stat=info) + if (info /= psb_success_) then + ierr(1) = info + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='allocate',i_err=ierr) + goto 9999 + end if if (local_) then - call a%csput(nz,ia,ja,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + ila(1:nz) = ia(1:nz) + jla(1:nz) = ja(1:nz) else - allocate(ila(nz),jla(nz),stat=info) - if (info /= psb_success_) then - ierr(1) = info - call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='allocate',i_err=ierr) - goto 9999 - end if - call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info) if (info == 0) call desc_a%indxmap%g2l(ja(1:nz),jla(1:nz),info) - - call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + end if + call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='a%csput') + goto 9999 end if else info = psb_err_invalid_cd_state_ @@ -210,9 +205,10 @@ subroutine psb_cspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info) type(psb_desc_type), intent(in) :: desc_ar type(psb_desc_type), intent(inout) :: desc_ac type(psb_cspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) complex(psb_spk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info !locals..... integer(psb_ipk_) :: nrow, err_act, ncol, spstate @@ -327,7 +323,7 @@ subroutine psb_cspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) type(psb_desc_type), intent(inout) :: desc_a type(psb_cspmat_type), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz - type(psb_i_vect_type), intent(inout) :: ia,ja + type(psb_l_vect_type), intent(inout) :: ia,ja type(psb_c_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild, local @@ -433,33 +429,29 @@ subroutine psb_cspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() + allocate(ila(nz),jla(nz),stat=info) + if (info /= psb_success_) then + ierr(1) = info + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='allocate',i_err=ierr) + goto 9999 + end if + if (ia%is_dev()) call ia%sync() + if (ja%is_dev()) call ja%sync() + if (val%is_dev()) call val%sync() + if (local_) then - call a%csput(nz,ia,ja,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + ila(1:nz) = ia%v%v(1:nz) + jla(1:nz) = ja%v%v(1:nz) else - allocate(ila(nz),jla(nz),stat=info) - if (info /= psb_success_) then - ierr(1) = info - call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='allocate',i_err=ierr) - goto 9999 - end if - if (ia%is_dev()) call ia%sync() - if (ja%is_dev()) call ja%sync() - if (val%is_dev()) call val%sync() - call desc_a%indxmap%g2l(ia%v%v(1:nz),ila(1:nz),info) if (info == 0) call desc_a%indxmap%g2l(ja%v%v(1:nz),jla(1:nz),info) - if (info == 0) call a%csput(nz,ila,jla,val%v%v,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + end if + if (info == 0) call a%csput(nz,ila,jla,val%v%v,ione,nrow,ione,ncol,info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='a%csput') + goto 9999 end if else info = psb_err_invalid_cd_state_ diff --git a/base/tools/psb_dins.f90 b/base/tools/psb_dins.f90 index b2140438f..d23a2b7d8 100644 --- a/base/tools/psb_dins.f90 +++ b/base/tools/psb_dins.f90 @@ -56,7 +56,7 @@ subroutine psb_dins_vect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:) type(psb_d_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -66,7 +66,8 @@ subroutine psb_dins_vect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -170,7 +171,7 @@ subroutine psb_dins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_d_vect_type), intent(inout) :: val type(psb_d_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -180,7 +181,8 @@ subroutine psb_dins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) real(psb_dpk_), allocatable :: lval(:) @@ -246,15 +248,14 @@ subroutine psb_dins_vect_v(m, irw, val, x, desc_a, info, dupl,local) local_ = .false. endif + if (irw%is_dev()) call irw%sync() if (local_) then - call x%ins(m,irw,val,dupl_,info) + irl(1:m) = irw%v%v(1:m) else - 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) - + call desc_a%indxmap%g2l(irw%v%v(1:m),irl(1:m),info,owned=.true.) end if + + call x%ins(m,irl,lval,dupl_,info) if (info /= 0) then call psb_errpush(info,name) goto 9999 @@ -280,7 +281,7 @@ subroutine psb_dins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:,:) type(psb_d_vect_type), intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -290,7 +291,8 @@ subroutine psb_dins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5), n + & loc_rows,loc_cols,err_act, int_err(5), n + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -401,7 +403,7 @@ subroutine psb_dins_multivect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:,:) type(psb_d_multivect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -411,7 +413,8 @@ subroutine psb_dins_multivect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_dins_a.f90 b/base/tools/psb_dins_a.f90 index 3a6faeb89..159268b5f 100644 --- a/base/tools/psb_dins_a.f90 +++ b/base/tools/psb_dins_a.f90 @@ -57,7 +57,7 @@ subroutine psb_dinsvi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:) real(psb_dpk_),intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -67,7 +67,8 @@ subroutine psb_dinsvi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -239,7 +240,7 @@ subroutine psb_dinsi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_dpk_), intent(in) :: val(:,:) real(psb_dpk_),intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a @@ -249,7 +250,8 @@ subroutine psb_dinsi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,loc_row,j,n,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np,me,dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_dspins.f90 b/base/tools/psb_dspins.f90 index 2a9997eaa..87c08a495 100644 --- a/base/tools/psb_dspins.f90 +++ b/base/tools/psb_dspins.f90 @@ -56,10 +56,11 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !....parameters... type(psb_desc_type), intent(inout) :: desc_a type(psb_dspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) real(psb_dpk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info - logical, intent(in), optional :: rebuild, local + integer(psb_ipk_), intent(out) :: info + logical, intent(in), optional :: rebuild, local !locals..... integer(psb_ipk_) :: nrow, err_act, ncol, spstate @@ -159,31 +160,25 @@ subroutine psb_dspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() + allocate(ila(nz),jla(nz),stat=info) + if (info /= psb_success_) then + ierr(1) = info + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='allocate',i_err=ierr) + goto 9999 + end if if (local_) then - call a%csput(nz,ia,ja,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + ila(1:nz) = ia(1:nz) + jla(1:nz) = ja(1:nz) else - allocate(ila(nz),jla(nz),stat=info) - if (info /= psb_success_) then - ierr(1) = info - call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='allocate',i_err=ierr) - goto 9999 - end if - call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info) if (info == 0) call desc_a%indxmap%g2l(ja(1:nz),jla(1:nz),info) - - call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + end if + call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='a%csput') + goto 9999 end if else info = psb_err_invalid_cd_state_ @@ -210,9 +205,10 @@ subroutine psb_dspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info) type(psb_desc_type), intent(in) :: desc_ar type(psb_desc_type), intent(inout) :: desc_ac type(psb_dspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) real(psb_dpk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info !locals..... integer(psb_ipk_) :: nrow, err_act, ncol, spstate @@ -327,7 +323,7 @@ subroutine psb_dspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) type(psb_desc_type), intent(inout) :: desc_a type(psb_dspmat_type), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz - type(psb_i_vect_type), intent(inout) :: ia,ja + type(psb_l_vect_type), intent(inout) :: ia,ja type(psb_d_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild, local @@ -433,33 +429,29 @@ subroutine psb_dspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() + allocate(ila(nz),jla(nz),stat=info) + if (info /= psb_success_) then + ierr(1) = info + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='allocate',i_err=ierr) + goto 9999 + end if + if (ia%is_dev()) call ia%sync() + if (ja%is_dev()) call ja%sync() + if (val%is_dev()) call val%sync() + if (local_) then - call a%csput(nz,ia,ja,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + ila(1:nz) = ia%v%v(1:nz) + jla(1:nz) = ja%v%v(1:nz) else - allocate(ila(nz),jla(nz),stat=info) - if (info /= psb_success_) then - ierr(1) = info - call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='allocate',i_err=ierr) - goto 9999 - end if - if (ia%is_dev()) call ia%sync() - if (ja%is_dev()) call ja%sync() - if (val%is_dev()) call val%sync() - call desc_a%indxmap%g2l(ia%v%v(1:nz),ila(1:nz),info) if (info == 0) call desc_a%indxmap%g2l(ja%v%v(1:nz),jla(1:nz),info) - if (info == 0) call a%csput(nz,ila,jla,val%v%v,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + end if + if (info == 0) call a%csput(nz,ila,jla,val%v%v,ione,nrow,ione,ncol,info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='a%csput') + goto 9999 end if else info = psb_err_invalid_cd_state_ diff --git a/base/tools/psb_eins_a.f90 b/base/tools/psb_eins_a.f90 index 2e84c8325..590f5f771 100644 --- a/base/tools/psb_eins_a.f90 +++ b/base/tools/psb_eins_a.f90 @@ -57,7 +57,7 @@ subroutine psb_einsvi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_epk_), intent(in) :: val(:) integer(psb_epk_),intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -67,7 +67,8 @@ subroutine psb_einsvi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -239,7 +240,7 @@ subroutine psb_einsi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_epk_), intent(in) :: val(:,:) integer(psb_epk_),intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a @@ -249,7 +250,8 @@ subroutine psb_einsi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,loc_row,j,n,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np,me,dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_iins.f90 b/base/tools/psb_iins.f90 index e8c2dbb03..1fd8bcd24 100644 --- a/base/tools/psb_iins.f90 +++ b/base/tools/psb_iins.f90 @@ -56,7 +56,7 @@ subroutine psb_iins_vect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), 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 @@ -66,7 +66,8 @@ subroutine psb_iins_vect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -170,7 +171,7 @@ subroutine psb_iins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_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 @@ -180,7 +181,8 @@ subroutine psb_iins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) integer(psb_ipk_), allocatable :: lval(:) @@ -246,15 +248,14 @@ subroutine psb_iins_vect_v(m, irw, val, x, desc_a, info, dupl,local) local_ = .false. endif + if (irw%is_dev()) call irw%sync() if (local_) then - call x%ins(m,irw,val,dupl_,info) + irl(1:m) = irw%v%v(1:m) else - 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) - + call desc_a%indxmap%g2l(irw%v%v(1:m),irl(1:m),info,owned=.true.) end if + + call x%ins(m,irl,lval,dupl_,info) if (info /= 0) then call psb_errpush(info,name) goto 9999 @@ -280,7 +281,7 @@ subroutine psb_iins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), 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 @@ -290,7 +291,8 @@ subroutine psb_iins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5), n + & loc_rows,loc_cols,err_act, int_err(5), n + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -401,7 +403,7 @@ subroutine psb_iins_multivect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_ipk_), intent(in) :: val(:,:) type(psb_i_multivect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -411,7 +413,8 @@ subroutine psb_iins_multivect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_lins.f90 b/base/tools/psb_lins.f90 index 270271149..bfae871b0 100644 --- a/base/tools/psb_lins.f90 +++ b/base/tools/psb_lins.f90 @@ -56,7 +56,7 @@ subroutine psb_lins_vect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_lpk_), intent(in) :: val(:) type(psb_l_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -66,7 +66,8 @@ subroutine psb_lins_vect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -170,7 +171,7 @@ subroutine psb_lins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_l_vect_type), intent(inout) :: val type(psb_l_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -180,7 +181,8 @@ subroutine psb_lins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) integer(psb_lpk_), allocatable :: lval(:) @@ -246,15 +248,14 @@ subroutine psb_lins_vect_v(m, irw, val, x, desc_a, info, dupl,local) local_ = .false. endif + if (irw%is_dev()) call irw%sync() if (local_) then - call x%ins(m,irw,val,dupl_,info) + irl(1:m) = irw%v%v(1:m) else - 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) - + call desc_a%indxmap%g2l(irw%v%v(1:m),irl(1:m),info,owned=.true.) end if + + call x%ins(m,irl,lval,dupl_,info) if (info /= 0) then call psb_errpush(info,name) goto 9999 @@ -280,7 +281,7 @@ subroutine psb_lins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_lpk_), intent(in) :: val(:,:) type(psb_l_vect_type), intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -290,7 +291,8 @@ subroutine psb_lins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5), n + & loc_rows,loc_cols,err_act, int_err(5), n + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -401,7 +403,7 @@ subroutine psb_lins_multivect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_lpk_), intent(in) :: val(:,:) type(psb_l_multivect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -411,7 +413,8 @@ subroutine psb_lins_multivect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_mins_a.f90 b/base/tools/psb_mins_a.f90 index a1aa68e71..fce1f2b89 100644 --- a/base/tools/psb_mins_a.f90 +++ b/base/tools/psb_mins_a.f90 @@ -57,7 +57,7 @@ subroutine psb_minsvi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_mpk_), intent(in) :: val(:) integer(psb_mpk_),intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -67,7 +67,8 @@ subroutine psb_minsvi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -239,7 +240,7 @@ subroutine psb_minsi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) integer(psb_mpk_), intent(in) :: val(:,:) integer(psb_mpk_),intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a @@ -249,7 +250,8 @@ subroutine psb_minsi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,loc_row,j,n,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np,me,dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_sins.f90 b/base/tools/psb_sins.f90 index ab12c61fb..83ce8d423 100644 --- a/base/tools/psb_sins.f90 +++ b/base/tools/psb_sins.f90 @@ -56,7 +56,7 @@ subroutine psb_sins_vect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:) type(psb_s_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -66,7 +66,8 @@ subroutine psb_sins_vect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -170,7 +171,7 @@ subroutine psb_sins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_s_vect_type), intent(inout) :: val type(psb_s_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -180,7 +181,8 @@ subroutine psb_sins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) real(psb_spk_), allocatable :: lval(:) @@ -246,15 +248,14 @@ subroutine psb_sins_vect_v(m, irw, val, x, desc_a, info, dupl,local) local_ = .false. endif + if (irw%is_dev()) call irw%sync() if (local_) then - call x%ins(m,irw,val,dupl_,info) + irl(1:m) = irw%v%v(1:m) else - 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) - + call desc_a%indxmap%g2l(irw%v%v(1:m),irl(1:m),info,owned=.true.) end if + + call x%ins(m,irl,lval,dupl_,info) if (info /= 0) then call psb_errpush(info,name) goto 9999 @@ -280,7 +281,7 @@ subroutine psb_sins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:,:) type(psb_s_vect_type), intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -290,7 +291,8 @@ subroutine psb_sins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5), n + & loc_rows,loc_cols,err_act, int_err(5), n + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -401,7 +403,7 @@ subroutine psb_sins_multivect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:,:) type(psb_s_multivect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -411,7 +413,8 @@ subroutine psb_sins_multivect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_sins_a.f90 b/base/tools/psb_sins_a.f90 index e9726d6b7..b1f60d717 100644 --- a/base/tools/psb_sins_a.f90 +++ b/base/tools/psb_sins_a.f90 @@ -57,7 +57,7 @@ subroutine psb_sinsvi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:) real(psb_spk_),intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -67,7 +67,8 @@ subroutine psb_sinsvi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -239,7 +240,7 @@ subroutine psb_sinsi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) real(psb_spk_), intent(in) :: val(:,:) real(psb_spk_),intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a @@ -249,7 +250,8 @@ subroutine psb_sinsi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,loc_row,j,n,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np,me,dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_sspins.f90 b/base/tools/psb_sspins.f90 index 35058f523..5d99dce93 100644 --- a/base/tools/psb_sspins.f90 +++ b/base/tools/psb_sspins.f90 @@ -56,10 +56,11 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !....parameters... type(psb_desc_type), intent(inout) :: desc_a type(psb_sspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) real(psb_spk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info - logical, intent(in), optional :: rebuild, local + integer(psb_ipk_), intent(out) :: info + logical, intent(in), optional :: rebuild, local !locals..... integer(psb_ipk_) :: nrow, err_act, ncol, spstate @@ -159,31 +160,25 @@ subroutine psb_sspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() + allocate(ila(nz),jla(nz),stat=info) + if (info /= psb_success_) then + ierr(1) = info + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='allocate',i_err=ierr) + goto 9999 + end if if (local_) then - call a%csput(nz,ia,ja,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + ila(1:nz) = ia(1:nz) + jla(1:nz) = ja(1:nz) else - allocate(ila(nz),jla(nz),stat=info) - if (info /= psb_success_) then - ierr(1) = info - call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='allocate',i_err=ierr) - goto 9999 - end if - call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info) if (info == 0) call desc_a%indxmap%g2l(ja(1:nz),jla(1:nz),info) - - call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + end if + call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='a%csput') + goto 9999 end if else info = psb_err_invalid_cd_state_ @@ -210,9 +205,10 @@ subroutine psb_sspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info) type(psb_desc_type), intent(in) :: desc_ar type(psb_desc_type), intent(inout) :: desc_ac type(psb_sspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) real(psb_spk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info !locals..... integer(psb_ipk_) :: nrow, err_act, ncol, spstate @@ -327,7 +323,7 @@ subroutine psb_sspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) type(psb_desc_type), intent(inout) :: desc_a type(psb_sspmat_type), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz - type(psb_i_vect_type), intent(inout) :: ia,ja + type(psb_l_vect_type), intent(inout) :: ia,ja type(psb_s_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild, local @@ -433,33 +429,29 @@ subroutine psb_sspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() + allocate(ila(nz),jla(nz),stat=info) + if (info /= psb_success_) then + ierr(1) = info + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='allocate',i_err=ierr) + goto 9999 + end if + if (ia%is_dev()) call ia%sync() + if (ja%is_dev()) call ja%sync() + if (val%is_dev()) call val%sync() + if (local_) then - call a%csput(nz,ia,ja,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + ila(1:nz) = ia%v%v(1:nz) + jla(1:nz) = ja%v%v(1:nz) else - allocate(ila(nz),jla(nz),stat=info) - if (info /= psb_success_) then - ierr(1) = info - call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='allocate',i_err=ierr) - goto 9999 - end if - if (ia%is_dev()) call ia%sync() - if (ja%is_dev()) call ja%sync() - if (val%is_dev()) call val%sync() - call desc_a%indxmap%g2l(ia%v%v(1:nz),ila(1:nz),info) if (info == 0) call desc_a%indxmap%g2l(ja%v%v(1:nz),jla(1:nz),info) - if (info == 0) call a%csput(nz,ila,jla,val%v%v,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + end if + if (info == 0) call a%csput(nz,ila,jla,val%v%v,ione,nrow,ione,ncol,info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='a%csput') + goto 9999 end if else info = psb_err_invalid_cd_state_ diff --git a/base/tools/psb_zins.f90 b/base/tools/psb_zins.f90 index 8044319b4..7bb538786 100644 --- a/base/tools/psb_zins.f90 +++ b/base/tools/psb_zins.f90 @@ -56,7 +56,7 @@ subroutine psb_zins_vect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:) type(psb_z_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -66,7 +66,8 @@ subroutine psb_zins_vect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -170,7 +171,7 @@ subroutine psb_zins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - type(psb_i_vect_type), intent(inout) :: irw + type(psb_l_vect_type), intent(inout) :: irw type(psb_z_vect_type), intent(inout) :: val type(psb_z_vect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -180,7 +181,8 @@ subroutine psb_zins_vect_v(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) complex(psb_dpk_), allocatable :: lval(:) @@ -246,15 +248,14 @@ subroutine psb_zins_vect_v(m, irw, val, x, desc_a, info, dupl,local) local_ = .false. endif + if (irw%is_dev()) call irw%sync() if (local_) then - call x%ins(m,irw,val,dupl_,info) + irl(1:m) = irw%v%v(1:m) else - 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) - + call desc_a%indxmap%g2l(irw%v%v(1:m),irl(1:m),info,owned=.true.) end if + + call x%ins(m,irl,lval,dupl_,info) if (info /= 0) then call psb_errpush(info,name) goto 9999 @@ -280,7 +281,7 @@ subroutine psb_zins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:,:) type(psb_z_vect_type), intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -290,7 +291,8 @@ subroutine psb_zins_vect_r2(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5), n + & loc_rows,loc_cols,err_act, int_err(5), n + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -401,7 +403,7 @@ subroutine psb_zins_multivect(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:,:) type(psb_z_multivect_type), intent(inout) :: x type(psb_desc_type), intent(in) :: desc_a @@ -411,7 +413,8 @@ subroutine psb_zins_multivect(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_zins_a.f90 b/base/tools/psb_zins_a.f90 index 8cd93f8c8..2568177ac 100644 --- a/base/tools/psb_zins_a.f90 +++ b/base/tools/psb_zins_a.f90 @@ -57,7 +57,7 @@ subroutine psb_zinsvi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:) complex(psb_dpk_),intent(inout) :: x(:) type(psb_desc_type), intent(in) :: desc_a @@ -67,7 +67,8 @@ subroutine psb_zinsvi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np, me, dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ @@ -239,7 +240,7 @@ subroutine psb_zinsi(m, irw, val, x, desc_a, info, dupl,local) !....parameters... integer(psb_ipk_), intent(in) :: m - integer(psb_ipk_), intent(in) :: irw(:) + integer(psb_lpk_), intent(in) :: irw(:) complex(psb_dpk_), intent(in) :: val(:,:) complex(psb_dpk_),intent(inout) :: x(:,:) type(psb_desc_type), intent(in) :: desc_a @@ -249,7 +250,8 @@ subroutine psb_zinsi(m, irw, val, x, desc_a, info, dupl,local) !locals..... integer(psb_ipk_) :: ictxt,i,loc_row,j,n,& - & loc_rows,loc_cols,mglob,err_act, int_err(5) + & loc_rows,loc_cols,err_act, int_err(5) + integer(psb_lpk_) :: mglob integer(psb_ipk_) :: np,me,dupl_ integer(psb_ipk_), allocatable :: irl(:) logical :: local_ diff --git a/base/tools/psb_zspins.f90 b/base/tools/psb_zspins.f90 index 047597ff0..615c5fa3a 100644 --- a/base/tools/psb_zspins.f90 +++ b/base/tools/psb_zspins.f90 @@ -56,10 +56,11 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) !....parameters... type(psb_desc_type), intent(inout) :: desc_a type(psb_zspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) complex(psb_dpk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info - logical, intent(in), optional :: rebuild, local + integer(psb_ipk_), intent(out) :: info + logical, intent(in), optional :: rebuild, local !locals..... integer(psb_ipk_) :: nrow, err_act, ncol, spstate @@ -159,31 +160,25 @@ subroutine psb_zspins(nz,ia,ja,val,a,desc_a,info,rebuild,local) nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() + allocate(ila(nz),jla(nz),stat=info) + if (info /= psb_success_) then + ierr(1) = info + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='allocate',i_err=ierr) + goto 9999 + end if if (local_) then - call a%csput(nz,ia,ja,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + ila(1:nz) = ia(1:nz) + jla(1:nz) = ja(1:nz) else - allocate(ila(nz),jla(nz),stat=info) - if (info /= psb_success_) then - ierr(1) = info - call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='allocate',i_err=ierr) - goto 9999 - end if - call desc_a%indxmap%g2l(ia(1:nz),ila(1:nz),info) if (info == 0) call desc_a%indxmap%g2l(ja(1:nz),jla(1:nz),info) - - call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + end if + call a%csput(nz,ila,jla,val,ione,nrow,ione,ncol,info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='a%csput') + goto 9999 end if else info = psb_err_invalid_cd_state_ @@ -210,9 +205,10 @@ subroutine psb_zspins_2desc(nz,ia,ja,val,a,desc_ar,desc_ac,info) type(psb_desc_type), intent(in) :: desc_ar type(psb_desc_type), intent(inout) :: desc_ac type(psb_zspmat_type), intent(inout) :: a - integer(psb_ipk_), intent(in) :: nz,ia(:),ja(:) + integer(psb_ipk_), intent(in) :: nz + integer(psb_lpk_), intent(in) :: ia(:),ja(:) complex(psb_dpk_), intent(in) :: val(:) - integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_), intent(out) :: info !locals..... integer(psb_ipk_) :: nrow, err_act, ncol, spstate @@ -327,7 +323,7 @@ subroutine psb_zspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) type(psb_desc_type), intent(inout) :: desc_a type(psb_zspmat_type), intent(inout) :: a integer(psb_ipk_), intent(in) :: nz - type(psb_i_vect_type), intent(inout) :: ia,ja + type(psb_l_vect_type), intent(inout) :: ia,ja type(psb_z_vect_type), intent(inout) :: val integer(psb_ipk_), intent(out) :: info logical, intent(in), optional :: rebuild, local @@ -433,33 +429,29 @@ subroutine psb_zspins_v(nz,ia,ja,val,a,desc_a,info,rebuild,local) nrow = desc_a%get_local_rows() ncol = desc_a%get_local_cols() + allocate(ila(nz),jla(nz),stat=info) + if (info /= psb_success_) then + ierr(1) = info + call psb_errpush(psb_err_from_subroutine_ai_,name,& + & a_err='allocate',i_err=ierr) + goto 9999 + end if + if (ia%is_dev()) call ia%sync() + if (ja%is_dev()) call ja%sync() + if (val%is_dev()) call val%sync() + if (local_) then - call a%csput(nz,ia,ja,val,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + ila(1:nz) = ia%v%v(1:nz) + jla(1:nz) = ja%v%v(1:nz) else - allocate(ila(nz),jla(nz),stat=info) - if (info /= psb_success_) then - ierr(1) = info - call psb_errpush(psb_err_from_subroutine_ai_,name,& - & a_err='allocate',i_err=ierr) - goto 9999 - end if - if (ia%is_dev()) call ia%sync() - if (ja%is_dev()) call ja%sync() - if (val%is_dev()) call val%sync() - call desc_a%indxmap%g2l(ia%v%v(1:nz),ila(1:nz),info) if (info == 0) call desc_a%indxmap%g2l(ja%v%v(1:nz),jla(1:nz),info) - if (info == 0) call a%csput(nz,ila,jla,val%v%v,ione,nrow,ione,ncol,info) - if (info /= psb_success_) then - info=psb_err_from_subroutine_ - call psb_errpush(info,name,a_err='a%csput') - goto 9999 - end if + end if + if (info == 0) call a%csput(nz,ila,jla,val%v%v,ione,nrow,ione,ncol,info) + if (info /= psb_success_) then + info=psb_err_from_subroutine_ + call psb_errpush(info,name,a_err='a%csput') + goto 9999 end if else info = psb_err_invalid_cd_state_