INMOST
Mathematical Modelling Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
inmost_common.h
Go to the documentation of this file.
1 
2 #ifndef INMOST_COMMON_INCLUDED
3 #define INMOST_COMMON_INCLUDED
4 
5 
6 #include "inmost_options.h"
7 #if !defined(INMOST_OPTIONS_CMAKE_INCLUDED)
8 //no options from cmake -- define minimum
9 //#define USE_OMP
10 
11 #define USE_MESH
12 
13 #define USE_PARTITIONER
14 //#define USE_PARTITIONER_ZOLTAN
15 //#define USE_PARTITIONER_PARMETIS
16 
17 #define USE_SOLVER
18 //#define USE_SOLVER_METIS
19 //#define USE_SOLVER_PETSC
20 //#define USE_SOLVER_TRILINOS
21 //#define USE_SOLVER_ANI
22 
23 
24 #define USE_NONLINEAR
25 //#define USE_NONLINEAR_PETSC
26 //#define USE_NONLINEAR_TRILINOS
27 //#define USE_NONLINEAR_SUNDIALS
28 
29 #define USE_AUTODIFF
30 //#define USE_AUTODIFF_ASMJIT
31 //#define USE_AUTODIFF_OPENCL
32 //#define USE_AUTODIFF_EXPRESSION_TEMPLATES
33 
34 //#define USE_MPI //include mpi for mpi functions
35 //#define USE_MPI_P2P //use (probably) more effective mpi-2 algorithms
36 //#define USE_MPI_FILE //use MPI_File_xxx functionality
37 //#define USE_MPI2 //set of your version produce warnings
38 #endif //INMOST_OPTIONS_CMAKE_INCLUDED
39 
40 
41 // a very expensive check for debug purposes,
42 // when you release marker checks all the elements
43 // that no element is marked by released marker
44 //#define CHECKS_MARKERS
45 
46 // use additional sets to store elements for parallel
47 // exchanges, otherwise it will recompute those elements
48 // which is quite expensive
49 #define USE_PARALLEL_STORAGE
50 
51 // output xml files for debugging of parallel algorithms
52 // search for style.xsl within examples for comfortable
53 // view of generated xml files
54 //#define USE_PARALLEL_WRITE_TIME
55 
56 // this will revert Mesh::PrepareReceiveInner to always
57 // use MPI point to point functionality disregarding problem type
58 // read comments in Mesh::SetParallelStrategy for more info
59 // USE_MPI_P2P must be enabled for feature to work
60 //#define PREFFER_MPI_P2P
61 
62 // this will write out shared set of elements that lay between processors in GMV format
63 //#define DEBUG_COMPUTE_SHARED_SKIN_SET
64 
65 // this controls how sparse data will be allocated,
66 // when difinition is not commented memory will be always consumed
67 // by data structure needed to support sparse data,
68 // otherwise data structure will be allocated only when
69 // sparse data is presenet
70 //#define LAZY_SPARSE_ALLOCATION
71 
72 // this will force array class to use 12 bytes instead of 16 bytes
73 #define PACK_ARRAY
74 
75 #define __INLINE inline
76 
77 #if defined(USE_OMP)
78 #include <omp.h>
79 #endif
80 #if defined(USE_MPI)
81 #include <mpi.h>
82 #if !defined(MSMPI_VER) && !defined(MPIO_INCLUDE) && defined(USE_MPI_FILE) && !defined(OMPI_PROVIDE_MPI_FILE_INTERFACE)
83 #include <mpio.h> //some versions of MPI doesn't include that
84 #endif
85 #endif
86 
87 #include <string>
88 #include <vector>
89 #include <set>
90 #include <map>
91 #include <list>
92 #include <algorithm>
93 #include <cmath>
94 #include <iostream>
95 #include <fstream>
96 #include <stdlib.h>
97 #include <stdio.h>
98 #include <limits.h>
99 #if defined(USE_OMP)
100 #include <omp.h>
101 #endif
102 #if defined(USE_MPI)
103 #include <mpi.h>
104 #endif
105 
106 #if !defined(USE_MPI)
107 #define INMOST_MPI_Request int
108 #define INMOST_MPI_Type int
109 #define INMOST_MPI_Comm int
110 #define INMOST_MPI_COMM_WORLD 0
111 #define INMOST_MPI_BYTE 0
112 #define INMOST_MPI_INT 0
113 #define INMOST_MPI_DOUBLE 0
114 #define INMOST_MPI_UNSIGNED 0
115 #define INMOST_MPI_Win int
116 #define INMOST_MPI_DATATYPE_NULL 0
117 #else
118 #define INMOST_MPI_Request MPI_Request
119 #define INMOST_MPI_Type MPI_Datatype
120 #define INMOST_MPI_Comm MPI_Comm
121 #define INMOST_MPI_COMM_WORLD MPI_COMM_WORLD
122 #define INMOST_MPI_BYTE MPI_BYTE
123 #define INMOST_MPI_INT MPI_INT
124 #define INMOST_MPI_DOUBLE MPI_DOUBLE
125 #define INMOST_MPI_UNSIGNED MPI_UNSIGNED
126 #define INMOST_MPI_Win MPI_Win
127 #define INMOST_MPI_DATATYPE_NULL MPI_DATATYPE_NULL
128 #endif
129 
130 
131 #define INMOST_MPI_SIZE int //in case MPI standard changes and compiler gives tons of warning
132 
133 #define INMOST_DATA_INTEGER_TYPE int
134 #define INMOST_DATA_REAL_TYPE double
135 #define INMOST_DATA_BULK_TYPE unsigned char //this should be one byte long
136 
137 #define INMOST_MPI_DATA_INTEGER_TYPE INMOST_MPI_INT
138 #define INMOST_MPI_DATA_REAL_TYPE INMOST_MPI_DOUBLE
139 #define INMOST_MPI_DATA_BULK_TYPE INMOST_MPI_BYTE
140 
141 
142 
143 #define INMOST_DATA_ENUM_TYPE unsigned int
144 #define ENUMUNDEF UINT_MAX
145 #define INMOST_DATA_BIG_ENUM_TYPE unsigned int
146 #define BIGENUMUNDEF UINT_MAX
147 
148 #define INMOST_MPI_DATA_ENUM_TYPE INMOST_MPI_UNSIGNED
149 #define INMOST_MPI_DATA_BIG_ENUM_TYPE INMOST_MPI_UNSIGNED
150 
151 
159 double Timer();
160 
161 namespace INMOST
162 {
168  enum ErrorType
169  {
171  Failure=100,
192 
204 
214 
219 
223  };
224 }
225 
226 #include "container.hpp"
227 //#include "io.hpp"
228 
229 
230 #endif //INMOST_COMMON_INCLUDED
The very tail of the errors list.
The list of errors connected to mesh consistency.
The list of errors may occur in the Linear Solver.
The list of errors may occur in the Partitioner.
double Timer()
The list of general type errors.