Mesh refinement: fix MR on GPUs#564
Merged
SeverinDiederichs merged 12 commits intoJul 21, 2021
Merged
Conversation
15 tasks
MaxThevenet
approved these changes
Jul 21, 2021
Member
|
Awesome, thanks for this PR! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, using level 1 does not work on GPUs. This PR is resolving the issue.
The problem lies within the field solver: the staging area, which is used to conduct the DST, was based on the real box array. However, on level 1, this boxes have an offset because not all cells are valid on level 1. This causes out of memory accesses in the field solver.
To resolve the issue, the staging area is created like the complex array, without an offset. All functions interacting with the staging area needed to be adapted to take into account the offset.
Using a version which includes #561, I ran the full MR test:
Previously, I found some differences between CPU and GPU, however, they were caused by different beam initialization. Reading a beam from file, both give the same result:

This was tested both in Debug and in normal mode.
Using just this PR (so without #561, therefore no plasma is allowed on level 1) and a grid current example, both CPU and GPU give the same result:

constisconst)