From 3a30c9495d14cadafa72d7082e80153ca353d06b Mon Sep 17 00:00:00 2001 From: sfilippone Date: Mon, 15 Jun 2026 14:36:46 +0200 Subject: [PATCH] First merge steps --- base/modules/serial/psb_c_base_vect_mod.F90 | 38 +- base/modules/serial/psb_c_vect_mod.F90 | 10 +- base/modules/serial/psb_d_base_vect_mod.F90 | 40 +- base/modules/serial/psb_d_vect_mod.F90 | 10 +- base/modules/serial/psb_s_base_vect_mod.F90 | 40 +- base/modules/serial/psb_s_vect_mod.F90 | 10 +- base/modules/serial/psb_z_base_vect_mod.F90 | 38 +- base/modules/serial/psb_z_vect_mod.F90 | 10 +- base/psblas/psb_cdiv_vect.f90 | 2 +- base/psblas/psb_ddiv_vect.f90 | 2 +- base/psblas/psb_sdiv_vect.f90 | 2 +- base/psblas/psb_zdiv_vect.f90 | 2 +- util/Makefile | 5 +- util/psb_mmio_mod.F90 | 499 +------------------- 14 files changed, 152 insertions(+), 556 deletions(-) diff --git a/base/modules/serial/psb_c_base_vect_mod.F90 b/base/modules/serial/psb_c_base_vect_mod.F90 index e1058c1f7..05026fe2f 100644 --- a/base/modules/serial/psb_c_base_vect_mod.F90 +++ b/base/modules/serial/psb_c_base_vect_mod.F90 @@ -205,13 +205,14 @@ module psb_c_base_vect_mod ! ! Vector-Vector operations ! - procedure, pass(x) :: div_v => c_base_div_v - procedure, pass(x) :: div_v_check => c_base_div_v_check + procedure, pass(y) :: div_v => c_base_div_v + procedure, pass(y) :: div_a => c_base_div_a + procedure, pass(y) :: div_v_check => c_base_div_v_check procedure, pass(z) :: div_v2 => c_base_div_v2 procedure, pass(z) :: div_v2_check => c_base_div_v2_check procedure, pass(z) :: div_a2 => c_base_div_a2 procedure, pass(z) :: div_a2_check => c_base_div_a2_check - generic, public :: div => div_v, div_v2, div_v_check, & + generic, public :: div => div_v, div_v2, div_v_check, div_a, & div_v2_check, div_a2, div_a2_check procedure, pass(y) :: inv_v => c_base_inv_v procedure, pass(y) :: inv_v_check => c_base_inv_v_check @@ -1280,7 +1281,7 @@ contains integer(psb_ipk_), intent(in) :: index complex(psb_spk_) :: res - res = 0 + res = czero if (allocated(x%v)) then if (x%is_dev()) call x%sync() res = x%v(index) @@ -1300,7 +1301,6 @@ contains x%v(index) =val call x%set_host() end if - end subroutine c_base_set_entry ! @@ -1817,9 +1817,28 @@ contains info = 0 if (x%is_dev()) call x%sync() - call x%div(x%v,y%v,info) + call y%div(x%v,info) end subroutine c_base_div_v + + subroutine c_base_div_a(x, y, info) + use psi_serial_mod + implicit none + complex(psb_spk_), intent(in) :: x(:) + class(psb_c_base_vect_type), intent(inout) :: y + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_) :: i, n + + info = 0 + if (y%is_dev()) call y%sync() + n = min(size(y%v), size(x)) + !$omp parallel do private(i) + do i=1, n + y%v(i) = y%v(i)/x(i) + end do + call y%set_host() + + end subroutine c_base_div_a ! !> Function base_div_v2 !! \memberof psb_c_base_vect_type @@ -1837,10 +1856,10 @@ contains integer(psb_ipk_) :: i, n info = 0 - if (z%is_dev()) call z%sync() + if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() call z%div(x%v,y%v,info) - - + call x%set_host() end subroutine c_base_div_v2 ! !> Function base_div_v_check @@ -1860,6 +1879,7 @@ contains info = 0 if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() call x%div(x%v,y%v,info,flag) end subroutine c_base_div_v_check diff --git a/base/modules/serial/psb_c_vect_mod.F90 b/base/modules/serial/psb_c_vect_mod.F90 index 5e628ff97..aaf013d1b 100644 --- a/base/modules/serial/psb_c_vect_mod.F90 +++ b/base/modules/serial/psb_c_vect_mod.F90 @@ -128,10 +128,10 @@ module psb_c_vect_mod procedure, pass(z) :: mlt_av => c_vect_mlt_av generic, public :: mlt => mlt_v, mlt_a, mlt_a_2,& & mlt_v_2, mlt_av, mlt_va - procedure, pass(x) :: div_v => c_vect_div_v + procedure, pass(y) :: div_v => c_vect_div_v procedure, pass(z) :: div_v2 => c_vect_div_v2 - procedure, pass(x) :: div_v_check => c_vect_div_v_check - procedure, pass(x) :: div_v2_check => c_vect_div_v2_check + procedure, pass(y) :: div_v_check => c_vect_div_v_check + procedure, pass(y) :: div_v2_check => c_vect_div_v2_check procedure, pass(z) :: div_a2 => c_vect_div_a2 procedure, pass(z) :: div_a2_check => c_vect_div_a2_check generic, public :: div => div_v, div_v2, div_v_check, & @@ -1100,7 +1100,7 @@ contains info = 0 if (allocated(x%v).and.allocated(y%v)) & - & call x%v%div(y%v,info) + & call y%v%div(x%v,info) end subroutine c_vect_div_v @@ -1130,7 +1130,7 @@ contains info = 0 if (allocated(x%v).and.allocated(y%v)) & - & call x%v%div(y%v,info,flag) + & call y%v%div(x%v,info,flag) end subroutine c_vect_div_v_check diff --git a/base/modules/serial/psb_d_base_vect_mod.F90 b/base/modules/serial/psb_d_base_vect_mod.F90 index cfdbcee54..2175a1935 100644 --- a/base/modules/serial/psb_d_base_vect_mod.F90 +++ b/base/modules/serial/psb_d_base_vect_mod.F90 @@ -205,13 +205,14 @@ module psb_d_base_vect_mod ! ! Vector-Vector operations ! - procedure, pass(x) :: div_v => d_base_div_v - procedure, pass(x) :: div_v_check => d_base_div_v_check + procedure, pass(y) :: div_v => d_base_div_v + procedure, pass(y) :: div_a => d_base_div_a + procedure, pass(y) :: div_v_check => d_base_div_v_check procedure, pass(z) :: div_v2 => d_base_div_v2 procedure, pass(z) :: div_v2_check => d_base_div_v2_check procedure, pass(z) :: div_a2 => d_base_div_a2 procedure, pass(z) :: div_a2_check => d_base_div_a2_check - generic, public :: div => div_v, div_v2, div_v_check, & + generic, public :: div => div_v, div_v2, div_v_check, div_a, & div_v2_check, div_a2, div_a2_check procedure, pass(y) :: inv_v => d_base_inv_v procedure, pass(y) :: inv_v_check => d_base_inv_v_check @@ -1287,7 +1288,7 @@ contains integer(psb_ipk_), intent(in) :: index real(psb_dpk_) :: res - res = 0 + res = dzero if (allocated(x%v)) then if (x%is_dev()) call x%sync() res = x%v(index) @@ -1307,7 +1308,6 @@ contains x%v(index) =val call x%set_host() end if - end subroutine d_base_set_entry ! @@ -1824,9 +1824,28 @@ contains info = 0 if (x%is_dev()) call x%sync() - call x%div(x%v,y%v,info) + call y%div(x%v,info) end subroutine d_base_div_v + + subroutine d_base_div_a(x, y, info) + use psi_serial_mod + implicit none + real(psb_dpk_), intent(in) :: x(:) + class(psb_d_base_vect_type), intent(inout) :: y + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_) :: i, n + + info = 0 + if (y%is_dev()) call y%sync() + n = min(size(y%v), size(x)) + !$omp parallel do private(i) + do i=1, n + y%v(i) = y%v(i)/x(i) + end do + call y%set_host() + + end subroutine d_base_div_a ! !> Function base_div_v2 !! \memberof psb_d_base_vect_type @@ -1844,10 +1863,10 @@ contains integer(psb_ipk_) :: i, n info = 0 - if (z%is_dev()) call z%sync() + if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() call z%div(x%v,y%v,info) - - + call x%set_host() end subroutine d_base_div_v2 ! !> Function base_div_v_check @@ -1867,6 +1886,7 @@ contains info = 0 if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() call x%div(x%v,y%v,info,flag) end subroutine d_base_div_v_check @@ -2201,8 +2221,8 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(PSB_OPENMP) res = HUGE(done) +#if defined(PSB_OPENMP) !$omp parallel do private(i) reduction(min: res) do i=1, n res = min(res,abs(x%v(i))) diff --git a/base/modules/serial/psb_d_vect_mod.F90 b/base/modules/serial/psb_d_vect_mod.F90 index cfa3fe6fb..d402a16de 100644 --- a/base/modules/serial/psb_d_vect_mod.F90 +++ b/base/modules/serial/psb_d_vect_mod.F90 @@ -128,10 +128,10 @@ module psb_d_vect_mod procedure, pass(z) :: mlt_av => d_vect_mlt_av generic, public :: mlt => mlt_v, mlt_a, mlt_a_2,& & mlt_v_2, mlt_av, mlt_va - procedure, pass(x) :: div_v => d_vect_div_v + procedure, pass(y) :: div_v => d_vect_div_v procedure, pass(z) :: div_v2 => d_vect_div_v2 - procedure, pass(x) :: div_v_check => d_vect_div_v_check - procedure, pass(x) :: div_v2_check => d_vect_div_v2_check + procedure, pass(y) :: div_v_check => d_vect_div_v_check + procedure, pass(y) :: div_v2_check => d_vect_div_v2_check procedure, pass(z) :: div_a2 => d_vect_div_a2 procedure, pass(z) :: div_a2_check => d_vect_div_a2_check generic, public :: div => div_v, div_v2, div_v_check, & @@ -1107,7 +1107,7 @@ contains info = 0 if (allocated(x%v).and.allocated(y%v)) & - & call x%v%div(y%v,info) + & call y%v%div(x%v,info) end subroutine d_vect_div_v @@ -1137,7 +1137,7 @@ contains info = 0 if (allocated(x%v).and.allocated(y%v)) & - & call x%v%div(y%v,info,flag) + & call y%v%div(x%v,info,flag) end subroutine d_vect_div_v_check diff --git a/base/modules/serial/psb_s_base_vect_mod.F90 b/base/modules/serial/psb_s_base_vect_mod.F90 index 814b11a57..7cb64d96d 100644 --- a/base/modules/serial/psb_s_base_vect_mod.F90 +++ b/base/modules/serial/psb_s_base_vect_mod.F90 @@ -205,13 +205,14 @@ module psb_s_base_vect_mod ! ! Vector-Vector operations ! - procedure, pass(x) :: div_v => s_base_div_v - procedure, pass(x) :: div_v_check => s_base_div_v_check + procedure, pass(y) :: div_v => s_base_div_v + procedure, pass(y) :: div_a => s_base_div_a + procedure, pass(y) :: div_v_check => s_base_div_v_check procedure, pass(z) :: div_v2 => s_base_div_v2 procedure, pass(z) :: div_v2_check => s_base_div_v2_check procedure, pass(z) :: div_a2 => s_base_div_a2 procedure, pass(z) :: div_a2_check => s_base_div_a2_check - generic, public :: div => div_v, div_v2, div_v_check, & + generic, public :: div => div_v, div_v2, div_v_check, div_a, & div_v2_check, div_a2, div_a2_check procedure, pass(y) :: inv_v => s_base_inv_v procedure, pass(y) :: inv_v_check => s_base_inv_v_check @@ -1287,7 +1288,7 @@ contains integer(psb_ipk_), intent(in) :: index real(psb_spk_) :: res - res = 0 + res = szero if (allocated(x%v)) then if (x%is_dev()) call x%sync() res = x%v(index) @@ -1307,7 +1308,6 @@ contains x%v(index) =val call x%set_host() end if - end subroutine s_base_set_entry ! @@ -1824,9 +1824,28 @@ contains info = 0 if (x%is_dev()) call x%sync() - call x%div(x%v,y%v,info) + call y%div(x%v,info) end subroutine s_base_div_v + + subroutine s_base_div_a(x, y, info) + use psi_serial_mod + implicit none + real(psb_spk_), intent(in) :: x(:) + class(psb_s_base_vect_type), intent(inout) :: y + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_) :: i, n + + info = 0 + if (y%is_dev()) call y%sync() + n = min(size(y%v), size(x)) + !$omp parallel do private(i) + do i=1, n + y%v(i) = y%v(i)/x(i) + end do + call y%set_host() + + end subroutine s_base_div_a ! !> Function base_div_v2 !! \memberof psb_s_base_vect_type @@ -1844,10 +1863,10 @@ contains integer(psb_ipk_) :: i, n info = 0 - if (z%is_dev()) call z%sync() + if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() call z%div(x%v,y%v,info) - - + call x%set_host() end subroutine s_base_div_v2 ! !> Function base_div_v_check @@ -1867,6 +1886,7 @@ contains info = 0 if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() call x%div(x%v,y%v,info,flag) end subroutine s_base_div_v_check @@ -2201,8 +2221,8 @@ contains integer(psb_ipk_) :: i if (x%is_dev()) call x%sync() -#if defined(PSB_OPENMP) res = HUGE(sone) +#if defined(PSB_OPENMP) !$omp parallel do private(i) reduction(min: res) do i=1, n res = min(res,abs(x%v(i))) diff --git a/base/modules/serial/psb_s_vect_mod.F90 b/base/modules/serial/psb_s_vect_mod.F90 index 3128866a5..47c44e2c4 100644 --- a/base/modules/serial/psb_s_vect_mod.F90 +++ b/base/modules/serial/psb_s_vect_mod.F90 @@ -128,10 +128,10 @@ module psb_s_vect_mod procedure, pass(z) :: mlt_av => s_vect_mlt_av generic, public :: mlt => mlt_v, mlt_a, mlt_a_2,& & mlt_v_2, mlt_av, mlt_va - procedure, pass(x) :: div_v => s_vect_div_v + procedure, pass(y) :: div_v => s_vect_div_v procedure, pass(z) :: div_v2 => s_vect_div_v2 - procedure, pass(x) :: div_v_check => s_vect_div_v_check - procedure, pass(x) :: div_v2_check => s_vect_div_v2_check + procedure, pass(y) :: div_v_check => s_vect_div_v_check + procedure, pass(y) :: div_v2_check => s_vect_div_v2_check procedure, pass(z) :: div_a2 => s_vect_div_a2 procedure, pass(z) :: div_a2_check => s_vect_div_a2_check generic, public :: div => div_v, div_v2, div_v_check, & @@ -1107,7 +1107,7 @@ contains info = 0 if (allocated(x%v).and.allocated(y%v)) & - & call x%v%div(y%v,info) + & call y%v%div(x%v,info) end subroutine s_vect_div_v @@ -1137,7 +1137,7 @@ contains info = 0 if (allocated(x%v).and.allocated(y%v)) & - & call x%v%div(y%v,info,flag) + & call y%v%div(x%v,info,flag) end subroutine s_vect_div_v_check diff --git a/base/modules/serial/psb_z_base_vect_mod.F90 b/base/modules/serial/psb_z_base_vect_mod.F90 index b236beb7d..1ac87a7d2 100644 --- a/base/modules/serial/psb_z_base_vect_mod.F90 +++ b/base/modules/serial/psb_z_base_vect_mod.F90 @@ -205,13 +205,14 @@ module psb_z_base_vect_mod ! ! Vector-Vector operations ! - procedure, pass(x) :: div_v => z_base_div_v - procedure, pass(x) :: div_v_check => z_base_div_v_check + procedure, pass(y) :: div_v => z_base_div_v + procedure, pass(y) :: div_a => z_base_div_a + procedure, pass(y) :: div_v_check => z_base_div_v_check procedure, pass(z) :: div_v2 => z_base_div_v2 procedure, pass(z) :: div_v2_check => z_base_div_v2_check procedure, pass(z) :: div_a2 => z_base_div_a2 procedure, pass(z) :: div_a2_check => z_base_div_a2_check - generic, public :: div => div_v, div_v2, div_v_check, & + generic, public :: div => div_v, div_v2, div_v_check, div_a, & div_v2_check, div_a2, div_a2_check procedure, pass(y) :: inv_v => z_base_inv_v procedure, pass(y) :: inv_v_check => z_base_inv_v_check @@ -1280,7 +1281,7 @@ contains integer(psb_ipk_), intent(in) :: index complex(psb_dpk_) :: res - res = 0 + res = zzero if (allocated(x%v)) then if (x%is_dev()) call x%sync() res = x%v(index) @@ -1300,7 +1301,6 @@ contains x%v(index) =val call x%set_host() end if - end subroutine z_base_set_entry ! @@ -1817,9 +1817,28 @@ contains info = 0 if (x%is_dev()) call x%sync() - call x%div(x%v,y%v,info) + call y%div(x%v,info) end subroutine z_base_div_v + + subroutine z_base_div_a(x, y, info) + use psi_serial_mod + implicit none + complex(psb_dpk_), intent(in) :: x(:) + class(psb_z_base_vect_type), intent(inout) :: y + integer(psb_ipk_), intent(out) :: info + integer(psb_ipk_) :: i, n + + info = 0 + if (y%is_dev()) call y%sync() + n = min(size(y%v), size(x)) + !$omp parallel do private(i) + do i=1, n + y%v(i) = y%v(i)/x(i) + end do + call y%set_host() + + end subroutine z_base_div_a ! !> Function base_div_v2 !! \memberof psb_z_base_vect_type @@ -1837,10 +1856,10 @@ contains integer(psb_ipk_) :: i, n info = 0 - if (z%is_dev()) call z%sync() + if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() call z%div(x%v,y%v,info) - - + call x%set_host() end subroutine z_base_div_v2 ! !> Function base_div_v_check @@ -1860,6 +1879,7 @@ contains info = 0 if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() call x%div(x%v,y%v,info,flag) end subroutine z_base_div_v_check diff --git a/base/modules/serial/psb_z_vect_mod.F90 b/base/modules/serial/psb_z_vect_mod.F90 index f7cf3584a..62ff259c9 100644 --- a/base/modules/serial/psb_z_vect_mod.F90 +++ b/base/modules/serial/psb_z_vect_mod.F90 @@ -128,10 +128,10 @@ module psb_z_vect_mod procedure, pass(z) :: mlt_av => z_vect_mlt_av generic, public :: mlt => mlt_v, mlt_a, mlt_a_2,& & mlt_v_2, mlt_av, mlt_va - procedure, pass(x) :: div_v => z_vect_div_v + procedure, pass(y) :: div_v => z_vect_div_v procedure, pass(z) :: div_v2 => z_vect_div_v2 - procedure, pass(x) :: div_v_check => z_vect_div_v_check - procedure, pass(x) :: div_v2_check => z_vect_div_v2_check + procedure, pass(y) :: div_v_check => z_vect_div_v_check + procedure, pass(y) :: div_v2_check => z_vect_div_v2_check procedure, pass(z) :: div_a2 => z_vect_div_a2 procedure, pass(z) :: div_a2_check => z_vect_div_a2_check generic, public :: div => div_v, div_v2, div_v_check, & @@ -1100,7 +1100,7 @@ contains info = 0 if (allocated(x%v).and.allocated(y%v)) & - & call x%v%div(y%v,info) + & call y%v%div(x%v,info) end subroutine z_vect_div_v @@ -1130,7 +1130,7 @@ contains info = 0 if (allocated(x%v).and.allocated(y%v)) & - & call x%v%div(y%v,info,flag) + & call y%v%div(x%v,info,flag) end subroutine z_vect_div_v_check diff --git a/base/psblas/psb_cdiv_vect.f90 b/base/psblas/psb_cdiv_vect.f90 index 9a2525a13..e384f5b4c 100644 --- a/base/psblas/psb_cdiv_vect.f90 +++ b/base/psblas/psb_cdiv_vect.f90 @@ -93,7 +93,7 @@ subroutine psb_cdiv_vect(x,y,desc_a,info) end if if(desc_a%get_local_rows() > 0) then - call x%div(y,info) + call y%div(x,info) end if call psb_erractionrestore(err_act) diff --git a/base/psblas/psb_ddiv_vect.f90 b/base/psblas/psb_ddiv_vect.f90 index 37fe59e1b..05d689c21 100644 --- a/base/psblas/psb_ddiv_vect.f90 +++ b/base/psblas/psb_ddiv_vect.f90 @@ -93,7 +93,7 @@ subroutine psb_ddiv_vect(x,y,desc_a,info) end if if(desc_a%get_local_rows() > 0) then - call x%div(y,info) + call y%div(x,info) end if call psb_erractionrestore(err_act) diff --git a/base/psblas/psb_sdiv_vect.f90 b/base/psblas/psb_sdiv_vect.f90 index 223ce77ff..c6ec1dc42 100644 --- a/base/psblas/psb_sdiv_vect.f90 +++ b/base/psblas/psb_sdiv_vect.f90 @@ -93,7 +93,7 @@ subroutine psb_sdiv_vect(x,y,desc_a,info) end if if(desc_a%get_local_rows() > 0) then - call x%div(y,info) + call y%div(x,info) end if call psb_erractionrestore(err_act) diff --git a/base/psblas/psb_zdiv_vect.f90 b/base/psblas/psb_zdiv_vect.f90 index ad4d069d8..1d61fea1e 100644 --- a/base/psblas/psb_zdiv_vect.f90 +++ b/base/psblas/psb_zdiv_vect.f90 @@ -93,7 +93,7 @@ subroutine psb_zdiv_vect(x,y,desc_a,info) end if if(desc_a%get_local_rows() > 0) then - call x%div(y,info) + call y%div(x,info) end if call psb_erractionrestore(err_act) diff --git a/util/Makefile b/util/Makefile index f19650899..fa4d27b56 100644 --- a/util/Makefile +++ b/util/Makefile @@ -8,7 +8,9 @@ MODDIR=../modules HERE=. BASEOBJS= psb_blockpart_mod.o psb_metispart_mod.o psb_partidx_mod.o \ - psb_hbio_mod.o psb_mmio_mod.o psb_mat_dist_mod.o \ + psb_hbio_mod.o psb_mmio_mod.o \ + psb_i_mmio_mod.o psb_s_mmio_mod.o psb_d_mmio_mod.o psb_c_mmio_mod.o psb_z_mmio_mod.o \ + psb_mat_dist_mod.o \ psb_s_mat_dist_mod.o psb_d_mat_dist_mod.o psb_c_mat_dist_mod.o psb_z_mat_dist_mod.o \ psb_renum_mod.o psb_gps_mod.o \ psb_s_renum_mod.o psb_d_renum_mod.o psb_c_renum_mod.o psb_z_renum_mod.o @@ -46,6 +48,7 @@ psb_util_mod.o: $(BASEOBJS) psb_metispart_mod.o: psb_metis_int.o psb_mat_dist_mod.o: psb_s_mat_dist_mod.o psb_d_mat_dist_mod.o psb_c_mat_dist_mod.o psb_z_mat_dist_mod.o psb_renum_mod.o: psb_s_renum_mod.o psb_d_renum_mod.o psb_c_renum_mod.o psb_z_renum_mod.o +psb_mmio_mod.o: psb_i_mmio_mod.o psb_s_mmio_mod.o psb_d_mmio_mod.o psb_c_mmio_mod.o psb_z_mmio_mod.o $(IMPLOBJS): $(BASEOBJS) diff --git a/util/psb_mmio_mod.F90 b/util/psb_mmio_mod.F90 index bc0630c28..156c9de2d 100644 --- a/util/psb_mmio_mod.F90 +++ b/util/psb_mmio_mod.F90 @@ -30,497 +30,10 @@ ! ! module psb_mmio_mod - - - use psb_base_mod, only : psb_ipk_, psb_lpk_, psb_spk_, psb_dpk_,& - & psb_s_vect_type, psb_d_vect_type, psb_i_vect_type, psb_l_vect_type,& - & psb_c_vect_type, psb_z_vect_type, & - & psb_sspmat_type, psb_cspmat_type, & - & psb_dspmat_type, psb_zspmat_type, & - & psb_lsspmat_type, psb_lcspmat_type, & - & psb_ldspmat_type, psb_lzspmat_type - - public mm_mat_read, mm_mat_write, mm_array_read, mm_array_write - -#if ! defined(PSB_HAVE_BUGGY_GENERICS) - public mm_vet_read, mm_vet_write -#endif - - interface mm_array_read - subroutine mm_svet_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_ - implicit none - real(psb_spk_), allocatable, intent(out) :: b(:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_svet_read - subroutine mm_dvet_read(b, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - real(psb_dpk_), allocatable, intent(out) :: b(:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_dvet_read - subroutine mm_cvet_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_ - implicit none - complex(psb_spk_), allocatable, intent(out) :: b(:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_cvet_read - subroutine mm_zvet_read(b, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - complex(psb_dpk_), allocatable, intent(out) :: b(:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_zvet_read - subroutine mm_svet2_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_ - implicit none - real(psb_spk_), allocatable, intent(out) :: b(:,:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_svet2_read - subroutine mm_dvet2_read(b, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - real(psb_dpk_), allocatable, intent(out) :: b(:,:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_dvet2_read - subroutine mm_cvet2_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_ - implicit none - complex(psb_spk_), allocatable, intent(out) :: b(:,:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_cvet2_read - subroutine mm_zvet2_read(b, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - complex(psb_dpk_), allocatable, intent(out) :: b(:,:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_zvet2_read - subroutine mm_ivet_read(b, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - integer(psb_ipk_), allocatable, intent(out) :: b(:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_ivet_read - subroutine mm_ivet2_read(b, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - integer(psb_ipk_), allocatable, intent(out) :: b(:,:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_ivet2_read -#if defined(PSB_IPK4) && defined(PSB_LPK8) - subroutine mm_lvet_read(b, info, iunit, filename) - import :: psb_dpk_, psb_ipk_, psb_lpk_ - implicit none - integer(psb_lpk_), allocatable, intent(out) :: b(:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_lvet_read - subroutine mm_lvet2_read(b, info, iunit, filename) - import :: psb_dpk_, psb_ipk_, psb_lpk_ - implicit none - integer(psb_lpk_), allocatable, intent(out) :: b(:,:) - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_lvet2_read -#endif - subroutine mm_svect_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_s_vect_type - implicit none - type(psb_s_vect_type), intent(inout) :: b - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_svect_read - subroutine mm_dvect_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_d_vect_type - implicit none - type(psb_d_vect_type), intent(inout) :: b - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_dvect_read - subroutine mm_cvect_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_c_vect_type - implicit none - type(psb_c_vect_type), intent(inout) :: b - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_cvect_read - subroutine mm_zvect_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_z_vect_type - implicit none - type(psb_z_vect_type), intent(inout) :: b - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_zvect_read - subroutine mm_ivect_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_i_vect_type - implicit none - type(psb_i_vect_type), intent(inout) :: b - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_ivect_read - subroutine mm_lvect_read(b, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_l_vect_type - implicit none - type(psb_l_vect_type), intent(inout) :: b - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_lvect_read - end interface - - -#if ! defined(PSB_HAVE_BUGGY_GENERICS) - interface mm_vet_read - procedure mm_svet_read, mm_dvet_read, mm_cvet_read,& - & mm_zvet_read, mm_svet2_read, mm_dvet2_read, & - & mm_cvet2_read, mm_zvet2_read - end interface -#endif - - - interface mm_array_write - subroutine mm_svet2_write(b, header, info, iunit, filename) - import :: psb_spk_, psb_ipk_ - implicit none - real(psb_spk_), intent(in) :: b(:,:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_svet2_write - subroutine mm_svet1_write(b, header, info, iunit, filename) - import :: psb_spk_, psb_ipk_ - implicit none - real(psb_spk_), intent(in) :: b(:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_svet1_write - subroutine mm_dvet2_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - real(psb_dpk_), intent(in) :: b(:,:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_dvet2_write - subroutine mm_dvet1_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - real(psb_dpk_), intent(in) :: b(:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_dvet1_write - subroutine mm_cvet2_write(b, header, info, iunit, filename) - import :: psb_spk_, psb_ipk_ - implicit none - complex(psb_spk_), intent(in) :: b(:,:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_cvet2_write - subroutine mm_cvet1_write(b, header, info, iunit, filename) - import :: psb_spk_, psb_ipk_ - implicit none - complex(psb_spk_), intent(in) :: b(:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_cvet1_write - subroutine mm_zvet2_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - complex(psb_dpk_), intent(in) :: b(:,:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_zvet2_write - subroutine mm_zvet1_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - complex(psb_dpk_), intent(in) :: b(:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_zvet1_write - subroutine mm_ivet2_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - integer(psb_ipk_), intent(in) :: b(:,:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_ivet2_write - subroutine mm_ivet1_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_ - implicit none - integer(psb_ipk_), intent(in) :: b(:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_ivet1_write -#if defined(PSB_IPK4) && defined(PSB_LPK8) - subroutine mm_lvet2_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_, psb_lpk_ - implicit none - integer(psb_lpk_), intent(in) :: b(:,:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_lvet2_write - subroutine mm_lvet1_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_, psb_lpk_ - implicit none - integer(psb_lpk_), intent(in) :: b(:) - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_lvet1_write -#endif - subroutine mm_svect_write(b, header, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_s_vect_type - implicit none - type(psb_s_vect_type), intent(inout) :: b - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_svect_write - subroutine mm_dvect_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_,psb_d_vect_type - implicit none - type(psb_d_vect_type), intent(inout) :: b - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_dvect_write - subroutine mm_cvect_write(b, header, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_c_vect_type - implicit none - type(psb_c_vect_type), intent(inout) :: b - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_cvect_write - subroutine mm_zvect_write(b, header, info, iunit, filename) - import :: psb_dpk_, psb_ipk_,psb_z_vect_type - implicit none - type(psb_z_vect_type), intent(inout) :: b - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_zvect_write - subroutine mm_ivect_write(b, header, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_i_vect_type - implicit none - type(psb_i_vect_type), intent(inout) :: b - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_ivect_write - subroutine mm_lvect_write(b, header, info, iunit, filename) - import :: psb_spk_, psb_ipk_,psb_l_vect_type - implicit none - type(psb_l_vect_type), intent(inout) :: b - character(len=*), intent(in) :: header - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine mm_lvect_write - end interface - -#if ! defined(PSB_HAVE_BUGGY_GENERICS) - interface mm_vet_write - procedure mm_svet1_write, mm_dvet1_write, mm_cvet1_write,& - & mm_zvet1_write, mm_svet2_write, mm_dvet2_write, & - & mm_cvet2_write, mm_zvet2_write, & - & mm_ivet1_write, mm_ivet2_write - end interface -#endif - - interface mm_mat_read - subroutine smm_mat_read(a, info, iunit, filename) - import :: psb_sspmat_type, psb_ipk_ - implicit none - type(psb_sspmat_type), intent(out) :: a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine smm_mat_read - subroutine dmm_mat_read(a, info, iunit, filename) - import :: psb_dspmat_type, psb_ipk_ - implicit none - type(psb_dspmat_type), intent(out) :: a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine dmm_mat_read - subroutine cmm_mat_read(a, info, iunit, filename) - import :: psb_cspmat_type, psb_ipk_ - implicit none - type(psb_cspmat_type), intent(out) :: a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine cmm_mat_read - subroutine zmm_mat_read(a, info, iunit, filename) - import :: psb_zspmat_type, psb_ipk_ - implicit none - type(psb_zspmat_type), intent(out) :: a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine zmm_mat_read - subroutine lsmm_mat_read(a, info, iunit, filename) - import :: psb_lsspmat_type, psb_ipk_ - implicit none - type(psb_lsspmat_type), intent(out) :: a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine lsmm_mat_read - subroutine ldmm_mat_read(a, info, iunit, filename) - import :: psb_ldspmat_type, psb_ipk_ - implicit none - type(psb_ldspmat_type), intent(out) :: a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine ldmm_mat_read - subroutine lcmm_mat_read(a, info, iunit, filename) - import :: psb_lcspmat_type, psb_ipk_ - implicit none - type(psb_lcspmat_type), intent(out) :: a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine lcmm_mat_read - subroutine lzmm_mat_read(a, info, iunit, filename) - import :: psb_lzspmat_type, psb_ipk_ - implicit none - type(psb_lzspmat_type), intent(out) :: a - integer(psb_ipk_), intent(out) :: info - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine lzmm_mat_read - end interface - - interface mm_mat_write - subroutine smm_mat_write(a,mtitle,info,iunit,filename) - import :: psb_sspmat_type, psb_ipk_ - implicit none - type(psb_sspmat_type), intent(in) :: a - integer(psb_ipk_), intent(out) :: info - character(len=*), intent(in) :: mtitle - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine smm_mat_write - subroutine dmm_mat_write(a,mtitle,info,iunit,filename) - import :: psb_dspmat_type, psb_ipk_ - implicit none - type(psb_dspmat_type), intent(in) :: a - integer(psb_ipk_), intent(out) :: info - character(len=*), intent(in) :: mtitle - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine dmm_mat_write - subroutine cmm_mat_write(a,mtitle,info,iunit,filename) - import :: psb_cspmat_type, psb_ipk_ - implicit none - type(psb_cspmat_type), intent(in) :: a - integer(psb_ipk_), intent(out) :: info - character(len=*), intent(in) :: mtitle - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine cmm_mat_write - subroutine zmm_mat_write(a,mtitle,info,iunit,filename) - import :: psb_zspmat_type, psb_ipk_ - implicit none - type(psb_zspmat_type), intent(in) :: a - integer(psb_ipk_), intent(out) :: info - character(len=*), intent(in) :: mtitle - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine zmm_mat_write - subroutine lsmm_mat_write(a,mtitle,info,iunit,filename) - import :: psb_lsspmat_type, psb_ipk_ - implicit none - type(psb_lsspmat_type), intent(in) :: a - integer(psb_ipk_), intent(out) :: info - character(len=*), intent(in) :: mtitle - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine lsmm_mat_write - subroutine ldmm_mat_write(a,mtitle,info,iunit,filename) - import :: psb_ldspmat_type, psb_ipk_ - implicit none - type(psb_ldspmat_type), intent(in) :: a - integer(psb_ipk_), intent(out) :: info - character(len=*), intent(in) :: mtitle - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine ldmm_mat_write - subroutine lcmm_mat_write(a,mtitle,info,iunit,filename) - import :: psb_lcspmat_type, psb_ipk_ - implicit none - type(psb_lcspmat_type), intent(in) :: a - integer(psb_ipk_), intent(out) :: info - character(len=*), intent(in) :: mtitle - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine lcmm_mat_write - subroutine lzmm_mat_write(a,mtitle,info,iunit,filename) - import :: psb_lzspmat_type, psb_ipk_ - implicit none - type(psb_lzspmat_type), intent(in) :: a - integer(psb_ipk_), intent(out) :: info - character(len=*), intent(in) :: mtitle - integer(psb_ipk_), optional, intent(in) :: iunit - character(len=*), optional, intent(in) :: filename - end subroutine lzmm_mat_write - end interface - + use psb_base_mod + use psb_i_mmio_mod + use psb_s_mmio_mod + use psb_d_mmio_mod + use psb_c_mmio_mod + use psb_z_mmio_mod end module psb_mmio_mod