New docs, merged comments from Daniela, updated PDF.

This commit is contained in:
Salvatore Filippone
2017-07-17 15:39:18 +01:00
parent 6097a8fbb6
commit 38df8fac57
126 changed files with 3778 additions and 4197 deletions
+26 -110
View File
@@ -7,8 +7,8 @@ original version by: Nikos Drakos, CBLU, University of Leeds
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Adding new smoothers and solvers to MLD2P4</TITLE>
<META NAME="description" CONTENT="Adding new smoothers and solvers to MLD2P4">
<TITLE>Error Handling</TITLE>
<META NAME="description" CONTENT="Error Handling">
<META NAME="keywords" CONTENT="userhtml">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
@@ -26,137 +26,53 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html369"
<A NAME="tex2html367"
HREF="node25.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html365"
<A NAME="tex2html363"
HREF="userhtml.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html359"
<A NAME="tex2html357"
HREF="node23.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html367"
<A NAME="tex2html365"
HREF="node2.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html370"
HREF="node25.html">Error Handling</A>
<B> Up:</B> <A NAME="tex2html366"
<B> Next:</B> <A NAME="tex2html368"
HREF="node25.html">License</A>
<B> Up:</B> <A NAME="tex2html364"
HREF="userhtml.html">userhtml</A>
<B> Previous:</B> <A NAME="tex2html360"
<B> Previous:</B> <A NAME="tex2html358"
HREF="node23.html">Subroutine descr</A>
&nbsp; <B> <A NAME="tex2html368"
&nbsp; <B> <A NAME="tex2html366"
HREF="node2.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION00090000000000000000"></A><A NAME="sec:adding"></A>
<H1><A NAME="SECTION00090000000000000000"></A><A NAME="sec:errors"></A>
<BR>
Adding new smoothers and solvers to MLD2P4
Error Handling
</H1>
<P>
Developers can add completely new smoother and/or solver classes
derived from the base objects in the library may be used without
recompiling the library itself.
The error handling in MLD2P4 is based on the PSBLAS (version 2) error
handling. Error conditions are signaled via an integer argument
<code>info</code>; whenever an error condition is detected, an error trace
stack is built by the library up to the top-level, user-callable
routine. This routine will then decide, according to the user
preferences, whether the error should be handled by terminating the
program or by returning the error condition to the user code, which
will then take action, and whether
an error message should be printed. These options may be set by using
the PSBLAS error handling routines; for further details see the PSBLAS
User's Guide [<A
HREF="node26.html#PSBLASGUIDE">13</A>].
<P>
To do so it is necessary first to select the base type to be extended;
in our experience, it is quite likely that the new application needs
only require the definition of a ``solver'' object, which is almost
always acting only on the local part of the distributed matrix.
<P>
The parallel actions required to connect the various solver objects
are most often already provided by the Block Jacobi or the Additive
Schwarz smoothers. To define a new solver, the developer will then
have to define its components and methods, perhaps taking one of the
predefined solvers as a starting point if possible.
<P>
Once the new smoother/solver class has been developed, to use it in
the context of the multilevel preconditioners it is necessary to:
<UL>
<LI>Declare in the application program a variable of the new type;
</LI>
<LI>Pass that variable as the argument to the se routine as in the
following:
<DIV ALIGN="CENTER">
<code>call p%set(smoother,info [,ilev, ilmax,pos])</code>
<BR><code>call p%set(solver,info [,ilev, ilmax,pos])</code>
</DIV>
</LI>
<LI>Link into the application executable the code implementing the
various methods.
</LI>
</UL>
The new solver object is then dynamically included in the
preconditioner structure, and will act as a <I>mold</I> to which the
preconditioner will conform, even though the MLD2P4 library has not
been modified to account for this new development.
<P>
It is possible to define new values for the keyword <code>WHAT</code> in the
<code>set</code> routines; if the library code does not recognize a keyword,
it passes it down the composition hierarchy (levels containing
smoothers containing solvers), so that it can be eventually caught by
the new solver.
<P>
An example is contained in the source code distribution under the
folder <code>tests/newslv</code>. This example solver is simply the ILU(0)
solver under a new name, but it should give an idea of what needs to
be done.
<P>
<BR>
<P>
<TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=34><code>smoother</code></TD>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=340><code>class(mld_x_base_smoother_type)</code></TD>
</TR>
<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=34>&nbsp;</TD>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=340>The user-defined new smoother to be employed in the
preconditioner.</TD>
</TR>
<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=34><code>solver</code></TD>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=340><code>class(mld_x_base_solver_type)</code></TD>
</TR>
<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=34>&nbsp;</TD>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=340>The user-defined new solver to be employed in the
preconditioner.</TD>
</TR>
</TABLE>
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html369"
HREF="node25.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html365"
HREF="userhtml.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html359"
HREF="node23.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html367"
HREF="node2.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html370"
HREF="node25.html">Error Handling</A>
<B> Up:</B> <A NAME="tex2html366"
HREF="userhtml.html">userhtml</A>
<B> Previous:</B> <A NAME="tex2html360"
HREF="node23.html">Subroutine descr</A>
&nbsp; <B> <A NAME="tex2html368"
HREF="node2.html">Contents</A></B>
<!--End of Navigation Panel-->
<BR><HR>
</BODY>
</HTML>