-
Notifications
You must be signed in to change notification settings - Fork 38
Allow for accessing flux Metadata
from Metadata::WithFluxes
Metadata
#1161
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
32a0d24
done
lroberts36 fb80247
changelog
lroberts36 5c9f88c
Add CellMemAligned flag
lroberts36 c664973
Only allocate after all received
lroberts36 7ee6475
Maybe speed up allocation status check
lroberts36 f31cce4
Actually include the flag
lroberts36 3eac37d
Merge branch 'lroberts36/add-non-one-copy-fluxes' into lroberts36/per…
lroberts36 19f7d85
Merge branch 'develop' into lroberts36/add-non-one-copy-fluxes
lroberts36 9728938
Merge branch 'lroberts36/add-non-one-copy-fluxes' of https://github.c…
lroberts36 dc4efa9
Merge branch 'develop' into lroberts36/add-non-one-copy-fluxes
lroberts36 8e8f201
format and lint
lroberts36 3ff2e8a
Make flux metadata accessible at WithFlux variable creation point
lroberts36 2977980
Add some documentation
lroberts36 917bf35
update changelog
lroberts36 d5c653d
ensure backward compatibility
lroberts36 fc82310
Merge branch 'develop' into lroberts36/add-non-one-copy-fluxes
lroberts36 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,7 +138,7 @@ struct PackDescriptor { | |
// default constructor needed for certain use cases | ||
PackDescriptor() | ||
: nvar_groups(0), var_group_names({}), var_groups({}), with_fluxes(false), | ||
coarse(false), flat(false), identifier("") {} | ||
coarse(false), flat(false), identifier(""), nvar_tot(0) {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just counts the total number of variables included in the pack at the time of |
||
|
||
template <class GROUP_t, class SELECTOR_t> | ||
PackDescriptor(StateDescriptor *psd, const std::vector<GROUP_t> &var_groups_in, | ||
|
@@ -147,7 +147,7 @@ struct PackDescriptor { | |
var_groups(BuildUids(var_groups_in.size(), psd, selector)), | ||
with_fluxes(options.count(PDOpt::WithFluxes)), | ||
coarse(options.count(PDOpt::Coarse)), flat(options.count(PDOpt::Flatten)), | ||
identifier(GetIdentifier()) { | ||
identifier(GetIdentifier()), nvar_tot(GetNVarsTotal(var_groups)) { | ||
PARTHENON_REQUIRE(!(with_fluxes && coarse), | ||
"Probably shouldn't be making a coarse pack with fine fluxes."); | ||
} | ||
|
@@ -159,8 +159,18 @@ struct PackDescriptor { | |
const bool coarse; | ||
const bool flat; | ||
const std::string identifier; | ||
const std::size_t nvar_tot; | ||
|
||
private: | ||
static int GetNVarsTotal(const std::vector<VariableGroup_t> &var_groups) { | ||
int nvar_tot = 0; | ||
for (const auto &group : var_groups) { | ||
for (const auto &[a, b] : group) { | ||
nvar_tot++; | ||
} | ||
} | ||
return nvar_tot; | ||
} | ||
std::string GetIdentifier() { | ||
std::string ident(""); | ||
for (const auto &vgroup : var_groups) { | ||
|
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes to allocating fields only after all boundary buffers are received. This should have no impact on code behavior, but can have a performance impact in some cases. The change is unrelated to the rest of the PR.