-
Notifications
You must be signed in to change notification settings - Fork 87
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
Reduce the DistributedBase interface #1606
Conversation
613231d
to
daf690d
Compare
ca9cb11
to
bfeca24
Compare
40f74db
to
fda0fc9
Compare
bfeca24
to
643d886
Compare
fda0fc9
to
51ff6f9
Compare
74f81ff
to
afb7bcf
Compare
51ff6f9
to
37aef87
Compare
afb7bcf
to
dd32707
Compare
f2cd744
to
2072219
Compare
0c725a9
to
e6543ec
Compare
20e3d96
to
2812123
Compare
e6543ec
to
280a66e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have added the shared_ptr version previously, so I hold my approval until the shared_ptr still works here. It should work seamlessly with these changes though.
core/base/dispatch_helper.hpp
Outdated
* | ||
* @return the result of f invoked with obj cast to the first matching type | ||
*/ | ||
template <template <class> class K, typename... Types, typename T, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template <template <class> class K, typename... Types, typename T, | |
template <template <class> class Base, typename... Types, typename T, |
also the documentation needs to be adjusted. I have changed some documentations here, you may need to rebase and keep them similar.
With that, I think the following function can be deleted, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which following function do you mean? This at l.221 or at l.252?
1ae79b6
to
d35432b
Compare
d35432b
to
b240d9b
Compare
@yhmtsai I've unified the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. but unique_ptr part is unneccessary now.
core/base/dispatch_helper.hpp
Outdated
* @tparam Func the function type that is invoked if the object can be | ||
* converted to std::shared_ptr<K> | ||
* converted to pointer of const Base<K> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* converted to pointer of const Base<K> | |
* converted to pointer of Base<K> |
The const depends on the given type now, right?
core/base/dispatch_helper.hpp
Outdated
* @tparam T the type of input object waiting converted, has to be either | ||
* unique_ptr or shared_ptr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can only be shared_ptr
because dynamic_pointer_cast
only allow shared_ptr
and the ownership issue.
b240d9b
to
e19e53a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the pgm headers should be left in the pgm related files. Otherwise LGTM
e19e53a
to
2b5553d
Compare
Co-authored-by: Yu-Hsiang M. Tsai <[email protected]>
2b5553d
to
456f509
Compare
Quality Gate passedIssues Measures |
This PR reduces the interface changes to the
DistributedBase
interface. It removes the virtual functionget_local_size
. The only place where this was used was in the multigrid solver. There it has been replaced by using therun
dispatch with every possible distributed Matrix type.It also makes
run
easier to use by automatically deducing the const qualifier.Note: although this is based on #1544, it can be rebased on develop and merged before.