Is there another thread or issue for the model class refactor that @mitzimorris is working on? Can’t find it… bumping this one.
re: gains from pre-compiling parts of the model, I ran an experiment and compiled just the bernoulli.hpp as a shared object vs. bringing in the cmdstan main.cpp and thus the algorithms and services, and to summarize it seems like about half the time is being spent on math library stuff and half the time on services/algorithms. So @Bob_Carpenter the model class / algo / etc refactor seems pretty worthwhile to me.
Here are the commands I ran:
dyn-160-39-166-41 ~/scm/cmdstan (develop) $ time clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -O3 -I src -I stan/src -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.66.0 -I stan/lib/stan_math/lib/sundials_3.1.0/include -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION examples/bernoulli/bernoulli.hpp -c -o b.o
real 0m23.562s
user 0m14.563s
sys 0m1.513s
dyn-160-39-166-41 ~/scm/cmdstan (develop) $ time make examples/bernoulli/bernoulli
--- Linking C++ model ---
clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -O3 -I src -I stan/src -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.66.0 -I stan/lib/stan_math/lib/sundials_3.1.0/include -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -include-pch stan/src/stan/model/model_header.hpp.gch -include examples/bernoulli/bernoulli.hpp src/cmdstan/main.cpp stan/lib/stan_math/lib/sundials_3.1.0/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_3.1.0/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_3.1.0/lib/libsundials_idas.a -o examples/bernoulli/bernoulli
real 0m42.764s
user 0m37.573s
sys 0m1.231s