Skip to content

Commit 71ab40a

Browse files
committed
remove openmp for random generate
1 parent 312baca commit 71ab40a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

source/module_psi/psi_initializer.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ void psi_initializer<T>::random_t(T* psi, const int iw_start, const int iw_end,
103103
for (int iw = iw_start; iw < iw_end; iw++)
104104
{
105105
T* psi_slice = &(psi[iw * npwk_max * npol]); // get the memory to write directly. For nspin 4, nbasis*2
106-
#ifdef _OPENMP
107-
#pragma omp parallel for schedule(static, 4096 / sizeof(T))
108-
#endif
106+
// donot use openmp here, because the random number generator is not thread-safe
109107
for (int ig = 0; ig < ng; ig++)
110108
{
111109
const double rr = std::rand() / double(RAND_MAX);

0 commit comments

Comments
 (0)