Skip to content

Commit 3eac0e2

Browse files
authored
Fix: makefile cannot compile without openmp (#5316)
1 parent 146a509 commit 3eac0e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

source/module_hsolver/diago_elpa_native.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ void DiagoElpaNative<T>::diag_pool(hamilt::MatrixBlock<T>& h_mat,
8181
// elpa_init(20210430);
8282
int success;
8383
elpa_t handle = elpa_allocate(&success);
84+
#ifdef _OPENMP
8485
int num_threads = omp_get_max_threads();
86+
#else
87+
int num_threads = 1;
88+
#endif
8589
elpa_set(handle, "omp_threads", num_threads, &success);
8690
elpa_set(handle, "na", (int)nFull, &success);
8791
elpa_set(handle, "nev", (int)nev, &success);

0 commit comments

Comments
 (0)