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/userhtmlsu18.html

350 lines
18 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. 805--><div class="crosslinks"><p class="noindent"><span
class="cmbx-12">[</span><a
href="userhtmlsu17.html" ><span
class="cmbx-12">prev</span></a><span
class="cmbx-12">] [</span><a
href="userhtmlsu17.html#tailuserhtmlsu17.html" ><span
class="cmbx-12">prev-tail</span></a><span
class="cmbx-12">] [</span><a
href="#tailuserhtmlsu18.html"><span
class="cmbx-12">tail</span></a><span
class="cmbx-12">] [</span><a
href="userhtmlse6.html#userhtmlsu18.html" ><span
class="cmbx-12">up</span></a><span
class="cmbx-12">] </span></p></div>
<h4 class="subsectionHead"><span class="titlemark"><span
class="cmbx-12">6.9 </span></span> <a
id="x28-270006.9"></a><span
class="cmbx-12">Auxiliary Methods</span></h4>
<!--l. 806--><p class="noindent" ><span
class="cmbx-12">Various functionalities are implemented as additional methods of the</span>
<span
class="cmbx-12">preconditioner object.</span>
<!--l. 809--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmbx-12">6.9.1 </span></span> <a
id="x28-280006.9.1"></a><span
class="cmbx-12">Method: dump</span></h5>
<div class="center"
>
<!--l. 811--><p class="noindent" >
<!--l. 812--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">call</span><span
class="cmtt-12">&#x00A0;p%dump(info[,istart,iend,prefix,head,ac,rp,smoother,solver,global_num])</span></span></span><br />
</div>
<!--l. 815--><p class="noindent" ><span
class="cmbx-12">Dump on file.</span>
<!--l. 818--><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:wrap; text-align:left;" id="TBL-17-1-1"
class="td11"><!--l. 821--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">info</span></span></span> </td><td style="white-space:wrap; text-align:left;" id="TBL-17-1-2"
class="td11"><!--l. 821--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">integer,</span><span
class="cmtt-12">&#x00A0;intent(out)</span></span></span><span
class="cmbx-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-17-2-"><td style="white-space:wrap; text-align:left;" id="TBL-17-2-1"
class="td11"><!--l. 822--><p class="noindent" > </td><td style="white-space:wrap; text-align:left;" id="TBL-17-2-2"
class="td11"><!--l. 822--><p class="noindent" ><span
class="cmbx-12">Error code. If no error, 0 is returned. See Section</span><span
class="cmbx-12">&#x00A0;</span><a
href="userhtmlse8.html#x30-340008"><span
class="cmbx-12">8</span><!--tex4ht:ref: sec:errors --></a> <span
class="cmbx-12">for</span>
<span
class="cmbx-12">details.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-17-3-"><td style="white-space:wrap; text-align:left;" id="TBL-17-3-1"
class="td11"><!--l. 823--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">amold</span></span></span> </td><td style="white-space:wrap; text-align:left;" id="TBL-17-3-2"
class="td11"><!--l. 823--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">class(psb_</span></span></span><span
class="cmbxti-10x-x-120">x</span><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">_base_sparse_mat),</span><span
class="cmtt-12">&#x00A0;intent(in),</span><span
class="cmtt-12">&#x00A0;optional</span></span></span><span
class="cmbx-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-17-4-"><td style="white-space:wrap; text-align:left;" id="TBL-17-4-1"
class="td11"><!--l. 824--><p class="noindent" > </td><td style="white-space:wrap; text-align:left;" id="TBL-17-4-2"
class="td11"><!--l. 824--><p class="noindent" ><span
class="cmbx-12">The desired dynamic type for internal matrix components;</span>
<span
class="cmbx-12">this allows e.g. running on GPUs; it needs not be the same</span>
<span
class="cmbx-12">on all processes. See the PSBLAS User&#8217;s Guide for details</span>
<span class="cite"><span
class="cmbx-12">[</span><a
href="userhtmlli4.html#XPSBLASGUIDE"><span
class="cmbx-12">15</span></a><span
class="cmbx-12">]</span></span><span
class="cmbx-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-17-5-"><td style="white-space:wrap; text-align:left;" id="TBL-17-5-1"
class="td11"> </td> </tr></table></div>
<!--l. 831--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmbx-12">6.9.2 </span></span> <a
id="x28-290006.9.2"></a><span
class="cmbx-12">Method: clone</span></h5>
<div class="center"
>
<!--l. 833--><p class="noindent" >
<!--l. 834--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">call</span><span
class="cmtt-12">&#x00A0;p%clone(pout,info)</span></span></span><br />
</div>
<!--l. 837--><p class="noindent" ><span
class="cmbx-12">Create a (deep) copy of the preconditioner object.</span>
<!--l. 840--><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:wrap; text-align:left;" id="TBL-18-1-1"
class="td11"><!--l. 843--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">pout</span></span></span> </td><td style="white-space:wrap; text-align:left;" id="TBL-18-1-2"
class="td11"><!--l. 843--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">type(amg_</span></span></span><span
class="cmbxti-10x-x-120">x</span><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">prec_type),</span><span
class="cmtt-12">&#x00A0;intent(out)</span></span></span><span
class="cmbx-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-18-2-"><td style="white-space:wrap; text-align:left;" id="TBL-18-2-1"
class="td11"><!--l. 844--><p class="noindent" > </td><td style="white-space:wrap; text-align:left;" id="TBL-18-2-2"
class="td11"><!--l. 844--><p class="noindent" ><span
class="cmbx-12">The copy of the preconditioner data structure. Note</span>
<span
class="cmbx-12">that </span><span
class="cmbxti-10x-x-120">x </span><span
class="cmbx-12">must be chosen according to the real/complex,</span>
<span
class="cmbx-12">single/double precision version of MLD2P4 under use.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-18-3-"><td style="white-space:wrap; text-align:left;" id="TBL-18-3-1"
class="td11"><!--l. 847--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">info</span></span></span> </td><td style="white-space:wrap; text-align:left;" id="TBL-18-3-2"
class="td11"><!--l. 847--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">integer,</span><span
class="cmtt-12">&#x00A0;intent(out)</span></span></span><span
class="cmbx-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-18-4-"><td style="white-space:wrap; text-align:left;" id="TBL-18-4-1"
class="td11"><!--l. 848--><p class="noindent" > </td><td style="white-space:wrap; text-align:left;" id="TBL-18-4-2"
class="td11"><!--l. 848--><p class="noindent" ><span
class="cmbx-12">Error code. If no error, 0 is returned. See Section</span><span
class="cmbx-12">&#x00A0;</span><a
href="userhtmlse8.html#x30-340008"><span
class="cmbx-12">8</span><!--tex4ht:ref: sec:errors --></a> <span
class="cmbx-12">for</span>
<span
class="cmbx-12">details.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-18-5-"><td style="white-space:wrap; text-align:left;" id="TBL-18-5-1"
class="td11"> </td> </tr></table></div>
<!--l. 853--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmbx-12">6.9.3 </span></span> <a
id="x28-300006.9.3"></a><span
class="cmbx-12">Method: sizeof</span></h5>
<div class="center"
>
<!--l. 855--><p class="noindent" >
<!--l. 856--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">sz</span><span
class="cmtt-12">&#x00A0;=</span><span
class="cmtt-12">&#x00A0;</span><span
class="cmtt-12">&#x00A0;p%sizeof()</span></span></span><br />
</div>
<!--l. 859--><p class="noindent" ><span
class="cmbx-12">Return memory footprint in bytes.</span>
<!--l. 862--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmbx-12">6.9.4 </span></span> <a
id="x28-310006.9.4"></a><span
class="cmbx-12">Method: allocate</span><span
class="cmbx-12">_wrk</span></h5>
<div class="center"
>
<!--l. 864--><p class="noindent" >
<!--l. 865--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">call</span><span
class="cmtt-12">&#x00A0;p%allocate_wrk(info[,</span><span
class="cmtt-12">&#x00A0;vmold])</span></span></span><br />
</div>
<!--l. 868--><p class="noindent" ><span
class="cmbx-12">Allocate internal work vectors. Each application of the preconditioner</span>
<span
class="cmbx-12">uses a number of work vectors which are allocated internally as</span>
<span
class="cmbx-12">necessary; therefore allocation and deallocation of memory occurs</span>
<span
class="cmbx-12">multiple times during the execution of a Krylov method. In most cases</span>
<span
class="cmbx-12">this strategy is perfectly acceptable, but on some platforms, most</span>
<span
class="cmbx-12">notably GPUs, memory allocation is a slow operation, and the default</span>
<span
class="cmbx-12">behaviour would lead to a slowdown. This method allows to trade</span>
<span
class="cmbx-12">space for time by preallocating the internal workspace outside of the</span>
<span
class="cmbx-12">invocation of a Krylov method. When using GPUs or other specialized</span>
<span
class="cmbx-12">devices, the </span><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">vmold</span></span></span> <span
class="cmbx-12">argument is also necessary to ensure the internal</span>
<span
class="cmbx-12">work vectors are of the appropriate dynamic type to exploit the</span>
<span
class="cmbx-12">accelerator hardware; when allocation occurs internally this is taken</span>
<span
class="cmbx-12">care of based on the dynamic type of the </span><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">x</span></span></span> <span
class="cmbx-12">argument to the </span><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">apply</span></span></span>
<span
class="cmbx-12">method.</span>
<!--l. 884--><p class="noindent" ><span
class="cmbx-12">Arguments</span>
<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:wrap; text-align:left;" id="TBL-19-1-1"
class="td11"><!--l. 887--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">info</span></span></span> </td><td style="white-space:wrap; text-align:left;" id="TBL-19-1-2"
class="td11"><!--l. 887--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">integer,</span><span
class="cmtt-12">&#x00A0;intent(out)</span></span></span><span
class="cmbx-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-19-2-"><td style="white-space:wrap; text-align:left;" id="TBL-19-2-1"
class="td11"><!--l. 888--><p class="noindent" > </td><td style="white-space:wrap; text-align:left;" id="TBL-19-2-2"
class="td11"><!--l. 888--><p class="noindent" ><span
class="cmbx-12">Error code. If no error, 0 is returned. See Section</span><span
class="cmbx-12">&#x00A0;</span><a
href="userhtmlse8.html#x30-340008"><span
class="cmbx-12">8</span><!--tex4ht:ref: sec:errors --></a> <span
class="cmbx-12">for</span>
<span
class="cmbx-12">details.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-19-3-"><td style="white-space:wrap; text-align:left;" id="TBL-19-3-1"
class="td11"><!--l. 889--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">vmold</span></span></span> </td><td style="white-space:wrap; text-align:left;" id="TBL-19-3-2"
class="td11"><!--l. 889--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">class(psb_</span></span></span><span
class="cmbxti-10x-x-120">x</span><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">_base_vect_type),</span><span
class="cmtt-12">&#x00A0;intent(in),</span><span
class="cmtt-12">&#x00A0;optional</span></span></span><span
class="cmbx-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-19-4-"><td style="white-space:wrap; text-align:left;" id="TBL-19-4-1"
class="td11"><!--l. 890--><p class="noindent" > </td><td style="white-space:wrap; text-align:left;" id="TBL-19-4-2"
class="td11"><!--l. 890--><p class="noindent" ><span
class="cmbx-12">The desired dynamic type for internal vector components;</span>
<span
class="cmbx-12">this allows e.g. running on GPUs.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-19-5-"><td style="white-space:wrap; text-align:left;" id="TBL-19-5-1"
class="td11"> </td> </tr></table></div>
<!--l. 896--><p class="noindent" >
<h5 class="subsubsectionHead"><span class="titlemark"><span
class="cmbx-12">6.9.5 </span></span> <a
id="x28-320006.9.5"></a><span
class="cmbx-12">Method: free</span><span
class="cmbx-12">_wrk</span></h5>
<div class="center"
>
<!--l. 898--><p class="noindent" >
<!--l. 899--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">call</span><span
class="cmtt-12">&#x00A0;p%free_wrk(info)</span></span></span><br />
</div>
<!--l. 902--><p class="noindent" ><span
class="cmbx-12">Deallocate internal work vectors.</span>
<!--l. 905--><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:wrap; text-align:left;" id="TBL-20-1-1"
class="td11"><!--l. 908--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">info</span></span></span> </td><td style="white-space:wrap; text-align:left;" id="TBL-20-1-2"
class="td11"><!--l. 908--><p class="noindent" ><span class="obeylines-h"><span class="verb"><span
class="cmtt-12">integer,</span><span
class="cmtt-12">&#x00A0;intent(out)</span></span></span><span
class="cmbx-12">.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-20-2-"><td style="white-space:wrap; text-align:left;" id="TBL-20-2-1"
class="td11"><!--l. 909--><p class="noindent" > </td><td style="white-space:wrap; text-align:left;" id="TBL-20-2-2"
class="td11"><!--l. 909--><p class="noindent" ><span
class="cmbx-12">Error code. If no error, 0 is returned. See Section</span><span
class="cmbx-12">&#x00A0;</span><a
href="userhtmlse8.html#x30-340008"><span
class="cmbx-12">8</span><!--tex4ht:ref: sec:errors --></a> <span
class="cmbx-12">for</span>
<span
class="cmbx-12">details.</span> </td>
</tr><tr
style="vertical-align:baseline;" id="TBL-20-3-"><td style="white-space:wrap; text-align:left;" id="TBL-20-3-1"
class="td11"> </td> </tr></table></div>
<!--l. 4--><div class="crosslinks"><p class="noindent"><span
class="cmbx-12">[</span><a
href="userhtmlsu17.html" ><span
class="cmbx-12">prev</span></a><span
class="cmbx-12">] [</span><a
href="userhtmlsu17.html#tailuserhtmlsu17.html" ><span
class="cmbx-12">prev-tail</span></a><span
class="cmbx-12">] [</span><a
href="userhtmlsu18.html" ><span
class="cmbx-12">front</span></a><span
class="cmbx-12">] [</span><a
href="userhtmlse6.html#userhtmlsu18.html" ><span
class="cmbx-12">up</span></a><span
class="cmbx-12">] </span></p></div>
<!--l. 4--><p class="indent" > <a
id="tailuserhtmlsu18.html"></a>
</body></html>