escript  Revision_
Options.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 
18 /****************************************************************************/
19 
20 /* Paso: Options */
21 
22 /****************************************************************************/
23 
24 /* Copyrights by ACcESS Australia 2003,2004,2005 */
25 /* Author: Lutz Gross, l.gross@uq.edu.au */
26 
27 /****************************************************************************/
28 
29 #ifndef __PASO_OPTIONS_H__
30 #define __PASO_OPTIONS_H__
31 
32 #include "Paso.h"
33 
34 #include <boost/python/object.hpp>
35 
36 // valid solver options
37 #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 #define PASO_MKL 15
50 #define PASO_UMFPACK 16
51 #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 #define PASO_AMG 22
57 #define PASO_REC_ILU 23
58 #define PASO_TRILINOS 24
59 #define PASO_NONLINEAR_GMRES 25
60 #define PASO_TFQMR 26
61 #define PASO_MINRES 27
62 #define PASO_GAUSS_SEIDEL 28
63 #define PASO_GS PASO_GAUSS_SEIDEL
64 #define PASO_RILU 29
65 #define PASO_DEFAULT_REORDERING 30
66 #define PASO_YAIR_SHAPIRA_COARSENING 33
67 #define PASO_RUGE_STUEBEN_COARSENING 34
68 #define PASO_AGGREGATION_COARSENING 35
69 #define PASO_NO_PRECONDITIONER 36
70 #define PASO_AMLI 38
71 #define PASO_STANDARD_COARSENING 39
72 #define PASO_CLASSIC_INTERPOLATION_WITH_FF_COUPLING 50
73 #define PASO_CLASSIC_INTERPOLATION 51
74 #define PASO_DIRECT_INTERPOLATION 52
75 #define PASO_BOOMERAMG 60
76 #define PASO_CIJP_FIXED_RANDOM_COARSENING 61
77 #define PASO_CIJP_COARSENING 62
78 #define PASO_FALGOUT_COARSENING 63
79 #define PASO_PMIS_COARSENING 64
80 #define PASO_HMIS_COARSENING 65
81 #define PASO_LINEAR_CRANK_NICOLSON 66
82 #define PASO_CRANK_NICOLSON 67
83 #define PASO_BACKWARD_EULER 68
84 
85 #define PASO_SMOOTHER 99999999
86 
87 namespace paso {
88 
89 struct Options
90 {
92 
94  Options(const boost::python::object& options);
95 
97  void setDefaults();
98 
100  void show() const;
101 
103  void showDiagnostics() const;
104 
106  void updateEscriptDiagnostics(boost::python::object& options) const;
107 
109  static int mapEscriptOption(int escriptOption);
110 
111  static const char* name(int key);
112 
113  static int getPackage(int solver, int package, bool symmetry,
114  const escript::JMPI& mpi_info);
115 
117  static int getSolver(int solver, int package, bool symmetry,
118  const escript::JMPI& mpi_info);
119 
120  int method;
121  int package;
122  bool symmetric;
123  double tolerance;
127  bool verbose;
133  double drop_storage;
136  int sweeps;
142  int smoother;
152  bool usePanel;
155 
156  // diagnostic values
160  double time;
161  double set_up_time;
164  double net_time;
166  bool converged;
167  double preconditioner_size; // in Mbytes
171 };
172 
173 } // namespace paso
174 
175 #endif // __PASO_OPTIONS_H__
176 
double residual_norm
Definition: Options.h:165
double relaxation_factor
Definition: Options.h:146
int ode_solver
Definition: Options.h:154
dim_t num_inner_iter
Definition: Options.h:159
double min_coarse_sparsity
Definition: Options.h:148
bool reordering
Definition: Options.h:128
int sweeps
Definition: Options.h:136
static const char * name(int key)
Definition: Options.cpp:179
bool symmetric
Definition: Options.h:122
double set_up_time
Definition: Options.h:161
double inner_tolerance
Definition: Options.h:125
Definition: Options.h:89
double coarse_level_sparsity
Definition: Options.h:169
void updateEscriptDiagnostics(boost::python::object &options) const
updates SolverBuddy diagnostics from this
Definition: Options.cpp:515
bool converged
Definition: Options.h:166
bool use_local_preconditioner
Definition: Options.h:147
int post_sweeps
Definition: Options.h:138
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
double coarsening_selection_time
Definition: Options.h:162
dim_t inner_iter_max
Definition: Options.h:131
dim_t coarse_matrix_refinements
Definition: Options.h:150
index_t restart
Definition: Options.h:135
double drop_tolerance
Definition: Options.h:132
int preconditioner
Definition: Options.h:129
bool usePanel
Definition: Options.h:152
dim_t num_level
Definition: Options.h:158
int interpolation_method
Definition: Options.h:153
double absolute_tolerance
Definition: Options.h:124
Definition: AMG.cpp:45
double preconditioner_size
Definition: Options.h:167
int pre_sweeps
Definition: Options.h:137
int package
Definition: Options.h:121
double diagonal_dominance_threshold
Definition: Options.h:151
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:59
dim_t min_coarse_matrix_size
Definition: Options.h:141
dim_t num_iter
Definition: Options.h:157
double coarsening_matrix_time
Definition: Options.h:163
bool accept_failed_convergence
Definition: Options.h:144
int cycle_type
Definition: Options.h:139
double tolerance
Definition: Options.h:123
void showDiagnostics() const
prints diagnostic data
Definition: Options.cpp:127
bool time_step_backtracking_used
Definition: Options.h:168
dim_t num_coarse_unknowns
Definition: Options.h:170
void show() const
prints current option values
Definition: Options.cpp:144
void setDefaults()
sets the default values for solver options
Definition: Options.cpp:72
Options()
Definition: Options.h:91
static int getSolver(int solver, int package, bool symmetry, const escript::JMPI &mpi_info)
returns the solver to be used with given combination
Definition: Options.cpp:273
int method
Definition: Options.h:120
static int getPackage(int solver, int package, bool symmetry, const escript::JMPI &mpi_info)
Definition: Options.cpp:364
double coarsening_threshold
Definition: Options.h:143
double time
Definition: Options.h:160
dim_t refinements
Definition: Options.h:149
double net_time
Definition: Options.h:164
index_t truncation
Definition: Options.h:134
int level_max
Definition: Options.h:140
double drop_storage
Definition: Options.h:133
static int mapEscriptOption(int escriptOption)
returns the corresponding paso option code for an escript option code
Definition: Options.cpp:404
int smoother
Definition: Options.h:142
index_t coarsening_method
Definition: Options.h:145
index_t dim_t
Definition: DataTypes.h:64
bool adapt_inner_tolerance
Definition: Options.h:126
dim_t iter_max
Definition: Options.h:130
bool verbose
Definition: Options.h:127