Less strict check for multithreading.

Removes the CHECK-fail for num_threads > 1 when
OpenMP is not detected

Change-Id: I5c1d48aad66c8b7a1f73c93dae572b73953859a0
This commit is contained in:
Chris Sweeney
2015-03-15 19:01:46 +01:00
parent e98445e0a6
commit 8db90ca2f6
+7 -3
View File
@@ -116,9 +116,13 @@ class ProgramEvaluator : public Evaluator {
evaluate_preparers_(
jacobian_writer_.CreateEvaluatePreparers(options.num_threads)) {
#ifndef CERES_USE_OPENMP
CHECK_EQ(1, options_.num_threads)
<< "OpenMP support is not compiled into this binary; "
<< "only options.num_threads=1 is supported.";
if (options_.num_threads > 1) {
LOG(WARNING)
<< "OpenMP support is not compiled into this binary; "
<< "only options.num_threads = 1 is supported. Switching "
<< "to single threaded mode.";
options_.num_threads = 1;
}
#endif
BuildResidualLayout(*program, &residual_layout_);