/[escript]/trunk/paso/src/Options.h
ViewVC logotype

Annotation of /trunk/paso/src/Options.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6799 - (hide annotations)
Mon Mar 25 05:53:58 2019 UTC (5 months, 4 weeks ago) by aellery
File MIME type: text/plain
File size: 4107 byte(s)
I have rewritten the solverbuddy. Briefly:

1. The remaining AMG code has been removed from PASO.
2. If Trilinos is available, escript will now use it by default.
3. eScript will use a direct solver by default, (if one is available,) when solving 2 dimensional problems and an iterative solver, by default, when solving 3 dimensional problems. This can be changed by a user by manually specifying which solver to use.
4. There is a new option available, setHermitian(), that allows a user to specify when a coefficient matrix is Hermitian.
5. Symmetry information is always passed onto the Trilinos solver when this information is relevant.
6. All tests have been updated, when relevant, to reflect these changes.
7. I fixed a couple of undocumented bugs.


1 ksteube 1312
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 jfenwick 6651 * Copyright (c) 2003-2018 by The University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
7     * Primary Business: Queensland, Australia
8 jfenwick 6112 * Licensed under the Apache License, version 2.0
9     * http://www.apache.org/licenses/LICENSE-2.0
10 ksteube 1811 *
11 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 * Development 2012-2013 by School of Earth Sciences
13     * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 jfenwick 3981 *
15     *****************************************************************************/
16 dhawcroft 631
17 ksteube 1811
18 caltinay 4846 /****************************************************************************/
19 jgs 150
20 caltinay 3642 /* Paso: Options */
21 jgs 150
22 caltinay 4846 /****************************************************************************/
23 jgs 150
24     /* Copyrights by ACcESS Australia 2003,2004,2005 */
25 jfenwick 2608 /* Author: Lutz Gross, l.gross@uq.edu.au */
26 jgs 150
27 caltinay 4846 /****************************************************************************/
28 jgs 150
29 caltinay 4846 #ifndef __PASO_OPTIONS_H__
30     #define __PASO_OPTIONS_H__
31 jgs 150
32 caltinay 5948 #include "Paso.h"
33 gross 2315
34 caltinay 5929 #include <boost/python/object.hpp>
35    
36 caltinay 4846 // valid solver options
37 jgs 150 #define PASO_DEFAULT 0
38     #define PASO_DIRECT 1
39     #define PASO_CHOLEVSKY 2
40     #define PASO_PCG 3
41     #define PASO_CR 4
42     #define PASO_CGS 5
43     #define PASO_BICGSTAB 6
44     #define PASO_ILU0 8
45     #define PASO_ILUT 9
46     #define PASO_JACOBI 10
47     #define PASO_GMRES 11
48     #define PASO_PRES20 12
49 caltinay 4846 #define PASO_MKL 15
50     #define PASO_UMFPACK 16
51 jgs 150 #define PASO_NO_REORDERING 17
52     #define PASO_MINIMUM_FILL_IN 18
53     #define PASO_NESTED_DISSECTION 19
54     #define PASO_ITERATIVE 20
55     #define PASO_PASO 21
56 gross 2474 #define PASO_REC_ILU 23
57     #define PASO_TRILINOS 24
58     #define PASO_NONLINEAR_GMRES 25
59     #define PASO_TFQMR 26
60     #define PASO_MINRES 27
61     #define PASO_GAUSS_SEIDEL 28
62     #define PASO_GS PASO_GAUSS_SEIDEL
63     #define PASO_RILU 29
64     #define PASO_DEFAULT_REORDERING 30
65     #define PASO_NO_PRECONDITIONER 36
66 gross 3440 #define PASO_CLASSIC_INTERPOLATION_WITH_FF_COUPLING 50
67     #define PASO_CLASSIC_INTERPOLATION 51
68     #define PASO_DIRECT_INTERPOLATION 52
69 gross 3650 #define PASO_LINEAR_CRANK_NICOLSON 66
70     #define PASO_CRANK_NICOLSON 67
71     #define PASO_BACKWARD_EULER 68
72 gross 3283
73 caltinay 4846 #define PASO_SMOOTHER 99999999
74 gross 3440
75 caltinay 4846 namespace paso {
76 gross 3650
77 caltinay 4846 struct Options
78     {
79     Options() { setDefaults(); }
80 gross 3283
81 caltinay 5929 /// constructor that fills values from an escript SolverBuddy instance
82     Options(const boost::python::object& options);
83    
84 caltinay 4846 /// sets the default values for solver options
85     void setDefaults();
86    
87     /// prints current option values
88     void show() const;
89    
90     /// prints diagnostic data
91     void showDiagnostics() const;
92    
93 caltinay 5929 /// updates SolverBuddy diagnostics from this
94     void updateEscriptDiagnostics(boost::python::object& options) const;
95    
96     /// returns the corresponding paso option code for an escript option code
97     static int mapEscriptOption(int escriptOption);
98    
99 caltinay 5179 static const char* name(int key);
100 caltinay 4846
101 caltinay 5179 static int getPackage(int solver, int package, bool symmetry,
102 caltinay 5997 const escript::JMPI& mpi_info);
103 caltinay 4846
104     /// returns the solver to be used with given combination
105 caltinay 5179 static int getSolver(int solver, int package, bool symmetry,
106 caltinay 5997 const escript::JMPI& mpi_info);
107 caltinay 4846
108 caltinay 5179 int method;
109     int package;
110 jfenwick 4521 bool symmetric;
111 aellery 6799 bool hermitian;
112 jgs 150 double tolerance;
113 gross 1476 double absolute_tolerance;
114     double inner_tolerance;
115 jfenwick 4521 bool adapt_inner_tolerance;
116     bool verbose;
117     bool reordering;
118 caltinay 5179 int preconditioner;
119 jgs 150 dim_t iter_max;
120 gross 1476 dim_t inner_iter_max;
121 jgs 150 double drop_tolerance;
122     double drop_storage;
123 gross 2474 index_t truncation;
124     index_t restart;
125 caltinay 5179 int sweeps;
126 jfenwick 4521 bool accept_failed_convergence;
127 gross 2474 double relaxation_factor;
128 jfenwick 4521 bool use_local_preconditioner;
129 gross 3283 dim_t refinements;
130 caltinay 5179 int ode_solver;
131 caltinay 4873
132 caltinay 4846 // diagnostic values
133 gross 2474 dim_t num_iter;
134 gross 2446 dim_t num_level;
135     dim_t num_inner_iter;
136     double time;
137 gross 2474 double set_up_time;
138 gross 3283 double coarsening_selection_time;
139     double coarsening_matrix_time;
140 lgao 2596 double net_time;
141 gross 2474 double residual_norm;
142 jfenwick 4521 bool converged;
143 caltinay 4846 double preconditioner_size; // in Mbytes
144 jfenwick 4521 bool time_step_backtracking_used;
145 gross 3402 double coarse_level_sparsity;
146     dim_t num_coarse_unknowns;
147 caltinay 4846 };
148 gross 2446
149 caltinay 4846 } // namespace paso
150 jgs 150
151 caltinay 4846 #endif // __PASO_OPTIONS_H__
152 jgs 150

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26