# include <numeric>
# include <base/thread_manager.h>
-
-# define NTHREADS 4
+# include <base/multithread_info.h>
#endif
// in MT mode: start new threads only
// if the matrix is sufficiently large.
// the limit is mostly artificial
- if (n_rows/NTHREADS > 2000)
+ if (n_rows/multithread_info.n_default_threads > 2000)
{
- const unsigned int n_threads = NTHREADS;
+ const unsigned int n_threads = multithread_info.n_default_threads;
ThreadManager thread_manager;
// if in MT mode and size sufficiently
// large: do it in parallel; the limit
// is mostly artificial
- if (n_rows/NTHREADS > 2000)
+ if (n_rows/multithread_info.n_default_threads > 2000)
{
- const unsigned int n_threads = NTHREADS;
+ const unsigned int n_threads = multithread_info.n_default_threads;
ThreadManager thread_manager;
// if in MT mode and size sufficiently
// large: do it in parallel; the limit
// is mostly artificial
- if (n_rows/NTHREADS > 2000)
+ if (n_rows/multithread_info.n_default_threads > 2000)
{
- const unsigned int n_threads = NTHREADS;
+ const unsigned int n_threads = multithread_info.n_default_threads;
ThreadManager thread_manager;
#include <base/smartpointer.h>
+#include <base/multithread_info.h>
#include <lac/forward_declarations.h>
#include <vector>
* building the inverses of the
* diagonal blocks. This
* parameter is ignored if not in
- * multithreaded mode.
+ * multithreaded mode. By
+ * default, this variable is set
+ * to the value of
+ * #multithread_info.n_default_threads#.
*/
SparseVanka(const SparseMatrix<number> &M,
const vector<bool> &selected,
const bool conserve_memory = false,
- const unsigned int n_threads = 1);
+ const unsigned int n_threads = multithread_info.n_default_threads);
/**
* Destructor.
* Number of threads to be used
* when building the
* inverses. Only relevant in
- * multithread mode.
+ * multithreaded mode.
*/
const unsigned int n_threads;
const unsigned int n_blocks,
const BlockingStrategy blocking_strategy,
const bool conserve_memory = false,
- const unsigned int n_threads = 1);
+ const unsigned int n_threads = multithread_info.n_default_threads);
/**
* Apply the preconditioner.