ParGeMSLR
utils.hpp
Go to the documentation of this file.
1 #ifndef PARGEMSLR_UTILS_H
2 #define PARGEMSLR_UTILS_H
3 
9 #include <stdio.h>
10 #include <cstdlib>
11 #include <utility>
12 #include <type_traits>
13 #include <ctype.h>
14 #include "complex.hpp"
15 #include <random>
16 #include <climits>
17 #include <cassert>
18 
19 #define PARGEMSLR_FIRM_CHKERR(ierr) {{if(ierr){printf("Err value: %d on MPI rank %d\n",ierr, parallel_log::_grank);assert(!(ierr));};}}
20 
21 #ifdef PARGEMSLR_DEBUG
22  #define PARGEMSLR_ERROR(message) {printf("Error: %s on MPI rank %d\n", message, parallel_log::_grank);assert(0);}
23  #define PARGEMSLR_CHKERR(ierr) {{if(ierr){printf("Err value: %d\n",ierr);assert(!(ierr));};}}
24  #define PARGEMSLR_PRINT_DEBUG(conda, condb, ...) {if(conda==condb) {printf("DEBUG: ");printf(__VA_ARGS__);}}
25 #else
26  #define PARGEMSLR_ERROR(message) {printf("Error: %s on MPI rank %d\n", message, parallel_log::_grank);}
27  #define PARGEMSLR_CHKERR(ierr) {;}
28  #define PARGEMSLR_PRINT_DEBUG(conda, condb, ...) {;}
29 #endif
30 #ifdef PARGEMSLR_NO_WARNING
31  #define PARGEMSLR_WARNING(message) {;}
32 #else
33  #define PARGEMSLR_WARNING(message) {printf("Warning: %s on MPI rank %d\n", message, parallel_log::_grank);}
34 #endif
35 
36 #define PARGEMSLR_PRINT(...) fprintf(pargemslr::pargemslr_global::_out_file, __VA_ARGS__);
37 
38 #ifndef PARGEMSLR_SUCCESS
39 #define PARGEMSLR_SUCCESS 0
40 #define PARGEMSLR_RETURN_METIS_INSUFFICIENT_NDOM 1
41 #define PARGEMSLR_RETURN_METIS_NO_INTERIOR 2
42 #define PARGEMSLR_RETURN_METIS_PROBLEM_TOO_SMALL 3
43 #define PARGEMSLR_RETURN_PARILU_NO_INTERIOR 10
44 #define PARGEMSLR_ERROR_INVALED_OPTION 100
45 #define PARGEMSLR_ERROR_INVALED_PARAM 101
46 #define PARGEMSLR_ERROR_IO_ERROR 102
47 #define PARGEMSLR_ERROR_ILU_EMPTY_ROW 103
48 #define PARGEMSLR_ERROR_DOUBLE_INIT_FREE 104 // call init function for multiple times
49 #define PARGEMSLR_ERROR_COMPILER 105
50 #define PARGEMSLR_ERROR_FUNCTION_CALL_ERR 106
51 #define PARGEMSLR_ERROR_MEMORY_LOCATION 107
52 #endif
53 
54 #define PARGEMSLR_CAST( type, val) reinterpret_cast<type>((val))
55 
56 /* The following is the detail of all the options
57  * The GEMSLR supports 4 different options yet.
58  *
59  * BJ -> Block Jacobi.
60  * This option uses the input partition of matrix A, apply local solve on the diagonal blocks.
61  *
62  * ESCHUR-> PartialILUT to form Approximate Schur on the top level.
63  * This option uses the PartialILUT to form an approximate Schur complement.
64  * The input partition of matrix A is used.
65  * Local solve can only be the PartialILUT.
66  *
67  * ISCHUR-> GEMSLR with IO ordering on the top level.
68  * This option uses the GeMSLR to approximate the Schur complement.
69  * The input partition of marix A is used.
70  *
71  * MLEV-> GEMSLR with true multilevel.
72  * This option uses the GeMSLR to approximate the Schur complement.
73  * ParMETIS is used on the top level to comstruct the partition.
74  *
75  */
76 
77 #define PARGEMSLR_IO_SIZE 180
78 
79 /*----------- Choose preconditioner */
80 
81 /* the global preconditioenr. 0: BJ; 1: ESCHUR; 2: ISCHUR; 3: MLEV */
82 #define PARGEMSLR_IO_PRECOND_GLOBAL_PRECOND 0
83 /* the first local preconditioner option on the B part. 0: ILUT; 1: GEMSLR. */
84 #define PARGEMSLR_IO_PRECOND_LOCAL_REPCOND1 1
85 /* the levels we apply the first preconditioner (start from level 0 till which level we apply local preconditioner 1) */
86 #define PARGEMSLR_IO_PRECOND_LOCAL_REPCOND1_LEVEL 2
87 /* the second local preconditioner option on the B part. 0: ILUT; 1: GEMSLR. Before the last level we apply this second preconditioner */
88 #define PARGEMSLR_IO_PRECOND_LOCAL_REPCOND2 3
89 /* the local preconditioner option for the last C block. 0: ILUT; 1: ILUK; 2: BJ-ILUT; 3: BJ-ILUK; 4: BJ-ILUT2; 5: BJ-ILUK2.
90  * On the global last level we apply this last preconditioner */
91 #define PARGEMSLR_IO_PRECOND_LOCAL_REPCOND3 4
92 /* the smoother for the MILU in the B part. 0: B-ILU; 1: B-MILU. */
93 #define PARGEMSLR_IO_PRECOND_LOCAL_SMOOTHER1 5
94 
95 /*----------- Choose solver */
96 
97 /* the solver. 0: FGMRES. */
98 #define PARGEMSLR_IO_SOLVER_OPTION 10
99 #define PARGEMSLR_IO_SOLVER_KDIM 11
100 #define PARGEMSLR_IO_SOLVER_MAXITS 12
101 #define PARGEMSLR_IO_SOLVER_TOL 13
102 #define PARGEMSLR_IO_SOLVER_ATOL 14
103 
104 /*----------- partition parameters */
105 
106 /* the global number of levels for parallel solver, the IO order is considered as one level */
107 #define PARGEMSLR_IO_PREPOSS_NLEV_GLOBAL 20
108 /* the local number of levels for the B part local solve */
109 #define PARGEMSLR_IO_PREPOSS_NLEV_LOCAL 21
110 /* the number of domains on each level, except the top level if IO order is used */
111 #define PARGEMSLR_IO_PREPOSS_NCOMP_GLOBAL 22
112 /* the number of domains on each level */
113 #define PARGEMSLR_IO_PREPOSS_NCOMP_LOCAL 23
114 /* the global partition option. 0: parallel ND; 1: parallel RKWay */
115 #define PARGEMSLR_IO_PREPOSS_PARTITION_GLOBAL 24
116 /* the local partition option. 0: ND; 1: RKWay */
117 #define PARGEMSLR_IO_PREPOSS_PARTITION_LOCAL 25
118 /* the minimal size of edge separator, use same value for parallel and local */
119 #define PARGEMSLR_IO_PREPOSS_MINSEP 26
120 /* the minimal size of number of domains for the global RKWay partition */
121 #define PARGEMSLR_IO_PREPOSS_KMIN_GLOBAL 27
122 /* the minimal size of number of domains for the local RKWay partition */
123 #define PARGEMSLR_IO_PREPOSS_KMIN_LOCAL 28
124 /* the reduce factor of number of domains for the global RKWay partition */
125 #define PARGEMSLR_IO_PREPOSS_KFACTOR_GLOBAL 29
126 /* the reduce factor of number of domains for the local RKWay partition */
127 #define PARGEMSLR_IO_PREPOSS_KFACTOR_LOCAL 30
128 /* use vertex seperator in global? 0: no; 1: yes. */
129 #define PARGEMSLR_IO_PREPOSS_VTXSEP_GLOBAL 31
130 /* use vertex seperator in local? 0: no; 1: yes. */
131 #define PARGEMSLR_IO_PREPOSS_VTXSEP_LOCAL 32
132 /* numbers of metis refine on parallel partition */
133 #define PARGEMSLR_IO_PREPOSS_METIS_REFINE 33
134 /* use global partition? 0: no; 1: yes. */
135 #define PARGEMSLR_IO_PREPOSS_GLOBAL_PARTITION 34
136 
137 /*----------- ILU parameters */
138 
139 /* droptol for the ILUT or the B block of global GeMSLR / PartialILUT */
140 #define PARGEMSLR_IO_ILU_DROPTOL_B_GLOBAL 40
141 /* droptol for the ILUT or the B block of local GeMSLR */
142 #define PARGEMSLR_IO_ILU_DROPTOL_B_LOCAL 41
143 /* droptol for the E/F part of the global PartialILUT */
144 #define PARGEMSLR_IO_ILU_DROPTOL_EF_GLOBAL 42
145 /* droptol for the E/F part of the global PartialILUT */
146 #define PARGEMSLR_IO_ILU_DROPTOL_EF_LOCAL 43
147 /* droptol for the last level of global GeMSLR */
148 #define PARGEMSLR_IO_ILU_DROPTOL_C_GLOBAL 44
149 /* droptol for the last level of lobal GeMSLR */
150 #define PARGEMSLR_IO_ILU_DROPTOL_C_LOCAL 45
151 /* droptol for the S part of the global PartialILUT */
152 #define PARGEMSLR_IO_ILU_DROPTOL_S_GLOBAL 46
153 /* droptol for the S part of the local PartialILUT */
154 #define PARGEMSLR_IO_ILU_DROPTOL_S_LOCAL 47
155 /* maximal row nonzeros for the ILUT or the B, E, F block of global GeMSLR / PartialILUT */
156 #define PARGEMSLR_IO_ILU_ROWNNZ_B_GLOBAL 48
157 /* maximal row nonzeros for the ILUT or the B, E, F block of local GeMSLR / PartialILUT */
158 #define PARGEMSLR_IO_ILU_ROWNNZ_B_LOCAL 49
159 /* maximal row nonzeros for the last level of global GeMSLR */
160 #define PARGEMSLR_IO_ILU_ROWNNZ_C_GLOBAL 50
161 /* maximal row nonzeros for the last level of local GeMSLR */
162 #define PARGEMSLR_IO_ILU_ROWNNZ_C_LOCAL 51
163 /* lfil for the ILUK of the B, E, F block of global GeMSLR / PartialILUT */
164 #define PARGEMSLR_IO_ILU_LFIL_B_GLOBAL 52
165 /* lfil for the ILUK of the B, E, F block of local GeMSLR / PartialILUT */
166 #define PARGEMSLR_IO_ILU_LFIL_B_LOCAL 53
167 /* lfil for the ILUK for the last level of global GeMSLR */
168 #define PARGEMSLR_IO_ILU_LFIL_C_GLOBAL 54
169 /* lfil for the ILUK for the last level of local GeMSLR */
170 #define PARGEMSLR_IO_ILU_LFIL_C_LOCAL 55
171 /* maximal row nonzeros for the last level of global PartialILUT */
172 #define PARGEMSLR_IO_ILU_ROWNNZ_S_GLOBAL 56
173 /* maximal row nonzeros for the last level of local PartialILUT */
174 #define PARGEMSLR_IO_ILU_ROWNNZ_S_LOCAL 57
175 /* reordering option for the global GeMSLR */
176 #define PARGEMSLR_IO_ILU_PERM_OPTION_GLOBAL 58
177 /* reordering option for the local GeMSLR */
178 #define PARGEMSLR_IO_ILU_PERM_OPTION_LOCAL 59
179 /* openmp option for the global GeMSLR */
180 #define PARGEMSLR_IO_ILU_OMP_OPTION_GLOBAL 60
181 /* openmp option for the local GeMSLR */
182 #define PARGEMSLR_IO_ILU_OMP_OPTION_LOCAL 61
183 
184 /*----------- low-rank parameters */
185 
186 /* Arnoldi option for the top level global GeMSLR */
187 #define PARGEMSLR_IO_LR_ARNOLDI_OPTION1_GLOBAL 70
188 /* Arnoldi option for other levels global GeMSLR */
189 #define PARGEMSLR_IO_LR_ARNOLDI_OPTION2_GLOBAL 71
190 /* Arnoldi option for the top level local GeMSLR */
191 #define PARGEMSLR_IO_LR_ARNOLDI_OPTION1_LOCAL 72
192 /* Arnoldi option for other levels local GeMSLR */
193 #define PARGEMSLR_IO_LR_ARNOLDI_OPTION2_LOCAL 73
194 /* rank for the top level global GeMSLR */
195 #define PARGEMSLR_IO_LR_RANK1_GLOBAL 74
196 /* rank for other levels global GeMSLR */
197 #define PARGEMSLR_IO_LR_RANK2_GLOBAL 75
198 /* rank for the top level local GeMSLR */
199 #define PARGEMSLR_IO_LR_RANK1_LOCAL 76
200 /* rank for other levels local GeMSLR */
201 #define PARGEMSLR_IO_LR_RANK2_LOCAL 77
202 /* rank factor for the top level global GeMSLR */
203 #define PARGEMSLR_IO_LR_RANK_FACTOR1_GLOBAL 78
204 /* rank factor for other levels global GeMSLR */
205 #define PARGEMSLR_IO_LR_RANK_FACTOR2_GLOBAL 79
206 /* rank factor for the top level local GeMSLR */
207 #define PARGEMSLR_IO_LR_RANK_FACTOR1_LOCAL 80
208 /* rank factor for other levels local GeMSLR */
209 #define PARGEMSLR_IO_LR_RANK_FACTOR2_LOCAL 81
210 /* arnoldi factor for the top level global GeMSLR */
211 #define PARGEMSLR_IO_LR_ARNOLDI_FACTOR1_GLOBAL 82
212 /* arnoldi factor for other levels global GeMSLR */
213 #define PARGEMSLR_IO_LR_ARNOLDI_FACTOR2_GLOBAL 83
214 /* arnoldi factor for the top level local GeMSLR */
215 #define PARGEMSLR_IO_LR_ARNOLDI_FACTOR1_LOCAL 84
216 /* arnoldi factor for other levels local GeMSLR */
217 #define PARGEMSLR_IO_LR_ARNOLDI_FACTOR2_LOCAL 85
218 /* eigenvalue accuracy for the top level global GeMSLR */
219 #define PARGEMSLR_IO_LR_TOL_EIG1_GLOBAL 86
220 /* eigenvalue accuracy for other levels global GeMSLR */
221 #define PARGEMSLR_IO_LR_TOL_EIG2_GLOBAL 87
222 /* eigenvalue accuracy for the top level local GeMSLR */
223 #define PARGEMSLR_IO_LR_TOL_EIG1_LOCAL 88
224 /* eigenvalue accuracy for other levels local GeMSLR */
225 #define PARGEMSLR_IO_LR_TOL_EIG2_LOCAL 89
226 /* max number of restarts for the top level global GeMSLR */
227 #define PARGEMSLR_IO_LR_MAXITS1_GLOBAL 90
228 /* max number of restarts for other levels global GeMSLR */
229 #define PARGEMSLR_IO_LR_MAXITS2_GLOBAL 91
230 /* max number of restarts for the top level local GeMSLR */
231 #define PARGEMSLR_IO_LR_MAXITS1_LOCAL 92
232 /* max number of restarts for other levels local GeMSLR */
233 #define PARGEMSLR_IO_LR_MAXITS2_LOCAL 93
234 /* the thick-restart factor */
235 #define PARGEMSLR_IO_LR_TR_FACTOR 94
236 /* the orthogonal threshold */
237 #define PARGEMSLR_IO_LR_TOL_ORTH 95
238 /* the re-orthogonal threshold */
239 #define PARGEMSLR_IO_LR_TOL_REORTH 96
240 /* should we use random initla guess? 0: no; 1: yes. (for parallel random vector, different np might leads to different result) */
241 #define PARGEMSLR_IO_LR_RAND_INIT_GUESS 97
242 /* rank for special global GeMSLR options */
243 #define PARGEMSLR_IO_LR_RANK_C_NITER 98
244 /* Arnoldi option for the A */
245 #define PARGEMSLR_IO_LR_ARNOLDI_OPTIONA 99
246 /* rank for the A correction */
247 #define PARGEMSLR_IO_LR_RANK_A 100
248 /* rank factor for the A */
249 #define PARGEMSLR_IO_LR_RANK_FACTORA 101
250 /* arnoldi factor for the A */
251 #define PARGEMSLR_IO_LR_ARNOLDI_FACTORA 102
252 /* eigenvalue accuracy for the A */
253 #define PARGEMSLR_IO_LR_TOL_EIGA 103
254 /* max number of restarts for the A */
255 #define PARGEMSLR_IO_LR_MAXITSA 104
256 
257 /*----------- schur option */
258 
259 /* turn on schur iteration? 0: no; 1: yes */
260 #define PARGEMSLR_IO_SCHUR_ENABLE 130
261 /* max number of schur iterations */
262 #define PARGEMSLR_IO_SCHUR_ITER_TOL 131
263 /* stop tolerance for the schur FGMRES */
264 #define PARGEMSLR_IO_SCHUR_MAXITS 132
265 
266 /*----------- other options */
267 
268 /* precondition with A+sI (complex version only) */
269 #define PARGEMSLR_IO_ADVANCED_DIAG_SHIFT 140
270 /* global solve option. 0: Add solve; 1: Add solve L only; 2: Mult solve */
271 #define PARGEMSLR_IO_ADVANCED_GLOBAL_SOLVE 141
272 /* should we turn on complex shift in ZILUT? */
273 #define PARGEMSLR_IO_ADVANCED_USE_COMPLEX_SHIFT 142
274 /* number of residual iterations for the B solve in the setup phase */
275 #define PARGEMSLR_IO_ADVANCED_RESIDUAL_ITERS 143
276 /* the gram schmidt option, see pargemslr_global */
277 #define PARGEMSLR_IO_ADVANCED_GRAM_SCHMIDT 144
278 /* the diagonal shift for the modified ILU, not in use now */
279 #define PARGEMSLR_IO_ADVANCED_DIAG_SHIFT_MODIFIED 145
280 
281 /*----------- general options */
282 
283 /* the print option */
284 #define PARGEMSLR_IO_GENERAL_PRINT_LEVEL 150
285 
286 /*----------- poly preconditioner options */
287 
288 #define PARGEMSLR_IO_POLY_ORDER 160
289 
290 /*----------- parallel options */
291 
292 #define PARGEMSLR_IO_PARALLEL_NPROCX 170
293 #define PARGEMSLR_IO_PARALLEL_NPROCY 171
294 #define PARGEMSLR_IO_PARALLEL_NPROCZ 172
295 #define PARGEMSLR_IO_PARALLEL_NDOMX 173
296 #define PARGEMSLR_IO_PARALLEL_NDOMY 174
297 #define PARGEMSLR_IO_PARALLEL_NDOMZ 175
298 
299 namespace pargemslr
300 {
306  typedef class PargemslrGlobalClass
307  {
308  public:
309 
314  static double _expand_fact;
315 
320  static int _coo_reserve_fact;
321 
327 
332  static int _metis_refine;
333 
339 
344  static int _minsep;
345 
350  static double _tr_factor;
351 
356  static double _orth_tol;
357 
362  static double _reorth_tol;
363 
368  static int _dash_line_width;
369 
374  static std::random_device _random_device;
375 
380  static std::mt19937 _mersenne_twister_engine;
381 
386  static std::uniform_int_distribution<int> _uniform_int_distribution;
387 
392  static FILE *_out_file;
393 
398  static double *_params;
399 
406  static int _gram_schmidt;
407 
408  }pargemslr_global;
409 
416  double* PargemslrSetDefaultParameterArray(double *params);
417 
422  template <class T> struct PargemslrIsInteger : public std::false_type {};
423  template <class T> struct PargemslrIsInteger<const T> : public PargemslrIsInteger<T> {};
424  template <class T> struct PargemslrIsInteger<volatile const T> : public PargemslrIsInteger<T>{};
425  template <class T> struct PargemslrIsInteger<volatile T> : public PargemslrIsInteger<T>{};
426  template<> struct PargemslrIsInteger<int> : public std::true_type {};
427  template<> struct PargemslrIsInteger<long int> : public std::true_type {};
428 
433  template <class T> struct PargemslrIsDoublePrecision : public std::false_type {};
434  template <class T> struct PargemslrIsDoublePrecision<const T> : public PargemslrIsDoublePrecision<T> {};
435  template <class T> struct PargemslrIsDoublePrecision<volatile const T> : public PargemslrIsDoublePrecision<T>{};
436  template <class T> struct PargemslrIsDoublePrecision<volatile T> : public PargemslrIsDoublePrecision<T>{};
437  template<> struct PargemslrIsDoublePrecision<double> : public std::true_type {};
438  template<> struct PargemslrIsDoublePrecision<complexd> : public std::true_type {};
439 
444  template <class T> struct PargemslrIsParallel : public std::false_type {};
445  template <class T> struct PargemslrIsParallel<const T> : public PargemslrIsParallel<T> {};
446  template <class T> struct PargemslrIsParallel<volatile const T> : public PargemslrIsParallel<T>{};
447 
453  {
454  kUnknownPrecision = -1,
455  kInt,
456  kLongInt,
457  kHalfReal,
458  kHalfComplex,
459  kSingleReal,
460  kSingleComplex,
461  kDoubleReal,
462  kDoubleComplex
463  };
464 
469  template <typename T>
471  {
472  T val;
473  int ord;
474  };
475 
480 
488  template <class T>
490  {
491  bool operator()(T const &a, T const &b) const { return a.val > b.val; }
492  };
493 
501  template <class T>
503  {
504  bool operator()(T const &a, T const &b) const { return a.val < b.val; }
505  };
506 
514  template <typename T>
515  T PargemslrMax(T a, T b);
516 
524  template <typename T>
525  T PargemslrMin(T a, T b);
526 
533  template <typename T>
534  typename std::enable_if<!PargemslrIsComplex<T>::value, T>::type
535  PargemslrAbs( const T &a);
536 
543  float PargemslrAbs( const complexs &a);
544 
551  double PargemslrAbs( const complexd &a);
552 
559  template <typename T>
560  typename std::enable_if<!PargemslrIsComplex<T>::value, T>::type
561  PargemslrReal( const T &a);
562 
569  float PargemslrReal( const complexs &a);
570 
577  double PargemslrReal( const complexd &a);
578 
585  template <typename T>
586  typename std::enable_if<!PargemslrIsComplex<T>::value, T>::type
587  PargemslrConj( const T &a);
588 
595  template <typename T>
596  typename std::enable_if<PargemslrIsComplex<T>::value, T>::type
597  PargemslrConj( const T &a);
598 
605  template <typename T>
606  typename std::enable_if<PargemslrIsInteger<T>::value, int>::type
607  PargemslrValueRandHost(T &a);
608 
615  template <typename T>
616  typename std::enable_if<PargemslrIsReal<T>::value, int>::type
617  PargemslrValueRandHost(T &a);
618 
625  template <typename T>
626  typename std::enable_if<PargemslrIsComplex<T>::value, int>::type
627  PargemslrValueRandHost(T &a);
628 
635  int PargemslrPrintSpace(int width);
636 
643  int PargemslrPrintDashLine(int width);
644 
652  template <typename T>
653  typename std::enable_if<PargemslrIsInteger<T>::value, int>::type
654  PargemslrPrintValueHost(T val, int width);
655 
663  template <typename T>
664  typename std::enable_if<PargemslrIsReal<T>::value, int>::type
665  PargemslrPrintValueHost(T val, int width);
666 
674  template <typename T>
675  typename std::enable_if<PargemslrIsComplex<T>::value, int>::type
676  PargemslrPrintValueHost(T val, int width);
677 
684  void PargemslrReadFirstWord(char *pin, char **pout);
685 
696  int PargemslrReadInputArg(const char *argname, int amount, float *val, int argc, char **argv);
697 
708  int PargemslrReadInputArg(const char *argname, int amount, double *val, int argc, char **argv);
709 
720  int PargemslrReadInputArg(const char *argname, int amount, complexs *val, int argc, char **argv);
721 
732  int PargemslrReadInputArg(const char *argname, int amount, complexd *val, int argc, char **argv);
733 
744  int PargemslrReadInputArg(const char *argname, int amount, int *val, int argc, char **argv);
745 
755  int PargemslrReadInputArg(const char *argname, char *val, int argc, char **argv);
756 
766  int PargemslrReadInputArg(const char *argname, bool *val, int argc, char **argv);
767 
776  int PargemslrReadInputArg(const char *argname, int argc, char **argv);
777 
787  template <typename T>
788  typename std::enable_if<!(PargemslrIsComplex<T>::value), int>::type
789  PargemslrPlotData(T* ydata, int length, int numx, int numy);
790 
799  template <typename T>
800  typename std::enable_if<PargemslrIsComplex<T>::value, int>::type
801  PargemslrPlotData(T* ydata, int length, int numx, int numy);
802 
809  int PargemslrSetOutputFile(const char *filename);
810 
811 }
812 
813 #endif
pargemslr::PargemslrGlobalClass::_gram_schmidt
static int _gram_schmidt
Gram schmidt option for the eigenvalue solver.
Definition: utils.hpp:406
pargemslr::PargemslrGlobalClass
The data structure for parallel computing, including data structures for MPI and CUDA.
Definition: utils.hpp:307
pargemslr::PargemslrGlobalClass::_params
static double * _params
The global parameters' array.
Definition: utils.hpp:398
complex.hpp
The complex value data structure.
pargemslr::PargemslrGlobalClass::_metis_refine
static int _metis_refine
Numter of Metis refine (for ParMetis).
Definition: utils.hpp:332
pargemslr::PargemslrIsParallel
Tell if a value is a parallel data structure.
Definition: utils.hpp:444
pargemslr::CompareStructGreater
The operator > for CompareStruct.
Definition: utils.hpp:490
pargemslr::PargemslrGlobalClass::_mersenne_twister_engine
static std::mt19937 _mersenne_twister_engine
Mersenne_twister_engine.
Definition: utils.hpp:380
pargemslr::PargemslrGlobalClass::_uniform_int_distribution
static std::uniform_int_distribution< int > _uniform_int_distribution
Uniform_int_distribution.
Definition: utils.hpp:386
pargemslr::PargemslrGlobalClass::_tr_factor
static double _tr_factor
Thick-restart factor for thick-restart Arnoldi.
Definition: utils.hpp:350
pargemslr::PargemslrGlobalClass::_expand_fact
static double _expand_fact
Expand factor, used when expand vectors with PushBack.
Definition: utils.hpp:314
pargemslr::PargemslrGlobalClass::_random_device
static std::random_device _random_device
Used to obtain a seed for the random number engine.
Definition: utils.hpp:374
pargemslr::PargemslrGlobalClass::_metis_loading_balance_tol
static double _metis_loading_balance_tol
The tolorance for loading balance when apply the parallel kway partition.
Definition: utils.hpp:338
pargemslr::ComplexValueClass
The template class complex.
Definition: complex.hpp:24
pargemslr::PargemslrGlobalClass::_dash_line_width
static int _dash_line_width
Default width of the dashline in the output.
Definition: utils.hpp:368
pargemslr::PargemslrGlobalClass::_openmp_min_loopsize
static int _openmp_min_loopsize
Disable OpenMP in some cases when a loop size is too small.
Definition: utils.hpp:326
pargemslr::PargemslrGlobalClass::_out_file
static FILE * _out_file
The output file, default is stdout.
Definition: utils.hpp:392
pargemslr::PargemslrIsDoublePrecision
Tell if a value is in double precision.
Definition: utils.hpp:433
pargemslr::PargemslrGlobalClass::_reorth_tol
static double _reorth_tol
The tolorance for re-orthogonalization for Arnoldi.
Definition: utils.hpp:362
pargemslr::CompareStructLess
The operator < for CompareStruct.
Definition: utils.hpp:503
pargemslr::PargemslrGlobalClass::_minsep
static int _minsep
Min size of the edge separator.
Definition: utils.hpp:344
pargemslr::PargemslrIsComplex
Tell if a value is a complex value.
Definition: complex.hpp:684
pargemslr::PargemslrGlobalClass::_coo_reserve_fact
static int _coo_reserve_fact
Reserved size of COO matrix, default is nrow * _coo_reserve_fact.
Definition: utils.hpp:320
pargemslr::PargemslrIsInteger
Tell if a value is integer.
Definition: utils.hpp:422
pargemslr::PargemslrGlobalClass::_orth_tol
static double _orth_tol
The tolorance for orthogonalization for Arnoldi.
Definition: utils.hpp:356
pargemslr::PrecisionEnum
PrecisionEnum
The precision enum.
Definition: utils.hpp:453
pargemslr::CompareStruct
The struct of for sorting.
Definition: utils.hpp:471