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

Feat halo #197

Merged
merged 30 commits into from
Dec 20, 2016
Merged

Feat halo #197

merged 30 commits into from
Dec 20, 2016

Conversation

fmoessbauer
Copy link
Member

@fmoessbauer fmoessbauer commented Dec 12, 2016

Merge halo implementation of @dhinf in development (#195). This feature is especially needed in #196 and the astro tutorial.

Please review carefully and also check if the tests run on a "real" cluster. Not just on online CIs, as there at max 3 units are spin up.

dhinf and others added 25 commits April 15, 2016 18:04
…nd reuses values)

fixed boundary/halo views and size calculation

replaced std::bind with lambda
…nd reuses values)

fixed boundary/halo views and size calculation

replaced std::bind with lambda
…halo

Conflicts:
	dash/include/dash/Cartesian.h
@fmoessbauer
Copy link
Member Author

fmoessbauer commented Dec 13, 2016

Unit tests are currently missing as well. There is a TODO in GlobStencilIterTest.cc to adopt it to the HaloMatrix.

According to my stencil example, I assume that something with the boundary region is not correct. Unfortunately I do not know, whether the bug is in my code or in DASH.
The pictures are generated using example 11 in branch feat-halo-ex-stencil with two units. The suspicious parts are marked red.

ex.11.halo-stencil

testimg_output_halo

ex.11.simple.stencil

testimg_output_simple

@fuchsto
Copy link
Member

fuchsto commented Dec 14, 2016

Great! Will review all changes back at the hotel and put my comments here.

namespace dash {

template<typename MatrixT, typename HaloSpecT>
class HaloMatrix
Copy link
Member

Choose a reason for hiding this comment

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

The design of dash::HaloMatrix violates a lot of concepts and the container definition.
For example, ibegin, iend and bbegin, bend should be views, like dash::HaloMatrix.boundary.begin|.end.
Methods updateHalo, waitHaloAsync etc. are obviously not container concerns, but algorithms.
We would have to re-implement those for every container that supports boundary regions.
I'm okay with putting this implementation in examples, but we can't publish it as a container type.

Copy link
Member Author

Choose a reason for hiding this comment

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

Furthermore it's cumbersome to use it, as no access to the underlying container is provided. Hence the halo has to be created on each iteration (see here).

For me, a halo is a prime example for the decorator pattern, because the halo adds features to a container. It's not really an algorithm. However halos should support all containers with block views.

Copy link
Member

@fuchsto fuchsto Dec 14, 2016

Choose a reason for hiding this comment

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

@fmoessbauer Yes, that was my intention with dash::HaloBlock exactly. It's just a view on a regular NArray block. dash::HaloBlock then again represents a sequence container.

See:

The unit tests demonstrate the usage of halo views like:

auto boundary_begin = halo_block.boundary().begin();
auto boundary_end   = halo_block.boundary().end();
auto halo_begin = halo_block.halo().begin();
auto halo_end   = halo_block.halo().end();
// north halo region:
auto h_region_n = halo_block.halo_region({ -1,  0 });
auto h_region_n_begin = h_region_n.begin();
auto h_region_n_end   = h_region_n.end();

Copy link
Member

Choose a reason for hiding this comment

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

Hrrrmmm, I had a variant of dash::Matrix where the block view type could be specified as a template parameter. Didn't migrate the branch with the implementation to github, apparently.

Copy link
Member

Choose a reason for hiding this comment

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

Okay, how about moving dash::HaloMatrix by @dhinf to the stencil example directory and merging? I want the commits by @dhinf in development so his contribution is visible. We will then open a separate issue on refactoring it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I prefer moving it to dash/experimental, as already two examples are using the halo stuff. dash/experimental won't be included in libdash.h so whenever a user dares to use it, he has to include dash/experimental/... explicitly.
Furthermore moving it to examples will give name clashes in the future.

Copy link
Member

Choose a reason for hiding this comment

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

Eh, "experimental" is for concept proposals actually, but it's okay, will refactor it some time soon.

@fmoessbauer
Copy link
Member Author

fmoessbauer commented Dec 15, 2016

IMO it can be merged.

@fmoessbauer fmoessbauer mentioned this pull request Dec 15, 2016
@fuchsto
Copy link
Member

fuchsto commented Dec 20, 2016

The original implementations of dash::Halo* and dash::GlobStencilIter are considered stable and should by no means be overwritten by the altered versions (now placed in experimental namespace).

@fuchsto fuchsto merged commit 51a9bb6 into development Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants