Bridge++  Ver. 1.2.x
 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 <valarray>
18 #include <string>
19 
20 //#include "configure.h"
21 //#include "defs.h"
22 #include "commonParameters.h"
23 #include "bridgeIO.h"
24 
25 
27 
42  private:
43  static int m_Nthread;
45  static valarray<double> m_darray_reduction;
46 
47  public:
48  static const std::string class_name;
49 
51  static void init(int nthread);
52 
54  static void finalize();
55 
57  static int get_num_threads_available() { return m_Nthread; }
58 
60  static int get_num_threads();
61 
63  static int get_thread_id();
64 
66  static void wait();
67 
69  static void barrier(const int nth);
70 
72  static void sync_barrier_all();
73 
75  static void reduce_sum_global(double& value,
76  const int ith, const int nth);
77 
79  static void assert_single_thread(const std::string& classname);
80 };
81 
82 #endif //THREADMANAGER_OPENMP_INCLUDED
static void barrier(const int nth)
barrier among threads inside a node.
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.
static valarray< double > m_darray_reduction
static void reduce_sum_global(double &value, const int ith, const int nth)
global reduction with summation: value is assumed thread local.
static int get_thread_id()
returns thread id.
static const std::string class_name
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 void init(int nthread)
setup: called in main only once.
static Bridge::VerboseLevel m_vl
verbose level.
VerboseLevel
Definition: bridgeIO.h:25
Thread manager with OpenMP.
static void assert_single_thread(const std::string &classname)
assert currently running on single thread.