Skip to content

Commit

Permalink
Initialize int naroc
Browse files Browse the repository at this point in the history
  • Loading branch information
AsTonyshment committed Jan 21, 2025
1 parent 2bdc83f commit 214bdb8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions source/module_hamilt_lcao/module_tddft/band_energy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void compute_ekb(const Parallel_Orbitals* pv,
}

int info = 0;
int naroc[2];
int naroc[2] = {0, 0};

double* Eii = new double[nband];
ModuleBase::GlobalFunc::ZEROS(Eii, nband);
Expand Down Expand Up @@ -242,7 +242,7 @@ void compute_ekb_tensor(const Parallel_Orbitals* pv,
}

int info = 0;
int naroc[2];
int naroc[2] = {0, 0};

// Create a Tensor for Eii
ct::Tensor Eii(ct::DataType::DT_DOUBLE, ct::DeviceType::CpuDevice, ct::TensorShape({nband}));
Expand Down
4 changes: 2 additions & 2 deletions source/module_hamilt_lcao/module_tddft/norm_psi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void norm_psi(const Parallel_Orbitals* pv,
GlobalV::ofs_running << std::endl;
}

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

for (int iprow = 0; iprow < pv->dim0; ++iprow)
{
Expand Down Expand Up @@ -304,7 +304,7 @@ void norm_psi_tensor(const Parallel_Orbitals* pv,
GlobalV::ofs_running << std::endl;
}

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

for (int iprow = 0; iprow < pv->dim0; ++iprow)
{
Expand Down
4 changes: 2 additions & 2 deletions source/module_hamilt_lcao/module_tddft/propagator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,8 +916,8 @@ void Propagator::compute_propagator_taylor(const int nlocal,
}

// set rank0
int info;
int naroc[2]; // maximum number of row or column
int info = 0;
int naroc[2] = {0, 0}; // maximum number of row or column

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

0 comments on commit 214bdb8

Please sign in to comment.