Skip to content

Commit

Permalink
Cleanup unused variables / Warnings (#748)
Browse files Browse the repository at this point in the history
* unused member variable in `Spherical_Bessel_functions`

* fix unused variables / missing include

* pass Communicator by value to gvec.hpp

* remove tmp variable and unnecessary move

* fixes

Co-authored-by: Anton Kozhevnikov <toxa81@gmail.com>
  • Loading branch information
simonpintarelli and toxa81 authored Jul 5, 2022
1 parent 9b103fd commit 7586b41
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/SDDK/gvec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class Gvec
matrix3d<double> lattice_vectors_;

/// Total communicator which is used to distribute G or G+k vectors.
Communicator const& comm_;
Communicator comm_;

/// Indicates that G-vectors are reduced by inversion symmetry.
bool reduce_gvec_{false};
Expand Down
4 changes: 4 additions & 0 deletions src/SDDK/wf_ortho.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ orthogonalize(::spla::Context& spla_ctx__, memory_t mem__, linalg_t la__, spin_r
RTE_OUT(std::cout) << "orthogonalization error : " << err << std::endl;
}
}

// TODO: remove this?
(void) gflops;

return 0;
}

Expand Down
3 changes: 3 additions & 0 deletions src/linalg/blacs_grid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ class BLACS_grid

std::unique_ptr<MPI_grid> mpi_grid_;


#ifdef SIRIUS_SCALAPACK
int blacs_handler_{-1};
#endif

int blacs_context_{-1};

Expand Down
2 changes: 1 addition & 1 deletion src/mixer/mixer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <vector>
#include <limits>
#include <memory>
#include <exception>
#include <stdexcept>
#include <cmath>
#include <numeric>

Expand Down
17 changes: 5 additions & 12 deletions src/mixer/mixer_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,11 @@ FunctionProperties<paw_density> paw_density_function_property()
{
for (int i = 0; i < x.ctx().unit_cell().spl_num_paw_atoms().local_size(); i++) {
for (int j = 0; j < x.ctx().num_mag_dims() + 1; j++) {
{
auto tmp1 = x.ae_density(j, i) * c + y.ae_density(j, i) * s;
auto tmp2 = x.ae_density(j, i) * -s + y.ae_density(j, i) * c;
x.ae_density(j, i) = std::move(tmp1);
y.ae_density(j, i) = std::move(tmp2);
}
{
auto tmp1 = x.ps_density(j, i) * c + y.ps_density(j, i) * s;
auto tmp2 = x.ps_density(j, i) * -s + y.ps_density(j, i) * c;
x.ps_density(j, i) = std::move(tmp1);
y.ps_density(j, i) = std::move(tmp2);
}
x.ae_density(j, i) = x.ae_density(j, i) * c + y.ae_density(j, i) * s;
y.ae_density(j, i) = x.ae_density(j, i) * -s + y.ae_density(j, i) * c;

x.ps_density(j, i) = x.ps_density(j, i) * c + y.ps_density(j, i) * s;
y.ps_density(j, i) = x.ps_density(j, i) * -s + y.ps_density(j, i) * c;
}
}
};
Expand Down
5 changes: 1 addition & 4 deletions src/specfunc/sbessel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ static void custom_bessel(int lmax, double x, double* result) {
Spherical_Bessel_functions::Spherical_Bessel_functions(int lmax__,
Radial_grid<double> const& rgrid__,
double q__)
: lmax_(lmax__)
, q_(q__)
: q_(q__)
, rgrid_(&rgrid__)
{
assert(q_ >= 0);
Expand Down Expand Up @@ -99,14 +98,12 @@ Spherical_Bessel_functions::sbessel_deriv_q(int lmax__, double q__, double x__,
Spline<double> const&
Spherical_Bessel_functions::operator[](int l__) const
{
assert(l__ <= lmax_);
return sbessel_[l__];
}

Spline<double>
Spherical_Bessel_functions::deriv_q(int l__)
{
assert(l__ <= lmax_);
assert(q_ >= 0);
Spline<double> s(*rgrid_);
if (q_ != 0) {
Expand Down
2 changes: 0 additions & 2 deletions src/specfunc/sbessel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ namespace sirius {
class Spherical_Bessel_functions
{
private:
int lmax_{-1};

double q_{0};

Radial_grid<double> const* rgrid_{nullptr};
Expand Down

0 comments on commit 7586b41

Please sign in to comment.