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

removed unnecessary inheritance #632

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open

removed unnecessary inheritance #632

wants to merge 3 commits into from

Conversation

dhinf
Copy link
Member

@dhinf dhinf commented Mar 5, 2019

bug fix for issue #631

@codecov
Copy link

codecov bot commented Mar 5, 2019

Codecov Report

Merging #632 into development will decrease coverage by 0.13%.
The diff coverage is n/a.

@@               Coverage Diff               @@
##           development     #632      +/-   ##
===============================================
- Coverage        84.95%   84.81%   -0.14%     
===============================================
  Files              335      335              
  Lines            24798    24798              
  Branches         11249    11262      +13     
===============================================
- Hits             21066    21033      -33     
  Misses            3729     3729              
- Partials             3       36      +33
Impacted Files Coverage Δ
dash/include/dash/halo/Halo.h 97.61% <ø> (ø) ⬆️
dash/include/dash/internal/Logging.h 68.18% <0%> (-31.82%) ⬇️
dash/test/TestBase.h 68.18% <0%> (-22.73%) ⬇️
dash/include/dash/Team.h 83.15% <0%> (-9.48%) ⬇️

@bertwesarg
Copy link
Member

Could you test it with Intel 19? I could send this one-liner to the original report, but it may take some time to get feedback.

@fuchsto fuchsto self-requested a review March 9, 2019 20:03
Copy link
Member

@fuchsto fuchsto left a comment

Choose a reason for hiding this comment

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

The subclassing was not unnecessary, it indicates the type category.
This is why public inheritance was used. The formal reading is "RegionSpec IS_A Dimensional<uint8_t, D>".

The compiler error is right, though, the fix is to add missing delegate constructor calls in RegionSpec.

@dhinf
Copy link
Member Author

dhinf commented Mar 11, 2019

RegionSpec is not really "a" Dimensional. The member RegionCoords is Dimensional. But RegionSpec only combines RegionCoords with some other properties.

@fuchsto
Copy link
Member

fuchsto commented Mar 11, 2019

Well, the question whether "A is a B" (A : public B) means:
"Can you pass an instance of A to every context that expects a B?
In this example, let's assume:

SizeT volume(const Dimensional & d) { return std::accumulate( ... , std::multiplies); }
RegionSpec<...> rs(...);
auto region_volume = volume(rs);

I don't see why something like that should not be okay, so RegionSpec could act as Dimensional.
Back then, I added some other types for Cartesian domains, perhaps something else is a better fit
We'll see tomorrow.

@devreal
Copy link
Member

devreal commented Mar 28, 2019

What is the way forward here? I don't remember this was discussed at the F2F but it keep biting...

@dhinf
Copy link
Member Author

dhinf commented Mar 28, 2019

i still think that no inheritance should be used. I don't use the data structure of the base class or any methods.

@dhinf dhinf added the bug label Mar 28, 2019
@dhinf dhinf self-assigned this Mar 28, 2019
@devreal
Copy link
Member

devreal commented Mar 28, 2019

Can the RegionSpec be implemented in terms of Dimensional?

@dhinf
Copy link
Member Author

dhinf commented Mar 28, 2019

Not really, because RegionSpec combines RegionCoords (Dimensional), the extent and some other useful things. In an older version i didn't used RegionCoords, but instead Dimensional to store the coordinates. Later i devided them. And at this point i missed to delete the inheritance.

@devreal
Copy link
Member

devreal commented Mar 28, 2019

In an older version i didn't used RegionCoords, but instead Dimensional to store the coordinates

What's the reason to not use Dimensional to store the coordinates anymore?

@dhinf
Copy link
Member Author

dhinf commented Mar 28, 2019

Because i needed RegionCoords separately for other components. But seriously, i don't understand the problem here. We have so much other, more urgent, stuff to do.

@devreal
Copy link
Member

devreal commented Apr 30, 2019

@fuchsto I think we should merge this PR as is. Can you accept RegionSpec not being a Dimensional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants