Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce NVHPC warning #4031

Merged
merged 1 commit into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions src/Estimators/InputSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,9 @@ class InputSection
*
* can't be bothered then just define your enum option as a string.
*/
virtual std::any assignAnyEnum(const std::string& tag) const
[[noreturn]] virtual std::any assignAnyEnum(const std::string& tag) const
{
throw std::runtime_error("derived class must provide assignAnyEnum method if enum parameters are used");
return std::any();
}

/** Assign any enum helper for InputSection derived class
Expand Down
5 changes: 2 additions & 3 deletions src/Numerics/SoaCartesianTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ struct SoaCartesianTensor
template<class T>
SoaCartesianTensor<T>::SoaCartesianTensor(const int l_max, bool addsign) : Lmax(l_max)
{
if (Lmax < 0 || Lmax > 6)
throw std::runtime_error("CartesianTensor can't handle Lmax > 6 or Lmax < 0.\n");
if (Lmax > 6)
throw std::runtime_error("CartesianTensor can't handle Lmax > 6.\n");

int ntot = 0;
for (int i = 0; i <= Lmax; i++)
Expand Down Expand Up @@ -2292,7 +2292,6 @@ void SoaCartesianTensor<T>::getABC(int n, int& a, int& b, int& c)

default:
throw std::runtime_error("CartesianTensor::getABC() - Incorrect index.\n");
break;
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/Particle/DistanceTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class DistanceTable
const RefVectorWithLeader<ParticleSet>& p_list,
const std::vector<PosType>& rnew_list,
const IndexType iat,
bool prepare_old = true) const
bool prepare_old = true) const
{
#pragma omp parallel for
for (int iw = 0; iw < dt_list.size(); iw++)
Expand Down Expand Up @@ -207,7 +207,10 @@ class DistanceTable
*/
virtual int get_first_neighbor(IndexType iat, RealType& r, PosType& dr, bool newpos) const = 0;

inline void print(std::ostream& os) { throw std::runtime_error("DistanceTable::print is not supported"); }
[[noreturn]] inline void print(std::ostream& os)
{
throw std::runtime_error("DistanceTable::print is not supported");
}

/// initialize a shared resource and hand it to a collection
virtual void createResource(ResourceCollection& collection) const {}
Expand Down Expand Up @@ -292,10 +295,9 @@ class DistanceTableAA : public DistanceTable
virtual size_t get_num_particls_stored() const { return 0; }

/// return multi walker temporary pair distance table data pointer
virtual const RealType* getMultiWalkerTempDataPtr() const
[[noreturn]] virtual const RealType* getMultiWalkerTempDataPtr() const
{
throw std::runtime_error(name_ + " multi walker data pointer for temp not supported");
return nullptr;
}

