Bridge++
Version 1.5.4
|
Thread manager with OpenMP. More...
#include <threadManager_OpenMP.h>
Static Public Member Functions | |
static void | init (int Nthread) |
setup: called in main only once. More... | |
static void | finalize () |
finalization. More... | |
static int | get_num_threads_available () |
returns number of threads (works outside of parallel region). More... | |
static int | get_num_threads () |
returns available number of threads. More... | |
static int | get_thread_id () |
returns thread id. More... | |
static void | wait () |
barrier among threads inside a node. More... | |
static void | barrier (const int Nthread) |
barrier among threads inside a node. More... | |
static void | sync_barrier_all () |
barrier among all the threads and nodes. More... | |
static void | reduce_sum_global (double &value, const int i_thread, const int Nthread) |
global reduction with summation: value is assumed thread local. More... | |
static void | reduce_sum_global (double *value, const int num, const int i_thread, const int Nthread) |
global reduction with summation for an array: values are assumed thread local. More... | |
static void | reduce_sum_global (float &value, const int i_thread, const int Nthread) |
global reduction with summation: value is assumed thread local. More... | |
static void | reduce_sum_global (float *value, const int num, const int i_thread, const int Nthread) |
global reduction with summation for an array: values are assumed thread local. More... | |
static void | assert_single_thread (const std::string &class_name) |
assert currently running on single thread. More... | |
Static Public Attributes | |
static const std::string | class_name = "ThreadManager_OpenMP" |
Private Member Functions | |
ThreadManager_OpenMP (const ThreadManager_OpenMP &) | |
ThreadManager_OpenMP & | operator= (const ThreadManager_OpenMP &) |
Static Private Attributes | |
static int | m_Nthread = 0 |
number of threads. More... | |
static Bridge::VerboseLevel | m_vl = Bridge::CRUCIAL |
verbose level. More... | |
static std::vector< double > | m_darray_reduction |
static std::vector< float > | m_darray_reductionF |
static const int | each_buf_size = 8 |
reduction buffer size for each thread (double) More... | |
static const int | each_buf_sizeF = 2*each_buf_size |
reduction buffer size for each thread (float) More... | |
Thread manager with OpenMP.
This class wraps OpenMP API functions. The number of available threads is specified as an argument of init() function, which is to be called at the begining of main, soon after Communicator and CommonParameter are initialized. If the specified number of threads (nthread) is not the same as that of OMP_NUM_THREADS environment variable, the number of threads is set to the specified one. If Nthread = 0 is specified, the number of threads is set to OMP_NUM_THREADS or maximum number of platform. [29 Aug 2013 H.Matsufuru]
Added reduce_sum_global for array [30 Sep 2019 I.Kanamori]
Definition at line 42 of file threadManager_OpenMP.h.
|
private |
|
static |
assert currently running on single thread.
Definition at line 238 of file threadManager_OpenMP.cpp.
|
static |
barrier among threads inside a node.
Definition at line 178 of file threadManager_OpenMP.cpp.
|
static |
finalization.
Definition at line 148 of file threadManager_OpenMP.cpp.
|
static |
returns available number of threads.
Definition at line 155 of file threadManager_OpenMP.cpp.
|
inlinestatic |
returns number of threads (works outside of parallel region).
Definition at line 77 of file threadManager_OpenMP.h.
|
static |
returns thread id.
Definition at line 162 of file threadManager_OpenMP.cpp.
|
static |
setup: called in main only once.
Definition at line 114 of file threadManager_OpenMP.cpp.
|
private |
|
static |
global reduction with summation: value is assumed thread local.
Definition at line 197 of file threadManager_OpenMP.cpp.
|
static |
global reduction with summation for an array: values are assumed thread local.
Definition at line 206 of file threadManager_OpenMP.cpp.
|
static |
global reduction with summation: value is assumed thread local.
Definition at line 217 of file threadManager_OpenMP.cpp.
|
static |
global reduction with summation for an array: values are assumed thread local.
Definition at line 227 of file threadManager_OpenMP.cpp.
|
static |
barrier among all the threads and nodes.
Definition at line 185 of file threadManager_OpenMP.cpp.
|
static |
barrier among threads inside a node.
Definition at line 169 of file threadManager_OpenMP.cpp.
|
static |
Definition at line 68 of file threadManager_OpenMP.h.
|
staticprivate |
reduction buffer size for each thread (double)
Definition at line 53 of file threadManager_OpenMP.h.
|
staticprivate |
reduction buffer size for each thread (float)
Definition at line 59 of file threadManager_OpenMP.h.
|
staticprivate |
Definition at line 46 of file threadManager_OpenMP.h.
|
staticprivate |
Definition at line 47 of file threadManager_OpenMP.h.
|
staticprivate |
number of threads.
Definition at line 44 of file threadManager_OpenMP.h.
|
staticprivate |
verbose level.
Definition at line 45 of file threadManager_OpenMP.h.