File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
module_base/module_mixing/test Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 1+ #ifdef _OPENMP
12#include < omp.h>
3+ #endif
24
35#include " ../broyden_mixing.h"
46#include " ../plain_mixing.h"
@@ -151,7 +153,9 @@ class Mixing_Test : public testing::Test
151153
152154TEST_F (Mixing_Test, BroydenSolveLinearEq)
153155{
156+ #ifdef _OPENMP
154157 omp_set_num_threads (1 );
158+ #endif
155159 init_method (" broyden" );
156160 std::vector<double > x_in = xd_ref;
157161 std::vector<double > x_out (3 );
@@ -196,7 +200,9 @@ TEST_F(Mixing_Test, BroydenSolveLinearEq)
196200
197201TEST_F (Mixing_Test, PulaySolveLinearEq)
198202{
203+ #ifdef _OPENMP
199204 omp_set_num_threads (1 );
205+ #endif
200206 init_method (" pulay" );
201207 std::vector<double > x_in = xd_ref;
202208 std::vector<double > x_out (3 );
@@ -242,7 +248,9 @@ TEST_F(Mixing_Test, PulaySolveLinearEq)
242248
243249TEST_F (Mixing_Test, PlainSolveLinearEq)
244250{
251+ #ifdef _OPENMP
245252 omp_set_num_threads (1 );
253+ #endif
246254 init_method (" plain" );
247255 std::vector<double > x_in = xd_ref;
248256 std::vector<double > x_out (3 );
Original file line number Diff line number Diff line change 1010#include " module_basis/module_pw/pw_basis.h"
1111#include " module_hamilt_general/module_xc/xc_functional.h"
1212#undef private
13+
14+ #ifdef __OPENMP
1315#include < omp.h>
16+ #endif
1417
1518int FUNC_TYPE = 1 ;
1619
@@ -116,7 +119,9 @@ class ChargeMixingTest : public ::testing::Test
116119
117120TEST_F (ChargeMixingTest, SetMixingTest)
118121{
122+ #ifdef _OPENMP
119123 omp_set_num_threads (1 );
124+ #endif
120125 PARAM.input .nspin = 1 ;
121126 Charge_Mixing CMtest;
122127 CMtest.set_rhopw (&pw_basis, &pw_basis);
@@ -214,7 +219,9 @@ TEST_F(ChargeMixingTest, SetMixingTest)
214219
215220TEST_F (ChargeMixingTest, InitMixingTest)
216221{
222+ #ifdef _OPENMP
217223 omp_set_num_threads (1 );
224+ #endif
218225 PARAM.input .nspin = 1 ;
219226 FUNC_TYPE = 1 ;
220227 Charge_Mixing CMtest;
You can’t perform that action at this time.
0 commit comments