Skip to content

Commit 9511c8b

Browse files
author
abacus_fixer
committed
Fix uninitialized radial_c pointer in toW90_PW trial orbital setup
Commit 385e5d5 replaced the inline radial_in_q[wannier_index].c expressions with a radial_c variable but left it self-initialized, so produce_trial_in_pw dereferenced an indeterminate pointer during Amn/Mmn trial orbital interpolation and crashed (101_PW_W90 segfault). Initialize radial_c from radial_in_q[wannier_index].c. Verified by rebuilding abacus_max_para and rerunning the 101_PW_W90 case with 4 MPI processes: etotref, etotperatomref, CompareAMN, CompareMMN and CompareEIG all pass; agent_governance_check reports no findings.
1 parent b839503 commit 9511c8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/source_io/module_wannier/to_w90_pw_setup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void toW90_PW::produce_trial_in_pw(
129129
std::vector<std::complex<double>> sf(npw);
130130
for (int wannier_index = 0; wannier_index < num_wannier; wannier_index++)
131131
{
132-
double* radial_c = radial_c;
132+
double* radial_c = radial_in_q[wannier_index].c;
133133
const int nqx = nqx_;
134134

135135
if (L[wannier_index] >= 0)

0 commit comments

Comments
 (0)