From 7f35ada70b4e4ead677d5c5418f8ad260b02a3eb Mon Sep 17 00:00:00 2001 From: Chen Nuo <49788094+Cstandardlib@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:31:45 +0800 Subject: [PATCH 1/6] Do not do unit tests on big input to reduce time consumption --- source/source_hsolver/test/diago_bpcg_test.cpp | 9 +++++---- source/source_hsolver/test/diago_cg_float_test.cpp | 9 +++++---- source/source_hsolver/test/diago_cg_real_test.cpp | 9 +++++---- source/source_hsolver/test/diago_cg_test.cpp | 9 +++++---- source/source_hsolver/test/diago_david_float_test.cpp | 2 +- source/source_hsolver/test/diago_david_real_test.cpp | 2 +- source/source_hsolver/test/diago_david_test.cpp | 2 +- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/source/source_hsolver/test/diago_bpcg_test.cpp b/source/source_hsolver/test/diago_bpcg_test.cpp index f36a09dafe..147f05c9e1 100644 --- a/source/source_hsolver/test/diago_bpcg_test.cpp +++ b/source/source_hsolver/test/diago_bpcg_test.cpp @@ -202,9 +202,10 @@ INSTANTIATE_TEST_SUITE_P(VerifyCG, ::testing::Values( // nband, npw, sparsity, reorder, eps, maxiter, threshold DiagoBPCGPrepare(10, 500, 0, true, 1e-5, 300, 5e-2), - DiagoBPCGPrepare(20, 500, 6, true, 1e-5, 300, 5e-2), - DiagoBPCGPrepare(20, 1000, 8, true, 1e-5, 300, 5e-2), - DiagoBPCGPrepare(40, 1000, 8, true, 1e-6, 300, 5e-2))); + DiagoBPCGPrepare(20, 500, 6, true, 1e-5, 300, 5e-2) + // DiagoBPCGPrepare(20, 1000, 8, true, 1e-5, 300, 5e-2), + // DiagoBPCGPrepare(40, 1000, 8, true, 1e-6, 300, 5e-2) + )); //DiagoBPCGPrepare(40, 2000, 8, true, 1e-5, 500, 1e-2))); // the last one is passed but time-consumming. @@ -251,7 +252,7 @@ TEST(DiagoBPCGTest, readH) // read Hamilt matrix from file data-H std::vector> hm; std::ifstream ifs; - std::string filename = "H-KPoints-Si64.dat"; + std::string filename = "H-KPoints-Si2.dat"; ifs.open(filename); // open file and check status if (!ifs.is_open()) diff --git a/source/source_hsolver/test/diago_cg_float_test.cpp b/source/source_hsolver/test/diago_cg_float_test.cpp index 9af83f174c..9375df4369 100644 --- a/source/source_hsolver/test/diago_cg_float_test.cpp +++ b/source/source_hsolver/test/diago_cg_float_test.cpp @@ -240,9 +240,10 @@ INSTANTIATE_TEST_SUITE_P(VerifyCG, ::testing::Values( // nband, npw, sparsity, reorder, eps, maxiter, threshold DiagoCGPrepare(10, 200, 0, true, 1e-6, 300, 1e-0), - DiagoCGPrepare(10, 200, 6, true, 1e-6, 300, 1e-0), - DiagoCGPrepare(10, 400, 8, true, 1e-6, 300, 1e-0), - DiagoCGPrepare(10, 600, 8, true, 1e-6, 300, 1e-0))); + DiagoCGPrepare(10, 200, 6, true, 1e-6, 300, 1e-0) + // DiagoCGPrepare(10, 400, 8, true, 1e-6, 300, 1e-0), + // DiagoCGPrepare(10, 600, 8, true, 1e-6, 300, 1e-0) + )); //DiagoCGPrepare(40, 2000, 8, true, 1e-5, 500, 1e-2))); // the last one is passed but time-consumming. @@ -312,7 +313,7 @@ TEST(DiagoCGFloatTest, readH) // read Hamilt matrix from file data-H std::vector> hm; std::ifstream ifs; - std::string filename = "H-KPoints-Si64.dat"; + std::string filename = "H-KPoints-Si2.dat"; // open file and check status ifs.open(filename); if (!ifs.is_open()) diff --git a/source/source_hsolver/test/diago_cg_real_test.cpp b/source/source_hsolver/test/diago_cg_real_test.cpp index 46b3971561..1c6694faa6 100644 --- a/source/source_hsolver/test/diago_cg_real_test.cpp +++ b/source/source_hsolver/test/diago_cg_real_test.cpp @@ -241,9 +241,10 @@ INSTANTIATE_TEST_SUITE_P(VerifyCG, ::testing::Values( // nband, npw, sparsity, reorder, eps, maxiter, threshold DiagoCGPrepare(10, 500, 0, true, 1e-5, 300, 1e-3), - DiagoCGPrepare(20, 500, 6, true, 1e-5, 300, 1e-3), - DiagoCGPrepare(20, 1000, 8, true, 1e-5, 300, 1e-3), - DiagoCGPrepare(40, 1000, 8, true, 1e-6, 300, 1e-3))); + DiagoCGPrepare(20, 500, 6, true, 1e-5, 300, 1e-3) + // DiagoCGPrepare(20, 1000, 8, true, 1e-5, 300, 1e-3), + // DiagoCGPrepare(40, 1000, 8, true, 1e-6, 300, 1e-3) + )); //DiagoCGPrepare(40, 2000, 8, true, 1e-5, 500, 1e-2))); // the last one is passed but time-consumming. @@ -289,7 +290,7 @@ TEST(DiagoCGTest, readH) // read Hamilt matrix from file data-H std::vector hm; std::ifstream ifs; - std::string filename = "H-GammaOnly-Si64.dat"; + std::string filename = "H-GammaOnly-Si2.dat"; ifs.open(filename); // open file and check status if (!ifs.is_open()) diff --git a/source/source_hsolver/test/diago_cg_test.cpp b/source/source_hsolver/test/diago_cg_test.cpp index d360e47e53..10353b4c76 100644 --- a/source/source_hsolver/test/diago_cg_test.cpp +++ b/source/source_hsolver/test/diago_cg_test.cpp @@ -235,9 +235,10 @@ INSTANTIATE_TEST_SUITE_P(VerifyCG, ::testing::Values( // nband, npw, sparsity, reorder, eps, maxiter, threshold DiagoCGPrepare(10, 500, 0, true, 1e-5, 300, 1e-3), - DiagoCGPrepare(20, 500, 6, true, 1e-5, 300, 1e-3), - DiagoCGPrepare(20, 1000, 8, true, 1e-5, 300, 1e-3), - DiagoCGPrepare(40, 1000, 8, true, 1e-6, 300, 1e-3))); + DiagoCGPrepare(20, 500, 6, true, 1e-5, 300, 1e-3) + // DiagoCGPrepare(20, 1000, 8, true, 1e-5, 300, 1e-3), + // DiagoCGPrepare(40, 1000, 8, true, 1e-6, 300, 1e-3) + )); //DiagoCGPrepare(40, 2000, 8, true, 1e-5, 500, 1e-2))); // the last one is passed but time-consumming. @@ -307,7 +308,7 @@ TEST(DiagoCGTest, readH) // read Hamilt matrix from file data-H std::vector> hm; std::ifstream ifs; - std::string filename = "H-KPoints-Si64.dat"; + std::string filename = "H-KPoints-Si2.dat"; ifs.open(filename); // open file and check status if (!ifs.is_open()) diff --git a/source/source_hsolver/test/diago_david_float_test.cpp b/source/source_hsolver/test/diago_david_float_test.cpp index 76c5226ce3..cba4186617 100644 --- a/source/source_hsolver/test/diago_david_float_test.cpp +++ b/source/source_hsolver/test/diago_david_float_test.cpp @@ -197,7 +197,7 @@ TEST(DiagoDavRealSystemTest,dataH) { std::vector> hmatrix; std::ifstream ifs; - std::string filename = "H-KPoints-Si64.dat"; + std::string filename = "H-KPoints-Si2.dat"; ifs.open(filename); // open file and check status if (!ifs.is_open()) diff --git a/source/source_hsolver/test/diago_david_real_test.cpp b/source/source_hsolver/test/diago_david_real_test.cpp index 77a64dcd01..e0f887a573 100644 --- a/source/source_hsolver/test/diago_david_real_test.cpp +++ b/source/source_hsolver/test/diago_david_real_test.cpp @@ -195,7 +195,7 @@ TEST(DiagoDavRealSystemTest, dataH) { std::vector hmatrix; std::ifstream ifs; - std::string filename = "H-GammaOnly-Si64.dat"; + std::string filename = "H-GammaOnly-Si2.dat"; ifs.open(filename); // open file and check status if (!ifs.is_open()) diff --git a/source/source_hsolver/test/diago_david_test.cpp b/source/source_hsolver/test/diago_david_test.cpp index 6239be7a2e..c6472ada4f 100644 --- a/source/source_hsolver/test/diago_david_test.cpp +++ b/source/source_hsolver/test/diago_david_test.cpp @@ -201,7 +201,7 @@ TEST(DiagoDavRealSystemTest, dataH) { std::vector> hmatrix; std::ifstream ifs; - std::string filename = "H-KPoints-Si64.dat"; + std::string filename = "H-KPoints-Si2.dat"; ifs.open(filename); // open file and check status if (!ifs.is_open()) From e0e6f4f453bb31d6188684e4faf82bd25d9447ee Mon Sep 17 00:00:00 2001 From: Chen Nuo <49788094+Cstandardlib@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:51:10 +0800 Subject: [PATCH 2/6] Do not do unit tests on big input Si64 to reduce time consumption --- source/source_hsolver/test/diago_lcao_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/source_hsolver/test/diago_lcao_test.cpp b/source/source_hsolver/test/diago_lcao_test.cpp index 69e4fab3bf..d8c1f5ae82 100644 --- a/source/source_hsolver/test/diago_lcao_test.cpp +++ b/source/source_hsolver/test/diago_lcao_test.cpp @@ -333,9 +333,10 @@ INSTANTIATE_TEST_SUITE_P( DiagoPrepare(0, 0, 32, 0, "genelpa", "H-GammaOnly-Si64.dat", "S-GammaOnly-Si64.dat"), #endif DiagoPrepare(0, 0, 1, 0, "scalapack_gvx", "H-GammaOnly-Si2.dat", "S-GammaOnly-Si2.dat"), - DiagoPrepare(0, 0, 32, 0, "scalapack_gvx", "H-GammaOnly-Si64.dat", "S-GammaOnly-Si64.dat"), + // DiagoPrepare(0, 0, 32, 0, "scalapack_gvx", "H-GammaOnly-Si64.dat", "S-GammaOnly-Si64.dat"), DiagoPrepare(0, 0, 1, 0, "lapack", "H-GammaOnly-Si2.dat", "S-GammaOnly-Si2.dat"), - DiagoPrepare(0, 0, 32, 0, "lapack", "H-GammaOnly-Si64.dat", "S-GammaOnly-Si64.dat"))); + // DiagoPrepare(0, 0, 32, 0, "lapack", "H-GammaOnly-Si64.dat", "S-GammaOnly-Si64.dat") + )); class DiagoKPointsTest : public ::testing::TestWithParam>> { From 208724fec964df505d41647ff58f44ec9277cb16 Mon Sep 17 00:00:00 2001 From: Chen Nuo <49788094+Cstandardlib@users.noreply.github.com> Date: Tue, 24 Feb 2026 11:55:31 +0800 Subject: [PATCH 3/6] Fix typo --- source/source_hsolver/test/diago_lcao_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/source_hsolver/test/diago_lcao_test.cpp b/source/source_hsolver/test/diago_lcao_test.cpp index d8c1f5ae82..d0ed0fdae6 100644 --- a/source/source_hsolver/test/diago_lcao_test.cpp +++ b/source/source_hsolver/test/diago_lcao_test.cpp @@ -334,7 +334,7 @@ INSTANTIATE_TEST_SUITE_P( #endif DiagoPrepare(0, 0, 1, 0, "scalapack_gvx", "H-GammaOnly-Si2.dat", "S-GammaOnly-Si2.dat"), // DiagoPrepare(0, 0, 32, 0, "scalapack_gvx", "H-GammaOnly-Si64.dat", "S-GammaOnly-Si64.dat"), - DiagoPrepare(0, 0, 1, 0, "lapack", "H-GammaOnly-Si2.dat", "S-GammaOnly-Si2.dat"), + DiagoPrepare(0, 0, 1, 0, "lapack", "H-GammaOnly-Si2.dat", "S-GammaOnly-Si2.dat") // DiagoPrepare(0, 0, 32, 0, "lapack", "H-GammaOnly-Si64.dat", "S-GammaOnly-Si64.dat") )); From 20bc6c001ada7d0c82ba33f38d65d365166eea40 Mon Sep 17 00:00:00 2001 From: Chen Nuo <49788094+Cstandardlib@users.noreply.github.com> Date: Tue, 24 Feb 2026 12:06:09 +0800 Subject: [PATCH 4/6] Further reduce random test size --- source/source_hsolver/test/diago_bpcg_test.cpp | 4 ++-- source/source_hsolver/test/diago_cg_float_test.cpp | 4 ++-- source/source_hsolver/test/diago_cg_real_test.cpp | 4 ++-- source/source_hsolver/test/diago_cg_test.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/source_hsolver/test/diago_bpcg_test.cpp b/source/source_hsolver/test/diago_bpcg_test.cpp index 147f05c9e1..962ce72315 100644 --- a/source/source_hsolver/test/diago_bpcg_test.cpp +++ b/source/source_hsolver/test/diago_bpcg_test.cpp @@ -201,8 +201,8 @@ INSTANTIATE_TEST_SUITE_P(VerifyCG, DiagoBPCGTest, ::testing::Values( // nband, npw, sparsity, reorder, eps, maxiter, threshold - DiagoBPCGPrepare(10, 500, 0, true, 1e-5, 300, 5e-2), - DiagoBPCGPrepare(20, 500, 6, true, 1e-5, 300, 5e-2) + DiagoBPCGPrepare(10, 500, 0, true, 1e-5, 300, 5e-2) + // DiagoBPCGPrepare(20, 500, 6, true, 1e-5, 300, 5e-2) // DiagoBPCGPrepare(20, 1000, 8, true, 1e-5, 300, 5e-2), // DiagoBPCGPrepare(40, 1000, 8, true, 1e-6, 300, 5e-2) )); diff --git a/source/source_hsolver/test/diago_cg_float_test.cpp b/source/source_hsolver/test/diago_cg_float_test.cpp index 9375df4369..4c4278b3f1 100644 --- a/source/source_hsolver/test/diago_cg_float_test.cpp +++ b/source/source_hsolver/test/diago_cg_float_test.cpp @@ -239,8 +239,8 @@ INSTANTIATE_TEST_SUITE_P(VerifyCG, DiagoCGFloatTest, ::testing::Values( // nband, npw, sparsity, reorder, eps, maxiter, threshold - DiagoCGPrepare(10, 200, 0, true, 1e-6, 300, 1e-0), - DiagoCGPrepare(10, 200, 6, true, 1e-6, 300, 1e-0) + DiagoCGPrepare(10, 200, 0, true, 1e-6, 300, 1e-0) + // DiagoCGPrepare(10, 200, 6, true, 1e-6, 300, 1e-0) // DiagoCGPrepare(10, 400, 8, true, 1e-6, 300, 1e-0), // DiagoCGPrepare(10, 600, 8, true, 1e-6, 300, 1e-0) )); diff --git a/source/source_hsolver/test/diago_cg_real_test.cpp b/source/source_hsolver/test/diago_cg_real_test.cpp index 1c6694faa6..dbcbe95ae8 100644 --- a/source/source_hsolver/test/diago_cg_real_test.cpp +++ b/source/source_hsolver/test/diago_cg_real_test.cpp @@ -240,8 +240,8 @@ INSTANTIATE_TEST_SUITE_P(VerifyCG, DiagoCGTest, ::testing::Values( // nband, npw, sparsity, reorder, eps, maxiter, threshold - DiagoCGPrepare(10, 500, 0, true, 1e-5, 300, 1e-3), - DiagoCGPrepare(20, 500, 6, true, 1e-5, 300, 1e-3) + DiagoCGPrepare(10, 500, 0, true, 1e-5, 300, 1e-3) + // DiagoCGPrepare(20, 500, 6, true, 1e-5, 300, 1e-3) // DiagoCGPrepare(20, 1000, 8, true, 1e-5, 300, 1e-3), // DiagoCGPrepare(40, 1000, 8, true, 1e-6, 300, 1e-3) )); diff --git a/source/source_hsolver/test/diago_cg_test.cpp b/source/source_hsolver/test/diago_cg_test.cpp index 10353b4c76..b3518205f0 100644 --- a/source/source_hsolver/test/diago_cg_test.cpp +++ b/source/source_hsolver/test/diago_cg_test.cpp @@ -234,8 +234,8 @@ INSTANTIATE_TEST_SUITE_P(VerifyCG, DiagoCGTest, ::testing::Values( // nband, npw, sparsity, reorder, eps, maxiter, threshold - DiagoCGPrepare(10, 500, 0, true, 1e-5, 300, 1e-3), - DiagoCGPrepare(20, 500, 6, true, 1e-5, 300, 1e-3) + DiagoCGPrepare(10, 500, 0, true, 1e-5, 300, 1e-3) + // DiagoCGPrepare(20, 500, 6, true, 1e-5, 300, 1e-3) // DiagoCGPrepare(20, 1000, 8, true, 1e-5, 300, 1e-3), // DiagoCGPrepare(40, 1000, 8, true, 1e-6, 300, 1e-3) )); From 636013955a9cc81d5a7f7166dd31bf9c574f27a3 Mon Sep 17 00:00:00 2001 From: Chen Nuo <49788094+Cstandardlib@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:40:12 +0800 Subject: [PATCH 5/6] Do not run time-consuming PERF_MODULE_HSOLVER_KERNELS --- source/source_hsolver/kernels/test/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/source_hsolver/kernels/test/CMakeLists.txt b/source/source_hsolver/kernels/test/CMakeLists.txt index 851c30c731..86765192f5 100644 --- a/source/source_hsolver/kernels/test/CMakeLists.txt +++ b/source/source_hsolver/kernels/test/CMakeLists.txt @@ -9,10 +9,10 @@ if(USE_CUDA OR USE_ROCM) ) endif() -if(ENABLE_GOOGLEBENCH) - AddTest( - TARGET PERF_MODULE_HSOLVER_KERNELS - LIBS parameter ${math_libs} base device - SOURCES perf_math_kernel.cpp - ) -endif() \ No newline at end of file +# if(ENABLE_GOOGLEBENCH) +# AddTest( +# TARGET PERF_MODULE_HSOLVER_KERNELS +# LIBS parameter ${math_libs} base device +# SOURCES perf_math_kernel.cpp +# ) +# endif() \ No newline at end of file From 59fcdacfbe183dd03920239b7f864eb1cccd3eef Mon Sep 17 00:00:00 2001 From: Chen Nuo <49788094+Cstandardlib@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:59:13 +0800 Subject: [PATCH 6/6] Do not run time-consuming PERF_MODULE_HSOLVER_KERNELS in CI/CD --- .github/workflows/test.yml | 2 +- source/source_hsolver/kernels/test/CMakeLists.txt | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9322eba82f..1dd109d45d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,7 @@ jobs: GTEST_COLOR: 'yes' OMP_NUM_THREADS: '2' run: | - ctest --test-dir build -V --timeout 1700 -R MODULE_HSOLVER + ctest --test-dir build -V --timeout 1700 -R MODULE_HSOLVER -E PERF_MODULE_HSOLVER_KERNELS - name: Module_Cell Unittests env: diff --git a/source/source_hsolver/kernels/test/CMakeLists.txt b/source/source_hsolver/kernels/test/CMakeLists.txt index 86765192f5..851c30c731 100644 --- a/source/source_hsolver/kernels/test/CMakeLists.txt +++ b/source/source_hsolver/kernels/test/CMakeLists.txt @@ -9,10 +9,10 @@ if(USE_CUDA OR USE_ROCM) ) endif() -# if(ENABLE_GOOGLEBENCH) -# AddTest( -# TARGET PERF_MODULE_HSOLVER_KERNELS -# LIBS parameter ${math_libs} base device -# SOURCES perf_math_kernel.cpp -# ) -# endif() \ No newline at end of file +if(ENABLE_GOOGLEBENCH) + AddTest( + TARGET PERF_MODULE_HSOLVER_KERNELS + LIBS parameter ${math_libs} base device + SOURCES perf_math_kernel.cpp + ) +endif() \ No newline at end of file