getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] (no subject)


From: Andriy Andreykiv
Subject: [Getfem-commits] (no subject)
Date: Thu, 16 May 2019 04:35:39 -0400 (EDT)

branch: c14_complience
commit 9b49d57295103979834c4ff181d609fbc769110a
Author: Andriy.Andreykiv <address@hidden>
Date:   Thu May 16 10:34:20 2019 +0200

    no need to run lambda in parallel, if called from parallel section
---
 src/getfem_omp.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/getfem_omp.cc b/src/getfem_omp.cc
index a8bb568..7803909 100644
--- a/src/getfem_omp.cc
+++ b/src/getfem_omp.cc
@@ -345,6 +345,10 @@ namespace getfem{
 
   void parallel_execution(std::function<void(void)> lambda,
                           bool iterate_over_partitions){
+    if (me_is_multithreaded_now()) {
+      lambda();
+      return;
+    }
     parallel_boilerplate boilerplate;
     auto &pm = partition_master::get();
     if (pm.get_nb_partitions() < true_thread_policy::num_threads()){



reply via email to

[Prev in Thread] Current Thread [Next in Thread]