You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2699 lines
120 KiB
HTML
2699 lines
120 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
|
"http://www.w3.org/TR/html4/loose.dtd">
|
|
<html >
|
|
<head><title>Data Structures and Classes</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<meta name="generator" content="TeX4ht (https://tug.org/tex4ht/)">
|
|
<meta name="originator" content="TeX4ht (https://tug.org/tex4ht/)">
|
|
<!-- html,3 -->
|
|
<meta name="src" content="userhtml.tex">
|
|
<link rel="stylesheet" type="text/css" href="userhtml.css">
|
|
</head><body
|
|
>
|
|
<!--l. 1--><div class="crosslinks"><p class="noindent">[<a
|
|
href="userhtmlse7.html" >next</a>] [<a
|
|
href="userhtmlse2.html" >prev</a>] [<a
|
|
href="userhtmlse2.html#tailuserhtmlse2.html" >prev-tail</a>] [<a
|
|
href="#tailuserhtmlse3.html">tail</a>] [<a
|
|
href="userhtml.html#userhtmlse6.html" >up</a>] </p></div>
|
|
<h3 class="sectionHead"><span class="titlemark">3 </span> <a
|
|
id="x8-90003"></a>Data Structures and Classes</h3>
|
|
<!--l. 5--><p class="noindent" >In this chapter we illustrate the data structures used for definition of routines
|
|
interfaces. They include data structures for sparse matrices, communication
|
|
descriptors and preconditioners.
|
|
<!--l. 11--><p class="indent" > All the data types and the basic subroutine interfaces related to descriptors and
|
|
sparse matrices are defined in the module <code class="lstinline"><span style="color:#000000">psb_base_mod</span></code>; this will have to be
|
|
included by every user subroutine that makes use of the library. The preconditioners
|
|
are defined in the module <code class="lstinline"><span style="color:#000000">psb_prec_mod</span></code>
|
|
<!--l. 17--><p class="indent" > Integer, real and complex data types are parametrized with a kind type defined in
|
|
the library as follows:
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 20--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_spk</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 20--><p class="noindent" >Kind parameter for short precision real and complex data; corresponds
|
|
to a <code class="lstinline"><span style="color:#000000">REAL</span></code> declaration and is normally 4 bytes;
|
|
</dd><dt class="description">
|
|
<!--l. 23--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_dpk</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 23--><p class="noindent" >Kind parameter for long precision real and complex data; corresponds to
|
|
a <code class="lstinline"><span style="color:#000000">DOUBLE</span><span style="color:#000000"> </span><span style="color:#000000">PRECISION</span></code> declaration and is normally 8 bytes;
|
|
</dd><dt class="description">
|
|
<!--l. 26--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_mpk</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 26--><p class="noindent" >Kind parameter for 4-bytes integer data, as is always used by MPI;
|
|
</dd><dt class="description">
|
|
<!--l. 28--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_epk</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 28--><p class="noindent" >Kind parameter for 8-bytes integer data, as is always used by the <code class="lstinline"><span style="color:#000000">sizeof</span></code>
|
|
methods;
|
|
</dd><dt class="description">
|
|
<!--l. 30--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_ipk</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 30--><p class="noindent" >Kind parameter for “local” integer indices and data; with default build
|
|
options this is a 4 bytes integer;
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 32--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_lpk</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 32--><p class="noindent" >Kind parameter for “global” integer indices and data; with default build
|
|
options this is an 8 bytes integer;</dd></dl>
|
|
<!--l. 35--><p class="noindent" >The integer kinds for local and global indices can be chosen at configure time to hold 4
|
|
or 8 bytes, with the global indices at least as large as the local ones. Together with the
|
|
classes attributes we also discuss their methods. Most methods detailed here only act
|
|
on the local variable, i.e. their action is purely local and asynchronous unless
|
|
otherwise stated. The list of methods here is not completely exhaustive; many
|
|
methods, especially those that alter the contents of the various objects, are usually
|
|
not needed by the end-user, and therefore are described in the developer’s
|
|
documentation.
|
|
<!--l. 48--><p class="noindent" >
|
|
<h4 class="subsectionHead"><span class="titlemark">3.1 </span> <a
|
|
id="x8-100003.1"></a>Descriptor data structure</h4>
|
|
<!--l. 50--><p class="noindent" >All the general matrix informations and elements to be exchanged among processes
|
|
are stored within a data structure of the type <a
|
|
id="descdata"></a><span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_desc</span><span
|
|
class="cmtt-10">_type</span>. Every structure of this
|
|
type is associated with a discretization pattern and enables data communications
|
|
and other operations that are necessary for implementing the various algorithms of
|
|
interest to us.
|
|
<!--l. 57--><p class="indent" > The data structure itself <code class="lstinline"><span style="color:#000000">psb_desc_type</span></code> can be treated as an opaque object
|
|
handled via the tools routines of Sec. <a
|
|
href="userhtmlse6.html#x11-770006">6<!--tex4ht:ref: sec:toolsrout --></a> or the query routines detailed below;
|
|
nevertheless we include here a description for the curious reader.
|
|
<!--l. 63--><p class="indent" > First we describe the <code class="lstinline"><span style="color:#000000">psb_indx_map</span></code> type. This is a data structure that keeps track
|
|
of a certain number of basic issues such as:
|
|
<ul class="itemize1">
|
|
<li class="itemize">
|
|
<!--l. 67--><p class="noindent" >The value of the communication context;
|
|
</li>
|
|
<li class="itemize">
|
|
<!--l. 68--><p class="noindent" >The number of indices in the index space, i.e. global number of rows and
|
|
columns of a sparse matrix;
|
|
</li>
|
|
<li class="itemize">
|
|
<!--l. 70--><p class="noindent" >The local set of indices, including:
|
|
<ul class="itemize2">
|
|
<li class="itemize">
|
|
<!--l. 72--><p class="noindent" >The number of local indices (and local rows);
|
|
</li>
|
|
<li class="itemize">
|
|
<!--l. 73--><p class="noindent" >The number of halo indices (and therefore local columns);
|
|
|
|
|
|
|
|
</li>
|
|
<li class="itemize">
|
|
<!--l. 74--><p class="noindent" >The global indices corresponding to the local ones.</li></ul>
|
|
</li></ul>
|
|
<!--l. 77--><p class="noindent" >There are many different schemes for storing these data; therefore there are a number of
|
|
types extending the base one, and the descriptor structure holds a polymorphic
|
|
object whose dynamic type can be any of the extended types. The methods
|
|
associated with this data type answer the following queries:
|
|
<ul class="itemize1">
|
|
<li class="itemize">
|
|
<!--l. 84--><p class="noindent" >For a given set of local indices, find the corresponding indices in the
|
|
global numbering;
|
|
</li>
|
|
<li class="itemize">
|
|
<!--l. 86--><p class="noindent" >For a given set of global indices, find the corresponding indices in the
|
|
local numbering, if any, or return an invalid
|
|
</li>
|
|
<li class="itemize">
|
|
<!--l. 88--><p class="noindent" >Add a global index to the set of halo indices;
|
|
</li>
|
|
<li class="itemize">
|
|
<!--l. 89--><p class="noindent" >Find the process owner of each member of a set of global indices.</li></ul>
|
|
<!--l. 92--><p class="noindent" >All methods but the last are purely local; the last method potentially requires
|
|
communication among processes, and thus is a synchronous method. The
|
|
choice of a specific dynamic type for the index map is made at the time the
|
|
descriptor is initially allocated, according to the mode of initialization (see
|
|
also <a
|
|
href="userhtmlse6.html#x11-770006">6<!--tex4ht:ref: sec:toolsrout --></a>).
|
|
<!--l. 98--><p class="indent" > The descriptor contents are as follows:
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 100--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">indxmap</span> </dt><dd
|
|
class="description">
|
|
<!--l. 100--><p class="noindent" >A polymorphic variable of a type that is any extension of the indx_map
|
|
type described above. <br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 102--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">halo</span><span
|
|
class="pplb7t-">_index</span> </dt><dd
|
|
class="description">
|
|
<!--l. 102--><p class="noindent" >A list of the halo and boundary elements for the current process to be
|
|
exchanged with other processes; for each processes with which it is necessary
|
|
to communicate:
|
|
|
|
|
|
|
|
<ol class="enumerate1" >
|
|
<li
|
|
class="enumerate" id="x8-10002x1">
|
|
<!--l. 106--><p class="noindent" >Process identifier;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10004x2">
|
|
<!--l. 107--><p class="noindent" >Number of points to be received;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10006x3">
|
|
<!--l. 108--><p class="noindent" >Indices of points to be received;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10008x4">
|
|
<!--l. 109--><p class="noindent" >Number of points to be sent;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10010x5">
|
|
<!--l. 110--><p class="noindent" >Indices of points to be sent;</li></ol>
|
|
<!--l. 114--><p class="noindent" >Specified as: a vector of integer type, see <a
|
|
href="#x8-460003.3">3.3<!--tex4ht:ref: sec:vecttype --></a>.
|
|
</dd><dt class="description">
|
|
<!--l. 115--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">ext</span><span
|
|
class="pplb7t-">_index</span> </dt><dd
|
|
class="description">
|
|
<!--l. 115--><p class="noindent" >A list of element indices to be exchanged to implement the mapping between a
|
|
base descriptor and a descriptor with overlap. <br
|
|
class="newline" />Specified as: a vector of integer type, see <a
|
|
href="#x8-460003.3">3.3<!--tex4ht:ref: sec:vecttype --></a>.
|
|
</dd><dt class="description">
|
|
<!--l. 119--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">ovrlap</span><span
|
|
class="pplb7t-">_index</span> </dt><dd
|
|
class="description">
|
|
<!--l. 119--><p class="noindent" >A list of the overlap elements for the current process, organized in groups like
|
|
the previous vector:
|
|
<ol class="enumerate1" >
|
|
<li
|
|
class="enumerate" id="x8-10012x1">
|
|
<!--l. 122--><p class="noindent" >Process identifier;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10014x2">
|
|
<!--l. 123--><p class="noindent" >Number of points to be received;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10016x3">
|
|
<!--l. 124--><p class="noindent" >Indices of points to be received;
|
|
|
|
|
|
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10018x4">
|
|
<!--l. 125--><p class="noindent" >Number of points to be sent;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10020x5">
|
|
<!--l. 126--><p class="noindent" >Indices of points to be sent;</li></ol>
|
|
<!--l. 130--><p class="noindent" >Specified as: a vector of integer type, see <a
|
|
href="#x8-460003.3">3.3<!--tex4ht:ref: sec:vecttype --></a>.
|
|
</dd><dt class="description">
|
|
<!--l. 131--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">ovr</span><span
|
|
class="pplb7t-">_mst</span><span
|
|
class="pplb7t-">_idx</span> </dt><dd
|
|
class="description">
|
|
<!--l. 131--><p class="noindent" >A list to retrieve the value of each overlap element from the respective master
|
|
process.<br
|
|
class="newline" />Specified as: a vector of integer type, see <a
|
|
href="#x8-460003.3">3.3<!--tex4ht:ref: sec:vecttype --></a>.
|
|
</dd><dt class="description">
|
|
<!--l. 134--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">ovrlap</span><span
|
|
class="pplb7t-">_elem</span> </dt><dd
|
|
class="description">
|
|
<!--l. 134--><p class="noindent" >For all overlap points belonging to th ecurrent process:
|
|
<ol class="enumerate1" >
|
|
<li
|
|
class="enumerate" id="x8-10022x1">
|
|
<!--l. 137--><p class="noindent" >Overlap point index;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10024x2">
|
|
<!--l. 138--><p class="noindent" >Number of processes sharing that overlap points;
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-10026x3">
|
|
<!--l. 139--><p class="noindent" >Index of a “master” process:</li></ol>
|
|
<!--l. 141--><p class="noindent" >Specified as: an allocatable integer array of rank two.
|
|
</dd><dt class="description">
|
|
<!--l. 142--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">bnd</span><span
|
|
class="pplb7t-">_elem</span> </dt><dd
|
|
class="description">
|
|
<!--l. 142--><p class="noindent" >A list of all boundary points, i.e. points that have a connection with other
|
|
processes.</dd></dl>
|
|
<!--l. 145--><p class="noindent" >The Fortran 2003 declaration for <code class="lstinline"><span style="color:#000000">psb_desc_type</span></code> structures is as follows:
|
|
<!--l. 147--><p class="indent" > <a
|
|
id="x8-10027r1"></a><hr class="float"><div class="float"
|
|
>
|
|
|
|
|
|
|
|
<div class="center"
|
|
>
|
|
<!--l. 162--><p class="noindent" >
|
|
<div class="minipage"><pre class="verbatim" id="verbatim-1">
|
|
type psb_desc_type
|
|
    class(psb_indx_map), allocatable :: indxmap
