From 8db90ca2f6889b1a34f5deffcc28137abbbcd62d Mon Sep 17 00:00:00 2001 From: Chris Sweeney Date: Sun, 15 Mar 2015 19:01:46 +0100 Subject: [PATCH] Less strict check for multithreading. Removes the CHECK-fail for num_threads > 1 when OpenMP is not detected Change-Id: I5c1d48aad66c8b7a1f73c93dae572b73953859a0 --- internal/ceres/program_evaluator.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/ceres/program_evaluator.h b/internal/ceres/program_evaluator.h index 00724fe38..82bb67a08 100644 --- a/internal/ceres/program_evaluator.h +++ b/internal/ceres/program_evaluator.h @@ -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_);