Skip to content

Commit

Permalink
Merge pull request #107 from chillenb/gil
Browse files Browse the repository at this point in the history
make sure only the thread that holds the GIL does Python stuff
  • Loading branch information
hczhai authored Jul 13, 2024
2 parents 0708415 + 40f569e commit c33cf18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dmrg/determinant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ struct DeterminantTRIE<S, FL, typename S::is_sz_t>
#pragma omp parallel num_threads(ntg)
// depth-first traverse of trie
while (!ptrs.empty()) {
#pragma omp master
check_signal_()();
int pstart = max(0, (int)ptrs.size() - ngroup);
#pragma omp for schedule(static)
Expand Down Expand Up @@ -772,6 +773,7 @@ struct DeterminantTRIE<S, FL, typename S::is_su2_t>
#pragma omp parallel num_threads(ntg)
// depth-first traverse of trie
while (!ptrs.empty()) {
#pragma omp master
check_signal_()();
int pstart = max(0, (int)ptrs.size() - ngroup);
#pragma omp for schedule(static)
Expand Down Expand Up @@ -1080,6 +1082,7 @@ struct DeterminantTRIE<S, FL, typename S::is_sg_t>
#pragma omp parallel num_threads(ntg)
// depth-first traverse of trie
while (!ptrs.empty()) {
#pragma omp master
check_signal_()();
int pstart = max(0, (int)ptrs.size() - ngroup);
#pragma omp for schedule(static)
Expand Down Expand Up @@ -1451,6 +1454,7 @@ struct DeterminantTRIE<S, FL, typename S::is_sany_t>
#pragma omp parallel num_threads(ntg)
// depth-first traverse of trie
while (!ptrs.empty()) {
#pragma omp master
check_signal_()();
int pstart = max(0, (int)ptrs.size() - ngroup);
#pragma omp for schedule(static)
Expand Down

0 comments on commit c33cf18

Please sign in to comment.