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.
amg4psblas/docs/html/userhtmlsu15.html

464 lines
22 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html >
<head><title>Auxiliary Methods</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)">
<meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)">
<!-- html,3 -->
<meta name="src" content="userhtml.tex">
<link rel="stylesheet" type="text/css" href="userhtml.css">
</head><body
>
<!--l. 887--><div class="crosslinks"><p class="noindent"><span
class="cmr-12">[</span><a
href="userhtmlsu14.html" ><span
class="cmr-12">prev</span></a><span
class="cmr-12">] [</span><a
href="userhtmlsu14.html#tailuserhtmlsu14.html" ><span
class="cmr-12">prev-tail</span></a><span
class="cmr-12">] [</span><a
href="#tailuserhtmlsu15.html"><span
class="cmr-12">tail</span></a><span
class="cmr-12">] [</span><a
href="userhtmlse5.html#userhtmlsu15.html" ><span
class="cmr-12">up</span></a><span
class="cmr-12">] </span></p></div>
<h4 class="subsectionHead"><span class="titlemark"><span
class="cmr-12">5.9 </span></span> <a
id="x25-240005.9"></a><span
class="cmr-12">Auxiliary Methods</span></h4>
<!--l. 888--><p class="noindent" ><span
class="cmr-12">Various functionalities are implemented as additional methods of the preconditioner</span>
<span
class="cmr-12">object.</span>
<!--l. 891--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmr-12">5.9.1 </span></span> <a
id="x25-250005.9.1"></a><span
class="cmr-12">Method: dump</span></h5>
<div class="center"
>
<!--l. 893--><p class="noindent" >
<!--l. 894--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">call</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">p</span><span
class="cmtt-12">%</span><span
class="cmtt-12">dump</span><span
class="cmtt-12">(</span><span
class="cmtt-12">info</span><span
class="cmtt-12">[,</span><span
class="cmtt-12">istart</span><span
class="cmtt-12">,</span><span
class="cmtt-12">iend</span><span
class="cmtt-12">,</span><span
class="cmtt-12">prefix</span><span
class="cmtt-12">,</span><span
class="cmtt-12">head</span><span
class="cmtt-12">,</span><span
class="cmtt-12">ac</span><span
class="cmtt-12">,</span><span
class="cmtt-12">rp</span><span
class="cmtt-12">,</span><span
class="cmtt-12">smoother</span><span
class="cmtt-12">,</span><span
class="cmtt-12">solver</span><span
class="cmtt-12">,</span><span
class="cmtt-12">global_num</span><span
class="cmtt-12">])</span><br />
</div>
<!--l. 897--><p class="noindent" ><span
class="cmr-12">Dump on file.</span>
<!--l. 900--><p class="noindent" ><span
class="cmbx-12">Arguments</span>
<div class="tabular"> <table id="TBL-17" class="tabular"
cellspacing="0" cellpadding="0"
><colgroup id="TBL-17-1g"><col
id="TBL-17-1"><col
id="TBL-17-2"></colgroup><tr
style="vertical-align:baseline;" id="TBL-17-1-"><td style="white-space:normal; text-align:left;" id="TBL-17-1-1"
class="td11"><!--l. 903--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-17-1-2"
class="td11"><!--l. 903--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">integer</span><span
class="cmtt-12">,</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">intent</span><span
class="cmtt-12">(</span><span
class="cmtt-12">out</span><span
class="cmtt-12">)</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-17-2-"><td style="white-space:normal; text-align:left;" id="TBL-17-2-1"
class="td11"><!--l. 904--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-17-2-2"
class="td11"><!--l. 904--><p class="noindent" ><span
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
class="cmr-12">&#x00A0;</span><a
href="userhtmlse7.html#x27-310007"><span
class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
class="cmr-12">for details.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-17-3-"><td style="white-space:normal; text-align:left;" id="TBL-17-3-1"
class="td11"><!--l. 905--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">amold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-17-3-2"
class="td11"><!--l. 905--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">class</span><span
class="cmtt-12">(</span><span
class="cmtt-12">psb_</span><span
class="cmti-12">x</span><span class="lstinline"></span><span
class="cmtt-12">_base_sparse_mat</span><span
class="cmtt-12">),</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">intent</span><span
class="cmtt-12">(</span><span
class="cmtt-12">in</span><span
class="cmtt-12">),</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">optional</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-17-4-"><td style="white-space:normal; text-align:left;" id="TBL-17-4-1"
class="td11"><!--l. 906--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-17-4-2"
class="td11"><!--l. 906--><p class="noindent" ><span
class="cmr-12">The desired dynamic type for internal matrix components; this</span>
<span
class="cmr-12">allows e.g. running on GPUs; it needs not be the same on all</span>
<span
class="cmr-12">processes. See the PSBLAS User&#8217;s Guide for details </span><span class="cite"><span
class="cmr-12">[</span><a
href="userhtmlli5.html#XPSBLASGUIDE"><span
class="cmr-12">20</span></a><span
class="cmr-12">]</span></span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-17-5-"><td style="white-space:normal; text-align:left;" id="TBL-17-5-1"
class="td11"> </td> </tr></table></div>
<!--l. 913--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmr-12">5.9.2 </span></span> <a
id="x25-260005.9.2"></a><span
class="cmr-12">Method: clone</span></h5>
<div class="center"
>
<!--l. 915--><p class="noindent" >
<!--l. 916--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">call</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">p</span><span
class="cmtt-12">%</span><span
class="cmtt-12">clone</span><span
class="cmtt-12">(</span><span
class="cmtt-12">pout</span><span
class="cmtt-12">,</span><span
class="cmtt-12">info</span><span
class="cmtt-12">)</span><br />
</div>
<!--l. 919--><p class="noindent" ><span
class="cmr-12">Create a (deep) copy of the preconditioner object.</span>
<!--l. 922--><p class="noindent" ><span
class="cmbx-12">Arguments</span>
<div class="tabular"> <table id="TBL-18" class="tabular"
cellspacing="0" cellpadding="0"
><colgroup id="TBL-18-1g"><col
id="TBL-18-1"><col
id="TBL-18-2"></colgroup><tr
style="vertical-align:baseline;" id="TBL-18-1-"><td style="white-space:normal; text-align:left;" id="TBL-18-1-1"
class="td11"><!--l. 925--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">pout</span> </td><td style="white-space:normal; text-align:left;" id="TBL-18-1-2"
class="td11"><!--l. 925--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">type</span><span
class="cmtt-12">(</span><span
class="cmtt-12">amg_</span><span
class="cmti-12">x</span><span class="lstinline"></span><span
class="cmtt-12">prec_type</span><span
class="cmtt-12">),</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">intent</span><span
class="cmtt-12">(</span><span
class="cmtt-12">out</span><span
class="cmtt-12">)</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-18-2-"><td style="white-space:normal; text-align:left;" id="TBL-18-2-1"
class="td11"><!--l. 926--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-18-2-2"
class="td11"><!--l. 926--><p class="noindent" ><span
class="cmr-12">The copy of the preconditioner data structure. Note that </span><span
class="cmti-12">x </span><span
class="cmr-12">must</span>
<span
class="cmr-12">be chosen according to the </span><span class="lstinline"></span><span
class="cmtt-12">real</span><span
class="cmr-12">/</span><span class="lstinline"></span><span
class="cmtt-12">complex</span><span
class="cmr-12">, single/double precision</span>
<span
class="cmr-12">version of AMG4PSBLAS under use.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-18-3-"><td style="white-space:normal; text-align:left;" id="TBL-18-3-1"
class="td11"><!--l. 929--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-18-3-2"
class="td11"><!--l. 929--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">integer</span><span
class="cmtt-12">,</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">intent</span><span
class="cmtt-12">(</span><span
class="cmtt-12">out</span><span
class="cmtt-12">)</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-18-4-"><td style="white-space:normal; text-align:left;" id="TBL-18-4-1"
class="td11"><!--l. 930--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-18-4-2"
class="td11"><!--l. 930--><p class="noindent" ><span
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
class="cmr-12">&#x00A0;</span><a
href="userhtmlse7.html#x27-310007"><span
class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
class="cmr-12">for details.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-18-5-"><td style="white-space:normal; text-align:left;" id="TBL-18-5-1"
class="td11"> </td> </tr></table></div>
<!--l. 935--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmr-12">5.9.3 </span></span> <a
id="x25-270005.9.3"></a><span
class="cmr-12">Method: sizeof</span></h5>
<div class="center"
>
<!--l. 937--><p class="noindent" >
<!--l. 938--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">sz</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">=</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">p</span><span
class="cmtt-12">%</span><span
class="cmtt-12">sizeof</span><span
class="cmtt-12">([</span><span
class="cmtt-12">global</span><span
class="cmtt-12">])</span><br />
</div>
<div class="tabular"> <table id="TBL-19" class="tabular"
cellspacing="0" cellpadding="0"
><colgroup id="TBL-19-1g"><col
id="TBL-19-1"><col
id="TBL-19-2"></colgroup><tr
style="vertical-align:baseline;" id="TBL-19-1-"><td style="white-space:normal; text-align:left;" id="TBL-19-1-1"
class="td11"><!--l. 942--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">global</span> </td> <td style="white-space:normal; text-align:left;" id="TBL-19-1-2"
class="td11"><!--l. 942--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">logical</span><span
class="cmtt-12">,</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">optional</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-19-2-"><td style="white-space:normal; text-align:left;" id="TBL-19-2-1"
class="td11"><!--l. 943--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-19-2-2"
class="td11"><!--l. 943--><p class="noindent" ><span
class="cmr-12">Whether the global or local preconditioner memory occupation is</span>
<span
class="cmr-12">desired. Default: </span><span class="lstinline"></span><span
class="cmtt-12">.</span><span
class="cmtt-12">false</span><span
class="cmtt-12">.</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-19-3-"><td style="white-space:normal; text-align:left;" id="TBL-19-3-1"
class="td11"> </td> </tr></table>
</div> <span
class="cmr-12">Return memory footprint in bytes.</span>
<!--l. 950--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmr-12">5.9.4 </span></span> <a
id="x25-280005.9.4"></a><span
class="cmr-12">Method: allocate</span><span
class="cmr-12">_wrk</span></h5>
<div class="center"
>
<!--l. 952--><p class="noindent" >
<!--l. 953--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">call</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">p</span><span
class="cmtt-12">%</span><span
class="cmtt-12">allocate_wrk</span><span
class="cmtt-12">(</span><span
class="cmtt-12">info</span><span
class="cmtt-12">[,</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">vmold</span><span
class="cmtt-12">])</span><br />
</div>
<!--l. 956--><p class="noindent" ><span
class="cmr-12">Allocate internal work vectors. Each application of the preconditioner uses a number of</span>
<span
class="cmr-12">work vectors which are allocated internally as necessary; therefore allocation and</span>
<span
class="cmr-12">deallocation of memory occurs multiple times during the execution of a Krylov method.</span>
<span
class="cmr-12">In most cases this strategy is perfectly acceptable, but on some platforms, most</span>
<span
class="cmr-12">notably GPUs, memory allocation is a slow operation, and the default behaviour would</span>
<span
class="cmr-12">lead to a slowdown. This method allows to trade space for time by preallocating</span>
<span
class="cmr-12">the internal workspace outside of the invocation of a Krylov method. When</span>
<span
class="cmr-12">using GPUs or other specialized devices, the </span><span class="lstinline"></span><span
class="cmtt-12">vmold</span> <span
class="cmr-12">argument is also necessary</span>
<span
class="cmr-12">to ensure the internal work vectors are of the appropriate dynamic type to</span>
<span
class="cmr-12">exploit the accelerator hardware; when allocation occurs internally this is</span>
<span
class="cmr-12">taken care of based on the dynamic type of the </span><span class="lstinline"></span><span
class="cmtt-12">x</span> <span
class="cmr-12">argument to the </span><span class="lstinline"></span><span
class="cmtt-12">apply</span>
<span
class="cmr-12">method.</span>
<!--l. 972--><p class="noindent" ><span
class="cmbx-12">Arguments</span>
<div class="tabular"> <table id="TBL-20" class="tabular"
cellspacing="0" cellpadding="0"
><colgroup id="TBL-20-1g"><col
id="TBL-20-1"><col
id="TBL-20-2"></colgroup><tr
style="vertical-align:baseline;" id="TBL-20-1-"><td style="white-space:normal; text-align:left;" id="TBL-20-1-1"
class="td11"><!--l. 975--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-20-1-2"
class="td11"><!--l. 975--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">integer</span><span
class="cmtt-12">,</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">intent</span><span
class="cmtt-12">(</span><span
class="cmtt-12">out</span><span
class="cmtt-12">)</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-20-2-"><td style="white-space:normal; text-align:left;" id="TBL-20-2-1"
class="td11"><!--l. 976--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-20-2-2"
class="td11"><!--l. 976--><p class="noindent" ><span
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
class="cmr-12">&#x00A0;</span><a
href="userhtmlse7.html#x27-310007"><span
class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
class="cmr-12">for details.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-20-3-"><td style="white-space:normal; text-align:left;" id="TBL-20-3-1"
class="td11"><!--l. 977--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">vmold</span> </td><td style="white-space:normal; text-align:left;" id="TBL-20-3-2"
class="td11"><!--l. 977--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">class</span><span
class="cmtt-12">(</span><span
class="cmtt-12">psb_</span><span
class="cmti-12">x</span><span class="lstinline"></span><span
class="cmtt-12">_base_vect_type</span><span
class="cmtt-12">),</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">intent</span><span
class="cmtt-12">(</span><span
class="cmtt-12">in</span><span
class="cmtt-12">),</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">optional</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-20-4-"><td style="white-space:normal; text-align:left;" id="TBL-20-4-1"
class="td11"><!--l. 978--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-20-4-2"
class="td11"><!--l. 978--><p class="noindent" ><span
class="cmr-12">The desired dynamic type for internal vector components; this</span>
<span
class="cmr-12">allows e.g. running on GPUs.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-20-5-"><td style="white-space:normal; text-align:left;" id="TBL-20-5-1"
class="td11"> </td> </tr></table></div>
<!--l. 984--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmr-12">5.9.5 </span></span> <a
id="x25-290005.9.5"></a><span
class="cmr-12">Method: free</span><span
class="cmr-12">_wrk</span></h5>
<div class="center"
>
<!--l. 986--><p class="noindent" >
<!--l. 987--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">call</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">p</span><span
class="cmtt-12">%</span><span
class="cmtt-12">free_wrk</span><span
class="cmtt-12">(</span><span
class="cmtt-12">info</span><span
class="cmtt-12">)</span><br />
</div>
<!--l. 990--><p class="noindent" ><span
class="cmr-12">Deallocate internal work vectors.</span>
<!--l. 993--><p class="noindent" ><span
class="cmbx-12">Arguments</span>
<div class="tabular"> <table id="TBL-21" class="tabular"
cellspacing="0" cellpadding="0"
><colgroup id="TBL-21-1g"><col
id="TBL-21-1"><col
id="TBL-21-2"></colgroup><tr
style="vertical-align:baseline;" id="TBL-21-1-"><td style="white-space:normal; text-align:left;" id="TBL-21-1-1"
class="td11"><!--l. 996--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">info</span> </td><td style="white-space:normal; text-align:left;" id="TBL-21-1-2"
class="td11"><!--l. 996--><p class="noindent" ><span class="lstinline"></span><span
class="cmtt-12">integer</span><span
class="cmtt-12">,</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">intent</span><span
class="cmtt-12">(</span><span
class="cmtt-12">out</span><span
class="cmtt-12">)</span><span
class="cmr-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-21-2-"><td style="white-space:normal; text-align:left;" id="TBL-21-2-1"
class="td11"><!--l. 997--><p class="noindent" > </td><td style="white-space:normal; text-align:left;" id="TBL-21-2-2"
class="td11"><!--l. 997--><p class="noindent" ><span
class="cmr-12">Error code. If no error, 0 is returned. See Section</span><span
class="cmr-12">&#x00A0;</span><a
href="userhtmlse7.html#x27-310007"><span
class="cmr-12">7</span><!--tex4ht:ref: sec:errors --></a> <span
class="cmr-12">for details.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-21-3-"><td style="white-space:normal; text-align:left;" id="TBL-21-3-1"
class="td11"> </td> </tr></table></div>
<!--l. 4--><div class="crosslinks"><p class="noindent"><span
class="cmr-12">[</span><a
href="userhtmlsu14.html" ><span
class="cmr-12">prev</span></a><span
class="cmr-12">] [</span><a
href="userhtmlsu14.html#tailuserhtmlsu14.html" ><span
class="cmr-12">prev-tail</span></a><span
class="cmr-12">] [</span><a
href="userhtmlsu15.html" ><span
class="cmr-12">front</span></a><span
class="cmr-12">] [</span><a
href="userhtmlse5.html#userhtmlsu15.html" ><span
class="cmr-12">up</span></a><span
class="cmr-12">] </span></p></div>
<!--l. 4--><p class="indent" > <a
id="tailuserhtmlsu15.html"></a>
</body></html>