mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-07 07:04:57 +00:00
Enable VECT objects in MMIO read/write.
This commit is contained in:
@@ -71,9 +71,9 @@ subroutine psi_i_crea_index(desc_a,index_in,index_out,nxch,nsnd,nrcv,info)
|
||||
integer(psb_ipk_),parameter :: root=psb_root_,no_comm=-1
|
||||
integer(psb_ipk_) :: debug_level, debug_unit
|
||||
character(len=20) :: name
|
||||
logical, parameter :: do_timings=.false.
|
||||
logical, parameter :: do_timings=.false., shuffle_dep_list=.false.
|
||||
integer(psb_ipk_), save :: idx_phase1=-1, idx_phase2=-1, idx_phase3=-1
|
||||
integer(psb_ipk_), save :: idx_phase11=-1, idx_phase12=-1, idx_phase13=-1
|
||||
integer(psb_ipk_), save :: idx_phase21=-1, idx_phase22=-1, idx_phase13=-1
|
||||
|
||||
info = psb_success_
|
||||
name='psi_crea_index'
|
||||
@@ -95,10 +95,10 @@ subroutine psi_i_crea_index(desc_a,index_in,index_out,nxch,nsnd,nrcv,info)
|
||||
& idx_phase2 = psb_get_timer_idx("PSI_CREA_INDEX: phase2")
|
||||
if ((do_timings).and.(idx_phase3==-1)) &
|
||||
& idx_phase3 = psb_get_timer_idx("PSI_CREA_INDEX: phase3")
|
||||
!!$ if ((do_timings).and.(idx_phase11==-1)) &
|
||||
!!$ & idx_phase11 = psb_get_timer_idx("PSI_CREA_INDEX: phase11 ")
|
||||
!!$ if ((do_timings).and.(idx_phase12==-1)) &
|
||||
!!$ & idx_phase12 = psb_get_timer_idx("PSI_CREA_INDEX: phase12")
|
||||
if ((do_timings).and.(idx_phase21==-1)) &
|
||||
& idx_phase21 = psb_get_timer_idx("PSI_CREA_INDEX: phase21 ")
|
||||
if ((do_timings).and.(idx_phase22==-1)) &
|
||||
& idx_phase22 = psb_get_timer_idx("PSI_CREA_INDEX: phase22")
|
||||
!!$ if ((do_timings).and.(idx_phase13==-1)) &
|
||||
!!$ & idx_phase13 = psb_get_timer_idx("PSI_CREA_INDEX: phase13")
|
||||
|
||||
@@ -123,6 +123,7 @@ subroutine psi_i_crea_index(desc_a,index_in,index_out,nxch,nsnd,nrcv,info)
|
||||
if (do_timings) call psb_tic(idx_phase2)
|
||||
|
||||
if (choose_sorting(dlmax,dlavg,np)) then
|
||||
if (do_timings) call psb_tic(idx_phase21)
|
||||
call psi_bld_glb_dep_list(ictxt,&
|
||||
& loc_dl,length_dl,c_dep_list,dl_ptr,info)
|
||||
if (info /= 0) then
|
||||
@@ -131,13 +132,15 @@ subroutine psi_i_crea_index(desc_a,index_in,index_out,nxch,nsnd,nrcv,info)
|
||||
!!$ call psi_dl_check(dep_list,dl_lda,np,length_dl)
|
||||
!!$
|
||||
!!$ ! ....now i can sort dependency lists.
|
||||
if (do_timings) call psb_toc(idx_phase21)
|
||||
if (do_timings) call psb_tic(idx_phase22)
|
||||
call psi_sort_dl(dl_ptr,c_dep_list,length_dl,ictxt,info)
|
||||
if (info /= 0) then
|
||||
write(0,*) me,trim(name),' From sort_dl ',info
|
||||
end if
|
||||
ldl = length_dl(me)
|
||||
loc_dl = c_dep_list(dl_ptr(me):dl_ptr(me)+ldl-1)
|
||||
|
||||
if (do_timings) call psb_toc(idx_phase22)
|
||||
!!$ if(info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_from_subroutine_,name,a_err='psi_sort_dl')
|
||||
!!$ goto 9999
|
||||
@@ -146,7 +149,26 @@ subroutine psi_i_crea_index(desc_a,index_in,index_out,nxch,nsnd,nrcv,info)
|
||||
else
|
||||
! Do nothing
|
||||
ldl = length_dl(me)
|
||||
loc_dl = loc_dl(1:ldl)
|
||||
loc_dl = loc_dl(1:ldl)
|
||||
if (shuffle_dep_list) then
|
||||
!
|
||||
! Apply a random shuffle to the dependency list
|
||||
! should improve the behaviour
|
||||
!
|
||||
block
|
||||
! Algorithm 3.4.2P from TAOCP vol 2.
|
||||
integer(psb_ipk_) :: tmp
|
||||
integer :: j,k
|
||||
real :: u
|
||||
do j=ldl,2,-1
|
||||
call random_number(u)
|
||||
k = min(j,floor(j*u)+1)
|
||||
tmp = loc_dl(k)
|
||||
loc_dl(k) = loc_dl(j)
|
||||
loc_dl(j) = tmp
|
||||
end do
|
||||
end block
|
||||
end if
|
||||
end if
|
||||
if (do_timings) call psb_toc(idx_phase2)
|
||||
|
||||
@@ -189,9 +211,9 @@ contains
|
||||
logical :: val
|
||||
|
||||
val = .not.(((dlmax>(26*4)).or.((dlavg>=(26*2)).and.(np>=128))))
|
||||
val = (dlavg<16)
|
||||
val = (dlmax<16)
|
||||
!val = .true.
|
||||
!val = .false.
|
||||
val = .false.
|
||||
end function choose_sorting
|
||||
|
||||
end subroutine psi_i_crea_index
|
||||
|
||||
@@ -66,9 +66,16 @@ class="description">Rigth hand side(s).<br
|
||||
class="newline" />Type: <span
|
||||
class="cmbx-10">required </span><br
|
||||
class="newline" />An array of type real or complex, rank 1 or 2 and having the
|
||||
ALLOCATABLE attribute; will be allocated and filled in if the input file
|
||||
contains a right hand side, otherwise will be left in the UNALLOCATED
|
||||
state.
|
||||
ALLOCATABLE attribute, or an object of type <a
|
||||
href="userhtmlsu7.html#vdata"><span
|
||||
class="cmtt-10">psb</span><span
|
||||
class="cmtt-10">_T</span><span
|
||||
class="cmtt-10">_vect</span><span
|
||||
class="cmtt-10">_type</span></a>, of
|
||||
type real or complex.<br
|
||||
class="newline" />Will be allocated and filled in if the input file contains a right hand side,
|
||||
otherwise will be left in the UNALLOCATED state. <br
|
||||
class="newline" />
|
||||
</dd><dt class="description">
|
||||
<span
|
||||
class="cmbx-10">iret</span> </dt><dd
|
||||
@@ -82,12 +89,12 @@ class="newline" />An integer value; 0 means no error has been detected.</dd></dl
|
||||
|
||||
|
||||
|
||||
<!--l. 173--><div class="crosslinks"><p class="noindent">[<a
|
||||
<!--l. 175--><div class="crosslinks"><p class="noindent">[<a
|
||||
href="userhtmlsu84.html" >next</a>] [<a
|
||||
href="userhtmlsu80.html" >prev</a>] [<a
|
||||
href="userhtmlsu80.html#tailuserhtmlsu80.html" >prev-tail</a>] [<a
|
||||
href="userhtmlsu81.html" >front</a>] [<a
|
||||
href="userhtmlsu80.html#userhtmlse10.html" >up</a>] </p></div>
|
||||
<!--l. 173--><p class="indent" > <a
|
||||
<!--l. 175--><p class="indent" > <a
|
||||
id="tailuserhtmlsu81.html"></a>
|
||||
</body></html>
|
||||
|
||||
@@ -11,7 +11,7 @@ format</title>
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 174--><div class="crosslinks"><p class="noindent">[<a
|
||||
<!--l. 176--><div class="crosslinks"><p class="noindent">[<a
|
||||
href="userhtmlsu85.html" >next</a>] [<a
|
||||
href="userhtmlsu81.html" >prev</a>] [<a
|
||||
href="userhtmlsu81.html#tailuserhtmlsu81.html" >prev-tail</a>] [<a
|
||||
@@ -20,13 +20,13 @@ href="userhtmlsu80.html#userhtmlsu84.html" >up</a>] </p></div>
|
||||
<h4 class="subsectionHead"><span class="titlemark">9.5 </span> <a
|
||||
id="x96-1330009.5"></a>mm_mat_write — Write a sparse matrix to a file in the MatrixMarket
|
||||
format</h4>
|
||||
<!--l. 177-->
|
||||
<!--l. 179-->
|
||||
<div class="lstlisting" id="listing-18"><span class="label"><a
|
||||
id="x96-133001r1"></a></span><span
|
||||
class="cmbx-10">call</span> mm_mat_write(a, mtitle, iret, iunit, filename)
|
||||
|
||||
</div>
|
||||
<!--l. 180--><p class="indent" >
|
||||
<!--l. 182--><p class="indent" >
|
||||
<dl class="description"><dt class="description">
|
||||
<span
|
||||
class="cmbx-10">Type:</span> </dt><dd
|
||||
@@ -73,7 +73,7 @@ class="newline" />Type:<span
|
||||
class="cmbx-10">optional</span>.<br
|
||||
class="newline" />Specified as: an integer value. Only meaningful if filename is not <span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">-</span></span></span>.</dd></dl>
|
||||
<!--l. 200--><p class="indent" >
|
||||
<!--l. 202--><p class="indent" >
|
||||
<dl class="description"><dt class="description">
|
||||
<span
|
||||
class="cmbx-10">On Return</span> </dt><dd
|
||||
@@ -94,12 +94,12 @@ class="newline" />An integer value; 0 means no error has been detected.</dd></dl
|
||||
|
||||
|
||||
|
||||
<!--l. 208--><div class="crosslinks"><p class="noindent">[<a
|
||||
<!--l. 210--><div class="crosslinks"><p class="noindent">[<a
|
||||
href="userhtmlsu85.html" >next</a>] [<a
|
||||
href="userhtmlsu81.html" >prev</a>] [<a
|
||||
href="userhtmlsu81.html#tailuserhtmlsu81.html" >prev-tail</a>] [<a
|
||||
href="userhtmlsu82.html" >front</a>] [<a
|
||||
href="userhtmlsu80.html#userhtmlsu84.html" >up</a>] </p></div>
|
||||
<!--l. 208--><p class="indent" > <a
|
||||
<!--l. 210--><p class="indent" > <a
|
||||
id="tailuserhtmlsu82.html"></a>
|
||||
</body></html>
|
||||
|
||||
@@ -11,7 +11,7 @@ format</title>
|
||||
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
||||
</head><body
|
||||
>
|
||||
<!--l. 209--><div class="crosslinks"><p class="noindent">[<a
|
||||
<!--l. 211--><div class="crosslinks"><p class="noindent">[<a
|
||||
href="userhtmlsu82.html" >prev</a>] [<a
|
||||
href="userhtmlsu82.html#tailuserhtmlsu82.html" >prev-tail</a>] [<a
|
||||
href="userhtmlsu80.html#tailuserhtmlsu83.html">tail</a>] [<a
|
||||
@@ -19,13 +19,13 @@ href="userhtmlsu80.html#userhtmlsu85.html" >up</a>] </p></div>
|
||||
<h4 class="subsectionHead"><span class="titlemark">9.6 </span> <a
|
||||
id="x97-1340009.6"></a>mm_array_write — Write a dense array from a file in the MatrixMarket
|
||||
format</h4>
|
||||
<!--l. 211-->
|
||||
<!--l. 213-->
|
||||
<div class="lstlisting" id="listing-19"><span class="label"><a
|
||||
id="x97-134001r1"></a></span><span
|
||||
class="cmbx-10">call</span> mm_array_write(b, iret, iunit, filename)
|
||||
class="cmbx-10">call</span> mm_array_write(b, vtitle, iret, iunit, filename)
|
||||
|
||||
</div>
|
||||
<!--l. 215--><p class="indent" >
|
||||
<!--l. 217--><p class="indent" >
|
||||
<dl class="description"><dt class="description">
|
||||
<span
|
||||
class="cmbx-10">Type:</span> </dt><dd
|
||||
@@ -40,12 +40,28 @@ class="cmbx-10">b</span> </dt><dd
|
||||
class="description">Rigth hand side(s).<br
|
||||
class="newline" />Type: <span
|
||||
class="cmbx-10">required </span><br
|
||||
class="newline" />An array of type real or complex, rank 1 or 2; will be written.. 
|
||||
class="newline" />An array of type real or complex, rank 1 or 2, or an object of type
|
||||
<a
|
||||
href="userhtmlsu7.html#vdata"><span
|
||||
class="cmtt-10">psb</span><span
|
||||
class="cmtt-10">_T</span><span
|
||||
class="cmtt-10">_vect</span><span
|
||||
class="cmtt-10">_type</span></a>, of type real or complex; its contents will be written to
|
||||
disk.<br
|
||||
class="newline" />
|
||||
</dd><dt class="description">
|
||||
<span
|
||||
class="cmbx-10">filename</span> </dt><dd
|
||||
class="description">The name of the file to be written.<br
|
||||
class="newline" />Type:<span
|
||||
class="newline" />
|
||||
</dd><dt class="description">
|
||||
<span
|
||||
class="cmbx-10">vtitle</span> </dt><dd
|
||||
class="description">Matrix title.<br
|
||||
class="newline" />Type: <span
|
||||
class="cmbx-10">required </span><br
|
||||
class="newline" />A charachter variable holding a descriptive title for the vector to be written
|
||||
to file. Type:<span
|
||||
class="cmbx-10">optional</span>.<br
|
||||
class="newline" />Specified as: a character variable containing a valid file name, or <span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">-</span></span></span>, in
|
||||
@@ -60,11 +76,14 @@ class="newline" />Type:<span
|
||||
class="cmbx-10">optional</span>.<br
|
||||
class="newline" />Specified as: an integer value. Only meaningful if filename is not <span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">-</span></span></span>.</dd></dl>
|
||||
<!--l. 231--><p class="indent" >
|
||||
<!--l. 239--><p class="indent" >
|
||||
<dl class="description"><dt class="description">
|
||||
<span
|
||||
class="cmbx-10">On Return</span> </dt><dd
|
||||
class="description">
|
||||
|
||||
|
||||
|
||||
</dd><dt class="description">
|
||||
<span
|
||||
class="cmbx-10">iret</span> </dt><dd
|
||||
|
||||
@@ -349,10 +349,6 @@ class="newline" />An integer value; 0 means no error has been detected.</dd></dl
|
||||
|
||||
|
||||
|
||||
<!--l. 110--><p class="indent" >
|
||||
|
||||
|
||||
|
||||
<!--l. 2--><div class="crosslinks"><p class="noindent">[<a
|
||||
href="userhtmlsu90.html" >front</a>] [<a
|
||||
href="# " >up</a>] </p></div>
|
||||
|
||||
+1249
-1178
File diff suppressed because it is too large
Load Diff
+12
-4
@@ -161,8 +161,10 @@ Specified as: an integer value. Only meaningful if filename is not \verb|-|.
|
||||
\item[b] Rigth hand side(s).\\
|
||||
Type: {\bf required} \\
|
||||
An array of type real or complex, rank 1 or 2 and having the ALLOCATABLE
|
||||
attribute; will be allocated and filled in if the input file contains
|
||||
a right hand side, otherwise will be left in the UNALLOCATED state.
|
||||
attribute, or an
|
||||
object of type \vdata, of type real or complex.\\
|
||||
Will be allocated and filled in if the input file contains
|
||||
a right hand side, otherwise will be left in the UNALLOCATED state. \\
|
||||
\item[iret] Error code.\\
|
||||
Type: {\bf required} \\
|
||||
An integer value; 0 means no error has been detected.
|
||||
@@ -209,7 +211,7 @@ An integer value; 0 means no error has been detected.
|
||||
file in the MatrixMarket format}
|
||||
|
||||
\begin{lstlisting}
|
||||
call mm_array_write(b, iret, iunit, filename)
|
||||
call mm_array_write(b, vtitle, iret, iunit, filename)
|
||||
\end{lstlisting}
|
||||
|
||||
\begin{description}
|
||||
@@ -217,8 +219,14 @@ call mm_array_write(b, iret, iunit, filename)
|
||||
\item[\bf On Entry ]
|
||||
\item[b] Rigth hand side(s).\\
|
||||
Type: {\bf required} \\
|
||||
An array of type real or complex, rank 1 or 2; will be written..\
|
||||
An array of type real or complex, rank 1 or 2, or an
|
||||
object of type \vdata, of type real or complex; its contents will be
|
||||
written to disk.\\
|
||||
\item[filename] The name of the file to be written.\\
|
||||
\item[vtitle] Matrix title.\\
|
||||
Type: {\bf required} \\
|
||||
A charachter variable holding a descriptive title for the vector to be
|
||||
written to file.
|
||||
Type:{\bf optional}.\\
|
||||
Specified as: a character variable containing a valid file name, or
|
||||
\verb|-|, in which case the default input unit 5 (i.e. standard input
|
||||
|
||||
@@ -286,6 +286,39 @@ subroutine mm_cvet1_write(b, header, info, iunit, filename)
|
||||
|
||||
end subroutine mm_cvet1_write
|
||||
|
||||
subroutine mm_cvect_read(b, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_cvect_read
|
||||
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
|
||||
!
|
||||
complex(psb_spk_), allocatable :: bv(:)
|
||||
|
||||
call mm_array_read(bv, info, iunit, filename)
|
||||
call b%bld(bv)
|
||||
|
||||
end subroutine mm_cvect_read
|
||||
|
||||
subroutine mm_cvect_write(b, header, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_cvect_write
|
||||
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
|
||||
info = psb_success_
|
||||
if (.not.allocated(b%v)) return
|
||||
call b%sync()
|
||||
|
||||
call mm_array_write(b%v%v,header,info,iunit,filename)
|
||||
|
||||
end subroutine mm_cvect_write
|
||||
|
||||
subroutine cmm_mat_read(a, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
|
||||
@@ -279,6 +279,39 @@ subroutine mm_dvet1_write(b, header, info, iunit, filename)
|
||||
|
||||
end subroutine mm_dvet1_write
|
||||
|
||||
subroutine mm_dvect_read(b, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_dvect_read
|
||||
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
|
||||
!
|
||||
real(psb_dpk_), allocatable :: bv(:)
|
||||
|
||||
call mm_array_read(bv, info, iunit, filename)
|
||||
if (info == 0) call b%bld(bv)
|
||||
|
||||
end subroutine mm_dvect_read
|
||||
|
||||
subroutine mm_dvect_write(b, header, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_dvect_write
|
||||
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
|
||||
info = psb_success_
|
||||
if (.not.allocated(b%v)) return
|
||||
call b%sync()
|
||||
|
||||
call mm_array_write(b%v%v,header,info,iunit,filename)
|
||||
|
||||
end subroutine mm_dvect_write
|
||||
|
||||
subroutine dmm_mat_read(a, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
|
||||
@@ -536,3 +536,69 @@ subroutine mm_lvet1_write(b, header, info, iunit, filename)
|
||||
end subroutine mm_lvet1_write
|
||||
|
||||
#endif
|
||||
|
||||
subroutine mm_ivect_read(b, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_ivect_read
|
||||
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
|
||||
!
|
||||
integer(psb_ipk_), allocatable :: bv(:)
|
||||
|
||||
call mm_array_read(bv, info, iunit, filename)
|
||||
call b%bld(bv)
|
||||
|
||||
end subroutine mm_ivect_read
|
||||
|
||||
subroutine mm_ivect_write(b, header, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_ivect_write
|
||||
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
|
||||
info = psb_success_
|
||||
if (.not.allocated(b%v)) return
|
||||
call b%sync()
|
||||
|
||||
call mm_array_write(b%v%v,header,info,iunit,filename)
|
||||
|
||||
end subroutine mm_ivect_write
|
||||
|
||||
subroutine mm_lvect_read(b, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_lvect_read
|
||||
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
|
||||
!
|
||||
integer(psb_lpk_), allocatable :: bv(:)
|
||||
|
||||
call mm_array_read(bv, info, iunit, filename)
|
||||
call b%bld(bv)
|
||||
|
||||
end subroutine mm_lvect_read
|
||||
|
||||
subroutine mm_lvect_write(b, header, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_lvect_write
|
||||
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
|
||||
info = psb_success_
|
||||
if (.not.allocated(b%v)) return
|
||||
call b%sync()
|
||||
|
||||
call mm_array_write(b%v%v,header,info,iunit,filename)
|
||||
|
||||
end subroutine mm_lvect_write
|
||||
|
||||
@@ -33,6 +33,8 @@ 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, &
|
||||
@@ -143,6 +145,54 @@ module psb_mmio_mod
|
||||
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
|
||||
|
||||
|
||||
@@ -266,6 +316,60 @@ module psb_mmio_mod
|
||||
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(HAVE_BUGGY_GENERICS)
|
||||
|
||||
@@ -281,6 +281,38 @@ subroutine mm_svet1_write(b, header, info, iunit, filename)
|
||||
|
||||
end subroutine mm_svet1_write
|
||||
|
||||
subroutine mm_svect_read(b, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_svect_read
|
||||
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
|
||||
!
|
||||
real(psb_spk_), allocatable :: bv(:)
|
||||
|
||||
call mm_array_read(bv, info, iunit, filename)
|
||||
if (info == 0) call b%bld(bv)
|
||||
|
||||
end subroutine mm_svect_read
|
||||
|
||||
subroutine mm_svect_write(b, header, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_svect_write
|
||||
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
|
||||
info = psb_success_
|
||||
if (.not.allocated(b%v)) return
|
||||
call b%sync()
|
||||
|
||||
call mm_array_write(b%v%v,header,info,iunit,filename)
|
||||
|
||||
end subroutine mm_svect_write
|
||||
|
||||
subroutine smm_mat_read(a, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
|
||||
@@ -286,6 +286,39 @@ subroutine mm_zvet1_write(b, header, info, iunit, filename)
|
||||
|
||||
end subroutine mm_zvet1_write
|
||||
|
||||
subroutine mm_zvect_read(b, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_zvect_read
|
||||
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
|
||||
!
|
||||
complex(psb_dpk_), allocatable :: bv(:)
|
||||
|
||||
call mm_array_read(bv, info, iunit, filename)
|
||||
if (info == 0) call b%bld(bv)
|
||||
|
||||
end subroutine mm_zvect_read
|
||||
|
||||
subroutine mm_zvect_write(b, header, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
use psb_mmio_mod, psb_protect_name => mm_zvect_write
|
||||
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
|
||||
info = psb_success_
|
||||
if (.not.allocated(b%v)) return
|
||||
call b%sync()
|
||||
|
||||
call mm_array_write(b%v%v,header,info,iunit,filename)
|
||||
|
||||
end subroutine mm_zvect_write
|
||||
|
||||
subroutine zmm_mat_read(a, info, iunit, filename)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
|
||||
Reference in New Issue
Block a user