|
|
The default builds are set in such a way that any mistakes are found as early as possible. This includes:
|
|
|
|
|
|
- The default build type is Debug
|
|
|
- Eigen matrices are initialized with NaN
|
|
|
- ...
|
|
|
|
|
|
Usually this safety features take some cycles to run resulting in slower than possible execution. To improve this there are several options:
|
|
|
- Build in release mode: CMAKE_BUILD_TYPE=Release
|
|
|
- Choose native cpu architecture (this is default): OGS_CPU_ARCHITECTURE=native
|
|
|
- Use fixed size matrices: OGS_EIGEN_DYNAMIC_SHAPE_MATRICES=OFF
|
|
|
- Don't initialize matrices by default: OGS_EIGEN_INITIALIZE_MATRICES_BY_NAN=OFF
|
|
|
- Enable Eigen's vectorization: EIGEN_DONT_VECTORIZE=OFF (__Warning__: Using vectorization might lead to unpredictable behaviour for Eigen >= 3.3. See [#1881](https://github.com/ufz/ogs/issues/1881) ff.)
|
|
|
- Potentially reduce log level choosing between OGS_LOG_LEVEL=LOGOG_LEVEL_DEBUG (most verbose), LOGOG_LEVEL_INFO, LOGOG_LEVEL_WARN, LOGOG_LEVEL_ERROR, LOGOG_LEVEL_NONE (no output at all)
|
|
|
|
|
|
General compilation flags improving the performance for gcc and clang compilers:
|
|
|
- Enable link time optimizations using `-flto` (this reduces the binary size and might save few function calls)
|
|
|
- Use profile guided optimizations. Requires two compilations, one for getting the statistics (`-fprofile-instr-generate` flag for the clang compiler), and another using those measurements (`-ffprofile-instr-use=profile.data`). See [Clang Compiler User's Manual # Profiling with instrumentation](https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation) |
|
|
\ No newline at end of file |