virtual const RealType* mw_evalDistsInRange(const RefVectorWithLeader<DistanceTable>& dt_list,
Expand Down Expand Up @@ -358,17 +360,15 @@ class DistanceTableAB : public DistanceTable
const DisplRow& getTempDispls() const { return temp_dr_; }

/// return multi-walker full (all pairs) distance table data pointer
virtual const RealType* getMultiWalkerDataPtr() const
[[noreturn]] virtual const RealType* getMultiWalkerDataPtr() const
{
throw std::runtime_error(name_ + " multi walker data pointer not supported");
return nullptr;
}

/// return stride of per target pctl data. full table data = stride * num of target particles
virtual size_t getPerTargetPctlStrideSize() const
[[noreturn]] virtual size_t getPerTargetPctlStrideSize() const
{
throw std::runtime_error(name_ + " getPerTargetPctlStrideSize not supported");
return 0;
}
};
} // namespace qmcplusplus
Expand Down
9 changes: 4 additions & 5 deletions src/QMCDrivers/SFNBranch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ int SFNBranch::initParam(const MCPopulation& population,
vParam[SBVP::SIGMA2] = var;
vParam[SBVP::TAUEFF] = vParam[SBVP::TAU] * R2Accepted.result() / R2Proposed.result();
/// FIXME, magic number 50
setBranchCutoff(vParam[SBVP::SIGMA2], vParam[SBVP::SIGMA_BOUND], 50, population.get_golden_electrons()->getTotalNum());
setBranchCutoff(vParam[SBVP::SIGMA2], vParam[SBVP::SIGMA_BOUND], 50,
population.get_golden_electrons()->getTotalNum());

int nwtot_now = population.get_num_global_walkers();
if (iParam[B_TARGETWALKERS] == 0)
Expand Down Expand Up @@ -168,8 +169,7 @@ void SFNBranch::updateParamAfterPopControl(int pop_int, const MCDataType<FullPre
else
{
throw UniformCommunicateError("Bug: FIXME SBVP::EREF should be calculated based on weights");
/// FIXME
vParam[SBVP::ETRIAL] = vParam[SBVP::EREF];
/// FIXME vParam[SBVP::ETRIAL] = vParam[SBVP::EREF];
}
}
else //warmup
Expand All @@ -190,8 +190,7 @@ void SFNBranch::updateParamAfterPopControl(int pop_int, const MCDataType<FullPre
else
{
throw UniformCommunicateError("Bug: FIXME SBVP::EREF should be calculated based on weights");
/// FIXME
vParam[SBVP::ETRIAL] = vParam[SBVP::ENOW];
/// FIXME vParam[SBVP::ETRIAL] = vParam[SBVP::ENOW];
}

--WarmUpToDoSteps;
Expand Down
8 changes: 0 additions & 8 deletions src/QMCHamiltonians/SOECPComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,13 @@ SOECPComponent::ComplexType SOECPComponent::sMatrixElements(RealType s1, RealTyp
{
case 0:
return ComplexType(std::cos(s1 + s2), 0.0);
break;
case 1:
return ComplexType(std::sin(s1 + s2), 0.0);
break;
case 2:
return ComplexType(0.0, std::sin(s1 - s2));
break;
default:
APP_ABORT("SOECPComponent::sMatrixElements invalid operator dimension\n");
return 0;
break;
}
}

Expand All @@ -91,22 +87,18 @@ SOECPComponent::ComplexType SOECPComponent::lmMatrixElements(int l, int m1, int
std::sqrt(l * (l + 1) - m2 * (m2 - 1)) * kroneckerDelta(m1, m2 - 1),
zero);
return val;
break;
case 1:
val = onehalf *
ComplexType(0.0,
std::sqrt(l * (l + 1) - m2 * (m2 - 1)) * kroneckerDelta(m1, m2 - 1) -
std::sqrt(l * (l + 1) - m2 * (m2 + 1)) * kroneckerDelta(m1, m2 + 1));
return val;
break;
case 2:
val = ComplexType(m2 * kroneckerDelta(m1, m2), zero);
return val;
break;
default:
APP_ABORT("SOECPComponent::lMatrixElements Invalid operator dimension\n");
return 0;
break;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/QMCHamiltonians/SkPot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ SkPot::Return_t SkPot::evaluate(ParticleSet& P)
{
throw std::runtime_error("SkPot::evaluate not implemented. There was an implementation with"
" complex-valued storage that may be resurrected using real-valued storage.");
return value_;
}

bool SkPot::put(xmlNodePtr cur)
Expand Down
5 changes: 3 additions & 2 deletions src/QMCHamiltonians/SkPot.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class SkPot : public OperatorBase

void resetTargetParticleSet(ParticleSet& P) override;

Return_t evaluate(ParticleSet& P) override;
[[noreturn]] Return_t evaluate(ParticleSet& P) override;

bool put(xmlNodePtr cur) override;
bool get(std::ostream& os) const override;
Expand All @@ -41,7 +41,8 @@ class SkPot : public OperatorBase
{
for (int ki = 0; ki < NumK; ki++)
{
RealType k = dot(sourcePtcl->getSimulationCell().getKLists().kpts_cart[ki], sourcePtcl->getSimulationCell().getKLists().kpts_cart[ki]);
RealType k = dot(sourcePtcl->getSimulationCell().getKLists().kpts_cart[ki],
sourcePtcl->getSimulationCell().getKLists().kpts_cart[ki]);
k = std::sqrt(k) - K_0;
Fk[ki] = OneOverN * V_0 * std::exp(-k * k);
// app_log()<<ki<<": "<<Fk[ki] << std::endl;
Expand Down
3 changes: 1 addition & 2 deletions src/QMCWaveFunctions/Fermion/DiracDeterminantWithBackflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ class DiracDeterminantWithBackflow : public DiracDeterminantBase
*/
std::unique_ptr<DiracDeterminantWithBackflow> makeCopyWithBF(std::unique_ptr<SPOSet>&& spo,
BackflowTransformation& BF) const;
std::unique_ptr<DiracDeterminantBase> makeCopy(std::unique_ptr<SPOSet>&& spo) const override
[[noreturn]] std::unique_ptr<DiracDeterminantBase> makeCopy(std::unique_ptr<SPOSet>&& spo) const override
{
throw std::runtime_error("makeCopy spo should not be called.");
return nullptr;
}

void testDerivFjj(ParticleSet& P, int pa);
Expand Down
2 changes: 1 addition & 1 deletion src/QMCWaveFunctions/Fermion/MultiDiracDeterminant.2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ void MultiDiracDeterminant::mw_evaluateDetsAndGradsForPtclMove(
for (size_t iw = 0; iw < nw; iw++)
{
GradType ratioGradRef_local(0);
PRAGMA_OFFLOAD("omp parallel for reduction(+ : ratioGradRef_local)")
//PRAGMA_OFFLOAD("omp parallel for reduction(+ : ratioGradRef_local)")
for (size_t i = 0; i < NumPtcls; i++)
{
const size_t J = confgListOccup_ptr[i];
Expand Down
2 changes: 1 addition & 1 deletion src/QMCWaveFunctions/Fermion/SlaterDetBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ bool SlaterDetBuilder::readDetList(xmlNodePtr cur,
for (size_t i = 0; i < confgLists[grp].size(); i++)
{
bool found = false;
size_t k = -1;
int k = -1;
for (size_t j = 0; j < uniqueConfgs[grp].size(); j++)
{
if (confgLists[grp][i] == uniqueConfgs[grp][j])
Expand Down
1 change: 0 additions & 1 deletion src/QMCWaveFunctions/Fermion/SmallMatrixDetCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ inline VALUE calcSmallDeterminant(size_t n, const VALUE* table_matrix, const int
default:
throw std::runtime_error("calculateSmallDeterminant only handles the number of excitations <= 5.");
}
return 0.0;
}


Expand Down
1 change: 0 additions & 1 deletion src/QMCWaveFunctions/SPOSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ void SPOSet::evaluate_notranspose(const ParticleSet& P,
std::unique_ptr<SPOSet> SPOSet::makeClone() const
{
throw std::runtime_error("Missing SPOSet::makeClone for " + className);
return std::unique_ptr<SPOSet>();
}

void SPOSet::basic_report(const std::string& pad) const
Expand Down
2 changes: 1 addition & 1 deletion src/QMCWaveFunctions/SPOSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ class SPOSet : public QMCTraits
/** make a clone of itself
* every derived class must implement this to have threading working correctly.
*/
virtual std::unique_ptr<SPOSet> makeClone() const;
[[noreturn]] virtual std::unique_ptr<SPOSet> makeClone() const;

/** Used only by cusp correction in AOS LCAO.
* Ye: the SoA LCAO moves all this responsibility to the builder.
Expand Down