Skip to content
Snippets Groups Projects
Commit 616f007e authored by Dmitri Naumov's avatar Dmitri Naumov Committed by GitHub
Browse files

Merge pull request #1919 from endJunction/EigenDontVectorize

Disable eigen vectorization by default.
parents 40f13de9 e2fd17a2
No related branches found
No related tags found
No related merge requests found
...@@ -90,6 +90,13 @@ option(OGS_USE_EIGEN_UNSUPPORTED "Use Eigen unsupported modules" ON) ...@@ -90,6 +90,13 @@ option(OGS_USE_EIGEN_UNSUPPORTED "Use Eigen unsupported modules" ON)
option(OGS_EIGEN_INITIALIZE_MATRICES_BY_NAN "" ON) option(OGS_EIGEN_INITIALIZE_MATRICES_BY_NAN "" ON)
option(EIGEN_NO_DEBUG "Disables Eigen's assertions" OFF) option(EIGEN_NO_DEBUG "Disables Eigen's assertions" OFF)
# We assume that it's save to use vectorization with Eigen < 3.3 (strictly smaller than 3.3.!).
# At least we only observed vectorization issues with Eigen 3.3.x.
# If you want to use Eigen vectorization, make sure that you run all the ctests several times, e.g.:
# $ ctest --repeat-until-fail 50
# You might also want to take a look at https://github.com/ufz/ogs/issues/1881.
option(EIGEN_DONT_VECTORIZE "Disables explicit vectorization when defined." ON)
set(OGS_EIGEN_DYNAMIC_SHAPE_MATRICES "Default" CACHE STRING "Use dynamically allocated shape matrices") set(OGS_EIGEN_DYNAMIC_SHAPE_MATRICES "Default" CACHE STRING "Use dynamically allocated shape matrices")
set_property(CACHE OGS_EIGEN_DYNAMIC_SHAPE_MATRICES set_property(CACHE OGS_EIGEN_DYNAMIC_SHAPE_MATRICES
PROPERTY STRINGS "Default" "ON" "OFF") PROPERTY STRINGS "Default" "ON" "OFF")
...@@ -192,6 +199,11 @@ endif() ...@@ -192,6 +199,11 @@ endif()
if (EIGEN_NO_DEBUG) if (EIGEN_NO_DEBUG)
add_definitions(-DEIGEN_NO_DEBUG) add_definitions(-DEIGEN_NO_DEBUG)
endif() endif()
if (EIGEN_DONT_VECTORIZE)
add_definitions(-DEIGEN_DONT_VECTORIZE)
endif()
if(OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL) if(OGS_EIGEN_DYNAMIC_SHAPE_MATRICES_INTERNAL)
add_definitions(-DOGS_EIGEN_DYNAMIC_SHAPE_MATRICES) add_definitions(-DOGS_EIGEN_DYNAMIC_SHAPE_MATRICES)
endif() endif()
......
...@@ -89,7 +89,7 @@ AddTest( ...@@ -89,7 +89,7 @@ AddTest(
WRAPPER time WRAPPER time
TESTER vtkdiff TESTER vtkdiff
REQUIREMENTS NOT OGS_USE_MPI REQUIREMENTS NOT OGS_USE_MPI
ABSTOL 5e-14 RELTOL 1e-16 ABSTOL 1e-13 RELTOL 1e-16
DIFF_DATA DIFF_DATA
expected_square_1e2_UC_late_pcs_0_ts_10_t_1000.000000.vtu square_1e2_UC_late_pcs_0_ts_10_t_1000.000000.vtu displacement displacement expected_square_1e2_UC_late_pcs_0_ts_10_t_1000.000000.vtu square_1e2_UC_late_pcs_0_ts_10_t_1000.000000.vtu displacement displacement
expected_square_1e2_UC_late_pcs_0_ts_10_t_1000.000000.vtu square_1e2_UC_late_pcs_0_ts_10_t_1000.000000.vtu pressure pressure expected_square_1e2_UC_late_pcs_0_ts_10_t_1000.000000.vtu square_1e2_UC_late_pcs_0_ts_10_t_1000.000000.vtu pressure pressure
......
...@@ -143,7 +143,7 @@ TEST(MPITest_NumLib, ComponentNormMultiComponent1) ...@@ -143,7 +143,7 @@ TEST(MPITest_NumLib, ComponentNormMultiComponent1)
unsigned const num_components = 3; unsigned const num_components = 3;
auto const norm_type = MathLib::VecNormType::NORM1; auto const norm_type = MathLib::VecNormType::NORM1;
auto const tolerance = auto const tolerance =
num_components * 600 * std::numeric_limits<double>::epsilon(); num_components * 1700 * std::numeric_limits<double>::epsilon();
do_test(num_components, norm_type, tolerance, do_test(num_components, norm_type, tolerance,
[](double n_total, double n) { return n_total + n; }, [](double n_total, double n) { return n_total + n; },
...@@ -159,7 +159,7 @@ TEST(MPITest_NumLib, ComponentNormMultiComponent2) ...@@ -159,7 +159,7 @@ TEST(MPITest_NumLib, ComponentNormMultiComponent2)
unsigned const num_components = 3; unsigned const num_components = 3;
auto const norm_type = MathLib::VecNormType::NORM2; auto const norm_type = MathLib::VecNormType::NORM2;
auto const tolerance = auto const tolerance =
num_components * 20 * std::numeric_limits<double>::epsilon(); num_components * 22 * std::numeric_limits<double>::epsilon();
do_test(num_components, norm_type, tolerance, do_test(num_components, norm_type, tolerance,
[](double n_total, double n) { return n_total + n*n; }, [](double n_total, double n) { return n_total + n*n; },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment