escript  Revision_
Options.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2018 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_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 #define PASO_CLASSIC_INTERPOLATION_WITH_FF_COUPLING 50
67 #define PASO_CLASSIC_INTERPOLATION 51
68 #define PASO_DIRECT_INTERPOLATION 52
69 #define PASO_LINEAR_CRANK_NICOLSON 66
70 #define PASO_CRANK_NICOLSON 67
71 #define PASO_BACKWARD_EULER 68
72 
73 #define PASO_SMOOTHER 99999999
74 
75 namespace paso {
76 
77 struct Options
78 {
80 
82  Options(const boost::python::object& options);
83 
85  void setDefaults();
86 
88  void show() const;
89 
91  void showDiagnostics() const;
92 
94  void updateEscriptDiagnostics(boost::python::object& options) const;
95 
97  static int mapEscriptOption(int escriptOption);
98 
99  static const char* name(int key);
100 
101  static int getPackage(int solver, int package, bool symmetry,
102  const escript::JMPI& mpi_info);
103 
105  static int getSolver(int solver, int package, bool symmetry,
106  const escript::JMPI& mpi_info);
107 
108  int method;
109  int package;
110  bool symmetric;
111  double tolerance;
115  bool verbose;
121  double drop_storage;
124  int sweeps;
130  int smoother;
140  bool usePanel;
142 
143  // diagnostic values
147  double time;
148  double set_up_time;
151  double net_time;
153  bool converged;
154  double preconditioner_size; // in Mbytes
158 };
159 
160 } // namespace paso
161 
162 #endif // __PASO_OPTIONS_H__
163 
double residual_norm
Definition: Options.h:152
double relaxation_factor
Definition: Options.h:134
int ode_solver
Definition: Options.h:141
dim_t num_inner_iter
Definition: Options.h:146
double min_coarse_sparsity
Definition: Options.h:136
bool reordering
Definition: Options.h:116
int sweeps
Definition: Options.h:124
static const char * name(int key)
Definition: Options.cpp:177
bool symmetric
Definition: Options.h:110
double set_up_time
Definition: Options.h:148
double inner_tolerance
Definition: Options.h:113
Definition: Options.h:77
double coarse_level_sparsity
Definition: Options.h:156
void updateEscriptDiagnostics(boost::python::object &options) const
updates SolverBuddy diagnostics from this
Definition: Options.cpp:464
bool converged
Definition: Options.h:153
bool use_local_preconditioner
Definition: Options.h:135
int post_sweeps
Definition: Options.h:126
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:71
double coarsening_selection_time
Definition: Options.h:149
dim_t inner_iter_max
Definition: Options.h:119
dim_t coarse_matrix_refinements
Definition: Options.h:138
index_t restart
Definition: Options.h:123
double drop_tolerance
Definition: Options.h:120
int preconditioner
Definition: Options.h:117
bool usePanel
Definition: Options.h:140
dim_t num_level
Definition: Options.h:145
double absolute_tolerance
Definition: Options.h:112
Definition: BiCGStab.cpp:25
double preconditioner_size
Definition: Options.h:154
int pre_sweeps
Definition: Options.h:125
int package
Definition: Options.h:109
double diagonal_dominance_threshold
Definition: Options.h:139
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:129
dim_t num_iter
Definition: Options.h:144
double coarsening_matrix_time
Definition: Options.h:150
bool accept_failed_convergence
Definition: Options.h:132
int cycle_type
Definition: Options.h:127
double tolerance
Definition: Options.h:111
void showDiagnostics() const
prints diagnostic data
Definition: Options.cpp:125
bool time_step_backtracking_used
Definition: Options.h:155
dim_t num_coarse_unknowns
Definition: Options.h:157
void show() const
prints current option values
Definition: Options.cpp:142
void setDefaults()
sets the default values for solver options
Definition: Options.cpp:71
Options()
Definition: Options.h:79
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:247
int method
Definition: Options.h:108
static int getPackage(int solver, int package, bool symmetry, const escript::JMPI &mpi_info)
Definition: Options.cpp:338
double coarsening_threshold
Definition: Options.h:131
double time
Definition: Options.h:147
dim_t refinements
Definition: Options.h:137
double net_time
Definition: Options.h:151
index_t truncation
Definition: Options.h:122
int level_max
Definition: Options.h:128
double drop_storage
Definition: Options.h:121
static int mapEscriptOption(int escriptOption)
returns the corresponding paso option code for an escript option code
Definition: Options.cpp:378
int smoother
Definition: Options.h:130
index_t coarsening_method
Definition: Options.h:133
index_t dim_t
Definition: DataTypes.h:64
bool adapt_inner_tolerance
Definition: Options.h:114
dim_t iter_max
Definition: Options.h:118
bool verbose
Definition: Options.h:115