/[escript]/trunk/paso/src/Options_setDefaults.c
ViewVC logotype

Contents of /trunk/paso/src/Options_setDefaults.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2596 - (show annotations)
Thu Aug 6 03:09:03 2009 UTC (10 years, 2 months ago) by lgao
File MIME type: text/plain
File size: 6475 byte(s)
Add new diagnostic information: "net time" (the execution time of solver, excluding the setup time for solver and the execution time of preconditioner)


1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2009 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /**************************************************************/
16
17 /* Paso: solver options */
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia, 2003,2004 */
22 /* author: gross@access.edu.au */
23
24 /**************************************************************/
25
26 #include "Paso.h"
27 #include "Options.h"
28
29 /**************************************************************/
30
31 /* set the default values for solver options */
32
33 void Paso_Options_setDefaults(Paso_Options* options) {
34 options->verbose=FALSE;
35 options->method=PASO_DEFAULT;
36 options->package=PASO_DEFAULT;
37 options->symmetric=FALSE;
38 options->reordering=PASO_NO_REORDERING;
39 options->tolerance=1.E-8;
40 options->absolute_tolerance=0.;
41 options->inner_tolerance=0.9;
42 options->adapt_inner_tolerance=TRUE;
43 options->preconditioner=PASO_JACOBI;
44 options->iter_max=10000;
45 options->inner_iter_max=10;
46 options->drop_tolerance=0.01;
47 options->drop_storage=2.;
48 options->restart=-1;
49 options->truncation=20;
50 options->sweeps=2;
51 options->pre_sweeps=2;
52 options->post_sweeps=2;
53 options->coarsening_threshold=0.05;
54 options->min_coarse_matrix_size=500;
55 options->level_max=5;
56 options->accept_failed_convergence=FALSE;
57 options->coarsening_method=PASO_DEFAULT;
58 options->relaxation_factor=0.95;
59
60 /* diagnostic values */
61 options->num_iter=-1;
62 options->num_level=-1;
63 options->num_inner_iter=-1;
64 options->time=-1.;
65 options->set_up_time=-1.;
66 options->net_time=-1.;
67 options->residual_norm=-1.;
68 options->converged=FALSE;
69 }
70 void Paso_Options_showDiagnostics(const Paso_Options* options) {
71 printf("Paso diagonsitics:\n");
72 printf("\tnum_iter = %d\n",options->num_iter);
73 printf("\tnum_level = %d\n",options->num_level);
74 printf("\tnum_inner_iter = %d\n",options->num_inner_iter);
75 printf("\ttime = %e\n",options->time);
76 printf("\tset_up_time = %e\n",options->set_up_time);
77 printf("\tnet_time = %e\n",options->net_time);
78 printf("\tresidual_norm = %e\n",options->residual_norm);
79 printf("\tconverged = %d\n",options->converged);
80 }
81 const char* Paso_Options_name(const index_t key){
82 switch (key) {
83 case PASO_DEFAULT:
84 return "DEFAULT";
85 case PASO_DIRECT:
86 return "DIRECT";
87 case PASO_CHOLEVSKY:
88 return "CHOLEVSKY";
89 case PASO_PCG:
90 return "PCG";
91 case PASO_CR:
92 return "CR";
93 case PASO_CGS:
94 return "CGS";
95 case PASO_BICGSTAB:
96 return "BICGSTAB";
97 case PASO_SSOR:
98 return "SSOR";
99 case PASO_ILU0:
100 return "ILU0";
101 case PASO_ILUT:
102 return "ILUT";
103 case PASO_JACOBI:
104 return "JACOBI";
105 case PASO_GMRES:
106 return "GMRES";
107 case PASO_PRES20:
108 return "PRES20";
109 case PASO_LUMPING:
110 return "LUMPING";
111 case PASO_NO_REORDERING:
112 return "NO_REORDERING";
113 case PASO_MINIMUM_FILL_IN:
114 return "MINIMUM_FILL_IN";
115 case PASO_NESTED_DISSECTION:
116 return "NESTED_DISSECTION";
117 case PASO_MKL:
118 return "MKL";
119 case PASO_UMFPACK:
120 return "UMFPACK";
121 case PASO_ITERATIVE:
122 return "ITERATIVE";
123 case PASO_PASO:
124 return "PASO";
125 case PASO_AMG:
126 return "AMG";
127 case PASO_REC_ILU:
128 return "REC_ILU";
129 case PASO_TRILINOS:
130 return "TRILINOS";
131 case PASO_NONLINEAR_GMRES:
132 return "NONLINEAR_GMRES";
133 case PASO_TFQMR :
134 return "TFQMR";
135 case PASO_MINRES:
136 return "MINRES";
137 case PASO_GAUSS_SEIDEL:
138 return "GAUSS_SEIDEL";
139 case PASO_RILU:
140 return "RILU";
141 case PASO_DEFAULT_REORDERING:
142 return "DEFAULT_REORDERING";
143 case PASO_SUPER_LU:
144 return "SUPER_LU";
145 case PASO_PASTIX:
146 return "PASTIX";
147 case PASO_YAIR_SHAPIRA_COARSENING:
148 return "YAIR_SHAPIRA_COARSENING";
149 case PASO_RUGE_STUEBEN_COARSENING:
150 return "RUGE_STUEBEN_COARSENING";
151 case PASO_AGGREGATION_COARSENING:
152 return "AGGREGATION_COARSENING";
153 case PASO_NO_PRECONDITIONER:
154 return "NO_PRECONDITIONER";
155 case PASO_MIN_COARSE_MATRIX_SIZE:
156 return "MIN_COARSE_MATRIX_SIZE";
157 default:
158 return "<unknown>";
159 }
160 }
161 void Paso_Options_show(const Paso_Options* options ) {
162 printf("Paso options settings:\n");
163 printf("\tverbose = %d\n",options->verbose);
164 printf("\tmethod = %s (%d)\n",Paso_Options_name(options->method),options->method);
165 printf("\tpackage = %s (%d)\n",Paso_Options_name(options->package),options->package);
166 printf("\tsymmetric = %d\n",options->symmetric);
167 printf("\treordering = %s (%d)\n",Paso_Options_name(options->reordering),options->reordering);
168 printf("\ttolerance = %e\n",options->tolerance);
169 printf("\tabsolute_tolerance = %e\n",options->absolute_tolerance);
170 printf("\tinner_tolerance = %e\n",options->inner_tolerance);
171 printf("\tadapt_inner_tolerance = %d\n",options->adapt_inner_tolerance);
172 printf("\tpreconditioner = %s (%d)\n",Paso_Options_name(options->preconditioner),options->preconditioner);
173 printf("\titer_max = %d\n",options->iter_max);
174 printf("\tinner_iter_max = %d\n",options->inner_iter_max);
175 printf("\tdrop_tolerance = %e\n",options->drop_tolerance);
176 printf("\tdrop_storage = %e\n",options->drop_storage);
177 printf("\trestart = %d\n",options->restart);
178 printf("\ttruncation = %d\n",options->truncation);
179 printf("\tsweeps = %d\n",options->sweeps);
180 printf("\tpre_sweeps = %d\n",options->pre_sweeps);
181 printf("\tpost_sweeps = %d\n",options->post_sweeps);
182 printf("\tcoarsening_threshold = %e\n",options->coarsening_threshold);
183 printf("\tlevel_max = %d\n",options->level_max);
184 printf("\taccept_failed_convergence = %d\n",options->accept_failed_convergence);
185 printf("\tcoarsening_method = %s (%d)\n",Paso_Options_name(options->coarsening_method), options->coarsening_method);
186 printf("\trelaxation_factor = %e\n",options->relaxation_factor);
187 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26