Commit 7fff920e authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

Initial commit mpp_mlmc

parents
cmake_minimum_required(VERSION 3.5.1)
project(MLMC-M++)
#---------------------------------------------------------------------------------------#
# Google test (Placed here to not compile it with mpiCC)
add_subdirectory(googletest)
include_directories(${PROJECT_BINARY_DIR}/googletest/googletest/include)
include_directories(${PROJECT_BINARY_DIR}/googlemock/googletest/include)
set(GTEST_LIB gtest gtest_main)
#---------------------------------------------------------------------------------------#
# MPI
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH}) #/usr/include/mpi/
set(CMAKE_C_COMPILER mpicc) #/usr/bin/mpicc
set(CMAKE_CXX_COMPILER mpiCC) #/usr/bin/mpiCC
set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS})
set(CMAKE_BUILD_TYPE distribution)
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-Ofast")
set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O0")
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O1")
#set(CMAKE_CXX_FLAGS_DISTRIBUTION "-O2")
set(CMAKE_CXX_FLAGS "-fPIC -g -Wno-deprecated -std=gnu++11")
#---------------------------------------------------------------------------------------#
# Blas Lapack
#Cmake can't find FFTW3 for some reason but is able to link it
#find_package(FFTW3 REQUIRED)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
#---------------------------------------------------------------------------------------#
# Manage folder structure build folder
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/gp)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/log)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/dual)
#---------------------------------------------------------------------------------------#
# Include directories
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/src/LIB_PS)
include_directories(${PROJECT_SOURCE_DIR}/mlmc/src)
include_directories(${PROJECT_SOURCE_DIR}/superlu/include)
include_directories(${PROJECT_SOURCE_DIR}/sprng5/include)
#---------------------------------------------------------------------------------------#
# Link directories
link_directories(${PROJECT_SOURCE_DIR}/superlu/lib)
if (UNIX AND NOT APPLE)
set(SUPERLU superlu_4.3)
elseif (APPLE)
set(SUPERLU superlu_4.3_mac10.10)
elseif (WIN32)
set(SUPERLU superlu_4.3_cygwin)
endif ()
link_directories(${PROJECT_SOURCE_DIR}/sprng5/lib)
#---------------------------------------------------------------------------------------#
# Subdirectories
add_subdirectory(src)
add_subdirectory(mlmc/src)
#---------------------------------------------------------------------------------------#
# Executables
add_executable(MLMC-M++ mlmc/src/MLMCMain.C)
# Linking
target_link_libraries(MLMC-M++ MLMC sprng SRC SRC_Solver blas lapack ${SUPERLU} fftw3 m)
#---------------------------------------------------------------------------------------#
# Test Executables
add_executable(TestCirculantEmbedding mlmc/tests/TestCirculantEmbedding.C)
add_executable(TestRNManager mlmc/tests/TestRNManager.C)
# Linking
target_link_libraries(TestCirculantEmbedding MLMC sprng SRC SRC_Solver
blas lapack ${SUPERLU} fftw3 m ${GTEST_LIB})
target_link_libraries(TestRNManager MLMC sprng fftw3 m ${GTEST_LIB})
set(MPI_COMMAND mpirun -np 4 )
#---------------------------------------------------------------------------------------#
#Problem = StochasticProblem1D
Problem = StochasticProblem2D
#Mesh = Line
Mesh = UnitSquare
Discretization = linear
#Discretization = serendipity
#Discretization = quadratic
Distribution = RCB
LinearSolver = GMRES
Preconditioner = LIB_PS
#Preconditioner = SGS
#Preconditioner = GaussSeidel
#Preconditioner = Jacobi
LinearReduction = 1e-12
LinearEpsilon = 1e-10
LinearSteps = 2000
NewtonSteps = 1
NewtonLineSearchSteps = 0
TimeLevel = -1
LinearVerbose = -1
BaseSolverVerbose = -1
MuteLevel = -1
NewtonVerbose = -1
DebugLevel = -1
POINTS:
0 0
1 0
2 0
3 0
0 1
1 1
2 1
3 1
0 2
1 2
2 2
3 2
0 3
1 3
2 3
3 3
CELLS:
4 1 0 1 5 4
4 1 2 3 7 6
4 1 4 5 9 8
4 1 5 6 10 9
4 1 6 7 11 10
4 1 8 9 13 12
4 1 9 10 14 13
4 1 10 11 15 14
FACES:
2 1 0 1
2 0 1 5
2 0 5 6
2 0 6 2
2 1 2 3
2 0 3 7
2 0 7 11
2 0 11 15
2 2 15 14
2 2 14 13
2 2 13 12
2 0 12 8
2 0 8 4
2 0 4 0
POINTS:
0
1
CELLS:
2 1 0 1
FACES:
1 2 0
1 1 1
POINTS:
-1 -1
0 -1
1 -1
-1 0
0 0
1 0
-1 1
0 1
1 1
CELLS:
4 1 0 1 4 3
4 1 1 2 5 4
4 1 3 4 7 6
4 1 4 5 8 7
FACES:
2 1 0 1
2 1 1 2
2 0 2 5
2 0 5 8
2 2 8 7
2 2 7 6
2 0 6 3
2 0 3 0
\ No newline at end of file
POINTS:
0.000000 0.000000
0.000000 0.062500
0.000000 0.125000
0.000000 0.187500
0.000000 0.250000
0.000000 0.312500
0.000000 0.375000
0.000000 0.437500
0.000000 0.500000
0.000000 0.562500
0.000000 0.625000
0.000000 0.687500
0.000000 0.750000
0.000000 0.812500
0.000000 0.875000
0.000000 0.937500
0.000000 1.000000
0.062500 0.000000
0.062500 0.062500
0.062500 0.125000
0.062500 0.187500
0.062500 0.250000
0.062500 0.312500
0.062500 0.375000
0.062500 0.437500
0.062500 0.500000
0.062500 0.562500
0.062500 0.625000
0.062500 0.687500
0.062500 0.750000
0.062500 0.812500
0.062500 0.875000
0.062500 0.937500
0.062500 1.000000
0.125000 0.000000
0.125000 0.062500
0.125000 0.125000
0.125000 0.187500
0.125000 0.250000
0.125000 0.312500
0.125000 0.375000
0.125000 0.437500
0.125000 0.500000
0.125000 0.562500
0.125000 0.625000
0.125000 0.687500
0.125000 0.750000
0.125000 0.812500
0.125000 0.875000
0.125000 0.937500
0.125000 1.000000
0.187500 0.000000
0.187500 0.062500
0.187500 0.125000
0.187500 0.187500
0.187500 0.250000
0.187500 0.312500
0.187500 0.375000
0.187500 0.437500
0.187500 0.500000
0.187500 0.562500
0.187500 0.625000
0.187500 0.687500
0.187500 0.750000
0.187500 0.812500
0.187500 0.875000
0.187500 0.937500
0.187500 1.000000
0.250000 0.000000
0.250000 0.062500
0.250000 0.125000
0.250000 0.187500
0.250000 0.250000
0.250000 0.312500
0.250000 0.375000
0.250000 0.437500
0.250000 0.500000
0.250000 0.562500
0.250000 0.625000
0.250000 0.687500
0.250000 0.750000
0.250000 0.812500
0.250000 0.875000
0.250000 0.937500
0.250000 1.000000
0.312500 0.000000
0.312500 0.062500
0.312500 0.125000
0.312500 0.187500
0.312500 0.250000
0.312500 0.312500
0.312500 0.375000
0.312500 0.437500
0.312500 0.500000
0.312500 0.562500
0.312500 0.625000
0.312500 0.687500
0.312500 0.750000
0.312500 0.812500
0.312500 0.875000
0.312500 0.937500
0.312500 1.000000
0.375000 0.000000
0.375000 0.062500
0.375000 0.125000
0.375000 0.187500
0.375000 0.250000
0.375000 0.312500
0.375000 0.375000
0.375000 0.437500
0.375000 0.500000
0.375000 0.562500
0.375000 0.625000
0.375000 0.687500
0.375000 0.750000
0.375000 0.812500
0.375000 0.875000
0.375000 0.937500
0.375000 1.000000
0.437500 0.000000
0.437500 0.062500
0.437500 0.125000
0.437500 0.187500
0.437500 0.250000
0.437500 0.312500
0.437500 0.375000
0.437500 0.437500
0.437500 0.500000
0.437500 0.562500
0.437500 0.625000
0.437500 0.687500
0.437500 0.750000
0.437500 0.812500
0.437500 0.875000
0.437500 0.937500
0.437500 1.000000
0.500000 0.000000
0.500000 0.062500
0.500000 0.125000
0.500000 0.187500
0.500000 0.250000
0.500000 0.312500
0.500000 0.375000
0.500000 0.437500
0.500000 0.500000
0.500000 0.562500
0.500000 0.625000
0.500000 0.687500
0.500000 0.750000
0.500000 0.812500
0.500000 0.875000
0.500000 0.937500
0.500000 1.000000
0.562500 0.000000
0.562500 0.062500
0.562500 0.125000
0.562500 0.187500
0.562500 0.250000
0.562500 0.312500
0.562500 0.375000
0.562500 0.437500
0.562500 0.500000
0.562500 0.562500
0.562500 0.625000
0.562500 0.687500
0.562500 0.750000
0.562500 0.812500
0.562500 0.875000
0.562500 0.937500
0.562500 1.000000
0.625000 0.000000
0.625000 0.062500
0.625000 0.125000
0.625000 0.187500
0.625000 0.250000
0.625000 0.312500
0.625000 0.375000
0.625000 0.437500
0.625000 0.500000
0.625000 0.562500
0.625000 0.625000
0.625000 0.687500
0.625000 0.750000
0.625000 0.812500
0.625000 0.875000
0.625000 0.937500
0.625000 1.000000
0.687500 0.000000
0.687500 0.062500
0.687500 0.125000
0.687500 0.187500
0.687500 0.250000
0.687500 0.312500
0.687500 0.375000
0.687500 0.437500
0.687500 0.500000
0.687500 0.562500
0.687500 0.625000
0.687500 0.687500
0.687500 0.750000
0.687500 0.812500
0.687500 0.875000
0.687500 0.937500
0.687500 1.000000
0.750000 0.000000
0.750000 0.062500
0.750000 0.125000
0.750000 0.187500
0.750000 0.250000
0.750000 0.312500
0.750000 0.375000
0.750000 0.437500
0.750000 0.500000
0.750000 0.562500
0.750000 0.625000
0.750000 0.687500
0.750000 0.750000
0.750000 0.812500
0.750000 0.875000
0.750000 0.937500
0.750000 1.000000
0.812500 0.000000
0.812500 0.062500
0.812500 0.125000
0.812500 0.187500
0.812500 0.250000
0.812500 0.312500
0.812500 0.375000
0.812500 0.437500
0.812500 0.500000
0.812500 0.562500
0.812500 0.625000
0.812500 0.687500
0.812500 0.750000
0.812500 0.812500
0.812500 0.875000
0.812500 0.937500
0.812500 1.000000
0.875000 0.000000
0.875000 0.062500
0.875000 0.125000
0.875000 0.187500
0.875000 0.250000
0.875000 0.312500
0.875000 0.375000
0.875000 0.437500
0.875000 0.500000
0.875000 0.562500
0.875000 0.625000
0.875000 0.687500
0.875000 0.750000
0.875000 0.812500
0.875000 0.875000
0.875000 0.937500
0.875000 1.000000
0.937500 0.000000
0.937500 0.062500
0.937500 0.125000
0.937500 0.187500
0.937500 0.250000
0.937500 0.312500
0.937500 0.375000
0.937500 0.437500
0.937500 0.500000
0.937500 0.562500
0.937500 0.625000
0.937500 0.687500
0.937500 0.750000
0.937500 0.812500
0.937500 0.875000
0.937500 0.937500
0.937500 1.000000
1.000000 0.000000
1.000000 0.062500
1.000000 0.125000
1.000000 0.187500
1.000000 0.250000
1.000000 0.312500
1.000000 0.375000
1.000000 0.437500
1.000000 0.500000
1.000000 0.562500
1.000000 0.625000
1.000000 0.687500
1.000000 0.750000
1.000000 0.812500
1.000000 0.875000
1.000000 0.937500
1.000000 1.000000
CELLS:
3 1 150 167 151
3 1 213 230 214
3 1 236 253 237
3 1 11 29 12
3 1 137 155 138
3 1 196 212 213
3 1 5 22 6
3 1 63 80 81
3 1 68 85 69
3 1 189 206 207
3 1 98 97 115
3 1 160 178 161
3 1 91 108 92
3 1 74 90 91
3 1 200 217 201
3 1 263 280 264
3 1 27 44 45
3 1 153 170 171
3 1 62 61 79
3 1 183 199 200
3 1 188 187 205
3 1 131 113 130
3 1 176 193 194
3 1 257 239 256
3 1 210 228 211
3 1 285 286 269
3 1 38 54 55
3 1 262 279 280
3 1 140 141 124
3 1 250 267 251
3 1 26 25 43
3 1 147 163 164
3 1 14 31 32
3 1 140 157 158
3 1 48 66 49
3 1 112 111 129
3 1 175 174 192
3 1 249 250 233
3 1 100 117 118
3 1 226 243 244
3 1 134 152 135
3 1 105 122 106
3 1 2 18 19
3 1 261 260 278
3 1 41 42 25
3 1 104 105 88
3 1 151 168 152
3 1 214 231 215
3 1 12 30 13
3 1 138 156 139
3 1 197 213 214
3 1 6 23 7
3 1 64 81 82
3 1 127 144 145
3 1 69 86 70
3 1 190 207 208
3 1 98 116 99
3 1 236 237 220
3 1 225 224 242
3 1 92 109 93
3 1 52 68 69
3 1 75 91 92
3 1 201 218 202
3 1 264 281 265
3 1 28 45 46
3 1 154 171 172
3 1 62 80 63
3 1 200 201 184
3 1 189 188 206
3 1 56 73 57
3 1 177 194 195
3 1 119 136 120
3 1 240 257 258
3 1 286 287 270
3 1 211 229 212
3 1 39 55 56
3 1 165 182 166
3 1 141 142 125
3 1 26 44 27
3 1 148 164 165
3 1 15 32 33
3 1 96 78 95
3 1 21 20 37
3 1 141 158 159
3 1 49 67 50
3 1 113 112 130
3 1 176 175 193
3 1 204 221 222
3 1 234 250 251
3 1 239 238 256
3 1 106 123 107
3 1 227 244 245
3 1 3 19 20
3 1 262 261 279
3 1 105 106 89
3 1 215 232 216
3 1 42 59 60
3 1 13 31 14
3 1 77 76 94
3 1 139 157 140
3 1 198 214 215
3 1 7 24 8
3 1 128 145 146
3 1 70 87 71
3 1 100 99 117
3 1 191 208 209
3 1 226 225 243
3 1 53 69 70
3 1 179 196 180
3 1 92 93 76
3 1 202 219 203
3 1 265 282 266
3 1 162 178 179
3 1 29 46 47
3 1 34 51 35
3 1 64 63 81
3 1 155 172 173
3 1 185 201 202
3 1 264 265 248
3 1 190 189 207
3 1 133 115 132
3 1 57 74 58
3 1 259 241 258
3 1 287 288 271
3 1 56 57 40
3 1 103 119 120
3 1 167 166 183
3 1 229 246 230
3 1 142 143 126
3 1 28 27 45
3 1 252 269 253
3 1 149 165 166
3 1 154 153 171
3 1 97 79 96
3 1 21 38 22
3 1 114 113 131
3 1 142 159 160
3 1 223 205 222
3 1 235 251 252
3 1 176 194 177
3 1 240 239 257
3 1 107 124 108
3 1 228 245 246
3 1 4 20 21
3 1 262 280 263
3 1 90 106 107
3 1 216 233 217
3 1 61 43 60
3 1 14 32 15
3 1 199 215 216
3 1 140 158 141
3 1 66 83 84
3 1 71 88 72
3 1 100 118 101
3 1 129 146 147
3 1 192 209 210
3 1 255 272 273
3 1 226 244 227
3 1 54 70 71
3 1 181 180 197
3 1 266 283 267
3 1 163 179 180