14 #include "libmesh/libmesh_common.h" 15 #include "libmesh/threads.h" 17 #ifdef LIBMESH_HAVE_TBB_API 18 #include "tbb/concurrent_queue.h" 19 #include "tbb/tbb_thread.h" 20 #elif LIBMESH_HAVE_OPENMP 22 #elif LIBMESH_HAVE_PTHREAD 32 #ifdef LIBMESH_HAVE_TBB_API 34 #elif LIBMESH_HAVE_OPENMP 35 id = omp_get_thread_num();
36 #elif LIBMESH_HAVE_PTHREAD 41 "No Thread IDs available in ParallelUniqueID. Did you forget to initialize()?");
53 #ifdef LIBMESH_HAVE_TBB_API 55 #elif !defined(LIBMESH_HAVE_OPENMP) && defined(LIBMESH_HAVE_PTHREAD) 72 #if defined(LIBMESH_HAVE_TBB_API) || \ 73 (!defined(LIBMESH_HAVE_OPENMP) && defined(LIBMESH_HAVE_PTHREAD)) 83 #ifdef LIBMESH_HAVE_TBB_API 84 static tbb::concurrent_bounded_queue<unsigned int>
_ids;
85 #elif !defined(LIBMESH_HAVE_OPENMP) && defined(LIBMESH_HAVE_PTHREAD) 86 static std::queue<unsigned int>
_ids;
static void initialize()
Must be called by main thread before any threaded computation! Do NOT call in a worker thread! ...
static tbb::concurrent_bounded_queue< unsigned int > _ids
static Threads::spin_mutex _pthread_id_mutex
Provides a way for users to bail out of the current solve.
static std::queue< unsigned int > _ids