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

#872: add encoding member bits in handler field #1118

Merged
merged 2 commits into from
Nov 9, 2020

Conversation

jstrzebonski
Copy link
Contributor

@jstrzebonski jstrzebonski commented Oct 19, 2020

  • adds encoding member bit in handler field
  • cleans up all the places that previously used member boolean
  • fixes handlers' ID extraction
  • standardizes making and getting handlers
  • remove redundant const refs to HandlerType

Fixes #872

Copy link
Collaborator

Codacy Here is an overview of what got changed by this pull request:

Clones added
============
- src/vt/pipe/pipe_manager_tl.impl.h  2
         

See the complete overview on Codacy

@jstrzebonski
Copy link
Contributor Author

OK, so I found a problem, and it's pretty dumb :- |
makeHandler() accepts several boolean, some of them with default values. Adding another one, without taking care of correctly pass it to function, screwed up the code. I'm fixing it right know and adding utest to check such scenario.

Also I was thinking, maybe it might make sense to replace that parameters with structs that have only one explicit ctor? That way it won't be possible anymore to pass arguments in wrong order. Something like this:

struct IsAuto {
  constexpr explicit IsAuto(bool const is_auto) : is_auto_{is_auto} {}
  operator bool() const { return is_auto_; }

private:
  bool is_auto_;
};

and refactor makeHandler to accept args of that special types, instead of regular bools.

HandlerIdentifierType and HandlerControlType could also be refactor that way..

Copy link
Contributor

@JacobDomagala JacobDomagala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. After the fixes to CI it should be good to be merged :)

Copy link
Contributor Author

@jstrzebonski jstrzebonski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks promising, but not quite finished yet. Rework and recheck some of the files / changes considering especially handlers making and ids extraction.

@jstrzebonski jstrzebonski force-pushed the 872-handler-types-bit-pattern branch from 92111ad to c59d312 Compare October 29, 2020 23:04
@jstrzebonski
Copy link
Contributor Author

I don't know if I should, but I standardized the way the handlers are made and get. There were a lot of test failures before, and now (at least locally on my machine) all of them pass.

@jstrzebonski jstrzebonski marked this pull request as ready for review October 30, 2020 17:28
@lifflander
Copy link
Collaborator

I don't know if I should, but I standardized the way the handlers are made and get. There were a lot of test failures before, and now (at least locally on my machine) all of them pass.

Looking over the code, I like the idea of standardizing how handlers are made and accessed. I think a lot of that code needs cleanup!

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #1118 (5e00be2) into develop (9119934) will increase coverage by 0.04%.
The diff coverage is 90.58%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1118      +/-   ##
===========================================
+ Coverage    79.19%   79.24%   +0.04%     
===========================================
  Files          714      715       +1     
  Lines        26939    26984      +45     
===========================================
+ Hits         21335    21383      +48     
+ Misses        5604     5601       -3     
Impacted Files Coverage Δ
src/vt/messaging/active.cc 80.98% <ø> (ø)
src/vt/messaging/active.h 87.09% <ø> (ø)
src/vt/messaging/envelope/envelope_setup.impl.h 100.00% <ø> (ø)
src/vt/parameterization/parameterization.h 100.00% <ø> (ø)
src/vt/pipe/callback/cb_union/cb_raw_base.h 100.00% <ø> (ø)
...t/pipe/callback/handler_bcast/callback_bcast_tl.cc 100.00% <ø> (ø)
.../vt/pipe/callback/handler_send/callback_send_tl.cc 100.00% <ø> (ø)
.../callback/objgroup_bcast/callback_objgroup_bcast.h 100.00% <ø> (ø)
src/vt/pipe/pipe_manager_tl.impl.h 99.08% <ø> (-0.04%) ⬇️
...c/vt/registry/auto/functor/auto_registry_functor.h 100.00% <ø> (ø)
... and 45 more

@jstrzebonski
Copy link
Contributor Author

jstrzebonski commented Oct 30, 2020

Also, there are two, very very very minor things, that kind of irritates me so much:

  1. passing fundamental types by const refs (in this PR's case it's HandlerType, which simply is int64_t)
  2. inconsistency with passing params sometimes by const value and sometimes by value (even if const val could be used).

I know that these are the least of our problems and things on the TODO list, but I wonder if we could, and want to, somehow unify this, going step by step, from time to time. I could start with HandlerType in this PR.

What do you think guys?

@jstrzebonski jstrzebonski force-pushed the 872-handler-types-bit-pattern branch from 03b3bdd to aa71db9 Compare October 30, 2020 18:48
@jstrzebonski jstrzebonski reopened this Nov 3, 2020
@jstrzebonski jstrzebonski force-pushed the 872-handler-types-bit-pattern branch from aa71db9 to f089a28 Compare November 3, 2020 19:11
@jstrzebonski jstrzebonski force-pushed the 872-handler-types-bit-pattern branch from f089a28 to 5e00be2 Compare November 4, 2020 14:44
@jstrzebonski
Copy link
Contributor Author

jstrzebonski commented Nov 4, 2020

OK, so in the end, I've removed redundant const refs to HandlerType.

@jstrzebonski
Copy link
Contributor Author

@lifflander @JacobDomagala @cz4rs @PhilMiller
Please review the changes.

Copy link
Member

@PhilMiller PhilMiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like some tiny stray changes, but otherwise good.

@jstrzebonski jstrzebonski merged commit e6e3834 into develop Nov 9, 2020
@jstrzebonski jstrzebonski deleted the 872-handler-types-bit-pattern branch November 9, 2020 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encode member collection handler types in the bit pattern for the handler
4 participants