Skip to content

Commit 214bdb8

Browse files
committed
Initialize int naroc
1 parent 2bdc83f commit 214bdb8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

source/module_hamilt_lcao/module_tddft/band_energy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void compute_ekb(const Parallel_Orbitals* pv,
109109
}
110110

111111
int info = 0;
112-
int naroc[2];
112+
int naroc[2] = {0, 0};
113113

114114
double* Eii = new double[nband];
115115
ModuleBase::GlobalFunc::ZEROS(Eii, nband);
@@ -242,7 +242,7 @@ void compute_ekb_tensor(const Parallel_Orbitals* pv,
242242
}
243243

244244
int info = 0;
245-
int naroc[2];
245+
int naroc[2] = {0, 0};
246246

247247
// Create a Tensor for Eii
248248
ct::Tensor Eii(ct::DataType::DT_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({nband}));

source/module_hamilt_lcao/module_tddft/norm_psi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void norm_psi(const Parallel_Orbitals* pv,
9898
GlobalV::ofs_running << std::endl;
9999
}
100100

101-
int naroc[2]; // maximum number of row or column
101+
int naroc[2] = {0, 0}; // maximum number of row or column
102102

103103
for (int iprow = 0; iprow < pv->dim0; ++iprow)
104104
{
@@ -304,7 +304,7 @@ void norm_psi_tensor(const Parallel_Orbitals* pv,
304304
GlobalV::ofs_running << std::endl;
305305
}
306306

307-
int naroc[2]; // maximum number of row or column
307+
int naroc[2] = {0, 0}; // maximum number of row or column
308308

309309
for (int iprow = 0; iprow < pv->dim0; ++iprow)
310310
{

source/module_hamilt_lcao/module_tddft/propagator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ void Propagator::compute_propagator_taylor(const int nlocal,
916916
}
917917

918918
// set rank0
919-
int info;
920-
int naroc[2]; // maximum number of row or column
919+
int info = 0;
920+
int naroc[2] = {0, 0}; // maximum number of row or column
921921

922922
for (int iprow = 0; iprow < this->ParaV->dim0; ++iprow)
923923
{

0 commit comments

Comments
 (0)