Hi guys,
I pulled ceres solver to the latest version (Dec 11 11:11:07, updated by Alex Stewart), which includes TBB module. I found the case run slower with multi-threading enabling. Some tests are as follow(Number of iterations: 50), and more details can be found in the attached file.
CERES_NO_THREADS defined
---------------------------------------------------
Residual evaluation 0.013869
Jacobian evaluation 0.054759
Linear solver 0.096086
Minimizer 0.189615
openmp + num_threads = 1
---------------------------------------------------
Residual evaluation 0.021007
Jacobian evaluation 0.063633
Linear solver 0.202915
Minimizer 0.318207
openmp + num_threads = 4
---------------------------------------------------
Residual evaluation 0.023179
Jacobian evaluation 0.072973
Linear solver 0.192077
Minimizer 0.319461
tbb + num_threads = 1
---------------------------------------------------
Residual evaluation 0.052823
Jacobian evaluation 0.088980
Linear solver 0.209207
Minimizer 0.382557
tbb + num_threads = 4
---------------------------------------------------
Residual evaluation 0.059175
Jacobian evaluation 0.094217
Linear solver 0.196872
Minimizer 0.380875
It looks odd. I expect CERES_HAVE_THREAD + num_threads=1 have the same behaviour and performance with the CERES_NO_THREADS case. But the result gave me a surprise.
Frank