From 90f5c2536795cff162d42b7620265e6a248cdc5f Mon Sep 17 00:00:00 2001 From: Jiacheng Xu <13862180016@163.com> Date: Sun, 1 Nov 2026 23:35:50 +0800 Subject: [PATCH] fix(xc): distribute Libxc batches across OpenMP threads --- source/source_hamilt/module_xc/libxc_pot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/source_hamilt/module_xc/libxc_pot.cpp b/source/source_hamilt/module_xc/libxc_pot.cpp index eb4275cf5e3..361cdca5914 100644 --- a/source/source_hamilt/module_xc/libxc_pot.cpp +++ b/source/source_hamilt/module_xc/libxc_pot.cpp @@ -65,7 +65,7 @@ void XC_Functional_Libxc::gradcorr_ncgga_sf_libxc(const std::vector& func_i std::vector vsigma(3 * nrxx); constexpr int nr_batch_size = 1024; #ifdef _OPENMP -#pragma omp parallel for schedule(static, nr_batch_size) +#pragma omp parallel for schedule(static) #endif for (int ir_start = 0; ir_start < static_cast(nrxx); ir_start += nr_batch_size) { @@ -319,7 +319,7 @@ std::tuple XC_Functional_Libxc::v_xc_libxc( case XC_FAMILY_LDA: { constexpr int nr_batch_size = 1024; #ifdef _OPENMP -#pragma omp parallel for schedule(static, nr_batch_size) +#pragma omp parallel for schedule(static) #endif for (int ir_start = 0; ir_start < nrxx; ir_start += nr_batch_size) { @@ -337,7 +337,7 @@ std::tuple XC_Functional_Libxc::v_xc_libxc( case XC_FAMILY_HYB_GGA: { constexpr int nr_batch_size = 1024; #ifdef _OPENMP -#pragma omp parallel for schedule(static, nr_batch_size) +#pragma omp parallel for schedule(static) #endif for (int ir_start = 0; ir_start < nrxx; ir_start += nr_batch_size) { @@ -574,7 +574,7 @@ std::tuple XC_Functional_Li ModuleBase::timer::start("Libxc","xc_mgga_exc_vxc"); constexpr int nr_batch_size = 1024; #ifdef _OPENMP - #pragma omp parallel for schedule(static, nr_batch_size) + #pragma omp parallel for schedule(static) #endif for( int ir_start = 0; ir_start < nrxx; ir_start += nr_batch_size ) {