Skip to content

Commit

Permalink
ci: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuck Atkins committed Feb 24, 2022
1 parent 713dab0 commit b51b731
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 24 deletions.
2 changes: 2 additions & 0 deletions CTestCustom.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"Warning: Rank mismatch between actual argument.*"
"zfp/types.h.*typedef"
"was built for newer macOS version"
"warning generated"
"warnings generated"
)
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
".*/thirdparty/.*"
Expand Down
2 changes: 1 addition & 1 deletion examples/hello/bpFWriteCRead/CppReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int argc, char *argv[])
const std::map<std::string, adios2::Params> variables =
bpIO.AvailableVariables();

for (const auto variablePair : variables)
for (const auto &variablePair : variables)
{
std::cout << "Name: " << variablePair.first;

Expand Down
2 changes: 1 addition & 1 deletion examples/hello/bpReader/helloBPReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main(int argc, char *argv[])
const std::map<std::string, adios2::Params> variables =
bpIO.AvailableVariables();

for (const auto variablePair : variables)
for (const auto &variablePair : variables)
{
std::cout << "Name: " << variablePair.first;

Expand Down
2 changes: 1 addition & 1 deletion source/adios2/core/Attribute.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct Pad;
template <typename T, typename Enable>
struct Pad
{
static void Zero(T &arg) {}
static void Zero(T & /*arg*/) {}
};

template <typename T>
Expand Down
1 change: 1 addition & 0 deletions source/adios2/core/IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ std::unordered_map<std::string, IO::EngineFactoryEntry>::const_iterator
FactoryLookup(std::string const &name)
{
std::lock_guard<std::mutex> factoryGuard(FactoryMutex);
(void)factoryGuard;
return Factory.find(name);
}

Expand Down
4 changes: 2 additions & 2 deletions source/adios2/core/VariableBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ bool VariableBase::IsCUDAPointer(void *ptr)
cudaPointerAttributes attr;
cudaPointerGetAttributes(&attr, ptr);
return attr.type == cudaMemoryTypeDevice;
#endif

#else
return false;
#endif
}

size_t VariableBase::TotalSize() const noexcept
Expand Down
4 changes: 2 additions & 2 deletions source/adios2/engine/bp5/BP5Writer_TwoLevelShm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void BP5Writer::SendDataToAggregator(format::BufferV *Data)
std::vector<core::iovec> DataVec = Data->DataVec();
size_t nBlocks = DataVec.size();

size_t sent = 0;
// size_t sent = 0;
size_t block = 0;
size_t temp_offset = 0;
while (block < nBlocks)
Expand Down Expand Up @@ -241,7 +241,7 @@ void BP5Writer::SendDataToAggregator(format::BufferV *Data)
break;
}
}
sent += b->actual_size;
// sent += b->actual_size;

