Skip to content

Commit 0ef5974

Browse files
Merge pull request #1771 from arcaneframework/dev/gg-remove-compiler-warnings
Remove some compiler warnings in Alien
2 parents acd3eb4 + 2a78afc commit 0ef5974

File tree

19 files changed

+51
-56
lines changed

19 files changed

+51
-56
lines changed

alien/ArcaneInterface/modules/external_packages/src/alien/kernels/hypre/data_structure/HypreInternal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ VectorInternal::~VectorInternal()
2929
/*---------------------------------------------------------------------------*/
3030

3131
bool
32-
MatrixInternal::init(const int ilower, const int iupper, const int jlower,
32+
MatrixInternal::init(const HYPRE_Int ilower, const HYPRE_Int iupper, const HYPRE_Int jlower,
3333
const int jupper, const Arccore::ConstArrayView<Arccore::Integer>& lineSizes)
3434
{
3535
int ierr = 0; // code d'erreur de retour

alien/ArcaneInterface/modules/external_packages/src/alien/kernels/petsc/data_structure/PETScInternal.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ VectorInternal::VectorInternal(const int local_size, const int local_offset,
3636
VectorInternal::VectorInternal(const int local_size,
3737
const int local_offset,
3838
const int global_size,
39-
const int block_size,
39+
[[maybe_unused]] const int block_size,
4040
const bool parallel,
4141
MPI_Comm comm)
4242
: m_offset(local_offset)

alien/ArcaneInterface/modules/external_packages/src/alien/kernels/petsc/data_structure/PETScVector.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ PETScVector::~PETScVector()
3636

3737
void
3838
PETScVector::init([[maybe_unused]] const VectorDistribution& dist,
39-
const bool need_allocate, Arccore::Integer block_size ALIEN_UNUSED_PARAM)
39+
const bool need_allocate, [[maybe_unused]] Arccore::Integer block_size)
4040
{
4141
if (need_allocate)
4242
allocate();
@@ -90,7 +90,7 @@ PETScVector::setValues(const int nrow, const int* rows, const double* values)
9090
}
9191

9292
bool
93-
PETScVector::setBlockValues(const int nrow, const int* rows, const int block_size, const double* values)
93+
PETScVector::setBlockValues(const int nrow, const int* rows,[[maybe_unused]] const int block_size, const double* values)
9494
{
9595
if (m_internal->m_internal == nullptr)
9696
return false;
@@ -118,7 +118,7 @@ PETScVector::setValues(const int nrow, const double* values)
118118
}
119119

120120
bool
121-
PETScVector::setBlockValues(const int nrow, const int block_size, const double* values)
121+
PETScVector::setBlockValues(const int nrow,[[maybe_unused]] const int block_size, const double* values)
122122
{
123123
if (!m_internal.get())
124124
return false;
@@ -146,7 +146,7 @@ PETScVector::setValues(Arccore::ConstArrayView<Arccore::Real> values)
146146

147147

148148
bool
149-
PETScVector::setBlockValues(int block_size, Arccore::ConstArrayView<Arccore::Real> values)
149+
PETScVector::setBlockValues([[maybe_unused]] int block_size, Arccore::ConstArrayView<Arccore::Real> values)
150150
{
151151
ALIEN_ASSERT((m_internal.get()), ("Not initialized PETScVector before updating"));
152152
#ifdef PETSC_HAVE_VECSETBLOCKSIZE

alien/ArcaneInterface/modules/interface_c/src/alien/c/alienc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ extern "C" {
622622

623623
#include "alien/c/alienc.h"
624624

625-
int ALIEN_init(int argc, char** argv)
625+
int ALIEN_init([[maybe_unused]] int argc,[[maybe_unused]] char** argv)
626626
{
627627
AlienManager::initialize() ;
628628
return 0 ;

alien/ArcaneInterface/modules/trilinos/src/alien/kernels/trilinos/TrilinosBackEnd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ template <> struct AlgebraTraits<BackEnd::tag::tpetraserial>
9393
typedef IInternalLinearSolver<matrix_type, vector_type> solver_type;
9494

9595
static algebra_type* algebra_factory(
96-
Arccore::MessagePassing::IMessagePassingMng* p_mng = nullptr)
96+
[[maybe_unused]] Arccore::MessagePassing::IMessagePassingMng* p_mng = nullptr)
9797
{
9898
return TrilinosInternalLinearAlgebraFactory();
9999
}

alien/ArcaneInterface/modules/trilinos/src/alien/kernels/trilinos/algebra/TrilinosInternalLinearAlgebra.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ TpetraCudaInternalLinearAlgebraFactory(Arccore::MessagePassing::IMessagePassingM
7070
/*---------------------------------------------------------------------------*/
7171

7272
Real
73-
TrilinosInternalLinearAlgebra::norm0(const Vector& x) const
73+
TrilinosInternalLinearAlgebra::norm0([[maybe_unused]] const Vector& x) const
7474
{
7575
return 0.;
7676
}
@@ -92,7 +92,7 @@ TrilinosInternalLinearAlgebra::norm2(const Vector& x) const
9292
}
9393

9494
Real
95-
TrilinosInternalLinearAlgebra::normInf(const Vector& x) const
95+
TrilinosInternalLinearAlgebra::normInf([[maybe_unused]] const Vector& x) const
9696
{
9797
return 0.;
9898
}
@@ -119,7 +119,7 @@ TrilinosInternalLinearAlgebra::axpy(
119119
}
120120

121121
void
122-
TrilinosInternalLinearAlgebra::axpy(Real alpha, const Vector& x, Vector& r) const
122+
TrilinosInternalLinearAlgebra::axpy([[maybe_unused]] Real alpha,[[maybe_unused]] const Vector& x,[[maybe_unused]] Vector& r) const
123123
{
124124
throw NotImplementedException(
125125
A_FUNCINFO, "TrilinosInternalLinearAlgebra::aypx not implemented");
@@ -128,14 +128,14 @@ TrilinosInternalLinearAlgebra::axpy(Real alpha, const Vector& x, Vector& r) cons
128128
/*---------------------------------------------------------------------------*/
129129
void
130130
TrilinosInternalLinearAlgebra::aypx(
131-
Real alpha, UniqueArray<Real>& y, const UniqueArray<Real>& x) const
131+
[[maybe_unused]] Real alpha, [[maybe_unused]] UniqueArray<Real>& y,[[maybe_unused]] const UniqueArray<Real>& x) const
132132
{
133133
throw NotImplementedException(
134134
A_FUNCINFO, "TrilinosInternalLinearAlgebra::aypx not implemented");
135135
}
136136

137137
void
138-
TrilinosInternalLinearAlgebra::aypx(Real alpha, Vector& y, const Vector& x) const
138+
TrilinosInternalLinearAlgebra::aypx([[maybe_unused]] Real alpha,[[maybe_unused]] Vector& y,[[maybe_unused]] const Vector& x) const
139139
{
140140
throw NotImplementedException(
141141
A_FUNCINFO, "TrilinosInternalLinearAlgebra::aypx not implemented");
@@ -145,12 +145,12 @@ TrilinosInternalLinearAlgebra::aypx(Real alpha, Vector& y, const Vector& x) cons
145145

146146
void
147147
TrilinosInternalLinearAlgebra::copy(
148-
const UniqueArray<Real>& x, UniqueArray<Real>& r) const
148+
[[maybe_unused]] const UniqueArray<Real>& x,[[maybe_unused]] UniqueArray<Real>& r) const
149149
{
150150
cblas::copy(x.size(), dataPtr(x), 1, dataPtr(r), 1);
151151
}
152152
void
153-
TrilinosInternalLinearAlgebra::copy(const Vector& x, Vector& r) const
153+
TrilinosInternalLinearAlgebra::copy([[maybe_unused]] const Vector& x,[[maybe_unused]] Vector& r) const
154154
{
155155
throw NotImplementedException(
156156
A_FUNCINFO, "TrilinosInternalLinearAlgebra::aypx not implemented");
@@ -171,14 +171,14 @@ TrilinosInternalLinearAlgebra::dot(const Vector& x, const Vector& y) const
171171

172172
/*---------------------------------------------------------------------------*/
173173
void
174-
TrilinosInternalLinearAlgebra::scal(Real alpha, UniqueArray<Real>& x) const
174+
TrilinosInternalLinearAlgebra::scal([[maybe_unused]] Real alpha,[[maybe_unused]] UniqueArray<Real>& x) const
175175
{
176176
throw NotImplementedException(
177177
A_FUNCINFO, "TrilinosInternalLinearAlgebra::scal not implemented");
178178
}
179179

180180
void
181-
TrilinosInternalLinearAlgebra::scal(Real alpha, Vector& x) const
181+
TrilinosInternalLinearAlgebra::scal([[maybe_unused]] Real alpha,[[maybe_unused]] Vector& x) const
182182
{
183183
throw NotImplementedException(
184184
A_FUNCINFO, "TrilinosInternalLinearAlgebra::scal not implemented");
@@ -187,7 +187,7 @@ TrilinosInternalLinearAlgebra::scal(Real alpha, Vector& x) const
187187
/*---------------------------------------------------------------------------*/
188188

189189
void
190-
TrilinosInternalLinearAlgebra::diagonal(const Matrix& a, Vector& x) const
190+
TrilinosInternalLinearAlgebra::diagonal([[maybe_unused]] const Matrix& a,[[maybe_unused]] Vector& x) const
191191
{
192192
throw NotImplementedException(
193193
A_FUNCINFO, "TrilinosInternalLinearAlgebra::diagonal not implemented");
@@ -196,7 +196,7 @@ TrilinosInternalLinearAlgebra::diagonal(const Matrix& a, Vector& x) const
196196
/*---------------------------------------------------------------------------*/
197197

198198
void
199-
TrilinosInternalLinearAlgebra::reciprocal(Vector& x) const
199+
TrilinosInternalLinearAlgebra::reciprocal([[maybe_unused]] Vector& x) const
200200
{
201201
throw NotImplementedException(
202202
A_FUNCINFO, "TrilinosInternalLinearAlgebra::reciprocal not implemented");
@@ -206,7 +206,7 @@ TrilinosInternalLinearAlgebra::reciprocal(Vector& x) const
206206

207207
void
208208
TrilinosInternalLinearAlgebra::pointwiseMult(
209-
const Vector& x, const Vector& y, Vector& w) const
209+
[[maybe_unused]] const Vector& x,[[maybe_unused]] const Vector& y,[[maybe_unused]] Vector& w) const
210210
{
211211
throw NotImplementedException(
212212
A_FUNCINFO, "TrilinosInternalLinearAlgebra::pointwiseMult not implemented");

alien/ArcaneInterface/modules/trilinos/src/alien/kernels/trilinos/algebra/TrilinosInternalLinearAlgebra.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ALIEN_TRILINOS_EXPORT TrilinosInternalLinearAlgebra
3030
: public IInternalLinearAlgebra<TrilinosMatrixType, TrilinosVectorType>
3131
{
3232
public:
33-
TrilinosInternalLinearAlgebra(Arccore::MessagePassing::IMessagePassingMng* pm = nullptr)
33+
TrilinosInternalLinearAlgebra(Arccore::MessagePassing::IMessagePassingMng* = nullptr)
3434
{
3535
}
3636

alien/ArcaneInterface/modules/trilinos/src/alien/kernels/trilinos/converters/SimpleCSR/SimpleCSR_to_Trilinos_MatrixConverter.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,11 @@ void
7777
SimpleCSR_to_Trilinos_MatrixConverter<TagT>::_build(
7878
const SimpleCSRMatrix<Real>& sourceImpl, TrilinosMatrix<Real, TagT>& targetImpl) const
7979
{
80-
typedef SimpleCSRMatrix<Real>::MatrixInternal CSRMatrixType;
81-
8280
const MatrixDistribution& dist = targetImpl.distribution();
83-
const CSRStructInfo& profile = sourceImpl.getCSRProfile();
84-
const Integer localSize = profile.getNRow();
8581
const Integer localOffset = dist.rowOffset();
8682
const Integer globalSize = dist.globalRowSize();
8783

8884
auto const& matrixInternal = *sourceImpl.internal();
89-
const Integer myRank = dist.parallelMng()->commRank();
90-
const Integer nProc = dist.parallelMng()->commSize();
9185

9286
auto const& matrix_profile = sourceImpl.internal()->getCSRProfile();
9387
int nrows = matrix_profile.getNRow();
@@ -104,7 +98,7 @@ SimpleCSR_to_Trilinos_MatrixConverter<TagT>::_build(
10498
template <typename TagT>
10599
void
106100
SimpleCSR_to_Trilinos_MatrixConverter<TagT>::_buildBlock(
107-
const SimpleCSRMatrix<Real>& sourceImpl, TrilinosMatrix<Real, TagT>& targetImpl) const
101+
[[maybe_unused]] const SimpleCSRMatrix<Real>& sourceImpl,[[maybe_unused]] TrilinosMatrix<Real, TagT>& targetImpl) const
108102
{
109103
}
110104

alien/ArcaneInterface/modules/trilinos/src/alien/kernels/trilinos/data_structure/TrilinosInternal.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050

5151
/* print callback (could be customized) */
52-
void print_callback(const char *msg, int length)
52+
void print_callback(const char *msg,[[maybe_unused]] int length)
5353
{
5454
int rank;
5555
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
@@ -116,7 +116,7 @@ TrilinosInternal::getEnv<std::string>(std::string const& key, std::string defaul
116116

117117
void
118118
TrilinosInternal::initialize(Arccore::MessagePassing::IMessagePassingMng* parallel_mng,
119-
std::string const& execution_space, int nb_threads, bool use_amgx)
119+
std::string const& execution_space, int nb_threads,[[maybe_unused]] bool use_amgx)
120120
{
121121
if (m_is_initialized)
122122
return;
@@ -569,7 +569,7 @@ void initAMGX(AMGXEnv& amgx_env,
569569
#endif
570570

571571
void
572-
TrilinosInternal::initMPIEnv(MPI_Comm comm)
572+
TrilinosInternal::initMPIEnv([[maybe_unused]] MPI_Comm comm)
573573
{
574574
}
575575

alien/ArcaneInterface/modules/trilinos/src/alien/kernels/trilinos/data_structure/TrilinosInternal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ BEGIN_TRILINOSINTERNAL_NAMESPACE
6969
//! Check parallel feature for MTL
7070
struct Features
7171
{
72-
static void checkParallel(const MatrixDistribution& dist) {}
72+
static void checkParallel([[maybe_unused]] const MatrixDistribution& dist) {}
7373
};
7474

7575
/*---------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)