19 #ifndef LIBMESH_THREADS_TBB_H 20 #define LIBMESH_THREADS_TBB_H 24 #ifndef LIBMESH_SQUASH_HEADER_WARNING 25 # warning "This file is designed to be included through libmesh/threads.h" 28 #ifdef LIBMESH_HAVE_TBB_API 36 #include "tbb/tbb_stddef.h" 37 #include "tbb/blocked_range.h" 38 #include "tbb/parallel_for.h" 39 #include "tbb/parallel_reduce.h" 40 #include "tbb/task_scheduler_init.h" 41 #include "tbb/partitioner.h" 42 #include "tbb/spin_mutex.h" 43 #include "tbb/recursive_mutex.h" 44 #include "tbb/atomic.h" 45 #include "tbb/tbb_thread.h" 46 #include "tbb/enumerable_thread_specific.h" 50 #define TBB_VERSION_LESS_THAN(major,minor) \ 51 ((LIBMESH_DETECTED_TBB_VERSION_MAJOR < (major) || \ 52 (LIBMESH_DETECTED_TBB_VERSION_MAJOR == (major) && (LIBMESH_DETECTED_TBB_VERSION_MINOR < (minor)))) ? 1 : 0) 55 #define LIBMESH_TLS_TYPE(type) tbb::enumerable_thread_specific<type> 56 #define LIBMESH_TLS_REF(value) (value).local() 68 typedef tbb::tbb_thread
Thread;
85 template <
typename Range,
typename Body>
87 void parallel_for (
const Range & range,
const Body & body)
91 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING 104 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING 116 template <
typename Range,
typename Body,
typename Partitioner>
122 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING 135 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING 147 template <
typename Range,
typename Body>
153 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING 166 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING 178 template <
typename Range,
typename Body,
typename Partitioner>
180 void parallel_reduce (
const Range & range, Body & body,
const Partitioner & partitioner)
184 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING 197 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING 223 template <
typename T>
224 class atomic :
public tbb::atomic<T> {};
230 #endif // LIBMESH_HAVE_TBB_API 232 #endif // LIBMESH_SQUASH_HEADER_WARNING 234 #endif // LIBMESH_THREADS_TBB_H NonConcurrentThread Thread
void parallel_for(const Range &range, const Body &body)
PerfLog perflog("libMesh", #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING true #else false #endif)
Base class for all concrete Partitioner instantiations.
tbb::task_scheduler_init task_scheduler_init
bool logging_enabled() const
tbb::spin_mutex spin_mutex
void parallel_reduce(const Range &range, Body &body)
tbb::recursive_mutex recursive_mutex