Skip to content

Commit

Permalink
limit threads to maximum merges
Browse files Browse the repository at this point in the history
  • Loading branch information
gamcil committed Sep 13, 2024
1 parent 8a90d6b commit c0430f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/strucclustutils/structuremsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1337,8 +1337,10 @@ int structuremsa(int argc, const char **argv, const Command& command, bool preCl
std::vector<SubMSA> globalSubMSAs;
std::vector<size_t> globalToRemove;
int index = 0; // in hit list
size_t maxMerges = *std::max_element(merges.begin(), merges.end());
int maxThreads = std::min(par.threads, static_cast<int>(maxMerges));

#pragma omp parallel num_threads(par.threads)
#pragma omp parallel num_threads(maxThreads)
{
unsigned int thread_idx = 0;
#ifdef OPENMP
Expand Down

0 comments on commit c0430f1

Please sign in to comment.