Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variadic argument lists for ODEs #1641

Merged
merged 262 commits into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
262 commits
Select commit Hold shift + click to select a range
2d696c8
omit recover_memory_global which is not needed
wds15 Jan 1, 2020
8a1d99e
Merge branch 'proto-parallel-v3' of https://github.com/stan-dev/math …
wds15 Jan 1, 2020
6d8ad8a
aggregate more efficiently the partial sums
wds15 Jan 1, 2020
1a54bde
simplify how values are copied
wds15 Jan 2, 2020
f689c93
const correctness
wds15 Jan 2, 2020
0da9de0
make code more generic (some meta magic bits are missing)
wds15 Jan 2, 2020
73fb5ae
make parallel reduce sum work with posted example... need more meta-p…
wds15 Jan 3, 2020
e7a83c6
rename to reduce_sum
wds15 Jan 5, 2020
2a370e7
add up to 4 arguments for reduce function
wds15 Jan 5, 2020
bd13907
make arguments optional
wds15 Jan 5, 2020
e1deb4f
more doc and const declares
wds15 Jan 5, 2020
358525c
doc
wds15 Jan 5, 2020
13641ea
Merge remote-tracking branch 'origin/develop' into proto-parallel-v3
wds15 Jan 5, 2020
5f76ca2
generalize possible input data structures
wds15 Jan 6, 2020
d9e5276
refactor such that any data strcuture (contained in an array) can be …
wds15 Jan 7, 2020
5e01bf0
fix looping order error
wds15 Jan 7, 2020
f2ed8a9
still struggling with performance regression
wds15 Jan 10, 2020
a3b4ad4
Merge remote-tracking branch 'origin/develop' into proto-parallel-v3
wds15 Jan 10, 2020
f3b37ae
start going back to better abstracted code
wds15 Jan 10, 2020
940fc82
move to shared_ptr, simplify counstructor call
wds15 Jan 12, 2020
8b66f94
move to partials being stored as flat vector
wds15 Jan 12, 2020
e56cdf2
get rid of obsolete code
wds15 Jan 12, 2020
2cece58
add preliminary support for structured slicing arguments which are no…
wds15 Jan 12, 2020
71c0196
add special case of local_operands_and_partials for non-var in a work…
wds15 Jan 12, 2020
e2b20d7
start cleanup bits of the reduce_sum code. Mostly to get an idea of w…
SteveBronder Jan 14, 2020
c0c118a
start cleanup bits of the reduce_sum code. Mostly to get an idea of w…
SteveBronder Jan 14, 2020
ff0f582
start cleanup bits of the reduce_sum code. Mostly to get an idea of w…
SteveBronder Jan 14, 2020
96e8c8e
start cleanup bits of the reduce_sum code. Mostly to get an idea of w…
SteveBronder Jan 14, 2020
3d62fa8
loose stuff needed removed
SteveBronder Jan 14, 2020
cbcf42f
Added variadic implementation of rev parallel_sum
bbbales2 Jan 15, 2020
8f90d8c
Adds enable_ifs to reduce_sum_impl
SteveBronder Jan 15, 2020
617d6e2
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 15, 2020
fbfa9ba
Fixup little templating things
SteveBronder Jan 15, 2020
008255e
merge to develop
SteveBronder Jan 15, 2020
00e5743
Make accumulate adjoints accept more types
SteveBronder Jan 15, 2020
623ed9e
Catch arithmetics in count_var_impl
SteveBronder Jan 15, 2020
16db0f2
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 15, 2020
9305fb0
move operator_paren checker out one scope
SteveBronder Jan 15, 2020
bb9a1b2
Merge branch 'cleanup/proto-parallel-v3' of github.com:stan-dev/math …
SteveBronder Jan 15, 2020
430ba3f
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 15, 2020
0248bcb
add left_fold helper func
SteveBronder Jan 15, 2020
b2c1dec
Merge branch 'cleanup/proto-parallel-v3' of github.com:stan-dev/math …
SteveBronder Jan 15, 2020
cf8b530
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 15, 2020
a27047f
Get slicing tests to pass
SteveBronder Jan 15, 2020
2dd8881
Merge branch 'cleanup/proto-parallel-v3' of github.com:stan-dev/math …
SteveBronder Jan 15, 2020
5e3e078
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 15, 2020
92fe766
some fixes, but not yet there
weberse2 Jan 15, 2020
2d1d57e
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 15, 2020
906c262
Merging in changes from pull
bbbales2 Jan 15, 2020
747c73a
Allow vars in sliced argument, fixed (at least temporarily) a couple …
bbbales2 Jan 15, 2020
3da42ff
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 15, 2020
70001ac
make things work with proper cleanup
wds15 Jan 16, 2020
be1ff0c
Changed how the sliced gradients work again
bbbales2 Jan 16, 2020
7a6b558
[Jenkins] auto-formatting by clang-format version 5.0.2-svn328729-1~e…
stan-buildbot Jan 16, 2020
d440aab
Merge branch 'cleanup/proto-parallel-v3' of https://github.com/stan-d…
wds15 Jan 16, 2020
89bad42
ensure proper cleaning of vars on all child threads
wds15 Jan 16, 2020
c1ac292
Adds metaprogramming to accept std vectors and eigen vectors
SteveBronder Jan 17, 2020
4ea5f1c
Remove dead code
SteveBronder Jan 17, 2020
6075dcc
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Jan 17, 2020
af7791e
idiot slaps keyboard
SteveBronder Jan 17, 2020
103333c
merge to remote
SteveBronder Jan 17, 2020
ab1e653
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Jan 17, 2020
29f1f71
Merge branch 'develop' into cleanup/proto-parallel-v3
bbbales2 Jan 17, 2020
37b516f
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Jan 17, 2020
b76cd8c
Added tests for reduce_sum
bbbales2 Jan 17, 2020
6b93f93
[Jenkins] auto-formatting by clang-format version 5.0.2-svn328729-1~e…
stan-buildbot Jan 17, 2020
e804157
Fix cpplint errors
SteveBronder Jan 17, 2020
66acef6
[Jenkins] auto-formatting by clang-format version 5.0.2-svn328729-1~e…
stan-buildbot Jan 17, 2020
906d7b0
Fix headers
SteveBronder Jan 17, 2020
71d8c71
Merge branch 'cleanup/proto-parallel-v3' of github.com:stan-dev/math …
SteveBronder Jan 17, 2020
d05d452
Added msgs argument to reduce_sum
bbbales2 Jan 19, 2020
658755d
Merge commit '10cc6ba675743f09832c6749fbb1a92d74888bd2' into HEAD
yashikno Jan 19, 2020
4e18f1e
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Jan 19, 2020
d834a4f
Allow arrays of all the Stan types to reduce_sum
bbbales2 Jan 20, 2020
145ae95
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Jan 20, 2020
9957909
Allocate deep copied varis on no-chain stack
bbbales2 Jan 20, 2020
3ecf79e
[Jenkins] auto-formatting by clang-format version 5.0.2-svn328729-1~e…
stan-buildbot Jan 20, 2020
3c56f6d
Initial commit of variadic ode functions with existing tests working
bbbales2 Jan 25, 2020
cf48965
[Jenkins] auto-formatting by clang-format version 5.0.2-svn328729-1~e…
stan-buildbot Jan 25, 2020
94989a0
Fixed off by one error on start/end indices passed by reduce_sum to u…
bbbales2 Jan 31, 2020
c9ac276
Merge commit 'dd9774dbc03935433b25a00be21763b43a242191' into HEAD
yashikno Jan 31, 2020
70546f4
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Jan 31, 2020
4cfcfe8
Revert "Fixed off by one error on start/end indices passed by reduce_…
bbbales2 Jan 31, 2020
d46c022
Added extra template conditions for accumulate_adjoints_, count_vars_…
bbbales2 Jan 31, 2020
ccc82e7
Merge branch 'cleanup/proto-parallel-v3' of https://github.com/stan-d…
bbbales2 Jan 31, 2020
87a86ea
Absorbed cvodes_ode_data.hpp stuff into cvodes_integrator.hpp
bbbales2 Feb 5, 2020
6c88e6a
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Feb 5, 2020
144bb9c
Changed how arg_adjoints_ is allocated in reduce_sum and added out of…
bbbales2 Feb 13, 2020
4adf05d
Merge commit '8fbce61858ae95745567d8c5f7e054e3d3b20834' into HEAD
yashikno Feb 13, 2020
80ae1bf
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Feb 13, 2020
7a1a27b
Made deep copy in reduce_sum a little more efficient
bbbales2 Feb 24, 2020
9e15292
Merge branch 'cleanup/proto-parallel-v3' of https://github.com/stan-d…
bbbales2 Feb 24, 2020
b6b215b
Merge commit 'b29eff6b027fb2a1bcc5af53d868ce8024235272' into HEAD
yashikno Feb 24, 2020
66ba573
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Feb 24, 2020
a5a50e2
Merge remote-tracking branch 'origin/develop' into cleanup/proto-para…
SteveBronder Mar 5, 2020
55171a4
Adds pf (yes I know but seriously this time it's good I think) to the…
SteveBronder Mar 6, 2020
bc3b7c6
add inline to functions
SteveBronder Mar 6, 2020
89d0781
Added signature that for exposing variadic arguments to higher level
bbbales2 Mar 8, 2020
e8b0294
Made some changes so ode rhs functions with variadic arguments work w…
bbbales2 Mar 9, 2020
a017619
Add docs for templates in reduce_sum
SteveBronder Mar 9, 2020
2561972
Merge remote-tracking branch 'origin/develop' into cleanup/parallel-v5
SteveBronder Mar 9, 2020
3e36ba8
[Jenkins] auto-formatting by clang-format version 5.0.2-svn328729-1~e…
stan-buildbot Mar 9, 2020
38aa2af
Merge remote-tracking branch 'origin/develop' into cleanup/proto-para…
SteveBronder Mar 9, 2020
b99d299
Merge branch 'cleanup/proto-parallel-v3' into cleanup/parallel-v5
SteveBronder Mar 9, 2020
cc37f22
Add includes for test-headers and add threading environment variable …
SteveBronder Mar 9, 2020
b64fe87
remove -fopenmp from CXXFLAGS
SteveBronder Mar 9, 2020
7d27f90
remove old prim/scal.hpp include from apply_test
SteveBronder Mar 10, 2020
c53d29d
Fix broadcast_array to remove vec_partial_
SteveBronder Mar 10, 2020
fb9f25a
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Mar 10, 2020
86bf06a
a few inlines added
rok-cesnovar Mar 11, 2020
ee1e0d7
Merge pull request #1768 from stan-dev/cleanup/parallel-v5
bbbales2 Mar 11, 2020
7aa19ce
Changed reduce_sum so sliced argument can be an array of any Stan type
bbbales2 Mar 13, 2020
cb57e75
Merge commit 'fe3a41c3e854fe604841b237fa0475f26d29fe98' into HEAD
yashikno Mar 13, 2020
09d3f52
[Jenkins] auto-formatting by clang-format version 5.0.2-svn328729-1~e…
stan-buildbot Mar 13, 2020
3522bbe
Merge remote-tracking branch 'origin/cleanup/proto-parallel-v3' into …
bbbales2 Mar 14, 2020
80449e0
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Mar 14, 2020
12f6ad9
Changed order of arguments for all the ODE stuff so the variadic argu…
bbbales2 Apr 3, 2020
a2e9c92
Merge remote-tracking branch 'origin/develop' into feature/parameter-…
bbbales2 Apr 13, 2020
64a017e
Variadic versions of ode solvers named ode_bdf and ode_rk45
bbbales2 Apr 13, 2020
b8168e1
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Apr 13, 2020
2a3d24a
Merge remote-tracking branch 'origin/develop' into feature/parameter-…
bbbales2 Apr 13, 2020
085c3bc
[Jenkins] auto-formatting by clang-format version 6.0.0
stan-buildbot Apr 13, 2020
8642b08
Reverting accidental changes to reduce_sum on this branch (Issue #1833)
bbbales2 Apr 13, 2020
f1d7b6c
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Apr 13, 2020
a3a3121
Cleaning up merge (Issue #1833)
bbbales2 Apr 13, 2020
7a8e3d5
Cleaning up merge (reverting Jenkinsfile to develop) (Issue #1833)
bbbales2 Apr 13, 2020
e012d1f
2 missing inlines
rok-cesnovar Apr 24, 2020
03756de
Switched ODE states to be expressed as Eigen Vectors (variadic odes, …
bbbales2 May 6, 2020
2cc1f3d
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 May 6, 2020
257afa0
Fixed bug with how ode sensitivities with respect to t0 work (design-…
bbbales2 May 9, 2020
a3530bb
Merge remote-tracking branch 'origin/develop' into feature/parameter-…
bbbales2 May 9, 2020
e3e2b9e
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot May 9, 2020
8bf8b87
Updated ODE function docs
bbbales2 May 11, 2020
9553f64
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 May 11, 2020
cb602ad
Updated ode_store_sensitivities references (design-doc #19)
bbbales2 May 11, 2020
36a15e2
Merge commit 'c02589c1513c57593661ec7b21f17923b55cd9f3' into HEAD
yashikno May 11, 2020
9831634
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot May 11, 2020
44529fd
Adjoint ode_bdf passing ode_bdf tests. integrate_ode_bdf not working …
bbbales2 May 16, 2020
e9cca92
Merge commit '6025c339b0fad05ac568a678d38cc6e74cddf57b' into HEAD
yashikno May 16, 2020
92314d0
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot May 16, 2020
c719ec5
integrate_ode_bdf tests mostly working now (Issue #1887)
bbbales2 May 21, 2020
7b3f7b7
Merge remote-tracking branch 'origin/develop' into feature/parameter-…
bbbales2 May 21, 2020
94fdd3e
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot May 21, 2020
1b2b066
template parameter fixes, reversed order of functions
rok-cesnovar May 22, 2020
962ba83
Revert back to forward mode sensitivity for cvodes (to make separate …
bbbales2 May 22, 2020
e6d7dcf
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 May 22, 2020
46d7230
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot May 22, 2020
7f5e7db
Made some minor changes with coupled_ode_system to make new code matc…
bbbales2 May 25, 2020
61cfd25
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 May 25, 2020
d962970
Merge commit 'd5849314500d88fe04719ec27b45adf5ed3d1ee2' into HEAD
yashikno May 25, 2020
7007256
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot May 25, 2020
ad58f9d
Allow integer initial times and output times (design-doc #19)
bbbales2 May 25, 2020
8c1a10d
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 May 25, 2020
8bd267f
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot May 25, 2020
8f28f3e
Add new adams interface (design-doc #19)
bbbales2 May 25, 2020
4ca2912
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 May 25, 2020
8dfa0d1
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot May 25, 2020
b4e89d3
Added tests for new adams ode interface (design-doc #19)
bbbales2 May 25, 2020
a1f928b
Times to ODE solvers only need to be sorted, not strictly increasing …
bbbales2 May 25, 2020
f16df92
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 May 25, 2020
ae99813
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot May 25, 2020
ea303ff
Added new prim tests for bdf solver. Added new interfaces that include
bbbales2 May 28, 2020
ae43edf
Merge commit '27afd26a854d7be23e6e20b0eaff4dbbbe700b13' into HEAD
yashikno May 28, 2020
c982322
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot May 28, 2020
6ae558c
Hopefully completed adding tests to new ode functions.
bbbales2 Jun 1, 2020
4ad49f4
Merge commit '576c358ce7427bffeee1c5055f2750058c652b1c' into HEAD
yashikno Jun 1, 2020
0eb1382
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jun 1, 2020
961780f
Performance optimizations for coupled_ode_system (design-doc #19)
bbbales2 Jun 16, 2020
3b5f18d
Merge remote-tracking branch 'origin/develop' into feature/parameter-…
bbbales2 Jun 22, 2020
dfdd989
Merge commit 'de6e454a7db5854c413dbb943a5a4f056d9085ec' into HEAD
yashikno Jun 22, 2020
5668b09
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jun 22, 2020
11605da
fix linting/docs errors
rok-cesnovar Jun 23, 2020
a1db0b4
Merge commit '93898d06805f7e54e801ddfcd5d7457d79ed46b3' into HEAD
yashikno Jun 23, 2020
28affd2
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jun 23, 2020
c42eec7
fix missing headers
rok-cesnovar Jun 23, 2020
27d4f49
Added eval statement to handle `value_of` expressions (design-doc #19)
bbbales2 Jun 23, 2020
69e5f86
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jun 23, 2020
1038387
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jun 23, 2020
bae0be9
Added tests for cvodes error prints, grad with no argument, and clean…
bbbales2 Jun 23, 2020
573dc1a
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jun 23, 2020
0eff931
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jun 23, 2020
9a10def
More optimizations to make the new ode interfaces fast (design-doc #19)
bbbales2 Jun 24, 2020
1fc074c
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jun 24, 2020
9c82020
Merge remote-tracking branch 'origin/develop' into feature/parameter-…
bbbales2 Jun 24, 2020
18f5c2d
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jun 24, 2020
1ef29d9
Updated function name in error messages to better reflect which funct…
bbbales2 Jun 30, 2020
e65fb97
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jun 30, 2020
9a84b50
Merge commit '5c6a4dd7a814a60bd3ea766ab8701ea2234724b3' into HEAD
yashikno Jun 30, 2020
4851d6b
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jun 30, 2020
9592cba
Added more time points to ode prim tests (design-doc #19)
bbbales2 Jun 30, 2020
d4f8fe1
Updated docs, cleaned up template naming, avoided unncessary nested a…
bbbales2 Jul 1, 2020
cbdace5
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jul 1, 2020
9f923e8
Added support for general arguments to variadic ODEs (design-doc #19)
bbbales2 Jul 2, 2020
40ba7a8
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 2, 2020
3b3a9f3
Merge remote-tracking branch 'origin/develop' into feature/parameter-…
bbbales2 Jul 2, 2020
7e411bc
Updated value_of implementation to work with holder again. Added test…
bbbales2 Jul 2, 2020
52c85a4
Added eigen version of harm_osc_ode_fun and reverse mode tests for co…
bbbales2 Jul 2, 2020
158ec02
Merge remote-tracking branch 'origin' into feature/parameter-pack-odes
bbbales2 Jul 3, 2020
8ab9809
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 3, 2020
b76e7a5
Made zero_adjoints its own standalone function (design-doc #19)
bbbales2 Jul 3, 2020
ea0f8b8
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 3, 2020
ce1377a
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 3, 2020
64805e3
Added tests for old ode interface adapter code (design-docs #19)
bbbales2 Jul 3, 2020
467b53a
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 3, 2020
393b2c9
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 3, 2020
66bf060
Clean up doxygen and test names (design-doc #19)
bbbales2 Jul 4, 2020
0ce1fe5
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 4, 2020
2b53b2d
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 4, 2020
f745294
Updated headers in zero_adjoints.hpp (design-doc #19)
bbbales2 Jul 4, 2020
c045a69
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 4, 2020
444ae2a
Updated types in coupled_ode_system tests (design-doc #19)
bbbales2 Jul 4, 2020
b8bc8e4
Added missing error print (design-doc #19)
bbbales2 Jul 6, 2020
9f62feb
Merge commit 'b95dd5a46e8bdfdf984d11413dc86bc98306a3d8' into HEAD
yashikno Jul 6, 2020
56196a3
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jul 6, 2020
15eb4ec
Fixed check_finite to work with expressions (design-doc #19)
bbbales2 Jul 6, 2020
efd5763
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 6, 2020
5773195
Updated check_finite to work with eigen arrays (design-doc #19)
bbbales2 Jul 6, 2020
6d365ce
Cleanup responding to review comments (design-doc #19)
bbbales2 Jul 6, 2020
0c18338
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jul 6, 2020
7538e97
Updated some includes (design-doc #19)
bbbales2 Jul 6, 2020
1a732b0
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 6, 2020
c2499be
Responding to comments. Added too much work tests to _tol versions of…
bbbales2 Jul 7, 2020
5f216f4
Merge commit 'd48a48744910f99cd94abf0a5789ad6a8031c758' into HEAD
yashikno Jul 7, 2020
29cde14
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 7, 2020
35267b1
Added ode_store_sensitivities tests (design-doc #19)
bbbales2 Jul 7, 2020
c6a687d
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 7, 2020
4646593
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 7, 2020
19e029c
Responding to reviews (design-doc #19)
bbbales2 Jul 8, 2020
51e8f24
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 8, 2020
7a42c5a
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 8, 2020
3e7abbf
Updated variable naming/docs (design-doc #19)
bbbales2 Jul 9, 2020
879510e
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 9, 2020
54de59b
Added some comments around strange code.
bbbales2 Jul 9, 2020
509f7b2
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jul 9, 2020
10acf66
Fixed wrong pointer name (design-doc #19)
bbbales2 Jul 9, 2020
ab7c503
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 9, 2020
0ce6e18
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jul 9, 2020
a5ee85d
Added eval function to call `.eval()` on expressions buried in parame…
bbbales2 Jul 9, 2020
49bfc45
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Jul 9, 2020
2e83467
Fixed doxygen problem though I'm not sure how (design-doc #19)
bbbales2 Jul 9, 2020
9c7f88d
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 9, 2020
3b4c217
Updated eval implementation and tests (design-docs #19)
bbbales2 Jul 10, 2020
a589de9
Removed unnecessary headers (design-doc #19)
bbbales2 Jul 10, 2020
a37be47
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 10, 2020
43fb63b
Switched integrate_ode_bdf, integrate_ode_adams, and integrate_ode_rk…
bbbales2 Jul 10, 2020
0d2e975
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2 (tag…
stan-buildbot Jul 10, 2020
1908f1c
Fixed error message printing with too much work and extended tests to…
bbbales2 Jul 13, 2020
a3f438b
Merge branch 'feature/parameter-pack-odes' of https://github.com/stan…
bbbales2 Jul 13, 2020
e51700b
Merge remote-tracking branch 'origin/develop' into feature/parameter-…
bbbales2 Jul 14, 2020
bec1c2a
comment-out dont run async tests
rok-cesnovar Jul 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added variadic implementation of rev parallel_sum
  • Loading branch information
bbbales2 committed Jan 15, 2020
commit cbcf42fad798015b317ba6dab7a6ddc5d9983aa2
1 change: 1 addition & 0 deletions stan/math/prim/scal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
#include <stan/math/prim/scal/fun/value_of.hpp>
#include <stan/math/prim/scal/fun/value_of_rec.hpp>

#include <stan/math/prim/scal/functor/apply.hpp>
#include <stan/math/prim/scal/functor/reduce_sum.hpp>

#include <stan/math/prim/prob/bernoulli_ccdf_log.hpp>
Expand Down
50 changes: 50 additions & 0 deletions stan/math/prim/scal/functor/apply.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#ifndef STAN_MATH_PRIM_SCAL_FUNCTOR_APPLY_HPP
#define STAN_MATH_PRIM_SCAL_FUNCTOR_APPLY_HPP

#include <functional>
#include <tuple>
#include <utility>

namespace stan {
namespace math {
/*
* Invoke the functor f with arguments given in t and indexed in the index
* sequence I
*
* @tparam F Type of functor
* @tparam Tuple Type of tuple containing arguments
* @tparam I Index sequence going from 0 to std::tuple_size<T>::value - 1
* inclusive
* @param f functor callable
* @param t tuple of arguments
* @param i placeholder variable for index sequence
*/
template <class F, class Tuple, std::size_t... I>
constexpr decltype(auto) apply_impl(F&& f, Tuple&& t,
std::index_sequence<I...> i) {
return f(std::forward<decltype(std::get<I>(t))>(std::get<I>(t))...);
}

/*
* Call the functor f with the tuple of arguments t, like:
*
* f(std::get<0>(t), std::get<1>(t), ...)
*
* TODO: replace this with implementation in C++ std when C++17 is available
*
* @tparam F Type of functor
* @tparam Tuple Type of tuple containing arguments
* @param f functor callable
* @param t tuple of arguments
*/
template <class F, class Tuple>
constexpr decltype(auto) apply(F&& f, Tuple&& t) {
return apply_impl(std::forward<F>(f), std::forward<Tuple>(t),
std::make_index_sequence<
std::tuple_size<std::remove_reference_t<Tuple>>{}>{});
}

} // namespace math
} // namespace stan

#endif
97 changes: 50 additions & 47 deletions stan/math/prim/scal/functor/reduce_sum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,59 +19,66 @@ namespace math {

namespace internal {


// base definition => compile error
template <typename ReduceFunction, typename Enable = void, typename M, typename T, typename... Args>
struct reduce_sum_impl {};

// todo, double check if I need enable if here
template <typename ReduceFunction, typename M, typename T, typename... Args>
struct reduce_sum_impl<ReduceFunction, require_arithmetic_t<T>, M, T, Args...> {
using vmapped_t = std::vector<M>;
// todo(Steve): Need helper funcs for manipulating / iterating tuples
std::tuple<std::vector<Args>...> arg_;
const vmapped_t& vmapped_;
T terms_sum_;

// todo(Steve): put back recursive reducer
reduce_sum_impl(const vmapped_t& vmapped, const T& init, Args&&... args)
: vmapped_(vmapped),
arg_(std::make_tuple(std::forward<Args>(args)...))
terms_sum_(value_of(init)) {}

reduce_sum_impl(reduce_sum_impl& other, tbb::split)
: vmapped_(other.vmapped_),
arg_(other.arg_),
terms_sum_(0.0) {}
template <typename ReduceFunction, typename M, typename... Args>
struct reduce_sum_impl {
struct recursive_reducer {
using vmapped_t = std::vector<M>;
std::tuple<const Args&...> args_tuple_;
const vmapped_t& vmapped_;
double sum_;

recursive_reducer(const vmapped_t& vmapped, const Args&... args)
: vmapped_(vmapped),
args_tuple_(args...),
sum_(0.0) {}

recursive_reducer(recursive_reducer& other, tbb::split)
: vmapped_(other.vmapped_),
args_tuple_(other.args_tuple_),
sum_(other.sum_) {}

void operator()(const tbb::blocked_range<size_t>& r) {
if (r.empty()) {
return;
return;
}

auto start = vmapped_.begin();
std::advance(start, r.begin());
auto end = vmapped_.begin();
std::advance(end, r.end());

const vmapped_t sub_slice(start, end);

terms_sum_ += ReduceFunction()(r.begin(), r.end() - 1, sub_slice, unpack_tuple_func(args));

sum_ += apply([&](auto&&... args) {
return ReduceFunction()(r.begin(), r.end() - 1, sub_slice, args...);
}, args_tuple_);
}

void join(const reduce_sum_impl& child) {
terms_sum_ += child.terms_sum_;
void join(const recursive_reducer& child) {
sum_ += child.sum_;
}
};

// Todo: Better name for this than operator(), collect()?
template <typename... OtherArgs>
T operator()(const vmapped_t& vmapped, T init, std::size_t grainsize,
Args&&... args) const {
double operator()(const std::vector<M>& vmapped, std::size_t grainsize,
const Args&... args) const {
const std::size_t num_jobs = vmapped.size();
reduce_sum_impl<ReduceFunction, M, T, OtherArgs...> worker(vmapped, init, args...);

if (num_jobs == 0)
return 0.0;

recursive_reducer worker(vmapped, args...);

#ifdef STAN_DETERMINISTIC
tbb::static_partitioner partitioner;
tbb::parallel_deterministic_reduce(
tbb::blocked_range<std::size_t>(0, num_jobs, grainsize), worker,
partitioner);
#else
tbb::parallel_reduce(
tbb::blocked_range<std::size_t>(0, num_jobs, grainsize), worker);
return std::move(worker.terms_sum_);
#endif

return worker.sum_;
}
};

Expand All @@ -82,17 +89,13 @@ struct reduce_sum_impl<ReduceFunction, require_arithmetic_t<T>, M, T, Args...> {
* that any internal state of the functor is causing trouble. Thus,
* the functor must be default constructible without any arguments.
*/
template <typename ReduceFunction, typename M, typename T, typename... Args>
constexpr T reduce_sum(const std::vector<M>& vmapped, T init,
std::size_t grainsize, Args&&... args) {
typedef T return_base_t;
// void here but need to figure out enable_if stuff
// We do this somewhere in the opencl code
return internal::reduce_sum_impl<ReduceFunction, M, T, void, Args...>()(
vmapped, init, grainsize, std::forward<Args>(args)...);
template <typename ReduceFunction, typename M, typename... Args>
constexpr double reduce_sum(const std::vector<M>& vmapped,
std::size_t grainsize, const Args&... args) {
return internal::reduce_sum_impl<ReduceFunction, M, Args...>()
(vmapped, grainsize, args...);
}


} // namespace math
} // namespace stan

Expand Down
36 changes: 1 addition & 35 deletions stan/math/rev/functor/adj_jac_apply.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,6 @@ namespace stan {
namespace math {

namespace internal {
/**
* Invoke the functor f with arguments given in t and indexed in the index
* sequence I
*
* @tparam F Type of functor
* @tparam Tuple Type of tuple containing arguments
* @tparam I Index sequence going from 0 to std::tuple_size<T>::value - 1
* inclusive
* @param f functor callable
* @param t tuple of arguments
* @param i placeholder variable for index sequence
*/
template <class F, class Tuple, std::size_t... I>
constexpr auto apply_impl(const F& f, const Tuple& t,
std::index_sequence<I...> i) {
return f(std::get<I>(t)...);
}

/**
* Call the functor f with the tuple of arguments t, like:
*
* f(std::get<0>(t), std::get<1>(t), ...)
*
* TODO: replace this with implementation in C++ std when C++17 is available
*
* @tparam F Type of functor
* @tparam Tuple Type of tuple containing arguments
* @param f functor callable
* @param t tuple of arguments
*/
template <class F, class Tuple>
constexpr auto apply(const F& f, const Tuple& t) {
return apply_impl(f, t, std::make_index_sequence<std::tuple_size<Tuple>{}>{});
}

/**
* Store the adjoint in y_vi[0] in y_adj
Expand Down Expand Up @@ -533,7 +499,7 @@ struct adj_jac_vari : public vari {
internal::build_y_adj(y_vi_, M_, y_adj);
auto y_adj_jacs = f_.multiply_adjoint_jacobian(is_var_, y_adj);

internal::apply(
apply(
[this](auto&&... args) { this->accumulate_adjoints(args...); },
y_adj_jacs);
}
Expand Down
Loading