From bf54f4a0eee88243c69646d2daefcb93d21ec7d9 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 26 Oct 2020 15:31:37 -0500 Subject: [PATCH] Placing appropriate ifdefs around OpenMP calls in the LibMesh class. --- src/mesh.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mesh.cpp b/src/mesh.cpp index 27e49107dd..efd627b6de 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -2210,7 +2210,12 @@ void LibMesh::initialize() { equation_systems_->add_system(eq_system_name_); // setup the point locator + #ifdef _OPENMP int n_threads = omp_get_max_threads(); + #else + int n_threads = 1; + #endif + point_locators_ = std::vector>(n_threads); for (int i = 0; i < n_threads; i++) { point_locators_[i] = m_->sub_point_locator(); @@ -2329,7 +2334,12 @@ LibMesh::get_bin(Position r) const // quick rejection check if (!bbox_.contains_point(p)) { return -1; } + #ifdef _OPENMP int thread = omp_get_thread_num(); + #else + int thread = 0; + #endif + auto e = (*point_locators_[thread])(p); if (!e) { return -1;