From 3219c8755a1f9f36de21d2aab5557ccef2d64752 Mon Sep 17 00:00:00 2001 From: Cameron Gilchrist Date: Thu, 5 Sep 2024 16:33:26 +0900 Subject: [PATCH] put map operations in critical blocks --- src/strucclustutils/structuremsa.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/strucclustutils/structuremsa.cpp b/src/strucclustutils/structuremsa.cpp index 1841301..db75a06 100644 --- a/src/strucclustutils/structuremsa.cpp +++ b/src/strucclustutils/structuremsa.cpp @@ -1136,7 +1136,7 @@ int structuremsa(int argc, const char **argv, const Command& command, bool preCl IndexReader qdbrH(par.db1, par.threads, IndexReader::HEADERS, touch ? IndexReader::PRELOAD_INDEX : 0); Debug(Debug::INFO) << "Got databases\n"; - + SubstitutionMatrix subMat_3di(par.scoringMatrixFile.values.aminoacid().c_str(), par.bitFactor3Di, par.scoreBias3di); std::string blosum; for (size_t i = 0; i < par.substitutionMatrices.size(); i++) { @@ -1148,6 +1148,7 @@ int structuremsa(int argc, const char **argv, const Command& command, bool preCl free(serializedMatrix); } } + SubstitutionMatrix subMat_aa(blosum.c_str(), par.bitFactorAa, par.scoreBiasAa); Debug(Debug::INFO) << "Got substitution matrices\n"; @@ -1632,8 +1633,11 @@ int structuremsa(int argc, const char **argv, const Command& command, bool preCl // Don't make profiles on final alignment if (i == merges.size() - 1 && j == merges[i] - 1) { +#pragma omp critical +{ profiles.erase(targetId); profiles.erase(mergedId); +} continue; } @@ -1679,8 +1683,10 @@ int structuremsa(int argc, const char **argv, const Command& command, bool preCl par.wg ); assert(profile_aa.length() == profile_3di.length()); +#pragma omp critical profiles[mergedId] = std::make_pair(profile_aa, profile_3di); if (targetIsProfile) { +#pragma omp critical profiles.erase(targetId); } }