[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] (no subject)
From: |
Markus Bürg |
Subject: |
[Getfem-commits] (no subject) |
Date: |
Thu, 21 Dec 2017 05:21:24 -0500 (EST) |
branch: mb-fix_compilation_error
commit 1db28fa096907b3c60b38d67d6d9d938831e18f8
Author: mb <address@hidden>
Date: Thu Dec 21 11:21:11 2017 +0100
Revert "Remove duplicated functions that are already defined in
getfem_omp.h"
This reverts commit 660f33ff40b603a56d4a1fa9f9b1158171ededa8.
---
src/gmm/gmm_std.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/gmm/gmm_std.h b/src/gmm/gmm_std.h
index 064a196..4d565e5 100644
--- a/src/gmm/gmm_std.h
+++ b/src/gmm/gmm_std.h
@@ -124,6 +124,8 @@ inline void GMM_NOPERATION_(int) { }
#include <array>
#include <locale.h>
+#include "getfem/getfem_arch_config.h"
+
namespace std {
#if defined(__GNUC__) && (__cplusplus <= 201103L)
template<typename _Tp>
@@ -170,6 +172,23 @@ namespace std {
}
+
+
+#ifdef GETFEM_HAVE_OPENMP
+
+#include <omp.h>
+ /**number of OpenMP threads*/
+ inline size_t num_threads(){return omp_get_max_threads();}
+ /**index of the current thread*/
+ inline size_t this_thread() {return omp_get_thread_num();}
+ /**is the program running in the parallel section*/
+ inline bool me_is_multithreaded_now(){return
static_cast<bool>(omp_in_parallel());}
+#else
+ inline size_t num_threads(){return size_t(1);}
+ inline size_t this_thread() {return size_t(0);}
+ inline bool me_is_multithreaded_now(){return false;}
+#endif
+
namespace gmm {
using std::endl; using std::cout; using std::cerr;