Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b69c085
Refactor: Encapsulate timer functionality in timer_wrapper.h
Jan 23, 2026
3829268
Refactor timer code and clean_esolver function
Jan 23, 2026
6fbf3dc
Merge branch 'develop' of github.com:mohanchen/abacus-mc into develop
Jan 24, 2026
ddafac6
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 25, 2026
202eac6
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 25, 2026
44a271b
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 25, 2026
2ac905d
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 25, 2026
1138023
Fix uninitialized variables in source_pw directory
Jan 25, 2026
626595a
Fix uninitialized variables in source_lcao directory
Jan 25, 2026
3b5c387
fix: initialize all uninitialized variables in source_relax and sourc…
Jan 25, 2026
f9edda4
fix: initialize all uninitialized variables in source_base
Jan 25, 2026
2ccadc5
fix: initialize all uninitialized variables in source_cell and source…
Jan 25, 2026
c4f18fc
fix: initialize all uninitialized variables in source_hsolver and sou…
Jan 25, 2026
493d6e2
fix: initialize all uninitialized variables in source_lcao and source…
Jan 25, 2026
60aede4
fix some uninitalized variables
Jan 25, 2026
1a0f1b4
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 27, 2026
47998bb
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 27, 2026
f19b85e
move exx_helper to module_pwdft
Jan 27, 2026
b7c1ebd
rename pw files
Jan 27, 2026
573dd78
Refactor: Move and rename nonlocal_pw files to module_pwdft directory
Jan 27, 2026
93f54cc
Refactor: Move and rename velocity_pw, veff_pw, and meta_pw files to …
Jan 27, 2026
98e429b
Refactor: Move and rename all operator_pw files to module_pwdft direc…
Jan 27, 2026
1158a0e
Refactor: Rename stress_func_xxx files to stress_xxx by removing _fun…
Jan 27, 2026
6dac2a7
Rename V*_in_pw files to more concise names and update references
Jan 27, 2026
e57560c
fix Makefile.Objects
Jan 27, 2026
123478a
Fix CI/CD error: Update operator_pw paths to new op_pw locations
Jan 27, 2026
49ccc32
Merge branch '20260127-move' into 20260125-fix-initialized
Jan 28, 2026
a4d1024
Merge branch 'develop' into 20260125-fix-initialized
mohanchen Jan 28, 2026
0ae466e
fix
Jan 28, 2026
b27b3dc
Merge branch '20260125-fix-initialized' of github.com:mohanchen/abacu…
Jan 28, 2026
216fb98
fix relax_sync.cpp
Jan 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/source_base/math_chebyshev.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void Chebyshev<REAL, Device>::calfinalvec_real(
std::complex<REAL>* arrayn = nullptr;
std::complex<REAL>* arrayn_1 = nullptr;
assert(N >= 0 && LDA >= N);
int ndmxt;
int ndmxt = 0;
if (m == 1)
{
ndmxt = N * m;
Expand Down Expand Up @@ -486,7 +486,7 @@ void Chebyshev<REAL, Device>::calfinalvec_complex(
std::complex<REAL>* arrayn = nullptr;
std::complex<REAL>* arrayn_1 = nullptr;
assert(N >= 0 && LDA >= N);
int ndmxt;
int ndmxt = 0;
if (m == 1)
{
ndmxt = N * m;
Expand Down Expand Up @@ -585,7 +585,7 @@ void Chebyshev<REAL, Device>::tracepolyA(
std::complex<REAL>* arrayn = nullptr;
std::complex<REAL>* arrayn_1 = nullptr;
assert(N >= 0 && LDA >= N);
int ndmxt;
int ndmxt = 0;
if (m == 1)
{
ndmxt = N * m;
Expand Down
4 changes: 2 additions & 2 deletions source/source_base/math_erf_complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ std::complex<double> ErrorFunc::scaled_w(std::complex<double> z, double relerr)
else if (x < 10)
{
double prod2ax = 1, prodm2ax = 1;
double expx2;
double expx2 = 0.0;

if (std::isnan(y))
return std::complex<double>(y, y);
Expand Down Expand Up @@ -235,7 +235,7 @@ std::complex<double> ErrorFunc::scaled_w(std::complex<double> z, double relerr)
sum3 = std::exp(-dx * dx) / (a2 * (n0 * n0) + y * y);
sum5 = a * n0 * sum3;
double exp1 = std::exp(4 * a * dx), exp1dn = 1;
int dn;
int dn = 0;
for (dn = 1; n0 - dn > 0; ++dn)
{ // loop over n0-dn and n0+dn terms
double np = n0 + dn, nm = n0 - dn;
Expand Down
2 changes: 1 addition & 1 deletion source/source_base/math_ylmreal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void YlmReal::rlylm
{
int twok = 2 * ik;

double gamma;
double gamma = 0.0;
double aux0, aux1, aux2, aux3;

aux0 = pow(-1.0, ik) * pow(2.0, -il);
Expand Down
2 changes: 1 addition & 1 deletion source/source_base/tool_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void CHECK_INT(std::ifstream &ifs,const int &v,bool quit)
void CHECK_DOUBLE(std::ifstream &ifs,const double &v,bool quit)
{
const double tiny = 1.0e-5;
double v_in;
double v_in = 0.0;
ifs >> v_in;
if( fabs(v - v_in) > tiny )
{
Expand Down
2 changes: 1 addition & 1 deletion source/source_base/tool_quit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void WARNING_QUIT(const std::string &file,const std::string &description)

#ifdef __MPI /* if it is MPI run, finalize first, then exit */
std::cout << "Detecting if MPI has been initialized..." << std::endl;
int is_initialized;
int is_initialized = 0;
MPI_Initialized(&is_initialized);
if (is_initialized) {
std::cout << "Terminating ABACUS with multiprocessing environment." << std::endl;
Expand Down
6 changes: 3 additions & 3 deletions source/source_base/ylm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ void Ylm::rlylm
{
int twok = 2 * ik;

double gamma;
double gamma = 0.0;
double aux0, aux1, aux2, aux3;

aux0 = pow(-1.0, ik) * pow(2.0, -il);
Expand Down Expand Up @@ -1107,7 +1107,7 @@ void Ylm::hes_rl_sph_harm
hrly.resize( (Lmax+1)*(Lmax+1), std::vector<double>(6) );

double radius2 = x*x+y*y+z*z;
double coeff;
double coeff = 0.0;

//begin calculation
/***************************
Expand Down Expand Up @@ -1867,7 +1867,7 @@ void Ylm::rlylm
{
int twok = 2 * ik;

double gamma;
double gamma = 0.0;
double aux0, aux1, aux2, aux3;

aux0 = pow(-1.0, ik) * pow(2.0, -il);
Expand Down
2 changes: 1 addition & 1 deletion source/source_cell/klist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ void K_Vectors::interpolate_k_between(std::ifstream& ifk, std::vector<ModuleBase

double K_Vectors::Monkhorst_Pack_formula(const int& k_type, const double& offset, const int& n, const int& dim)
{
double coordinate;
double coordinate = 0.0;
if (k_type == 1)
{
coordinate = (offset + 2.0 * (double)n - (double)dim - 1.0) / (2.0 * (double)dim);
Expand Down
4 changes: 2 additions & 2 deletions source/source_cell/read_pp_blps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ int Pseudopot_upf::read_pseudo_blps(std::ifstream &ifs, Atom_pseudo& pp)
// if(!SCAN_BEGIN(ifs,"BLPS")) WARNING_QUIT("read_pp_blps","Find no PP_HEADER");
ifs.ignore(300, '\n');

double zatom;
double zion;
double zatom = 0.0;
double zion = 0.0;
ifs >> zatom >> zion;
pp.zv = zion;
ifs.ignore(300, '\n');
Expand Down
2 changes: 1 addition & 1 deletion source/source_cell/read_pp_upf100.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void Pseudopot_upf::read_pseudo_nl(std::ifstream& ifs, Atom_pseudo& pp)
ModuleBase::GlobalFunc::READ_VALUE(ifs, this->nd); // nl_4
for (int i = 0; i < this->nd; i++)
{
double swap;
double swap = 0.0;
ifs >> nb >> mb >> swap;
nb--;
mb--;
Expand Down
2 changes: 1 addition & 1 deletion source/source_cell/read_pp_upf201.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ void Pseudopot_upf::read_pseudo_upf201_fullwfc(std::ifstream& ifs)
std::string word;
std::string name[50];
std::string val[50];
int nparameter;
int nparameter = 0;
this->aewfc.create(this->nbeta, this->mesh);
this->pswfc.create(this->nbeta, this->mesh);
ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_FULL_WFC");
Expand Down
2 changes: 1 addition & 1 deletion source/source_cell/setup_nonlocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void InfoNonlocal::Read_NonLocal(const int& it,
{
if (ModuleBase::GlobalFunc::SCAN_BEGIN(ifs, "<PP_BETA>", false))
{
int iproj;
int iproj = 0;
ModuleBase::GlobalFunc::READ_VALUE(ifs, iproj);
if (iproj != p1)
{
Expand Down
2 changes: 1 addition & 1 deletion source/source_estate/cal_ux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void cal_ux(UnitCell& ucell) {

bool judge_parallel(double a[3], ModuleBase::Vector3<double> b) {
bool jp = false;
double cross;
double cross = 0.0;
cross = pow((a[1] * b.z - a[2] * b.y), 2)
+ pow((a[2] * b.x - a[0] * b.z), 2)
+ pow((a[0] * b.y - a[1] * b.x), 2);
Expand Down
4 changes: 2 additions & 2 deletions source/source_hamilt/module_vdw/vdwd2_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void Vdwd2Parameters::C6_input(const std::string &file, const std::string &unit)
ModuleBase::WARNING_QUIT("Vdwd2::C6_input",
"Can not find the file " + ModuleBase::GlobalFunc::TO_STRING(file));
std::string element;
double value;
double value = 0.0;
while (ifs >> element >> value)
C6_[element] = value;
ifs.close();
Expand All @@ -77,7 +77,7 @@ void Vdwd2Parameters::R0_input(const std::string &file, const std::string &unit)
ModuleBase::WARNING_QUIT("Vdwd2::R0_input",
"Can not find the file " + ModuleBase::GlobalFunc::TO_STRING(file));
std::string element;
double value;
double value = 0.0;
while (ifs >> element >> value)
R0_[element] = value;
ifs.close();
Expand Down
8 changes: 4 additions & 4 deletions source/source_hamilt/module_vdw/vdwd3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ void Vdwd3::cal_energy()
ModuleBase::timer::tick("Vdwd3", "cal_energy");
init();

int ij;
int ij = 0;
double c6 = 0.0, c8 = 0.0, r2 = 0.0, r6 = 0.0, r8 = 0.0, rr = 0.0, damp6 = 0.0, damp8 = 0.0;
double e6 = 0.0, e8 = 0.0, eabc = 0.0;
std::vector<double> cc6ab(ucell_.nat * ucell_.nat), cn(ucell_.nat);
pbc_ncoord(cn);
ModuleBase::Vector3<double> tau;
if (para_.version() == "d3_0") // DFT-D3(zero-damping)
{
double tmp;
double tmp = 0.0;
for (int iat = 0; iat != ucell_.nat - 1; iat++) {
for (int jat = iat + 1; jat != ucell_.nat; jat++)
{
Expand Down Expand Up @@ -178,7 +178,7 @@ void Vdwd3::cal_energy()
} // end d3_0
else if (para_.version() == "d3_bj") // DFT-D3(BJ-damping)
{
double r42;
double r42 = 0.0;
for (int iat = 0; iat != ucell_.nat; iat++)
{
for (int jat = iat + 1; jat != ucell_.nat; jat++)
Expand Down Expand Up @@ -860,7 +860,7 @@ void Vdwd3::pbc_gdisp(std::vector<ModuleBase::Vector3<double>> &g, ModuleBase::m
} // end d3_0
else if (para_.version() == "d3_bj")
{
double r4;
double r4 = 0.0;
for (int iat = 0; iat != ucell_.nat; iat++)
{
get_dc6_dcnij(para_.mxc()[iz_[iat]], para_.mxc()[iz_[iat]], cn[iat], cn[iat],
Expand Down
2 changes: 1 addition & 1 deletion source/source_hamilt/module_xc/xc_funct_corr_gga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void XC_Functional::ggac(const double &rho,const double &grho, double &sc, doubl
y = af * t * t;
xy = (1.0 + y) / (1.0 + y + y * y);

double x;
double x = 0.0;
x = 1.0 + y + y * y;
qy = y * y * (2.0 + y) / (x * x);
s1 = 1.0 + 2.0 * al / be * t * t * xy;
Expand Down
2 changes: 1 addition & 1 deletion source/source_hamilt/module_xc/xc_funct_corr_lda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void XC_Functional::vwn(const double &rs, double &ec, double &vc)
fx = rs + b * rs12 + c;
qx = atan(q / (2.0 * rs12 + b));

double x;
double x = 0.0;
x = (rs12 - x0);
ec = a * (log(rs / fx) + f1 * qx - f2 * (log((x * x) /
fx) + f3 * qx));
Expand Down
4 changes: 2 additions & 2 deletions source/source_hamilt/module_xc/xc_functional_gradcorr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void XC_Functional::gradcorr(double &etxc, double &vtxc, ModuleBase::matrix &v,

if(nspin0==1)
{
double segno;
double segno = 0.0;
#ifdef _OPENMP
#pragma omp for
#endif
Expand All @@ -249,7 +249,7 @@ void XC_Functional::gradcorr(double &etxc, double &vtxc, ModuleBase::matrix &v,
#ifdef USE_LIBXC
if(func_type == 3 || func_type == 5) //the gradcorr part to stress of mGGA
{
double v3xc;
double v3xc = 0.0;
double atau = chr->kin_r[0][ir]/2.0;
XC_Functional_Libxc::tau_xc( func_id, arho, grho2a, atau, sxc, v1xc, v2xc, v3xc);
}
Expand Down
4 changes: 2 additions & 2 deletions source/source_hamilt/module_xc/xc_functional_wrapper_gcxc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void XC_Functional::gcx_spin(double rhoup, double rhodw, double grhoup2, double
// parameter :
double small = 1.e-10;
double sxup, sxdw;
int iflag;
int iflag = 0;

// exchange
double rho = rhoup + rhodw;
Expand Down Expand Up @@ -247,7 +247,7 @@ void XC_Functional::gcc_spin(double rho, double &zeta, double grho, double &sc,
double small = 1.0e-10;
double epsr = 1.0e-6;

double x;
double x = 0.0;

sc = 0.00;
v1cup = 0.00; v1cdw = 0.00;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void XC_Functional::xc(const double &rho, double &exc, double &vxc)

double third = 1.0 / 3.0;
double pi34 = 0.6203504908994e0 ; // pi34=(3/4pi)^(1/3)
double rs;
double rs = 0.0;
double e,v;

exc = vxc = 0.00;
Expand Down
2 changes: 1 addition & 1 deletion source/source_hsolver/diago_elpa_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void DiagoElpaNative<T>::diag_pool(hamilt::MatrixBlock<T>& h_mat,
}

// elpa_init(20210430);
int success;
int success = 0;
elpa_t handle = elpa_allocate(&success);
#ifdef _OPENMP
int num_threads = omp_get_max_threads();
Expand Down
4 changes: 2 additions & 2 deletions source/source_hsolver/hsolver_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ void HSolverPW<T, Device>::build_k_neighbors() {
// Store k-points and corresponding indices
struct KPoint {
ModuleBase::Vector3<double> kvec;
int index;
double norm;
int index = 0;
double norm = 0.0;

KPoint(const ModuleBase::Vector3<double>& v, int i) :
kvec(v), index(i), norm(v.norm()) {}
Expand Down
10 changes: 5 additions & 5 deletions source/source_hsolver/module_genelpa/elpa_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ELPA_Solver::ELPA_Solver(const bool isReal,
else
kernel_id = read_complex_kernel();
// cout<<"kernel id is inited as "<<kernel_id<<"\n";
int error;
int error = 0;

static int total_handle = 0;

Expand Down Expand Up @@ -139,7 +139,7 @@ ELPA_Solver::ELPA_Solver(const bool isReal,

int error;
static std::map<int, elpa_t> NEW_ELPA_HANDLE_POOL;
static int total_handle;
static int total_handle = 0;

#ifdef _OPENMP
int num_threads = omp_get_max_threads();
Expand Down Expand Up @@ -270,7 +270,7 @@ int ELPA_Solver::read_cpuflag()

int ELPA_Solver::read_real_kernel()
{
int kernel_id;
int kernel_id = 0;

if (const char* env = getenv("ELPA_DEFAULT_real_kernel"))
{
Expand Down Expand Up @@ -454,7 +454,7 @@ int ELPA_Solver::read_complex_kernel()
int ELPA_Solver::allocate_work()
{
unsigned long nloc = static_cast<unsigned long>(narows) * nacols; // local size
unsigned long maxloc; // maximum local size
unsigned long maxloc = 0; // maximum local size
MPI_Allreduce(&nloc, &maxloc, 1, MPI_UNSIGNED_LONG, MPI_MAX, comm);
maxloc = nloc;

Expand All @@ -467,7 +467,7 @@ int ELPA_Solver::allocate_work()

void ELPA_Solver::timer(int myid, const char function[], const char step[], double& t0)
{
double t1;
double t1 = 0.0;
if (t0 < 0) // t0 < 0 means this is the init call before the function
{
t0 = MPI_Wtime();
Expand Down
12 changes: 6 additions & 6 deletions source/source_hsolver/module_genelpa/elpa_new_complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ extern std::map<int, elpa_t> NEW_ELPA_HANDLE_POOL;

int ELPA_Solver::eigenvector(std::complex<double>* A, double* EigenValue, std::complex<double>* EigenVector)
{
int info;
int allinfo;
double t;
int info = 0;
int allinfo = 0;
double t = 0.0;

if((loglevel>0 && myid==0) || loglevel>1)
{
Expand All @@ -42,7 +42,7 @@ int ELPA_Solver::generalized_eigenvector(std::complex<double>* A, std::complex<d
double* EigenValue, std::complex<double>* EigenVector)
{
int info, allinfo;
double t;
double t = 0.0;

if((loglevel>0 && myid==0) || loglevel>1)
{
Expand Down Expand Up @@ -164,7 +164,7 @@ int ELPA_Solver::decomposeRightMatrix(std::complex<double>* B, double* EigenValu
{
int info=0;
int allinfo=0;
double t;
double t = 0.0;

// first try cholesky decomposing
if(nFull<CHOLESKY_CRITICAL_SIZE) // use pdpotrf for small matrix
Expand Down Expand Up @@ -316,7 +316,7 @@ int ELPA_Solver::decomposeRightMatrix(std::complex<double>* B, double* EigenValu

int ELPA_Solver::composeEigenVector(int DecomposedState, std::complex<double>* B, std::complex<double>* EigenVector)
{
double t;
double t = 0.0;
if(DecomposedState==1 || DecomposedState==2)
{
// transform the eigenvectors to original general equation, let U^-1*q, and put to q
Expand Down
Loading
Loading