Skip to content

Commit

Permalink
Merge branch 'eigen-fix' into 'master'
Browse files Browse the repository at this point in the history
[ML/Eigen] fix parallel execution for Eigen linear solvers

See merge request ogs/ogs!5182
  • Loading branch information
Dmitry Yu. Naumov committed Jan 7, 2025
2 parents b97c0b4 + 1963cda commit b3350d9
Show file tree
Hide file tree
Showing 19 changed files with 62 additions and 50 deletions.
17 changes: 16 additions & 1 deletion Applications/ApplicationsLib/LinearSolverLibrarySetup.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,22 @@ namespace ApplicationsLib
{
struct LinearSolverLibrarySetup final
{
LinearSolverLibrarySetup(int /*argc*/, char* /*argv*/[]) {}
LinearSolverLibrarySetup(int /*argc*/, char* /*argv*/[])
{
#ifdef _OPENMP
const char* omp_num_threads_env = std::getenv("OMP_NUM_THREADS");
if (omp_num_threads_env)
{
INFO("OMP_NUM_THREADS is set to: {:s}", omp_num_threads_env);
}
else
{
WARN("OMP_NUM_THREADS is not set, falling back to: {:d}",
omp_get_max_threads());
}
#endif
INFO("Eigen use {:d} threads", Eigen::nbThreads());
}
~LinearSolverLibrarySetup()
{
NumLib::cleanupGlobalMatrixProviders();
Expand Down
2 changes: 1 addition & 1 deletion Applications/Utils/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ AddTest(
EXECUTABLE_ARGS -i sfc_mesh_9k.vtu -o ${Data_BINARY_DIR}/Utils/createTetgenSmeshFromRasters/CTSMFL-test -r rasterlist.txt
RUNTIME 1
TESTER numdiff
DIFF_DATA CTSMFL-test.smesh 0 5e-13
DIFF_DATA CTSMFL-test.smesh 0 7e-12
)

AddTest(
Expand Down
4 changes: 2 additions & 2 deletions ProcessLib/LIE/HydroMechanics/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ AddTest(
single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu fracture_stress fracture_stress 1e-15 1e-15
single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu fracture_aperture fracture_aperture 1e-15 1e-15
single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu fracture_permeability fracture_permeability 1e-15 1e-15
single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu sigma sigma 5e-13 1e-15
single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu sigma sigma 5e-13 2e-13
single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu epsilon epsilon 1e-15 1e-15
single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu velocity velocity 1e-15 1e-15
single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_ts_1108_t_10000.000000.vtu fracture_stress_avg fracture_stress_avg 1e-15 1e-15
Expand Down Expand Up @@ -156,7 +156,7 @@ AddTest(
single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu fracture_permeability fracture_permeability 1e-15 1e-15
single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu fracture_stress fracture_stress 1e-15 1e-15
single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu fracture_aperture fracture_aperture 1e-15 1e-15
single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu sigma sigma 2e-13 1e-15
single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu sigma sigma 3e-13 1e-15
single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu epsilon epsilon 1e-15 1e-15
single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu velocity velocity 1e-15 1e-15
single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu single_fracture_3compartments_flow_linear_aperture0_e_ts_1108_t_10000.000000.vtu local_jump_w_avg local_jump_w_avg 1e-15 1e-15
Expand Down
2 changes: 1 addition & 1 deletion ProcessLib/LiquidFlow/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ AddTest(
TESTER vtkdiff
REQUIREMENTS NOT OGS_USE_MPI
DIFF_DATA
standard_solution_buildup_test_ts_107_t_424800.000000.vtu buildup_test_ts_107_t_424800.000000.vtu pressure pressure 1.6e-5 0.0
standard_solution_buildup_test_ts_107_t_424800.000000.vtu buildup_test_ts_107_t_424800.000000.vtu pressure pressure 1.7e-5 0.0
standard_solution_buildup_test_ts_211_t_720000.000000.vtu buildup_test_ts_211_t_720000.000000.vtu pressure pressure 5.8e-5 0.0
)

Expand Down
8 changes: 4 additions & 4 deletions ProcessLib/ThermoMechanics/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ AddTest(
DIFF_DATA
cthex_ref.vtu cube_1e0_lin_ts_1_t_1.000000.vtu sigma_1 sigma 1e-16 0
cthex_ref.vtu cube_1e0_lin_ts_2_t_2.000000.vtu sigma_2 sigma 1e-8 0
cthex_ref.vtu cube_1e0_lin_ts_3_t_3.000000.vtu sigma_3 sigma 1e-8 0
cthex_ref.vtu cube_1e0_lin_ts_4_t_4.000000.vtu sigma_4 sigma 1e-8 0
cthex_ref.vtu cube_1e0_lin_ts_3_t_3.000000.vtu sigma_3 sigma 2e-8 0
cthex_ref.vtu cube_1e0_lin_ts_4_t_4.000000.vtu sigma_4 sigma 2e-8 0
cthex_ref.vtu cube_1e0_lin_ts_5_t_5.000000.vtu sigma_5 sigma 1e-8 0
cthex_ref.vtu cube_1e0_lin_ts_6_t_6.000000.vtu sigma_6 sigma 1e-8 0
cthex_ref.vtu cube_1e0_lin_ts_7_t_7.000000.vtu sigma_7 sigma 1e-8 0
cthex_ref.vtu cube_1e0_lin_ts_6_t_6.000000.vtu sigma_6 sigma 2e-8 0
cthex_ref.vtu cube_1e0_lin_ts_7_t_7.000000.vtu sigma_7 sigma 2e-8 0
cthex_ref.vtu cube_1e0_lin_ts_8_t_8.000000.vtu sigma_8 sigma 2e-8 0
cthex_ref.vtu cube_1e0_lin_ts_9_t_9.000000.vtu sigma_9 sigma 2e-8 0
cthex_ref.vtu cube_1e0_lin_ts_10_t_10.000000.vtu sigma_10 sigma 2e-8 0
Expand Down
2 changes: 1 addition & 1 deletion Tests/Data/Mechanics/Ehlers/cube_1e0.prj
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
<vtkdiff>
<file>cube_1e0_ts_101_t_2.550000.vtu</file>
<field>sigma</field>
<absolute_tolerance>2e-13</absolute_tolerance>
<absolute_tolerance>3e-13</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
<vtkdiff>
<file>out_bar_medium_ED_ts_60_t_0.600000.vtu</file>
<field>sigma</field>
<absolute_tolerance>2.1e-7</absolute_tolerance>
<absolute_tolerance>2.3e-7</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
<vtkdiff>
<file>out_beam_fine_ED_ts_80_t_0.800000.vtu</file>
<field>sigma</field>
<absolute_tolerance>2e-6</absolute_tolerance>
<absolute_tolerance>2.1e-6</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
<vtkdiff>
<regex>load_test_hb_ts_.*_t_.*.vtu</regex>
<field>EquivalentPlasticStrain</field>
<absolute_tolerance>6e-9</absolute_tolerance>
<absolute_tolerance>9e-9</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
</test_definition>
Expand Down
2 changes: 1 addition & 1 deletion Tests/Data/Mechanics/Linear/PythonPiston/piston.prj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
<vtkdiff>
<file>piston_ts_10_t_10.000000.vtu</file>
<field>sigma</field>
<absolute_tolerance>3e-8</absolute_tolerance>
<absolute_tolerance>3.4e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
</test_definition>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,31 +445,31 @@
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Cm-247]</field>
<absolute_tolerance>2e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>1e-10</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Am-243]</field>
<absolute_tolerance>2e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>1e-16</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Pu-239]</field>
<absolute_tolerance>2e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>1e-16</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[U-235]</field>
<absolute_tolerance>2e-8</absolute_tolerance>
<absolute_tolerance>3.2e-8</absolute_tolerance>
<relative_tolerance>1e-16</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Pa-231]</field>
<absolute_tolerance>2e-8</absolute_tolerance>
<absolute_tolerance>3e-8</absolute_tolerance>
<relative_tolerance>1e-16</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,37 @@
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Cm-247]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Am-243]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Pu-239]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.2e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[U-235]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.2e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Pa-231]</field>
<absolute_tolerance>1.5e-8</absolute_tolerance>
<absolute_tolerance>3e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Ac-227]</field>
<absolute_tolerance>2.6e-9</absolute_tolerance>
<absolute_tolerance>5.1e-9</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,37 +46,37 @@
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Cm-247]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Am-243]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Pu-239]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.2e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[U-235]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.2e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Pa-231]</field>
<absolute_tolerance>1.5e-8</absolute_tolerance>
<absolute_tolerance>3e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Ac-227]</field>
<absolute_tolerance>2.6e-9</absolute_tolerance>
<absolute_tolerance>5.1e-9</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,37 @@
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Cm-247]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Am-243]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.1e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Pu-239]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.2e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[U-235]</field>
<absolute_tolerance>1.6e-8</absolute_tolerance>
<absolute_tolerance>3.2e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Pa-231]</field>
<absolute_tolerance>1.5e-8</absolute_tolerance>
<absolute_tolerance>3e-8</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>1d_decay_chain_GIA_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
<field>[Ac-227]</field>
<absolute_tolerance>2.6e-9</absolute_tolerance>
<absolute_tolerance>5.1e-9</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
2 changes: 1 addition & 1 deletion Tests/Data/TH2M/HM/flow_fully_saturated_gas.prj
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
<vtkdiff>
<regex>flow_fully_saturated_gas_ts_.*.vtu</regex>
<field>HeatFlowRate</field>
<absolute_tolerance>4e-12</absolute_tolerance>
<absolute_tolerance>4.3e-12</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,13 @@
<vtkdiff>
<regex>Results_ts_.*_t_.*_sec.vtu</regex>
<field>sigma_ice</field>
<absolute_tolerance>3e-7</absolute_tolerance>
<absolute_tolerance>4e-6</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>Results_ts_.*_t_.*_sec.vtu</regex>
<field>ice_volume_fraction</field>
<absolute_tolerance>1e-15</absolute_tolerance>
<absolute_tolerance>4e-15</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand All @@ -376,13 +376,13 @@
<vtkdiff>
<regex>Results_ts_.*_t_.*_sec.vtu</regex>
<field>HeatFlowRate</field>
<absolute_tolerance>4e-13</absolute_tolerance>
<absolute_tolerance>2e-11</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
<vtkdiff>
<regex>Results_ts_.*_t_.*_sec.vtu</regex>
<field>NodalForces</field>
<absolute_tolerance>1e-9</absolute_tolerance>
<absolute_tolerance>6e-9</absolute_tolerance>
<relative_tolerance>0</relative_tolerance>
</vtkdiff>
</test_definition>
Expand Down
7 changes: 2 additions & 5 deletions Tests/Data/ThermoMechanics/tm1_2Dbeam/tm1_2Dbeam.prj
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,9 @@
<linear_solvers>
<linear_solver>
<name>general_linear_solver</name>
<lis>-i bicgstab -p jacobi -tol 1e-2 -maxiter 10000</lis>
<eigen>
<solver_type>BiCGSTAB</solver_type>
<precon_type>DIAGONAL</precon_type>
<max_iteration_step>10000</max_iteration_step>
<error_tolerance>1e-2</error_tolerance>
<solver_type>SparseLU</solver_type>
<scaling>true</scaling>
</eigen>
<petsc>
<prefix>tm</prefix>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
<vtkdiff>
<regex>bentonite_column_ts_.*_t_.*_sec[.]vtu</regex>
<field>NodalForces</field>
<absolute_tolerance>1.2e-13</absolute_tolerance>
<absolute_tolerance>2.0e-13</absolute_tolerance>
<relative_tolerance>0.0 <!-- inf --></relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down Expand Up @@ -628,7 +628,7 @@
<vtkdiff>
<regex>bentonite_column_ts_.*_t_.*_sec[.]vtu</regex>
<field>sigma_total_avg</field>
<absolute_tolerance>1.5e-07</absolute_tolerance>
<absolute_tolerance>1.6e-07</absolute_tolerance>
<relative_tolerance>0.0 <!-- 600.0 --></relative_tolerance>
</vtkdiff>
<vtkdiff>
Expand Down
2 changes: 1 addition & 1 deletion web/data/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"hugo": "0.122.0",
"boost": "1.82.0",
"eigen": "3.4.0",
"eigen-unsupported": "9000b3767770f6dd0f4cfb12f4e19c71921885a4",
"eigen-unsupported": "24e0c2a125d2b37b35719124d1f758777c150ca8",
"vtk": "9.3.0",
"petsc": "3.18.6",
"qt": "5.14.2",
Expand Down

0 comments on commit b3350d9

Please sign in to comment.