-
Notifications
You must be signed in to change notification settings - Fork 102
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
Refactor/expansion of MG setup methods #1283
Open
weinbe2
wants to merge
25
commits into
develop
Choose a base branch
from
feature/cheby-mg-setup
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
84c7c7f
Initial hacky support for Chebyshev setup: controlled by environment …
weinbe2 da23108
Added solver.hpp include
weinbe2 4dce64e
Separate flags for level 1 and 2
weinbe2 7f659a8
Big commit refactoring near-null setup, exposing multiple types on a …
weinbe2 cef28f5
Threaded in command line support for Chebyshev filter setup
weinbe2 f954cec
Various cleanup
weinbe2 4b3d7b6
Split out test vector setup, disabled for the time being.
weinbe2 05762b3
Merge branch 'develop' into feature/cheby-mg-setup
weinbe2 ae55523
Added (untested) support to polish near-nulls with inverse iterations…
weinbe2 4539dad
Merge branch 'develop' into feature/cheby-mg-setup
weinbe2 3b300ee
Need temporary vector for restricting half prec fine near-nulls -> co…
weinbe2 5e109fe
Partial progress to using eigensolver to generate extra vectors after…
weinbe2 0014953
Mixed restrict/eigensolver setup is now working.
weinbe2 462854d
Fixed type typo on chebyshev filter bounds
weinbe2 70dafdd
Merge branch 'develop' into feature/cheby-mg-setup
weinbe2 5f282c0
Merge branch 'develop' into feature/cheby-mg-setup
weinbe2 e8a8677
Merge branch 'develop' into feature/cheby-mg-setup
weinbe2 de512c9
Merge branch 'develop' into feature/cheby-mg-setup
weinbe2 5ac5288
Addressed most PR review comments ; wrote block-BLAS orthonormalization
weinbe2 b4cdb6f
Added a more general matrix polynomial abstraction
weinbe2 e9fba21
Updated CA basis generation to use polynomial basis struct
weinbe2 998fe80
Merge branch 'hotfix/hdot' into feature/cheby-mg-setup
weinbe2 925c2dc
Merge branch 'develop' into feature/cheby-mg-setup
weinbe2 edd3e93
Merge branch 'hotfix/init_check_mg_mma' into feature/cheby-mg-setup
weinbe2 65ceb67
Merge branch 'develop' into feature/cheby-mg-setup
weinbe2 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -286,7 +286,7 @@ namespace quda { | |
SolverParam *param_coarse_solver; | ||
|
||
/** The coarse-grid representation of the null space vectors */ | ||
std::vector<ColorSpinorField*> *B_coarse; | ||
std::vector<ColorSpinorField*> B_coarse; | ||
|
||
/** Residual vector */ | ||
ColorSpinorField *r; | ||
|
@@ -449,7 +449,7 @@ namespace quda { | |
|
||
/** | ||
@brief Load the null space vectors in from file | ||
@param B Loaded null-space vectors (pre-allocated) | ||
@param B Load null-space vectors to here | ||
*/ | ||
void loadVectors(std::vector<ColorSpinorField *> &B); | ||
|
||
|
@@ -460,22 +460,59 @@ namespace quda { | |
void saveVectors(const std::vector<ColorSpinorField *> &B) const; | ||
|
||
/** | ||
@brief Generate the null-space vectors | ||
@brief Initialize a set of vectors to random noise | ||
@param B set of vectors | ||
*/ | ||
void initializeRandomVectors(const std::vector<ColorSpinorField*> &B) const; | ||
|
||
/** | ||
@brief Wrapping function that manages logic for constructing near-null vectors | ||
@param refresh whether or not we're only refreshing near null vectors | ||
*/ | ||
void constructNearNulls(bool refresh = false); | ||
|
||
/** | ||
@brief Generate the null-space vectors via inverse iterations | ||
@param B Generated null-space vectors | ||
@param refresh Whether we refreshing pre-exising vectors or starting afresh | ||
@param iterations if non-zero, override the max number of iterations | ||
*/ | ||
void generateNullVectors(std::vector<ColorSpinorField*> &B, bool refresh=false); | ||
void generateInverseIterations(std::vector<ColorSpinorField*> &B, int iterations = 0); | ||
|
||
/** | ||
@brief Generate the null-space vectors via a Chebyshev filter; this approach is | ||
based on arXiv:2103.05034, P. Boyle and A. Yamaguchi. | ||
@param B Generated null-space vectors | ||
*/ | ||
void generateChebyshevFilter(std::vector<ColorSpinorField*> &B); | ||
|
||
/** | ||
@brief Generate lowest eigenvectors | ||
@param B Generated null-space vectors | ||
@param post_restrict whether or not we're generating extra eigenvectors after restricting | ||
some fine eigenvectors; if true we override the requested n_conv in the multigrid | ||
eigenvalue struct | ||
*/ | ||
void generateEigenVectors(); | ||
void generateEigenvectors(std::vector<ColorSpinorField*> &B, bool post_restrict = false); | ||
|
||
/** | ||
@brief Generate near-null vectors via restricting finer near-nulls, generating extras if need be | ||
@param refresh Whether or not we're only refreshing extra near nulls | ||
*/ | ||
void generateRestrictedVectors(bool refresh = false); | ||
|
||
/** | ||
@brief Build free-field null-space vectors | ||
@param B Free-field null-space vectors | ||
@param B Generated null-space vectors | ||
*/ | ||
void generateFreeVectors(std::vector<ColorSpinorField*> &B); | ||
|
||
/** | ||
@brief Orthonormalize a vector of ColorSpinorField, erroring out if | ||
the fields are not sufficiently linearly independent | ||
@param vecs vector of ColorSpinorFields to normalize | ||
@param count number of near-null vectors to orthonormalize, default all | ||
*/ | ||
void buildFreeVectors(std::vector<ColorSpinorField*> &B); | ||
void orthonormalizeVectors(const std::vector<ColorSpinorField*>& vecs, int count = -1) const; | ||
|
||
/** | ||
@brief Return the total flops done on this and all coarser levels. | ||
|
@@ -495,6 +532,14 @@ namespace quda { | |
|
||
return (param.level == 0 || kd_nearnull_gen); | ||
} | ||
|
||
/** | ||
@brief Return if we're on the coarsest grid right now | ||
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. Use |
||
*/ | ||
bool is_coarsest_grid() const { | ||
return (param.level == (param.Nlevel - 1)); | ||
} | ||
|
||
}; | ||
|
||
/** | ||
|
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.
Can you add
[in]
/[out]
tags to all the doxgyen you've touched in this file?