[CppAD] Sparse Hessian or Speed Test problem

Brad Bell bradbell at seanet.com
Sun Jan 25 13:51:50 EST 2015


It seems that (for large problems) the first time a Sparse Hessian (of a 
specific size) is computed, it takes much longer than on subsequent 
times. Even if the entire calculation is repeated.

If you get the current git master
     git clone git at github.com:coin-or/CppAD.git cppad.git
     cd cppad.git
or the current svn trunk
     svn checkout https://projects.coin-or.org/svn/CppAD/trunk cppad.svn
     cd cppad.svn
and then execute
     cd bug
     ./sparse_hessian.sh
you will get output ending with
     cppad/time_test.hpp: # define CPPAD_EXTRA_RUN_BEFORE_TIMING 0
     cppad_sparse_hessian_ok =  true
     cppad_sparse_hessian_size = [ 100, 400, 900, 1600, 2500 ]
     cppad_sparse_hessian_rate = [ 58330, 18853, 8158, 4750, 0.93 ]
     cppad_sparse_hessian_sweep = [ 19, 23, 24, 25, 26 ]
     cppad/time_test.hpp: # define CPPAD_EXTRA_RUN_BEFORE_TIMING 1
     cppad_sparse_hessian_ok =  true
     cppad_sparse_hessian_size = [ 100, 400, 900, 1600, 2500 ]
     cppad_sparse_hessian_rate = [ 55095, 18208, 8258, 4852, 3148 ]
     cppad_sparse_hessian_sweep = [ 19, 23, 23, 25, 27 ]
The huge difference (0.93 versus 3148 above) occurs both with the GNU 
and Clang compilers, under Fedora and Ubuntu, and on multiple machines.

The only thing that changes between the two cases is the value of
     CPPAD_EXTRA_RUN_BEFORE_TIMING
in the file
     cppad/time_test.hpp

I would appreciate any suggestions as to what the problem might be.


More information about the CppAD mailing list