|
Reference documentation for deal.II version 9.2.0
|
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\)
\(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\)
\(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\)
\(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Go to the documentation of this file.
19 #ifdef DEAL_II_HAVE_UNISTD_H
23 #if (defined(__MACH__) && defined(__APPLE__)) || defined(__FreeBSD__)
24 # include <sys/sysctl.h>
25 # include <sys/types.h>
30 #ifdef DEAL_II_WITH_THREADS
31 # define TBB_SUPPRESS_DEPRECATED_MESSAGES 1
32 # include <tbb/task_scheduler_init.h>
33 # undef TBB_SUPPRESS_DEPRECATED_MESSAGES
38 #ifdef DEAL_II_WITH_THREADS
48 # if defined(__linux__) || defined(__sun__) || defined(__osf__) || \
54 return sysconf(_SC_NPROCESSORS_ONLN);
57 # elif (defined(__MACH__) && defined(__APPLE__)) || defined(__FreeBSD__)
71 sysctl(mib, 2, &
n_cpus, &len,
nullptr, 0);
123 const char *penv = getenv(
"DEAL_II_NUM_THREADS");
137 "When specifying the <DEAL_II_NUM_THREADS> environment "
138 "variable, it needs to be something that can be interpreted "
139 "as an integer. The text you have in the environment "
146 "When specifying the <DEAL_II_NUM_THREADS> environment "
147 "variable, it needs to be a positive number."));
158 n_max_threads = tbb::task_scheduler_init::default_num_threads();
161 static tbb::task_scheduler_init
dummy(tbb::task_scheduler_init::deferred);
162 if (
dummy.is_active())
176 #else // not in MT mode
222 static bool done =
false;
static unsigned int n_max_threads
static unsigned int get_n_cpus()
static unsigned int n_threads()
static const unsigned int n_cpus
static unsigned int n_cores()
static std::size_t memory_consumption()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define DEAL_II_NAMESPACE_OPEN
int string_to_int(const std::string &s)
static bool is_running_single_threaded()
const types::global_dof_index * dummy()
static ::ExceptionBase & ExcInternalError()
#define Assert(cond, exc)
static void initialize_multithreading()
static const unsigned int invalid_unsigned_int
T min(const T &t, const MPI_Comm &mpi_communicator)
#define DEAL_II_NAMESPACE_CLOSE
#define AssertThrow(cond, exc)
static void set_thread_limit(const unsigned int max_threads=numbers::invalid_unsigned_int)