/*if (m_RankMPI >= 42)
{
Expand Down
4 changes: 2 additions & 2 deletions source/adios2/engine/bp5/BP5Writer_TwoLevelShm_Async.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void BP5Writer::AsyncWriteThread_TwoLevelShm_SendDataToAggregator(
std::vector<core::iovec> DataVec = Data->DataVec();
size_t nBlocks = DataVec.size();

size_t sent = 0;
// size_t sent = 0;
size_t block = 0;
size_t temp_offset = 0;
while (block < nBlocks)
Expand Down Expand Up @@ -126,7 +126,7 @@ void BP5Writer::AsyncWriteThread_TwoLevelShm_SendDataToAggregator(
break;
}
}
sent += b->actual_size;
// sent += b->actual_size;
a->UnlockProducerBuffer();
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/engine/ssc/SscReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ void SscReader::CalculatePosition(ssc::BlockVecVec &bvv,
for (int rank = 0; rank < static_cast<int>(bvv.size()); ++rank)
{
bool hasOverlap = false;
for (const auto r : allRanks)
for (const auto &r : allRanks)
{
if (r.first == rank)
{
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/engine/ssc/SscWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void SscWriter::CalculatePosition(ssc::BlockVecVec &writerVecVec,
for (int rank = 0; rank < static_cast<int>(writerVecVec.size()); ++rank)
{
bool hasOverlap = false;
for (const auto r : currentReaderOverlapWriterRanks)
for (const auto &r : currentReaderOverlapWriterRanks)
{
if (r.first == rank)
{
Expand Down
2 changes: 2 additions & 0 deletions source/adios2/helper/adiosMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ void CopyPayloadStride(const char *src, const size_t payloadStride, char *dest,
std::copy(src, src + payloadStride, dest);
}
#else
(void)endianReverse;
(void)destType;
std::copy(src, src + payloadStride, dest);
#endif
}
Expand Down
4 changes: 2 additions & 2 deletions source/adios2/operator/compress/CompressSZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ size_t CompressSZ::DecompressV1(const char *bufferIn, const size_t sizeIn,

// Get type info
int dtype = 0;
size_t dataTypeSize;
size_t dataTypeSize = 0;
if (type == helper::GetDataType<double>() ||
type == helper::GetDataType<std::complex<double>>())
{
Expand Down Expand Up @@ -437,7 +437,7 @@ size_t CompressSZ::DecompressV2(const char *bufferIn, const size_t sizeIn,

// Get type info
int dtype = 0;
size_t dataTypeSize;
size_t dataTypeSize = 0;
if (type == helper::GetDataType<double>() ||
type == helper::GetDataType<std::complex<double>>())
{
Expand Down
1 change: 0 additions & 1 deletion source/adios2/toolkit/format/bp5/BP5Serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ static void GetMinMax(const void *Data, size_t ElemCount, const DataType Type,
else if (MemSpace == MemorySpace::CUDA && \
Type == helper::GetDataType<T>()) \
{ \
const size_t size = ElemCount * sizeof(T); \
const T *values = (const T *)Data; \
helper::CUDAMinMax(values, ElemCount, MinMax.MinUnion.field_##N, \
MinMax.MaxUnion.field_##N); \
Expand Down
2 changes: 1 addition & 1 deletion source/adios2/toolkit/sst/dp/rdma_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static void init_fabric(struct fabric_state *fabric, struct _SstParams *Params,
CP_Services Svcs, void *CP_Stream)
{
struct fi_info *hints, *info, *originfo, *useinfo;
struct fi_av_attr av_attr = {0};
struct fi_av_attr av_attr = {FI_AV_UNSPEC};
struct fi_cq_attr cq_attr = {0};
char *ifname;
int result;
Expand Down
2 changes: 1 addition & 1 deletion source/utils/adios_iotest/adiosStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ void adiosStream::writeADIOS(CommandWrite *cmdW, Config &cfg,
MPI_Barrier(comm);
timeStart = MPI_Wtime();
engine.BeginStep();
for (const auto ov : cmdW->variables)
for (const auto &ov : cmdW->variables)
{
putADIOSArray(ov);
}
Expand Down
6 changes: 3 additions & 3 deletions source/utils/adios_iotest/adios_iotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ int main(int argc, char *argv[])
std::cout << "App " + std::to_string(settings.appId) + " Step "
<< step << ": " << std::endl;
}
for (const auto cmd : cfg.commands)
for (const auto &cmd : cfg.commands)
{
if (!cmd->conditionalStream.empty() &&
cfg.condMap.at(cmd->conditionalStream) !=
Expand Down Expand Up @@ -248,8 +248,8 @@ int main(int argc, char *argv[])
auto cmdS = dynamic_cast<const CommandBusy *>(cmd.get());
std::chrono::high_resolution_clock::time_point start =
std::chrono::high_resolution_clock::now();
auto sleeptime =
std::chrono::microseconds(cmdS->busyTime_us);
// auto sleeptime =
// std::chrono::microseconds(cmdS->busyTime_us);
if (!settings.myRank && settings.verbose)
{
double t =
Expand Down
4 changes: 2 additions & 2 deletions source/utils/adios_iotest/processConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void printConfig(const Config &cfg)
}

std::cout << " Commands :" << std::endl;
for (const auto cmd : cfg.commands)
for (const auto &cmd : cfg.commands)
{
if (!cmd->conditionalStream.empty())
{
Expand Down Expand Up @@ -408,7 +408,7 @@ void printVarMaps(Config &cfg, std::string &groupName)

void globalChecks(const Config &cfg, const Settings &settings)
{
for (const auto cmd : cfg.commands)
for (const auto &cmd : cfg.commands)
{
if (!cmd->conditionalStream.empty())
{
Expand Down
1 change: 1 addition & 0 deletions testing/adios2/engine/bp/TestBPWriteReadBlockInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void CheckStepsBlockInfo1D_C(adios2_variable *var, adios2_varinfo *vi,
const size_t NSteps, const size_t nproc,
const size_t Nx)
{
(void)NSteps;
EXPECT_EQ(vi->nblocks, nproc);
adios2_shapeid shapeid;
adios2_variable_shapeid(&shapeid, var);
Expand Down
2 changes: 1 addition & 1 deletion testing/adios2/engine/staging-common/TestSupp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ function(add_common_test basename engine)
endif()
set (timeout "${${basename}_TIMEOUT}")
if ("${timeout}" STREQUAL "")
set (timeout "30")
set (timeout "60")
endif()

set_tests_properties(${testname} PROPERTIES
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Disable warnings in thirdparty code
if(CMAKE_C_COMPILER_ID MATCHES
"^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|PGI|NVIDIA)$")
"^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM|PGI|NVIDIA|NVHPC)$")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES
"^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|PGI|NVIDIA)$")
"^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel|IntelLLVM|PGI|NVIDIA|NVHPC)$")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
endif()

Expand Down

0 comments on commit b51b731

Please sign in to comment.