|
|
    type(psb_i_vect_type) :: v_halo_index
|
|
    type(psb_i_vect_type) :: v_ext_index
|
|
    type(psb_i_vect_type) :: v_ovrlap_index
|
|
    type(psb_i_vect_type) :: v_ovr_mst_idx
|
|
    integer, allocatable  :: ovrlap_elem(:,:)
|
|
    integer, allocatable  :: bnd_elem(:)
|
|
end type psb_desc_type
|
|
</pre>
|
|
<!--l. 174--><p class="nopar" > </div></div>
|
|
<br /> <div class="caption"
|
|
><span class="id">Listing 1: </span><span
|
|
class="content">The PSBLAS defined data type that contains the communication
|
|
descriptor.</span></div><!--tex4ht:label?: x8-10027r1 -->
|
|
|
|
|
|
|
|
</div><hr class="endfloat" />
|
|
<!--l. 186--><p class="indent" > A communication descriptor associated with a sparse matrix has a state, which
|
|
can take the following values:
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 189--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Build:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 189--><p class="noindent" >State entered after the first allocation, and before the first assembly; in this
|
|
state it is possible to add communication requirements among different
|
|
processes.
|
|
</dd><dt class="description">
|
|
<!--l. 192--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Assembled:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 192--><p class="noindent" >State entered after the assembly; computations using the associated
|
|
sparse matrix, such as matrix-vector products, are only possible in this
|
|
state.</dd></dl>
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.1 </span> <a
|
|
id="x8-110003.1.1"></a>Descriptor Methods</h5>
|
|
<!--l. 199--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.2 </span> <a
|
|
id="x8-120003.1.2"></a>get_local_rows — Get number of local rows</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-2">
|
|
nr = desc%get_local_rows()
|
|
</pre>
|
|
<!--l. 203--><p class="nopar" >
|
|
<!--l. 205--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 206--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 206--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 207--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 207--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 208--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">desc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 208--><p class="noindent" >the communication descriptor.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 215--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 216--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 216--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 217--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 217--><p class="noindent" >The number of local rows, i.e. the number of rows owned by the current
|
|
process; as explained in <a
|
|
href="userhtmlse1.html#x3-20001">1<!--tex4ht:ref: sec:intro --></a>, it is equal to <span
|
|
class="zplmr7y-">|<img
|
|
src="zplmr7y-49.png" alt="I" class="x-x-49" /></span><sub><span
|
|
class="zplmr7m-x-x-76">i</span></sub><span
|
|
class="zplmr7y-">| </span><span
|
|
class="zplmr7t-">+ </span><span
|
|
class="zplmr7y-">|<img
|
|
src="zplmr7y-42.png" alt="B" class="x-x-42" /></span><sub><span
|
|
class="zplmr7m-x-x-76">i</span></sub><span
|
|
class="zplmr7y-">|</span>. The returned value is
|
|
specific to the calling process.</dd></dl>
|
|
<!--l. 224--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.3 </span> <a
|
|
id="x8-130003.1.3"></a>get_local_cols — Get number of local cols</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-3">
|
|
nc = desc%get_local_cols()
|
|
</pre>
|
|
<!--l. 228--><p class="nopar" >
|
|
<!--l. 230--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 231--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 231--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 232--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 232--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 233--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">desc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 233--><p class="noindent" >the communication descriptor.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 240--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 241--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 241--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 242--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 242--><p class="noindent" >The number of local cols, i.e. the number of indices used by the current
|
|
process, including both local and halo indices; as explained in <a
|
|
href="userhtmlse1.html#x3-20001">1<!--tex4ht:ref: sec:intro --></a>, it is
|
|
equal to <span
|
|
class="zplmr7y-">|<img
|
|
src="zplmr7y-49.png" alt="I" class="x-x-49" /></span><sub><span
|
|
class="zplmr7m-x-x-76">i</span></sub><span
|
|
class="zplmr7y-">| </span><span
|
|
class="zplmr7t-">+ </span><span
|
|
class="zplmr7y-">|<img
|
|
src="zplmr7y-42.png" alt="B" class="x-x-42" /></span><sub><span
|
|
class="zplmr7m-x-x-76">i</span></sub><span
|
|
class="zplmr7y-">| </span><span
|
|
class="zplmr7t-">+ </span><span
|
|
class="zplmr7y-">|<img
|
|
src="zplmr7y-48.png" alt="H" class="x-x-48" /></span><sub><span
|
|
class="zplmr7m-x-x-76">i</span></sub><span
|
|
class="zplmr7y-">|</span>. The returned value is specific to the calling
|
|
process.</dd></dl>
|
|
<!--l. 250--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.4 </span> <a
|
|
id="x8-140003.1.4"></a>get_global_rows — Get number of global rows</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-4">
|
|
nr = desc%get_global_rows()
|
|
</pre>
|
|
<!--l. 254--><p class="nopar" >
|
|
<!--l. 256--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 257--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 257--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 258--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 258--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 259--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">desc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 259--><p class="noindent" >the communication descriptor.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 266--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 267--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 267--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 268--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 268--><p class="noindent" >The number of global rows, i.e. the size of the global index space.</dd></dl>
|
|
<!--l. 272--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.5 </span> <a
|
|
id="x8-150003.1.5"></a>get_global_cols — Get number of global cols</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-5">
|
|
nr = desc%get_global_cols()
|
|
</pre>
|
|
<!--l. 276--><p class="nopar" >
|
|
<!--l. 278--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 279--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 279--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 280--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 280--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 281--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">desc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 281--><p class="noindent" >the communication descriptor.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 288--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 289--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 289--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 290--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 290--><p class="noindent" >The number of global cols; usually this is equal to the number of global
|
|
rows.</dd></dl>
|
|
<!--l. 295--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.6 </span> <a
|
|
id="x8-160003.1.6"></a>get_global_indices — Get vector of global indices</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-6">
|
|
myidx = desc%get_global_indices([owned])
|
|
</pre>
|
|
<!--l. 299--><p class="nopar" >
|
|
<!--l. 301--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 302--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 302--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 303--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 303--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 304--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">desc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 304--><p class="noindent" >the communication descriptor.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">required</span>.<br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 307--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">owned</span> </dt><dd
|
|
class="description">
|
|
<!--l. 307--><p class="noindent" >Choose if you only want owned indices (<code class="lstinline"><span style="color:#000000">owned</span><span style="color:#000000">=.</span><span style="color:#000000">true</span><span style="color:#000000">.</span></code>) or also halo
|
|
indices (<code class="lstinline"><span style="color:#000000">owned</span><span style="color:#000000">=.</span><span style="color:#000000">false</span><span style="color:#000000">.</span></code>). Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">optional</span>; default: <code class="lstinline"><span style="color:#000000">.</span><span style="color:#000000">true</span><span style="color:#000000">.</span></code>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 315--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 316--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 316--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 317--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 317--><p class="noindent" >The global indices, returned as an allocatable integer array of kind
|
|
<code class="lstinline"><span style="color:#000000">psb_lpk_</span></code> and rank 1.</dd></dl>
|
|
<!--l. 323--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.7 </span> <a
|
|
id="x8-170003.1.7"></a>get_context — Get communication context</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-7">
|
|
ctxt = desc%get_context()
|
|
</pre>
|
|
<!--l. 327--><p class="nopar" >
|
|
<!--l. 329--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 330--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 330--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 331--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 331--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 332--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">desc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 332--><p class="noindent" >the communication descriptor.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 339--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 340--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 340--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 341--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 341--><p class="noindent" >The communication context.</dd></dl>
|
|
<!--l. 344--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.8 </span> <a
|
|
id="x8-180003.1.8"></a>Clone — clone current object</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-8">
|
|
call  desc%clone(descout,info)
|
|
</pre>
|
|
<!--l. 348--><p class="nopar" >
|
|
<!--l. 350--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 351--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 351--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 352--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 352--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 353--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">desc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 353--><p class="noindent" >the communication descriptor.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 360--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 361--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 361--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 362--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">descout</span> </dt><dd
|
|
class="description">
|
|
<!--l. 362--><p class="noindent" >A copy of the input object.
|
|
</dd><dt class="description">
|
|
<!--l. 363--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 363--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 367--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.9 </span> <a
|
|
id="x8-190003.1.9"></a>CNV — convert internal storage format</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-9">
|
|
call  desc%cnv(mold)
|
|
</pre>
|
|
<!--l. 371--><p class="nopar" >
|
|
<!--l. 373--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 374--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 374--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 375--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 375--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 376--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">desc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 376--><p class="noindent" >the communication descriptor.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 378--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">mold</span> </dt><dd
|
|
class="description">
|
|
<!--l. 378--><p class="noindent" >the desired integer storage format.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />Specified as: a object of type derived from (integer)
|
|
<a
|
|
id="vbasedata"></a><span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_T</span><span
|
|
class="cmtt-10">_base</span><span
|
|
class="cmtt-10">_vect</span><span
|
|
class="cmtt-10">_type</span>.</dd></dl>
|
|
<!--l. 384--><p class="noindent" >The <code class="lstinline"><span style="color:#000000">mold</span></code> arguments may be employed to interface with special devices, such as GPUs
|
|
and other accelerators.
|
|
<!--l. 391--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.10 </span> <a
|
|
id="x8-200003.1.10"></a>psb_cd_get_large_threshold — Get threshold for index mapping
|
|
switch</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-10">
|
|
ith = psb_cd_get_large_threshold()
|
|
</pre>
|
|
<!--l. 395--><p class="nopar" >
|
|
<!--l. 397--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 398--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 398--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 399--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 399--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 400--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 400--><p class="noindent" >The current value for the size threshold.
|
|
</dd></dl>
|
|
<!--l. 407--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.11 </span> <a
|
|
id="x8-210003.1.11"></a>psb_cd_set_large_threshold — Set threshold for index mapping
|
|
switch</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-11">
|
|
call psb_cd_set_large_threshold(ith)
|
|
</pre>
|
|
<!--l. 412--><p class="nopar" >
|
|
<!--l. 414--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 415--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 415--><p class="noindent" >Synchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 416--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 416--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 417--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">ith</span> </dt><dd
|
|
class="description">
|
|
<!--l. 417--><p class="noindent" >the new threshold for communication descriptors.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">global</span>.<br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">required</span>.<br
|
|
class="newline" />Intent: <span
|
|
class="pplb7t-">in</span>.<br
|
|
class="newline" />Specified as: an integer value greater than zero.</dd></dl>
|
|
<!--l. 423--><p class="noindent" >Note: the threshold value is only queried by the library at the time a call to <code class="lstinline"><span style="color:#000000">psb_cdall</span></code> is
|
|
executed, therefore changing the threshold has no effect on communication
|
|
descriptors that have already been initialized. Moreover the threshold must have the
|
|
same value on all processes.
|
|
<!--l. 430--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.12 </span> <a
|
|
id="x8-220003.1.12"></a>get_p_adjcncy — Get process adjacency list</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-12">
|
|
list =  desc%get_p_adjcncy()
|
|
</pre>
|
|
<!--l. 435--><p class="nopar" >
|
|
<!--l. 437--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 438--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 438--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 439--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 439--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 440--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 440--><p class="noindent" >The current list of adjacent processes, i.e. processes with which the
|
|
current one has to exchange halo data.
|
|
</dd></dl>
|
|
<!--l. 446--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.13 </span> <a
|
|
id="x8-230003.1.13"></a>set_p_adjcncy — Set process adjacency list</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-13">
|
|
call desc%set_p_adjcncy(list)
|
|
</pre>
|
|
<!--l. 451--><p class="nopar" >
|
|
<!--l. 453--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 454--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 454--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 455--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 455--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 456--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">list</span> </dt><dd
|
|
class="description">
|
|
<!--l. 456--><p class="noindent" >the list of adjacent processes.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">required</span>.<br
|
|
class="newline" />Intent: <span
|
|
class="pplb7t-">in</span>.<br
|
|
class="newline" />Specified as: a one-dimensional array of integers of kind <code class="lstinline"><span style="color:#000000">psb_ipk_</span></code>.</dd></dl>
|
|
<!--l. 462--><p class="noindent" >Note: this method can be called after a call to <code class="lstinline"><span style="color:#000000">psb_cdall</span></code> and before a call to <code class="lstinline"><span style="color:#000000">psb_cdasb</span></code>.
|
|
The user is specifying here some knowledge about which processes are topological
|
|
neighbours of the current process. The availability of this information may speed up
|
|
the execution of the assembly call <code class="lstinline"><span style="color:#000000">psb_cdasb</span></code>.
|
|
<!--l. 469--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.14 </span> <a
|
|
id="x8-240003.1.14"></a>fnd_owner — Find the owner process of a set of indices</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-14">
|
|
call desc%fnd_owner(idx,iprc,info)
|
|
</pre>
|
|
<!--l. 474--><p class="nopar" >
|
|
<!--l. 476--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 477--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 477--><p class="noindent" >Synchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 478--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 478--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 479--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">idx</span> </dt><dd
|
|
class="description">
|
|
<!--l. 479--><p class="noindent" >the list of global indices for which we need the owning processes.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">required</span>.<br
|
|
class="newline" />Intent: <span
|
|
class="pplb7t-">in</span>.<br
|
|
class="newline" />Specified as: a one-dimensional array of integers of kind <code class="lstinline"><span style="color:#000000">psb_lpk_</span></code>.
|
|
</dd><dt class="description">
|
|
<!--l. 484--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 484--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 485--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">iprc</span> </dt><dd
|
|
class="description">
|
|
<!--l. 485--><p class="noindent" >the list of processes owning the indices in <code class="lstinline"><span style="color:#000000">idx</span></code>.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">required</span>.<br
|
|
class="newline" />Intent: <span
|
|
class="pplb7t-">in</span>.<br
|
|
class="newline" />Specified as: an allocatable one-dimensional array of integers of kind
|
|
<code class="lstinline"><span style="color:#000000">psb_ipk_</span></code>.</dd></dl>
|
|
<!--l. 491--><p class="noindent" >Note: this method may or may not actually require communications, depending on the
|
|
exact internal data storage; given that the choice of storage may be altered by
|
|
runtime parameters, it is necessary for safety that this method is called by all
|
|
processes.
|
|
|
|
|
|
|
|
<!--l. 499--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.1.15 </span> <a
|
|
id="x8-250003.1.15"></a>Named Constants</h5>
|
|
<!--l. 501--><p class="noindent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 502--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_none</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 502--><p class="noindent" >Generic no-op;
|
|
</dd><dt class="description">
|
|
<!--l. 503--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_root</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 503--><p class="noindent" >Default root process for broadcast and scatter operations;
|
|
</dd><dt class="description">
|
|
<!--l. 504--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_nohalo</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 504--><p class="noindent" >Do not fetch halo elements;
|
|
</dd><dt class="description">
|
|
<!--l. 505--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_halo</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 505--><p class="noindent" >Fetch halo elements from neighbouring processes;
|
|
</dd><dt class="description">
|
|
<!--l. 506--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_sum</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 506--><p class="noindent" >Sum overlapped elements
|
|
</dd><dt class="description">
|
|
<!--l. 507--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_avg</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 507--><p class="noindent" >Average overlapped elements
|
|
</dd><dt class="description">
|
|
<!--l. 508--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_comm</span><span
|
|
class="pplb7t-">_halo</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 508--><p class="noindent" >Exchange data based on the <code class="lstinline"><span style="color:#000000">halo_index</span></code> list;
|
|
</dd><dt class="description">
|
|
<!--l. 510--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_comm</span><span
|
|
class="pplb7t-">_ext</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 510--><p class="noindent" >Exchange data based on the <code class="lstinline"><span style="color:#000000">ext_index</span></code> list;
|
|
</dd><dt class="description">
|
|
<!--l. 512--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_comm</span><span
|
|
class="pplb7t-">_ovr</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 512--><p class="noindent" >Exchange data based on the <code class="lstinline"><span style="color:#000000">ovrlap_index</span></code> list;
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 514--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_comm</span><span
|
|
class="pplb7t-">_mov</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 514--><p class="noindent" >Exchange data based on the <code class="lstinline"><span style="color:#000000">ovr_mst_idx</span></code> list;
|
|
</dd></dl>
|
|
<!--l. 534--><p class="noindent" >
|
|
<h4 class="subsectionHead"><span class="titlemark">3.2 </span> <a
|
|
id="x8-260003.2"></a>Sparse Matrix class</h4>
|
|
<!--l. 536--><p class="noindent" >The <a
|
|
id="spdata"></a><span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_Tspmat</span><span
|
|
class="cmtt-10">_type </span>class contains all information about the local portion of the
|
|
sparse matrix and its storage mode. Its design is based on the STATE design
|
|
pattern <span class="cite">[<a
|
|
href="userhtmlli2.html#XDesignPatterns">13</a>]</span> as detailed in <span class="cite">[<a
|
|
href="userhtmlli2.html#XSparse03">11</a>]</span>; the type declaration is shown in figure <a
|
|
href="#x8-26001r2">2<!--tex4ht:ref: fig:spmattype --></a> where <code class="lstinline"><span style="color:#000000">T</span></code> is
|
|
a placeholder for the data type and precision variants
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 544--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">S</span> </dt><dd
|
|
class="description">
|
|
<!--l. 544--><p class="noindent" >Single precision real;
|
|
</dd><dt class="description">
|
|
<!--l. 545--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">D</span> </dt><dd
|
|
class="description">
|
|
<!--l. 545--><p class="noindent" >Double precision real;
|
|
</dd><dt class="description">
|
|
<!--l. 546--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">C</span> </dt><dd
|
|
class="description">
|
|
<!--l. 546--><p class="noindent" >Single precision complex;
|
|
</dd><dt class="description">
|
|
<!--l. 547--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Z</span> </dt><dd
|
|
class="description">
|
|
<!--l. 547--><p class="noindent" >Double precision complex;
|
|
</dd><dt class="description">
|
|
<!--l. 548--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">LS,LD,LC,LZ</span> </dt><dd
|
|
class="description">
|
|
<!--l. 548--><p class="noindent" >Same numeric type as above, but with <code class="lstinline"><span style="color:#000000">psb_lpk_</span></code> integer indices.</dd></dl>
|
|
<!--l. 551--><p class="noindent" >The actual data is contained in the polymorphic component <code class="lstinline"><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">a</span></code> of type
|
|
<a
|
|
id="spbasedata"></a><span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_T</span><span
|
|
class="cmtt-10">_base</span><span
|
|
class="cmtt-10">_sparse</span><span
|
|
class="cmtt-10">_mat</span>; its specific layout can be chosen dynamically among the
|
|
predefined types, or an entirely new storage layout can be implemented and passed
|
|
to the library at runtime via the <code class="lstinline"><span style="color:#000000">psb_spasb</span></code> routine.
|
|
<!--l. 556--><p class="indent" > <a
|
|
id="x8-26001r2"></a><hr class="float"><div class="float"
|
|
>
|
|
|
|
|
|
|
|
<div class="center"
|
|
>
|
|
<!--l. 565--><p class="noindent" >
|
|
<div class="minipage"><pre class="verbatim" id="verbatim-15">
|
|
  type :: psb_Tspmat_type
|
|
    class(psb_T_base_sparse_mat), allocatable  :: a
|
|
  end type  psb_Tspmat_type
|
|
</pre>
|
|
<!--l. 571--><p class="nopar" > </div></div>
|
|
<br /><div class="caption"
|
|
><span class="id">Listing 2: </span><span
|
|
class="content"> The PSBLAS defined data type that contains a sparse matrix.</span></div><!--tex4ht:label?: x8-26001r2 -->
|
|
|
|
|
|
|
|
</div><hr class="endfloat" />
|
|
<!--l. 584--><p class="indent" > The following very common formats are precompiled in PSBLAS and thus are
|
|
always available:
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 587--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_T</span><span
|
|
class="pplb7t-">_coo</span><span
|
|
class="pplb7t-">_sparse</span><span
|
|
class="pplb7t-">_mat</span> </dt><dd
|
|
class="description">
|
|
<!--l. 587--><p class="noindent" >Coordinate storage;
|
|
</dd><dt class="description">
|
|
<!--l. 588--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_T</span><span
|
|
class="pplb7t-">_csr</span><span
|
|
class="pplb7t-">_sparse</span><span
|
|
class="pplb7t-">_mat</span> </dt><dd
|
|
class="description">
|
|
<!--l. 588--><p class="noindent" >Compressed storage by rows;
|
|
</dd><dt class="description">
|
|
<!--l. 589--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_T</span><span
|
|
class="pplb7t-">_csc</span><span
|
|
class="pplb7t-">_sparse</span><span
|
|
class="pplb7t-">_mat</span> </dt><dd
|
|
class="description">
|
|
<!--l. 589--><p class="noindent" >Compressed storage by columns;</dd></dl>
|
|
<!--l. 591--><p class="noindent" >The inner sparse matrix has an associated state, which can take the following
|
|
values:
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 594--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Build:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 594--><p class="noindent" >State entered after the first allocation, and before the first assembly; in
|
|
this state it is possible to add nonzero entries.
|
|
</dd><dt class="description">
|
|
<!--l. 596--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Assembled:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 596--><p class="noindent" >State entered after the assembly; computations using the sparse matrix,
|
|
such as matrix-vector products, are only possible in this state;
|
|
</dd><dt class="description">
|
|
<!--l. 599--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Update:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 599--><p class="noindent" >State entered after a reinitalization; this is used to handle applications
|
|
in which the same sparsity pattern is used multiple times with different
|
|
coefficients. In this state it is only possible to enter coefficients for already
|
|
existing nonzero entries.</dd></dl>
|
|
<!--l. 604--><p class="noindent" >The only storage variant supporting the build state is COO; all other variants are
|
|
obtained by conversion to/from it.
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.1 </span> <a
|
|
id="x8-270003.2.1"></a>Sparse Matrix Methods</h5>
|
|
<!--l. 609--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.2 </span> <a
|
|
id="x8-280003.2.2"></a>get_nrows — Get number of rows in a sparse matrix</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-16">
|
|
nr = a%get_nrows()
|
|
</pre>
|
|
<!--l. 614--><p class="nopar" >
|
|
<!--l. 616--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 617--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 617--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 618--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 618--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 619--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 619--><p class="noindent" >the sparse matrix<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 626--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 627--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 627--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 628--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 628--><p class="noindent" >The number of rows of sparse matrix <code class="lstinline"><span style="color:#000000">a</span></code>.</dd></dl>
|
|
<!--l. 633--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.3 </span> <a
|
|
id="x8-290003.2.3"></a>get_ncols — Get number of columns in a sparse matrix</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-17">
|
|
nc = a%get_ncols()
|
|
</pre>
|
|
<!--l. 638--><p class="nopar" >
|
|
<!--l. 640--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 641--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 641--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 642--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 642--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 643--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 643--><p class="noindent" >the sparse matrix<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 650--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 651--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 651--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 652--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 652--><p class="noindent" >The number of columns of sparse matrix <code class="lstinline"><span style="color:#000000">a</span></code>.</dd></dl>
|
|
<!--l. 657--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.4 </span> <a
|
|
id="x8-300003.2.4"></a>get_nnzeros — Get number of nonzero elements in a sparse matrix</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-18">
|
|
nz = a%get_nnzeros()
|
|
</pre>
|
|
<!--l. 662--><p class="nopar" >
|
|
<!--l. 664--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 665--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 665--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 666--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 666--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 667--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 667--><p class="noindent" >the sparse matrix<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 674--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 675--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 675--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 676--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 676--><p class="noindent" >The number of nonzero elements stored in sparse matrix <code class="lstinline"><span style="color:#000000">a</span></code>.</dd></dl>
|
|
<!--l. 679--><p class="noindent" ><span
|
|
class="pplb7t-">Notes</span>
|
|
<ol class="enumerate1" >
|
|
<li
|
|
class="enumerate" id="x8-30002x1">
|
|
<!--l. 681--><p class="noindent" >The function value is specific to the storage format of matrix <code class="lstinline"><span style="color:#000000">a</span></code>; some
|
|
storage formats employ padding, thus the returned value for the same
|
|
matrix may be different for different storage choices.</li></ol>
|
|
<!--l. 687--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.5 </span> <a
|
|
id="x8-310003.2.5"></a>get_size — Get maximum number of nonzero elements in a sparse
|
|
matrix</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-19">
|
|
maxnz = a%get_size()
|
|
</pre>
|
|
<!--l. 692--><p class="nopar" >
|
|
<!--l. 694--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 695--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 695--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 696--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 696--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 697--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 697--><p class="noindent" >the sparse matrix<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 704--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 705--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 705--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 706--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 706--><p class="noindent" >The maximum number of nonzero elements that can be stored in sparse
|
|
matrix <code class="lstinline"><span style="color:#000000">a</span></code> using its current memory allocation.</dd></dl>
|
|
<!--l. 711--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.6 </span> <a
|
|
id="x8-320003.2.6"></a>sizeof — Get memory occupation in bytes of a sparse matrix</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-20">
|
|
memory_size = a%sizeof()
|
|
</pre>
|
|
<!--l. 716--><p class="nopar" >
|
|
<!--l. 718--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 719--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 719--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 720--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 720--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 721--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 721--><p class="noindent" >the sparse matrix<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 728--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 729--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 729--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 730--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 730--><p class="noindent" >The memory occupation in bytes.</dd></dl>
|
|
<!--l. 734--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.7 </span> <a
|
|
id="x8-330003.2.7"></a>get_fmt — Short description of the dynamic type</h5>
|
|
<!--l. 738--><p class="noindent" ><code class="lstinline"><span style="color:#000000">write</span><span style="color:#000000">(*,*)</span><span style="color:#000000"> </span><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">get_fmt</span><span style="color:#000000">()</span></code>
|
|
<!--l. 741--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 742--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 742--><p class="noindent" >Asynchronous.
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 743--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 743--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 744--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 744--><p class="noindent" >the sparse matrix<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 751--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 752--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 752--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 753--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 753--><p class="noindent" >A short string describing the dynamic type of the matrix. Predefined
|
|
values include <code class="lstinline"><span style="color:#000000">NULL</span></code>, <code class="lstinline"><span style="color:#000000">COO</span></code>, <code class="lstinline"><span style="color:#000000">CSR</span></code> and <code class="lstinline"><span style="color:#000000">CSC</span></code>.</dd></dl>
|
|
<!--l. 758--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.8 </span> <a
|
|
id="x8-340003.2.8"></a>is_bld, is_upd, is_asb — Status check</h5>
|
|
<!--l. 762--><p class="noindent" ><code class="lstinline"><span style="color:#000000">if</span><span style="color:#000000"> </span><span style="color:#000000">(</span><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">is_bld</span><span style="color:#000000">())</span><span style="color:#000000"> </span><span style="color:#000000">then</span></code><br
|
|
class="newline" /><code class="lstinline"><span style="color:#000000">if</span><span style="color:#000000"> </span><span style="color:#000000">(</span><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">is_upd</span><span style="color:#000000">())</span><span style="color:#000000"> </span><span style="color:#000000">then</span></code><br
|
|
class="newline" /><code class="lstinline"><span style="color:#000000">if</span><span style="color:#000000"> </span><span style="color:#000000">(</span><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">is_asb</span><span style="color:#000000">())</span><span style="color:#000000"> </span><span style="color:#000000">then</span></code>
|
|
<!--l. 766--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 767--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 767--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 768--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 768--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 769--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 769--><p class="noindent" >the sparse matrix<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
|
|
|
|
|
|
<!--l. 776--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 777--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 777--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 778--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 778--><p class="noindent" >A <code class="lstinline"><span style="color:#000000">logical</span></code> value indicating whether the matrix is in the Build, Update or
|
|
Assembled state, respectively.</dd></dl>
|
|
<!--l. 783--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.9 </span> <a
|
|
id="x8-350003.2.9"></a>is_lower, is_upper, is_triangle, is_unit — Format check</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-21">
|
|
if (a%is_triangle()) then
|
|
if (a%is_upper()) then
|
|
if (a%is_lower()) then
|
|
if (a%is_unit()) then
|
|
</pre>
|
|
<!--l. 799--><p class="nopar" >
|
|
<!--l. 802--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 803--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 803--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 804--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 804--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 805--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 805--><p class="noindent" >the sparse matrix<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 812--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 813--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 813--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 814--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 814--><p class="noindent" >A <code class="lstinline"><span style="color:#000000">logical</span></code> value indicating whether the matrix is triangular; if
|
|
<code class="lstinline"><span style="color:#000000">is_triangle</span><span style="color:#000000">()</span></code> returns <code class="lstinline"><span style="color:#000000">.</span><span style="color:#000000">true</span><span style="color:#000000">.</span></code> check also if it is lower, upper and with a
|
|
unit (i.e. assumed) diagonal.</dd></dl>
|
|
<!--l. 821--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.10 </span> <a
|
|
id="x8-360003.2.10"></a>cscnv — Convert to a different storage format</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-22">
|
|
call  a%cscnv(b,info [, type, mold, dupl])
|
|
call  a%cscnv(info [, type, mold, dupl])
|
|
</pre>
|
|
<!--l. 833--><p class="nopar" >
|
|
<!--l. 836--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 837--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 837--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 838--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 838--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 839--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 839--><p class="noindent" >the sparse matrix.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 842--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">type</span> </dt><dd
|
|
class="description">
|
|
<!--l. 842--><p class="noindent" >a string requesting a new format.<br
|
|
class="newline" />Type: optional.
|
|
</dd><dt class="description">
|
|
<!--l. 844--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">mold</span> </dt><dd
|
|
class="description">
|
|
<!--l. 844--><p class="noindent" >a variable of <code class="lstinline"><span style="color:#000000">class</span><span style="color:#000000">(</span><span style="color:#000000">psb_T_base_sparse_mat</span><span style="color:#000000">)</span></code> requesting a new format.<br
|
|
class="newline" />Type: optional.
|
|
</dd><dt class="description">
|
|
<!--l. 846--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">dupl</span> </dt><dd
|
|
class="description">
|
|
<!--l. 846--><p class="noindent" >an integer value specifing how to handle duplicates (see Named
|
|
Constants below)</dd></dl>
|
|
<!--l. 850--><p class="indent" >
|
|
|
|
|
|
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 851--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 851--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 852--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">b,a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 852--><p class="noindent" >A copy of <code class="lstinline"><span style="color:#000000">a</span></code> with a new storage format.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.
|
|
</dd><dt class="description">
|
|
<!--l. 854--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 854--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 856--><p class="noindent" >The <code class="lstinline"><span style="color:#000000">mold</span></code> arguments may be employed to interface with special devices, such as GPUs
|
|
and other accelerators.
|
|
<!--l. 861--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.11 </span> <a
|
|
id="x8-370003.2.11"></a>csclip — Reduce to a submatrix</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-23">
|
|
    call a%csclip(b,info[,&
|
|
       & imin,imax,jmin,jmax,rscale,cscale])
|
|
</pre>
|
|
<!--l. 873--><p class="nopar" >
|
|
<!--l. 876--><p class="indent" > Returns the submatrix <code class="lstinline"><span style="color:#000000">A</span><span style="color:#000000">(</span><span style="color:#000000">imin</span><span style="color:#000000">:</span><span style="color:#000000">imax</span><span style="color:#000000">,</span><span style="color:#000000">jmin</span><span style="color:#000000">:</span><span style="color:#000000">jmax</span><span style="color:#000000">)</span></code>, optionally rescaling row/col
|
|
indices to the range <code class="lstinline"><span style="color:#000000">1:</span><span style="color:#000000">imax</span><span style="color:#000000">-</span><span style="color:#000000">imin</span><span style="color:#000000">+1,1:</span><span style="color:#000000">jmax</span><span style="color:#000000">-</span><span style="color:#000000">jmin</span><span style="color:#000000">+1</span></code>.
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 880--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 880--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 881--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 881--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 882--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 882--><p class="noindent" >the sparse matrix.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 885--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">imin,imax,jmin,jmax</span> </dt><dd
|
|
class="description">
|
|
<!--l. 885--><p class="noindent" >Minimum and maximum row and column indices.<br
|
|
class="newline" />Type: optional.
|
|
</dd><dt class="description">
|
|
<!--l. 887--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">rscale,cscale</span> </dt><dd
|
|
class="description">
|
|
<!--l. 887--><p class="noindent" >Whether to rescale row/column indices. Type: optional.</dd></dl>
|
|
<!--l. 890--><p class="noindent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 891--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 891--><p class="noindent" >
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 892--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">b</span> </dt><dd
|
|
class="description">
|
|
<!--l. 892--><p class="noindent" >A copy of a submatrix of <code class="lstinline"><span style="color:#000000">a</span></code>.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.
|
|
</dd><dt class="description">
|
|
<!--l. 894--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 894--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 897--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.12 </span> <a
|
|
id="x8-380003.2.12"></a>clean_zeros — Eliminate zero coefficients</h5>
|
|
<!--l. 899--><p class="noindent" ><code class="lstinline"><span style="color:#000000">call</span><span style="color:#000000"> </span><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">clean_zeros</span><span style="color:#000000">(</span><span style="color:#000000">info</span><span style="color:#000000">)</span></code>
|
|
<!--l. 901--><p class="indent" > Eliminates zero coefficients explicitly stored in the input matrix.
|
|
<!--l. 903--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 904--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 904--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 905--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 905--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 906--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 906--><p class="noindent" >the sparse matrix.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 910--><p class="noindent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 911--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 911--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 912--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 912--><p class="noindent" >The matrix <code class="lstinline"><span style="color:#000000">a</span></code> without zero coefficients.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 914--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 914--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 916--><p class="noindent" ><span
|
|
class="pplb7t-">Notes</span>
|
|
<ol class="enumerate1" >
|
|
<li
|
|
class="enumerate" id="x8-38002x1">
|
|
<!--l. 918--><p class="noindent" >Depending on the internal storage format, there may still be some
|
|
amount of zero padding in the output.
|
|
</li>
|
|
<li
|
|
class="enumerate" id="x8-38004x2">
|
|
<!--l. 920--><p class="noindent" >Any explicit zeros on the main diagonal are always kept in the data
|
|
structure.</li></ol>
|
|
<!--l. 924--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.13 </span> <a
|
|
id="x8-390003.2.13"></a>get_diag — Get main diagonal</h5>
|
|
<!--l. 926--><p class="noindent" ><code class="lstinline"><span style="color:#000000">call</span><span style="color:#000000"> </span><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">get_diag</span><span style="color:#000000">(</span><span style="color:#000000">d</span><span style="color:#000000">,</span><span style="color:#000000">info</span><span style="color:#000000">)</span></code>
|
|
<!--l. 928--><p class="indent" > Returns a copy of the main diagonal.
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 930--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 930--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 931--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 931--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 932--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 932--><p class="noindent" >the sparse matrix.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 936--><p class="noindent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 937--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 937--><p class="noindent" >
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 938--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">d</span> </dt><dd
|
|
class="description">
|
|
<!--l. 938--><p class="noindent" >A copy of the main diagonal.<br
|
|
class="newline" />A one-dimensional array of the appropriate type.
|
|
</dd><dt class="description">
|
|
<!--l. 940--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 940--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 944--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.14 </span> <a
|
|
id="x8-400003.2.14"></a>clip_diag — Cut out main diagonal</h5>
|
|
<!--l. 946--><p class="noindent" ><code class="lstinline"><span style="color:#000000">call</span><span style="color:#000000"> </span><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">clip_diag</span><span style="color:#000000">(</span><span style="color:#000000">b</span><span style="color:#000000">,</span><span style="color:#000000">info</span><span style="color:#000000">)</span></code>
|
|
<!--l. 948--><p class="indent" > Returns a copy of <code class="lstinline"><span style="color:#000000">a</span></code> without the main diagonal.
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 950--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 950--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 951--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 951--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 952--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 952--><p class="noindent" >the sparse matrix.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 956--><p class="noindent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 957--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 957--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 958--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">b</span> </dt><dd
|
|
class="description">
|
|
<!--l. 958--><p class="noindent" >A copy of <code class="lstinline"><span style="color:#000000">a</span></code> without the main diagonal.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 960--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 960--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 964--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.15 </span> <a
|
|
id="x8-410003.2.15"></a>tril — Return the lower triangle</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-24">
|
|
    call a%tril(l,info[,&
|
|
       & diag,imin,imax,jmin,jmax,rscale,cscale,u])
|
|
</pre>
|
|
<!--l. 976--><p class="nopar" >
|
|
<!--l. 979--><p class="indent" > Returns the lower triangular part of submatrix <code class="lstinline"><span style="color:#000000">A</span><span style="color:#000000">(</span><span style="color:#000000">imin</span><span style="color:#000000">:</span><span style="color:#000000">imax</span><span style="color:#000000">,</span><span style="color:#000000">jmin</span><span style="color:#000000">:</span><span style="color:#000000">jmax</span><span style="color:#000000">)</span></code>,
|
|
optionally rescaling row/col indices to the range <code class="lstinline"><span style="color:#000000">1:</span><span style="color:#000000">imax</span><span style="color:#000000">-</span><span style="color:#000000">imin</span><span style="color:#000000">+1,1:</span><span style="color:#000000">jmax</span><span style="color:#000000">-</span><span style="color:#000000">jmin</span><span style="color:#000000">+1</span></code>
|
|
and returing the complementary upper triangle.
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 984--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 984--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 985--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 985--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 986--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 986--><p class="noindent" >the sparse matrix.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 989--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">diag</span> </dt><dd
|
|
class="description">
|
|
<!--l. 989--><p class="noindent" >Include diagonals up to this one; <code class="lstinline"><span style="color:#000000">diag</span><span style="color:#000000">=1</span></code> means the first superdiagonal,
|
|
<code class="lstinline"><span style="color:#000000">diag</span><span style="color:#000000">=-1</span></code> means the first subdiagonal. Default 0.
|
|
</dd><dt class="description">
|
|
<!--l. 992--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">imin,imax,jmin,jmax</span> </dt><dd
|
|
class="description">
|
|
<!--l. 992--><p class="noindent" >Minimum and maximum row and column indices.<br
|
|
class="newline" />Type: optional.
|
|
</dd><dt class="description">
|
|
<!--l. 994--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">rscale,cscale</span> </dt><dd
|
|
class="description">
|
|
<!--l. 994--><p class="noindent" >Whether to rescale row/column indices. Type: optional.</dd></dl>
|
|
<!--l. 997--><p class="noindent" >
|
|
|
|
|
|
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 998--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 998--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 999--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">l</span> </dt><dd
|
|
class="description">
|
|
<!--l. 999--><p class="noindent" >A copy of the lower triangle of <code class="lstinline"><span style="color:#000000">a</span></code>.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.
|
|
</dd><dt class="description">
|
|
<!--l. 1001--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">u</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1001--><p class="noindent" >(optional) A copy of the upper triangle of <code class="lstinline"><span style="color:#000000">a</span></code>.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.
|
|
</dd><dt class="description">
|
|
<!--l. 1003--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1003--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 1006--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.16 </span> <a
|
|
id="x8-420003.2.16"></a>triu — Return the upper triangle</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-25">
|
|
    call a%triu(u,info[,&
|
|
       & diag,imin,imax,jmin,jmax,rscale,cscale,l])
|
|
</pre>
|
|
<!--l. 1017--><p class="nopar" >
|
|
<!--l. 1020--><p class="indent" > Returns the upper triangular part of submatrix <code class="lstinline"><span style="color:#000000">A</span><span style="color:#000000">(</span><span style="color:#000000">imin</span><span style="color:#000000">:</span><span style="color:#000000">imax</span><span style="color:#000000">,</span><span style="color:#000000">jmin</span><span style="color:#000000">:</span><span style="color:#000000">jmax</span><span style="color:#000000">)</span></code>,
|
|
optionally rescaling row/col indices to the range <code class="lstinline"><span style="color:#000000">1:</span><span style="color:#000000">imax</span><span style="color:#000000">-</span><span style="color:#000000">imin</span><span style="color:#000000">+1,1:</span><span style="color:#000000">jmax</span><span style="color:#000000">-</span><span style="color:#000000">jmin</span><span style="color:#000000">+1</span></code>,
|
|
and returing the complementary lower triangle.
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1025--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1025--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 1026--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1026--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1027--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1027--><p class="noindent" >the sparse matrix.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 1030--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">diag</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1030--><p class="noindent" >Include diagonals up to this one; <code class="lstinline"><span style="color:#000000">diag</span><span style="color:#000000">=1</span></code> means the first superdiagonal,
|
|
<code class="lstinline"><span style="color:#000000">diag</span><span style="color:#000000">=-1</span></code> means the first subdiagonal. Default 0.
|
|
</dd><dt class="description">
|
|
<!--l. 1033--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">imin,imax,jmin,jmax</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1033--><p class="noindent" >Minimum and maximum row and column indices.<br
|
|
class="newline" />Type: optional.
|
|
</dd><dt class="description">
|
|
<!--l. 1035--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">rscale,cscale</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1035--><p class="noindent" >Whether to rescale row/column indices. Type: optional.</dd></dl>
|
|
<!--l. 1038--><p class="noindent" >
|
|
|
|
|
|
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1039--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1039--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1040--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">u</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1040--><p class="noindent" >A copy of the upper triangle of <code class="lstinline"><span style="color:#000000">a</span></code>.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.
|
|
</dd><dt class="description">
|
|
<!--l. 1042--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">l</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1042--><p class="noindent" >(optional) A copy of the lower triangle of <code class="lstinline"><span style="color:#000000">a</span></code>.<br
|
|
class="newline" />A variable of type <code class="lstinline"><span style="color:#000000">psb_Tspmat_type</span></code>.
|
|
</dd><dt class="description">
|
|
<!--l. 1044--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1044--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 1050--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.17 </span> <a
|
|
id="x8-430003.2.17"></a>psb_set_mat_default — Set default storage format</h5>
|
|
<!--l. 1054--><p class="noindent" ><code class="lstinline"><span style="color:#000000">call</span><span style="color:#000000"> </span><span style="color:#000000">psb_set_mat_default</span><span style="color:#000000">(</span><span style="color:#000000">a</span><span style="color:#000000">)</span></code>
|
|
<!--l. 1056--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1057--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1057--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 1058--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1058--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1059--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1059--><p class="noindent" >a variable of <code class="lstinline"><span style="color:#000000">class</span><span style="color:#000000">(</span><span style="color:#000000">psb_T_base_sparse_mat</span><span style="color:#000000">)</span></code> requesting a new default
|
|
storage format.<br
|
|
class="newline" />Type: required.</dd></dl>
|
|
|
|
|
|
|
|
<!--l. 1068--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.18 </span> <a
|
|
id="x8-440003.2.18"></a>clone — Clone current object</h5>
|
|
<!--l. 1071--><p class="noindent" ><code class="lstinline"><span style="color:#000000">call</span><span style="color:#000000"> </span><span style="color:#000000">a</span><span style="color:#000000">%</span><span style="color:#000000">clone</span><span style="color:#000000">(</span><span style="color:#000000">b</span><span style="color:#000000">,</span><span style="color:#000000">info</span><span style="color:#000000">)</span></code>
|
|
<!--l. 1073--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1074--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1074--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 1075--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1075--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1076--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">a</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1076--><p class="noindent" >the sparse matrix.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 1083--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1084--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1084--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1085--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">b</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1085--><p class="noindent" >A copy of the input object.
|
|
</dd><dt class="description">
|
|
<!--l. 1086--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1086--><p class="noindent" >Return code.</dd></dl>
|
|
<!--l. 1090--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.2.19 </span> <a
|
|
id="x8-450003.2.19"></a>Named Constants</h5>
|
|
<!--l. 1092--><p class="noindent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1097--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_dupl</span><span
|
|
class="pplb7t-">_ovwrt</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1097--><p class="noindent" >Duplicate coefficients should be overwritten (i.e. ignore duplications)
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 1099--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_dupl</span><span
|
|
class="pplb7t-">_add</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1099--><p class="noindent" >Duplicate coefficients should be added;
|
|
</dd><dt class="description">
|
|
<!--l. 1100--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_dupl</span><span
|
|
class="pplb7t-">_err</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1100--><p class="noindent" >Duplicate coefficients should trigger an error conditino
|
|
</dd><dt class="description">
|
|
<!--l. 1101--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_upd</span><span
|
|
class="pplb7t-">_dflt</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1101--><p class="noindent" >Default update strategy for matrix coefficients;
|
|
</dd><dt class="description">
|
|
<!--l. 1102--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_upd</span><span
|
|
class="pplb7t-">_srch</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1102--><p class="noindent" >Update strategy based on search into the data structure;
|
|
</dd><dt class="description">
|
|
<!--l. 1103--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">psb</span><span
|
|
class="pplb7t-">_upd</span><span
|
|
class="pplb7t-">_perm</span><span
|
|
class="pplb7t-">_</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1103--><p class="noindent" >Update strategy based on additional permutation data (see tools routine
|
|
description).</dd></dl>
|
|
<!--l. 1108--><p class="noindent" >
|
|
<h4 class="subsectionHead"><span class="titlemark">3.3 </span> <a
|
|
id="x8-460003.3"></a>Dense Vector Data Structure</h4>
|
|
<!--l. 1110--><p class="noindent" >The <a
|
|
id="vdata"></a><span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_T</span><span
|
|
class="cmtt-10">_vect</span><span
|
|
class="cmtt-10">_type </span>data structure encapsulates the dense vectors in a way similar
|
|
to sparse matrices, i.e. including a base type <a
|
|
id="vbasedata"></a><span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_T</span><span
|
|
class="cmtt-10">_base</span><span
|
|
class="cmtt-10">_vect</span><span
|
|
class="cmtt-10">_type</span>. The user will
|
|
not, in general, access the vector components directly, but rather via the routines of
|
|
sec. <a
|
|
href="userhtmlse6.html#x11-770006">6<!--tex4ht:ref: sec:toolsrout --></a>. Among other simple things, we define here an extraction method that
|
|
can be used to get a full copy of the part of the vector stored on the local
|
|
process.
|
|
<!--l. 1120--><p class="indent" > The type declaration is shown in figure <a
|
|
href="#x8-46001r3">3<!--tex4ht:ref: fig:vectype --></a> where <code class="lstinline"><span style="color:#000000">T</span></code> is a placeholder for the data
|
|
type and precision variants
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1124--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">I</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1124--><p class="noindent" >Integer;
|
|
</dd><dt class="description">
|
|
<!--l. 1125--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">S</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1125--><p class="noindent" >Single precision real;
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 1126--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">D</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1126--><p class="noindent" >Double precision real;
|
|
</dd><dt class="description">
|
|
<!--l. 1127--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">C</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1127--><p class="noindent" >Single precision complex;
|
|
</dd><dt class="description">
|
|
<!--l. 1128--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Z</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1128--><p class="noindent" >Double precision complex.</dd></dl>
|
|
<!--l. 1130--><p class="noindent" >The actual data is contained in the polymorphic component <code class="lstinline"><span style="color:#000000">v</span><span style="color:#000000">%</span><span style="color:#000000">v</span></code>; the separation between
|
|
the application and the actual data is essential for cases where it is necessary to link
|
|
to data storage made available elsewhere outside the direct control of the
|
|
compiler/application, e.g. data stored in a graphics accelerator’s private
|
|
memory.
|
|
<!--l. 1136--><p class="indent" > <a
|
|
id="x8-46001r3"></a><hr class="float"><div class="float"
|
|
>
|
|
|
|
|
|
|
|
<div class="center"
|
|
>
|
|
<!--l. 1150--><p class="noindent" >
|
|
<div class="minipage"><pre class="verbatim" id="verbatim-26">
|
|
  type psb_T_base_vect_type
|
|
    TYPE(KIND_), allocatable :: v(:)
|
|
  end type psb_T_base_vect_type
|
|
|
|
  type psb_T_vect_type
|
|
    class(psb_T_base_vect_type), allocatable :: v
|
|
  end type  psb_T_vect_type
|
|
|
|
</pre>
|
|
<!--l. 1161--><p class="nopar" > </div></div>
|
|
<br /><div class="caption"
|
|
><span class="id">Listing 3: </span><span
|
|
class="content"> The PSBLAS defined data type that contains a dense vector.</span></div><!--tex4ht:label?: x8-46001r3 -->
|
|
|
|
|
|
|
|
</div><hr class="endfloat" />
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.1 </span> <a
|
|
id="x8-470003.3.1"></a>Vector Methods</h5>
|
|
<!--l. 1176--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.2 </span> <a
|
|
id="x8-480003.3.2"></a>get_nrows — Get number of rows in a dense vector</h5>
|
|
<!--l. 1179--><p class="noindent" ><code class="lstinline"><span style="color:#000000">nr</span><span style="color:#000000"> </span><span style="color:#000000">=</span><span style="color:#000000"> </span><span style="color:#000000">v</span><span style="color:#000000">%</span><span style="color:#000000">get_nrows</span><span style="color:#000000">()</span></code>
|
|
<!--l. 1181--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1182--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1182--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 1183--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1183--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1184--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">v</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1184--><p class="noindent" >the dense vector<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 1191--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1192--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1192--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1193--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1193--><p class="noindent" >The number of rows of dense vector <code class="lstinline"><span style="color:#000000">v</span></code>.</dd></dl>
|
|
<!--l. 1198--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.3 </span> <a
|
|
id="x8-490003.3.3"></a>sizeof — Get memory occupation in bytes of a dense vector</h5>
|
|
<!--l. 1201--><p class="noindent" ><code class="lstinline"><span style="color:#000000">memory_size</span><span style="color:#000000"> </span><span style="color:#000000">=</span><span style="color:#000000"> </span><span style="color:#000000">v</span><span style="color:#000000">%</span><span style="color:#000000">sizeof</span><span style="color:#000000">()</span></code>
|
|
<!--l. 1203--><p class="indent" >
|
|
|
|
|
|
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1204--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1204--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 1205--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1205--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1206--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">v</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1206--><p class="noindent" >the dense vector<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 1213--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1214--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1214--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1215--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1215--><p class="noindent" >The memory occupation in bytes.</dd></dl>
|
|
<!--l. 1219--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.4 </span> <a
|
|
id="x8-500003.3.4"></a>set — Set contents of the vector</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-27">
|
|
 call  v%set(alpha[,first,last])
|
|
 call  v%set(vect[,first,last])
|
|
 call  v%zero()
|
|
</pre>
|
|
<!--l. 1233--><p class="nopar" >
|
|
<!--l. 1236--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1237--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1237--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 1238--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1238--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1239--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">v</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1239--><p class="noindent" >the dense vector<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 1244--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">alpha</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1244--><p class="noindent" >A scalar value. <br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local </span><br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">required </span><br
|
|
class="newline" />Intent: <span
|
|
class="pplb7t-">in</span>.<br
|
|
class="newline" />Specified as: a number of the data type indicated in Table <a
|
|
href="userhtmlse4.html#x9-56001r1">1<!--tex4ht:ref: tab:f90axpby --></a>.
|
|
</dd><dt class="description">
|
|
<!--l. 1248--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">first,last</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1248--><p class="noindent" >Boundaries for setting in the vector.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local </span><br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">optional </span><br
|
|
class="newline" />Intent: <span
|
|
class="pplb7t-">in</span>.<br
|
|
class="newline" />Specified as: integers.
|
|
</dd><dt class="description">
|
|
<!--l. 1251--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">vect</span> </dt><dd
|
|
class="description">
|
|
|
|
|
|
|
|
<!--l. 1251--><p class="noindent" >An array <br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local </span><br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">required </span><br
|
|
class="newline" />Intent: <span
|
|
class="pplb7t-">in</span>.<br
|
|
class="newline" />Specified as: a number of the data type indicated in Table <a
|
|
href="userhtmlse4.html#x9-56001r1">1<!--tex4ht:ref: tab:f90axpby --></a>.</dd></dl>
|
|
<!--l. 1255--><p class="noindent" >Note that a call to <code class="lstinline"><span style="color:#000000">v</span><span style="color:#000000">%</span><span style="color:#000000">zero</span><span style="color:#000000">()</span></code> is provided as a shorthand, but is equivalent to a call
|
|
to <code class="lstinline"><span style="color:#000000">v</span><span style="color:#000000">%</span><span style="color:#000000">set</span><span style="color:#000000">(</span><span style="color:#000000">zero</span><span style="color:#000000">)</span></code> with the <code class="lstinline"><span style="color:#000000">zero</span></code> constant having the appropriate type and
|
|
kind.
|
|
<!--l. 1259--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1260--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1260--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1261--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">v</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1261--><p class="noindent" >the dense vector, with updated entries<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 1265--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.5 </span> <a
|
|
id="x8-510003.3.5"></a>get_vect — Get a copy of the vector contents</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-28">
|
|
extv = v%get_vect([n])
|
|
</pre>
|
|
<!--l. 1270--><p class="nopar" >
|
|
<!--l. 1272--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1273--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1273--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 1274--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1274--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1275--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">v</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1275--><p class="noindent" >the dense vector<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span><br
|
|
class="newline" />
|
|
</dd><dt class="description">
|
|
<!--l. 1280--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">n</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1280--><p class="noindent" >Size to be returned<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" />Type: <span
|
|
class="pplb7t-">optional</span>; default: entire vector.<br
|
|
class="newline" />
|
|
</dd></dl>
|
|
<!--l. 1286--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1287--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1287--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1288--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Function value</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1288--><p class="noindent" >An allocatable array holding a copy of the dense vector contents. If
|
|
the argument <span
|
|
class="zplmr7m-">n </span>is specified, the size of the returned array equals the
|
|
minimum between <span
|
|
class="zplmr7m-">n </span>and the internal size of the vector, or 0 if <span
|
|
class="zplmr7m-">n </span>is
|
|
negative; otherwise, the size of the array is the same as the internal size
|
|
of the vector.</dd></dl>
|
|
|
|
|
|
|
|
<!--l. 1295--><p class="noindent" >
|
|
<h5 class="subsubsectionHead"><span class="titlemark">3.3.6 </span> <a
|
|
id="x8-520003.3.6"></a>clone — Clone current object</h5>
|
|
|
|
|
|
|
|
<pre class="verbatim" id="verbatim-29">
|
|
call  x%clone(y,info)
|
|
</pre>
|
|
<!--l. 1299--><p class="nopar" >
|
|
<!--l. 1301--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1302--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">Type:</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1302--><p class="noindent" >Asynchronous.
|
|
</dd><dt class="description">
|
|
<!--l. 1303--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Entry</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1303--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1304--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">x</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1304--><p class="noindent" >the dense vector.<br
|
|
class="newline" />Scope: <span
|
|
class="pplb7t-">local</span>.<br
|
|
class="newline" /></dd></dl>
|
|
<!--l. 1311--><p class="indent" >
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1312--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">On Return</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1312--><p class="noindent" >
|
|
</dd><dt class="description">
|
|
<!--l. 1313--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">y</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1313--><p class="noindent" >A copy of the input object.
|
|
</dd><dt class="description">
|
|
<!--l. 1314--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">info</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1314--><p class="noindent" >Return code.</dd></dl>
|
|
|
|
|
|
|
|
<!--l. 1318--><p class="noindent" >
|
|
<h4 class="subsectionHead"><span class="titlemark">3.4 </span> <a
|
|
id="x8-530003.4"></a>Preconditioner data structure</h4>
|
|
<!--l. 1320--><p class="noindent" >Our base library offers support for simple well known preconditioners like Diagonal
|
|
Scaling or Block Jacobi with incomplete factorization ILU(0).
|
|
<!--l. 1324--><p class="indent" > A preconditioner is held in the <a
|
|
id="precdata"></a><span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_Tprec</span><span
|
|
class="cmtt-10">_type </span>data structure reported in
|
|
figure <a
|
|
href="#x8-53001r4">4<!--tex4ht:ref: fig:prectype --></a>. The <code class="lstinline"><span style="color:#000000">psb_Tprec_type</span></code> data type may contain a simple preconditioning
|
|
matrix with the associated communication descriptor. The internal preconditioner is
|
|
allocated appropriately with the dynamic type corresponding to the desired
|
|
preconditioner.
|
|
|
|
|
|
|
|
<!--l. 1343--><p class="indent" > <a
|
|
id="x8-53001r4"></a><hr class="float"><div class="float"
|
|
>
|
|
|
|
|
|
|
|
<div class="center"
|
|
>
|
|
<!--l. 1353--><p class="noindent" >
|
|
<div class="minipage"><pre class="verbatim" id="verbatim-30">
|
|
|
|
  type psb_Tprec_type
|
|
    class(psb_T_base_prec_type), allocatable :: prec
|
|
  end type psb_Tprec_type
|
|
|
|
</pre>
|
|
<!--l. 1361--><p class="nopar" > </div></div>
|
|
<br /> <div class="caption"
|
|
><span class="id">Listing 4: </span><span
|
|
class="content">The PSBLAS defined data type that contains a preconditioner.</span></div><!--tex4ht:label?: x8-53001r4 -->
|
|
|
|
|
|
|
|
</div><hr class="endfloat" />
|
|
<h4 class="subsectionHead"><span class="titlemark">3.5 </span> <a
|
|
id="x8-540003.5"></a>Heap data structure</h4>
|
|
<!--l. 1397--><p class="noindent" >Among the tools routines of sec. <a
|
|
href="userhtmlse6.html#x11-770006">6<!--tex4ht:ref: sec:toolsrout --></a>, we have a number of sorting utilities; the heap
|
|
sort is implemented in terms of heaps having the following signatures:
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1401--><p class="noindent" >
|
|
<span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_T</span><span
|
|
class="cmtt-10">_heap</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1401--><p class="noindent" >: a heap containing elements of type T, where T can be <code class="lstinline"><span style="color:#000000">i</span><span style="color:#000000">,</span><span style="color:#000000">s</span><span style="color:#000000">,</span><span style="color:#000000">c</span><span style="color:#000000">,</span><span style="color:#000000">d</span><span style="color:#000000">,</span><span style="color:#000000">z</span></code> for
|
|
integer, real and complex data;
|
|
</dd><dt class="description">
|
|
<!--l. 1403--><p class="noindent" >
|
|
<span
|
|
class="cmtt-10">psb</span><span
|
|
class="cmtt-10">_T</span><span
|
|
class="cmtt-10">_idx</span><span
|
|
class="cmtt-10">_heap</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1403--><p class="noindent" >: a heap containing elements of type T, as above, together with an integer
|
|
index.</dd></dl>
|
|
<!--l. 1406--><p class="noindent" >Given a heap object, the following methods are defined on it:
|
|
<dl class="description"><dt class="description">
|
|
<!--l. 1408--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">init</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1408--><p class="noindent" >Initialize memory; also choose ascending or descending order;
|
|
</dd><dt class="description">
|
|
<!--l. 1410--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">howmany</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1410--><p class="noindent" >Current heap occupancy;
|
|
</dd><dt class="description">
|
|
<!--l. 1411--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">insert</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1411--><p class="noindent" >Add an item (or an item and its index);
|
|
</dd><dt class="description">
|
|
<!--l. 1412--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">get</span><span
|
|
class="pplb7t-">_first</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1412--><p class="noindent" >Remove and return the first element;
|
|
</dd><dt class="description">
|
|
<!--l. 1413--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">dump</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1413--><p class="noindent" >Print on file;
|
|
|
|
|
|
|
|
</dd><dt class="description">
|
|
<!--l. 1414--><p class="noindent" >
|
|
<span
|
|
class="pplb7t-">free</span> </dt><dd
|
|
class="description">
|
|
<!--l. 1414--><p class="noindent" >Release memory.</dd></dl>
|
|
<!--l. 1416--><p class="noindent" >These objects are used to implement the factorization and approximate inversion
|
|
algorithms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--l. 1--><div class="crosslinks"><p class="noindent">[<a
|
|
href="userhtmlse7.html" >next</a>] [<a
|
|
href="userhtmlse2.html" >prev</a>] [<a
|
|
href="userhtmlse2.html#tailuserhtmlse2.html" >prev-tail</a>] [<a
|
|
href="userhtmlse3.html" >front</a>] [<a
|
|
href="userhtml.html#userhtmlse6.html" >up</a>] </p></div>
|
|
<!--l. 1--><p class="indent" > <a
|
|
id="tailuserhtmlse3.html"></a>
|
|
</body></html>
|