Problem 2 of Final Assignment for Parallel Programming: Parallel Optimization of Eigenvalue Solution via Iterative Methods#7492
Open
L12345j wants to merge 22 commits into
Open
Problem 2 of Final Assignment for Parallel Programming: Parallel Optimization of Eigenvalue Solution via Iterative Methods#7492L12345j wants to merge 22 commits into
L12345j wants to merge 22 commits into
Conversation
PPCG_5.29
Add bpcg kernel op
test: extend hsolver bpcg and ppcg unit tests
PPCG_6.2_xyr
Improve PPCG boundary tests and small-subspace handling
PPCG: rebase onto latest L12345j/develop
Improve hsolver PPCG tests and add test report target
There was a problem hiding this comment.
Pull request overview
This PR introduces a new PPCG (Projected Preconditioned Conjugate Gradient) block eigensolver into the HSolver (plane-wave) path and expands HSolver unit tests, including additional BPCG kernel correctness/thread-consistency checks and a helper to generate test reports.
Changes:
- Add
DiagoPPCGimplementation and integrate it intoHSolverPWviadiago_method = ppcg. - Extend HSolver unit tests with PPCG/BPCG validation against LAPACK and add BPCG kernel tests (incl. OpenMP consistency).
- Add a CMake custom target + script to generate HSolver unit test reports.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| source/source_hsolver/diago_ppcg.h | Declares the PPCG solver API and internal workspace/state. |
| source/source_hsolver/diago_ppcg.cpp | Implements PPCG iteration, subspace projection, and orthonormalization. |
| source/source_hsolver/hsolver_pw.cpp | Adds ppcg as a selectable diagonalization method in PW HSolver. |
| source/source_hsolver/kernels/bpcg_kernel_op.cpp | Adds OpenMP thresholds/guards and refactors some kernels for thread-safe reductions. |
| source/source_hsolver/test/diago_ppcg_test.cpp | Adds PPCG unit tests, LAPACK comparisons, and consistency checks. |
| source/source_hsolver/test/diago_bpcg_test.cpp | Extends BPCG tests, fixes indexing, adds kernel tests and OpenMP consistency checks. |
| source/source_hsolver/test/CMakeLists.txt | Adds PPCG test target, copies test assets into build dir, adds report target. |
| source/source_hsolver/test/generate_hsolver_test_report.sh | Adds helper script to run HSolver unit tests and write logs/JUnit XML. |
| source/source_hsolver/CMakeLists.txt | Adds diago_ppcg.cpp to HSolver build objects. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+162
to
+167
| // Cholesky: gram = U^H U (upper), then invert U in-place -> gram holds inv(U) in upper triangle | ||
| int info = 0; | ||
| lapackConnector::potrf('U', ncols, gram.data<T>(), ncols, info); | ||
| assert(info == 0); | ||
| lapackConnector::trtri('U', 'N', ncols, gram.data<T>(), ncols, info); | ||
| assert(info == 0); |
Comment on lines
+8
to
+11
| #include "source_hsolver/kernels/bpcg_kernel_op.h" // reuse normalize_op / apply_eigenvalues_op / precondition_op | ||
|
|
||
| #include "source_base/module_container/base/third_party/lapack.h" | ||
|
|
Comment on lines
+45
to
+47
| ctest --test-dir "$build_dir" -V -R "$test_regex" --output-junit "$xml_file" 2>&1 | tee "$log_file" | ||
| status=${PIPESTATUS[0]} | ||
|
|
Comment on lines
+562
to
+563
| TEST(DiagoPPCGTest, ComprehensiveBenchmark) | ||
| { |
Comment on lines
+386
to
+393
| std::string filename = "H-KPoints-Si2.dat"; | ||
| ifs.open(filename); | ||
| if (!ifs.is_open()) | ||
| { | ||
| std::cout << "Error opening file " << filename << std::endl; | ||
| exit(1); | ||
| } | ||
| DIAGOTEST::readh(ifs, hm); |
|
|
||
| namespace hsolver { | ||
|
|
||
| namespace lapackConnector = container::lapackConnector; |
Address hsolver PPCG test review comments
Add missing functional include for DiagoPPCG
Link PPCG sources into hsolver pw tests
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.
This PR adds a PPCG eigensolver implementation for the HSolver module and extends the related unit tests.
Main changes:
diago_method = ppcg.Testing:
MODULE_HSOLVER_ppcgMODULE_HSOLVER_bpcgNotes: