Skip to content

Commit 3219c87

Browse files
committed
put map operations in critical blocks
1 parent c1e3b0a commit 3219c87

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/strucclustutils/structuremsa.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ int structuremsa(int argc, const char **argv, const Command& command, bool preCl
11361136
IndexReader qdbrH(par.db1, par.threads, IndexReader::HEADERS, touch ? IndexReader::PRELOAD_INDEX : 0);
11371137

11381138
Debug(Debug::INFO) << "Got databases\n";
1139-
1139+
11401140
SubstitutionMatrix subMat_3di(par.scoringMatrixFile.values.aminoacid().c_str(), par.bitFactor3Di, par.scoreBias3di);
11411141
std::string blosum;
11421142
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
11481148
free(serializedMatrix);
11491149
}
11501150
}
1151+
11511152
SubstitutionMatrix subMat_aa(blosum.c_str(), par.bitFactorAa, par.scoreBiasAa);
11521153

11531154
Debug(Debug::INFO) << "Got substitution matrices\n";
@@ -1632,8 +1633,11 @@ int structuremsa(int argc, const char **argv, const Command& command, bool preCl
16321633

16331634
// Don't make profiles on final alignment
16341635
if (i == merges.size() - 1 && j == merges[i] - 1) {
1636+
#pragma omp critical
1637+
{
16351638
profiles.erase(targetId);
16361639
profiles.erase(mergedId);
1640+
}
16371641
continue;
16381642
}
16391643

@@ -1679,8 +1683,10 @@ int structuremsa(int argc, const char **argv, const Command& command, bool preCl
16791683
par.wg
16801684
);
16811685
assert(profile_aa.length() == profile_3di.length());
1686+
#pragma omp critical
16821687
profiles[mergedId] = std::make_pair(profile_aa, profile_3di);
16831688
if (targetIsProfile) {
1689+
#pragma omp critical
16841690
profiles.erase(targetId);
16851691
}
16861692
}

0 commit comments

Comments
 (0)