Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
threadManager_OpenMP.h
Go to the documentation of this file.
1 
14 #ifndef THREADMANAGER_OPENMP_INCLUDED
15 #define THREADMANAGER_OPENMP_INCLUDED
16 
17 #include <string>
18 
19 //#include "configure.h"
20 //#include "defs.h"
22 #include "IO/bridgeIO.h"
23 
24 
26 
41  private:
42  static int m_Nthread;
44  static std::vector<double> m_darray_reduction;
45 
46  private:
47  // non-copyable
50 
51  public:
52  static const std::string class_name;
53 
55  static void init(int Nthread);
56 
58  static void finalize();
59 
61  static int get_num_threads_available() { return m_Nthread; }
62 
64  static int get_num_threads();
65 
67  static int get_thread_id();
68 
70  static void wait();
71 
73  static void barrier(const int Nthread);
74 
76  static void sync_barrier_all();
77 
79  static void reduce_sum_global(double& value,
80  const int i_thread, const int Nthread);
81 
83  static void assert_single_thread(const std::string& class_name);
84 };
85 #endif //THREADMANAGER_OPENMP_INCLUDED
static int m_Nthread
number of threads.
static int get_num_threads()
returns available number of threads.
static void wait()
barrier among threads inside a node.
ThreadManager_OpenMP & operator=(const ThreadManager_OpenMP &)
static int get_thread_id()
returns thread id.
static void init(int Nthread)
setup: called in main only once.
static const std::string class_name
static void barrier(const int Nthread)
barrier among threads inside a node.
static void reduce_sum_global(double &value, const int i_thread, const int Nthread)
global reduction with summation: value is assumed thread local.
static void sync_barrier_all()
barrier among all the threads and nodes.
static void finalize()
finalization.
static int get_num_threads_available()
returns number of threads (works outside of parallel region).
static Bridge::VerboseLevel m_vl
verbose level.
static std::vector< double > m_darray_reduction
VerboseLevel
Definition: bridgeIO.h:42
Thread manager with OpenMP.
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.
ThreadManager_OpenMP(const ThreadManager_OpenMP &)