Bridge++  Version 1.4.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
threadManager_OpenMP.cpp
Go to the documentation of this file.
1 
15 
16 
18 #include "IO/bridgeIO.h"
19 using Bridge::vout;
20 
21 // These are stub routine when OpenMP is not used.
22 // [11 Mar 2014 H.Matsufuru]
23 //====================================================================
24 // initialization of static member variables.
25 
28 std::vector<double> ThreadManager_OpenMP::m_darray_reduction(0);
29 
30 //====================================================================
31 void ThreadManager_OpenMP::init(int Nthread)
32 {
34 
35  m_Nthread = 1;
36 
37  vout.general(m_vl, "ThreadManager_OpenMP being setup.\n");
38  vout.general(m_vl, " Number of thread = %d\n", m_Nthread);
39  vout.general(m_vl, " OpenMP is not used: stub implementation.\n");
40 }
41 
42 
43 //====================================================================
45 {
46  vout.paranoiac(m_vl, "Thread manager says good-bye.\n");
47 }
48 
49 
50 //====================================================================
52 {
53  return 1;
54 }
55 
56 
57 //====================================================================
59 {
60  return 0;
61 }
62 
63 
64 //====================================================================
66 {
67 }
68 
69 
70 //====================================================================
71 void ThreadManager_OpenMP::barrier(int Nthread)
72 {
73 }
74 
75 
76 //====================================================================
78 {
80 }
81 
82 
83 //====================================================================
85  const int i_thread, const int Nthread)
86 {
88 }
89 
90 
91 //====================================================================
93  const std::string& class_name)
94 { // do nothing.
95 }
96 
97 
98 //====================================================================
99 //============================================================END=====
static int m_Nthread
number of threads.
BridgeIO vout
Definition: bridgeIO.cpp:495
static int get_num_threads()
returns available number of threads.
void general(const char *format,...)
Definition: bridgeIO.cpp:195
static Bridge::VerboseLevel Vlevel()
static void wait()
barrier among threads inside a node.
static int get_thread_id()
returns thread id.
static void init(int Nthread)
setup: called in main only once.
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.
void paranoiac(const char *format,...)
Definition: bridgeIO.cpp:229
static Bridge::VerboseLevel m_vl
verbose level.
static std::vector< double > m_darray_reduction
VerboseLevel
Definition: bridgeIO.h:42
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
static int sync()
synchronize within small world.
static void assert_single_thread(const std::string &class_name)
assert currently running on single thread.