Skip to content
Snippets Groups Projects

Feature: FastDGGridOperator from exadune

Merged René Heß requested to merge feature/fast-dg-assemble into master
2 unresolved threads

This merge request copies the FastDGGridOperator from EXADune to PDELab. This allows to make use of blocking of degrees of freedom in the global degree of freedom vector for DG methods. This way we can avoid copying the data around several times.

All code credit goes to @smuething. I just copied his code around.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Sorry for being picky, but I don't think this MR is not OK.

    • we are using two git repos. I don't link copying code around. I'd like to see the history.
    • you could pick the relevant commits, as we only have few modified files and mostly new files.
    • the MR could be split into two or three different sets of features, which would make it easier to review.
    • the code uses TBB. Does it also work without TBB?
    • there is no test at all for this assembler.
  • 146 global_sn_view.attach(solution_);
    147 }
    148
    149 //! Called immediately after binding of local function space in
    150 //! global assembler.
    151 //! @{
    152 template<typename EG, typename LFSUC, typename LFSVC>
    153 void onBindLFSUV(const EG & eg, const LFSUC & lfsu_cache, const LFSVC & lfsv_cache){
    154 global_sl_view.bind(lfsu_cache);
    155 //xl.resize(lfsu_cache.size());
    156 }
    157
    158 template<typename EG, typename LFSVC>
    159 void onBindLFSV(const EG & eg, const LFSVC & lfsv_cache){
    160 global_rl_view.bind(lfsv_cache);
    161 //rl.assign(lfsv_cache.size(),0.0);
    • The changes compared to the default assembler seem to be marginal. Would it be possible to merge the Fast and the Default engines? One could introduce ResidualViews in both cases and they should only differ in the particular implementation. This would avoid the copy-paste hell.

    • Please register or sign in to reply
  • Author Developer

    Sorry I forgot to tag the merge request work in progress. It is definitely not ready to be merged but I wanted to make it visible here so that @smuething and everybody else can have a look. So thanks for looking into it!

    I think there will be more places with obvious mistakes or where things could be done better. I hope @smuething will find the time to look at it. Some specific answers:

    • The #* file is of course garbage.
    • About history preserving: I think this would be really hard. Maybe I am wrong but I would guess that preserving history from exadune would be really difficult.
    • This whole merging back from exadune is something which should be discussed at some point. I have the impression that exadune is like a playground for implenenting features and finding the right ways to do it without worrying about breaking things. I think the developed features should in the end reach pdelab. The important question is how. I agree that more informative commit messages would be a good thing but it could be difficult to find someone with the time and knowledge to achieve a nice well documented merge into pdelab.
    • For me it would be impossible to split this merge since I started with an example and fixed pdelab along the way.
    • I can't say anything about TBB.
    • Tests: Right now there is no test since this would involve writing a local operator. We have a test for this code but it comes from generated code that is not easy to read. Maybe just document that this is some kind of experimental feature that should only be used if you know what you are doing?
    Edited by René Heß
  • René Heß marked as a Work In Progress

    marked as a Work In Progress

  • About history preserving: I think this would be really hard. Maybe I am wrong but I would guess that preserving history from exadune would be really difficult.

    why? The changes are mainly new files. It should be easy to cherry-pick these commits and the other ones should only be few, so that hopefully it is not too much work to keep them working...

  • Author Developer

    The main reason is that @smuething implemented the FastDGGridOperator directly in the normal pdelab GridOperator. This of course broke all CG stuff. So about 10 month ago @marian moved the FastDGGridOperator to a new file. If you look at a blame of

    https://gitlab.dune-project.org/exadune/dune-pdelab/blame/feature/blockiterative-preconditioner/dune/pdelab/gridoperator/fastdg.hh

    you can see that the history is already lost at this point.

  • Dominic Kempf added 1 commit

    added 1 commit

    • c8ca0a76 - Dune::ForEachValue -> Hybrid::forEach

    Compare with previous version

  • I would like to get this one into 2.5 as we are actively using it. Also, it stands quite isolated within PDELab, so it cannot potentially be harmful to existing code.

  • Dominic Kempf changed milestone to %PDELab 2.9

    changed milestone to %PDELab 2.9

  • In the next days I want to go through the last year's commit messages in EXADune PDELab because we also want to backport the improved interface for matrix-free computations. I can then tell whether everything is OK with this backport. But I reckon so, since you are both using it for your testing.

    I personally believe that it is better that the two grid operators are separated because it really doesn't harm the old code.

  • added 2 commits

    • d760660f - correct Dirichlet constraints handling in standard case to old behaviour
    • 049c7e3b - [FastDG] delete friend declaration of GridOperator in local assembler

    Compare with previous version

  • added 1 commit

    • 35414e29 - [LocalAssemblerBase,FastDG] revert mixing up public and proctected accessibility of members

    Compare with previous version

  • From my point of view and level of understanding, this integration should be OK.

  • added 1 commit

    • 614f525f - [FastDGGridOperator,Engines] improve readability of code + consistent style

    Compare with previous version

  • Marian Piatkowski mentioned in merge request !212 (merged)

    mentioned in merge request !212 (merged)

  • René Heß added 21 commits

    added 21 commits

    • e3856241 - Add fastdg stuff in gridfunctionspace/
    • d32cf9ea - Update lfsindexcache
    • a599e7c5 - Remove timers from fastdg engines
    • 91065bc4 - Remove direction in fastdg.hh
    • 8ecbd998 - Update localfunctionspace.hh
    • 4e2addd7 - Update backend/istl/bcrsmatrix.hh/vector.hh
    • 6827e859 - Add backend/common/aliasedmatrixview.hh/aliasedvectorview.hh
    • 9c986d19 - Add backend/istl/flatmatrixbackend.hh/flatvectorbackend.hh
    • d1cfb904 - Remove flatmatrixbackend.hh/flatvectorbackend.hh
    • ac3d5456 - Update bcrsmatrix.hh
    • a778597d - Update matrixhelpers.hh
    • 79f33890 - Update fastdg/assemlbler.hh
    • e35d9a6a - Update p/g/c/assemblerutilities.hh
    • fa19552c - Update subspacelocalfunctionspace.hh
    • 85289732 - Add clear_row_block() method to simple matrix backends
    • 31112b3e - Use std::tuple_size
    • 310639b9 - Dune::ForEachValue -> Hybrid::forEach
    • 8c0156cc - correct Dirichlet constraints handling in standard case to old behaviour
    • e51df0d2 - [FastDG] delete friend declaration of GridOperator in local assembler
    • b91a5424 - [LocalAssemblerBase,FastDG] revert mixing up public and proctected accessibility of members
    • fdceb4dd - [FastDGGridOperator,Engines] improve readability of code + consistent style

    Compare with previous version

  • René Heß added 1 commit

    added 1 commit

    Compare with previous version

  • Dominic Kempf unmarked as a Work In Progress

    unmarked as a Work In Progress

  • By the way, before you merge this. I still need to incorporate the changes in the one-step engines to get both grid operators to work..... Currently it only works for the standard grid operator, but not for the fast DG case.

  • Okay then... now is the time.

  • René Heß added 1 commit

    added 1 commit

    • bd972ab1 - Remove unneeded methods from aliasedmatrixview

    Compare with previous version

  • Looks good to me. One last thing, though: After merging, the new operator might need the same cleanups as the standard one from Marian's !212 (merged).

  • added 3 commits

    • 74ec228a - [PrestageEngine] fix code to cover default and fast DG grid operator
    • 5b152cbf - [OneStep,Prestage] improve documentation
    • cf57018b - [OneStep,Prestage] add empty bind-functions on the lfs and explain why

    Compare with previous version

  • This was a pain in the a** now to get the things back from EXADune for the one-step engines. Please test this.

    Obviously I did a good job because now this MR cannot be merged automatically any more :wink:

  • 146 146 }
    147 147
    148 148 //! Access time at given stage
    149 Real timeAtStage(int stage_){
    149 Real timeAtStage(int stage_) const
    150 {
    150 151 return time+osp_method->d(stage_)*dt;
    151 152 }
    152 153
    153 154 //! Access time at given stage
    154 Real timeAtStage(){
    155 return time+osp_method->d(stage)*dt;
    155 Real timeAtStage() const
    156 {
    157 return time+osp_method->d(stage_)*dt;
  • Dominic Kempf added 1 commit

    added 1 commit

    • 255434a7 - [bugfix] Use correct stage class member

    Compare with previous version

  • We are encountering some problems in testing. We are not sure, where the problem is exactly, but I do not feel confident with rushing it into the RC. So 3.0 it is.

  • Dominic Kempf changed milestone to %PDELab 2.7

    changed milestone to %PDELab 2.7

  • mentioned in issue #88 (closed)

  • mentioned in issue #92 (closed)

  • René Heß added 5 commits

    added 5 commits

    • 3085f7fc - Write test for FastDGOperator -> Residuals are done
    • 5b5b1473 - Write test for FastDGOperator -> Jacobians are done
    • b5f5099c - Write test for FastDGGridOperator -> return 1 if error is too large
    • e3c332db - Fix small class access bug (public/private)
    • f6f0df1f - Add test for instationary FastDG

    Compare with previous version

  • Author Developer

    I added some a stationary and an instationary test using FastDGGridOperator and they produce the same output as the non fast DG versions. Maybe we can come closer to merging this ;).

  • Dominic Kempf added 180 commits

    added 180 commits

    • f6f0df1f...511f9d4e - 148 commits from branch master
    • ecdb1fe8 - Add fastdg stuff in gridfunctionspace/
    • 43bb71c1 - Update lfsindexcache
    • 70448c98 - Remove timers from fastdg engines
    • 4df8b7d8 - Remove direction in fastdg.hh
    • b9d7e3c6 - Update localfunctionspace.hh
    • 895e3264 - Update backend/istl/bcrsmatrix.hh/vector.hh
    • 0bee92c6 - Add backend/common/aliasedmatrixview.hh/aliasedvectorview.hh
    • 1930dccd - Add backend/istl/flatmatrixbackend.hh/flatvectorbackend.hh
    • efaaec2f - Remove flatmatrixbackend.hh/flatvectorbackend.hh
    • 91c323b3 - Update bcrsmatrix.hh
    • 3f7f3138 - Update matrixhelpers.hh
    • c3d7b6ea - Update fastdg/assemlbler.hh
    • f19efb8b - Update p/g/c/assemblerutilities.hh
    • 0cc96626 - Update subspacelocalfunctionspace.hh
    • a426d08e - Add clear_row_block() method to simple matrix backends
    • 150e5637 - Use std::tuple_size
    • 9de940d2 - Dune::ForEachValue -> Hybrid::forEach
    • e8e0a9ee - correct Dirichlet constraints handling in standard case to old behaviour
    • 7580a5db - [FastDG] delete friend declaration of GridOperator in local assembler
    • 3f822313 - [LocalAssemblerBase,FastDG] revert mixing up public and proctected accessibility of members
    • a9f674d8 - [FastDGGridOperator,Engines] improve readability of code + consistent style
    • c990e1fe - Remove TBB stuff
    • cf66e2bc - Remove unneeded methods from aliasedmatrixview
    • 77c4838b - [PrestageEngine] fix code to cover default and fast DG grid operator
    • af57721d - [OneStep,Prestage] improve documentation
    • 8c7f9830 - [OneStep,Prestage] add empty bind-functions on the lfs and explain why
    • 483fe64b - [bugfix] Use correct stage class member
    • 81885cc8 - Write test for FastDGOperator -> Residuals are done
    • 5ba06b27 - Write test for FastDGOperator -> Jacobians are done
    • b28065fe - Write test for FastDGGridOperator -> return 1 if error is too large
    • 7778446e - Fix small class access bug (public/private)
    • 1efecf30 - Add test for instationary FastDG

    Compare with previous version

  • Dominic Kempf added 1 commit

    added 1 commit

    • d82e6df8 - [bugfix] Fix bug introduced in rebasing

    Compare with previous version

  • Author Developer

    If no one complains I will merge this wednesday next week (25.5).

  • Besides my two minor comments, I'm fine with the MR.

  • René Heß added 3 commits

    added 3 commits

    • 0d4e1fc0 - Use dynamic category
    • c1285307 - [istl] Use override specifier to protect against typos
    • 3eb0913c - Fix tests

    Compare with previous version

  • René Heß added 1 commit

    added 1 commit

    Compare with previous version

  • René Heß added 1 commit

    added 1 commit

    Compare with previous version

  • René Heß added 1 commit

    added 1 commit

    Compare with previous version

  • Author Developer

    I finally had time to rebase to master and fix the issues mentioned by @marian. The tests pass so I will merge on friday if no one objects.

  • René Heß added 39 commits

    added 39 commits

    • 6d913798...d98f396f - 5 commits from branch master
    • eda2b1da - Add fastdg stuff in gridfunctionspace/
    • 84529f38 - Update lfsindexcache
    • 8aae4bcb - Remove timers from fastdg engines
    • e8244997 - Remove direction in fastdg.hh
    • ceb99f8a - Update localfunctionspace.hh
    • 169d63fa - Update backend/istl/bcrsmatrix.hh/vector.hh
    • ca809f2f - Add backend/common/aliasedmatrixview.hh/aliasedvectorview.hh
    • 286dcb36 - Add backend/istl/flatmatrixbackend.hh/flatvectorbackend.hh
    • 61f9849c - Remove flatmatrixbackend.hh/flatvectorbackend.hh
    • 02c3d31d - Update bcrsmatrix.hh
    • cbea80e0 - Update matrixhelpers.hh
    • 65248657 - Update fastdg/assemlbler.hh
    • f47c8ae7 - Update p/g/c/assemblerutilities.hh
    • 9b2a3274 - Update subspacelocalfunctionspace.hh
    • 3e612110 - Add clear_row_block() method to simple matrix backends
    • ed51efd2 - Use std::tuple_size
    • d65ae046 - Dune::ForEachValue -> Hybrid::forEach
    • 979f4226 - correct Dirichlet constraints handling in standard case to old behaviour
    • 4b436829 - [FastDG] delete friend declaration of GridOperator in local assembler
    • d526b830 - [LocalAssemblerBase,FastDG] revert mixing up public and proctected accessibility of members
    • f0c7ee65 - [FastDGGridOperator,Engines] improve readability of code + consistent style
    • 4b7aa714 - Remove TBB stuff
    • fb5388f4 - Remove unneeded methods from aliasedmatrixview
    • 0aaa0e26 - [PrestageEngine] fix code to cover default and fast DG grid operator
    • c9dcb3ec - [OneStep,Prestage] improve documentation
    • e5de600b - [OneStep,Prestage] add empty bind-functions on the lfs and explain why
    • c4ec8176 - [bugfix] Use correct stage class member
    • 3d6626aa - Write test for FastDGOperator -> Residuals are done
    • d460daf3 - Write test for FastDGOperator -> Jacobians are done
    • 4302e684 - Write test for FastDGGridOperator -> return 1 if error is too large
    • 5a40dcff - Fix small class access bug (public/private)
    • f3877bb9 - Add test for instationary FastDG
    • ae11c5b9 - [bugfix] Fix bug introduced in rebasing
    • db7c6f53 - Fix tests

    Compare with previous version

  • merged

  • René Heß mentioned in commit 590ac4e6

    mentioned in commit 590ac4e6

  • Please register or sign in to reply
    Loading