Modified MMIO to accept PSB_X_VECT_TYPE variables.

psblas-3.6-maint
Salvatore Filippone 5 years ago
parent f632a27ad1
commit 7a1ad1f207

@ -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="userhtmlsu81.html" >next</a>] [<a
href="userhtmlsu77.html" >prev</a>] [<a
href="userhtmlsu77.html#tailuserhtmlsu77.html" >prev-tail</a>] [<a
href="userhtmlsu78.html" >front</a>] [<a
href="userhtmlsu77.html#userhtmlse10.html" >up</a>] </p></div>
<!--l. 173--><p class="indent" > <a
<!--l. 175--><p class="indent" > <a
id="tailuserhtmlsu78.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="userhtmlsu82.html" >next</a>] [<a
href="userhtmlsu78.html" >prev</a>] [<a
href="userhtmlsu78.html#tailuserhtmlsu78.html" >prev-tail</a>] [<a
@ -20,13 +20,13 @@ href="userhtmlsu77.html#userhtmlsu81.html" >up</a>] </p></div>
<h4 class="subsectionHead"><span class="titlemark">9.5 </span> <a
id="x93-1270009.5"></a>mm_mat_write &#8212; 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="x93-127001r1"></a></span><span
class="cmbx-10">call</span>&#x00A0;mm_mat_write(a,&#x00A0;mtitle,&#x00A0;iret,&#x00A0;iunit,&#x00A0;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="userhtmlsu82.html" >next</a>] [<a
href="userhtmlsu78.html" >prev</a>] [<a
href="userhtmlsu78.html#tailuserhtmlsu78.html" >prev-tail</a>] [<a
href="userhtmlsu79.html" >front</a>] [<a
href="userhtmlsu77.html#userhtmlsu81.html" >up</a>] </p></div>
<!--l. 208--><p class="indent" > <a
<!--l. 210--><p class="indent" > <a
id="tailuserhtmlsu79.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="userhtmlsu79.html" >prev</a>] [<a
href="userhtmlsu79.html#tailuserhtmlsu79.html" >prev-tail</a>] [<a
href="userhtmlsu77.html#tailuserhtmlsu80.html">tail</a>] [<a
@ -19,13 +19,13 @@ href="userhtmlsu77.html#userhtmlsu82.html" >up</a>] </p></div>
<h4 class="subsectionHead"><span class="titlemark">9.6 </span> <a
id="x94-1280009.6"></a>mm_array_write &#8212; 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="x94-128001r1"></a></span><span
class="cmbx-10">call</span>&#x00A0;mm_array_write(b,&#x00A0;iret,&#x00A0;iunit,&#x00A0;filename)
class="cmbx-10">call</span>&#x00A0;mm_array_write(b,&#x00A0;vtitle,&#x00A0;iret,&#x00A0;iunit,&#x00A0;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..&#x00A0;
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,6 +349,10 @@ class="newline" />An integer value; 0 means no error has been detected.</dd></dl
<!--l. 123--><p class="indent" >
<!--l. 2--><div class="crosslinks"><p class="noindent">[<a
href="userhtmlsu87.html" >front</a>] [<a
href="# " >up</a>] </p></div>

File diff suppressed because it is too large Load Diff

@ -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

@ -2,7 +2,7 @@
BICGSTAB Iterative method BICGSTAB CGS BICG BICGSTABL RGMRES FCG CGR
BJAC Preconditioner NONE DIAG BJAC
CSR Storage format for matrix A: CSR COO
040 Domain size (acutal system is this**3 (pde3d) or **2 (pde2d) )
080 Domain size (acutal system is this**3 (pde3d) or **2 (pde2d) )
2 Stopping criterion 1 2
0100 MAXIT
01 ITRACE

@ -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

@ -33,6 +33,8 @@ module psb_mmio_mod
use psb_base_mod, only : psb_ipk_, psb_spk_, psb_dpk_,&
& psb_s_vect_type, psb_d_vect_type, &
& psb_c_vect_type, psb_z_vect_type, &
& psb_sspmat_type, psb_cspmat_type, &
& psb_dspmat_type, psb_zspmat_type
@ -123,6 +125,38 @@ module psb_mmio_mod
integer(psb_ipk_), optional, intent(in) :: iunit
character(len=*), optional, intent(in) :: filename
end subroutine mm_ivet2_read
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
end interface
@ -226,6 +260,42 @@ module psb_mmio_mod
integer(psb_ipk_), optional, intent(in) :: iunit
character(len=*), optional, intent(in) :: filename
end subroutine mm_ivet1_write
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
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

Loading…
Cancel
Save