Skip to content

Commit

Permalink
Merge pull request #47201 from Dr15Jones/removeOMP
Browse files Browse the repository at this point in the history
Remove use of OpenMP threading
  • Loading branch information
cmsbuild authored Jan 30, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 502e64b + 070e8cb commit fbc77ff
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 0 additions & 1 deletion CommonTools/Utils/test/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@
<ifrelease name="ASAN">
<flags NO_TEST_PREFIX="1"/>
</ifrelease>
<flags CXXFLAGS="-fopenmp"/>
<use name="CommonTools/Utils"/>
</bin>

17 changes: 14 additions & 3 deletions CommonTools/Utils/test/ExpressionEvaluatorUnitTest.cpp
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@

#include <iostream>
#include <atomic>
#include <thread>

int main() {
// build fake test package...
@@ -75,15 +76,25 @@ int main() {

// stress test
std::atomic<int> j(0);
#pragma omp parallel num_threads(2)
{
//wait for both threads to start before running the test
std::atomic<int> waitForAll(2);

auto work = [&]() {
--waitForAll;
while (waitForAll > 0)
;
reco::genericExpression<bool, int, int> const* acut = nullptr;
for (int i = 0; i < 20; ++i) {
acut = reco_expressionEvaluator("CommonTools/Utils", SINGLE_ARG(reco::genericExpression<bool, int, int>), cut);
(*acut)(2, 7);
std::cerr << j++ << ',';
}
}
};

std::thread t1(work);
std::thread t2(work);
t1.join();
t2.join();
std::cerr << std::endl;

std::cout << "If HERE OK" << std::endl;

0 comments on commit fbc77ff

Please sign in to comment.