diff --git a/bindings/C/adios2/c/adios2_c_attribute.cpp b/bindings/C/adios2/c/adios2_c_attribute.cpp index 73d42b513a..fa34cb6293 100644 --- a/bindings/C/adios2/c/adios2_c_attribute.cpp +++ b/bindings/C/adios2/c/adios2_c_attribute.cpp @@ -169,7 +169,7 @@ adios2_error adios2_attribute_data(void *data, size_t *size, *size = attributeCpp->m_Elements; char **dataT = reinterpret_cast(data); - for (auto e = 0; e < *size; ++e) + for (size_t e = 0; e < *size; ++e) { attributeCpp->m_DataArray[e].copy( dataT[e], attributeCpp->m_DataArray[e].size()); diff --git a/bindings/CXX11/adios2/cxx11/Attribute.cpp b/bindings/CXX11/adios2/cxx11/Attribute.cpp index 86fcd43ee0..10dba9dae0 100644 --- a/bindings/CXX11/adios2/cxx11/Attribute.cpp +++ b/bindings/CXX11/adios2/cxx11/Attribute.cpp @@ -59,8 +59,7 @@ namespace adios2 } \ else \ { \ - return reinterpret_cast &>( \ - m_Attribute->m_DataArray); \ + return helper::NewVectorType(m_Attribute->m_DataArray); \ } \ } \ \ diff --git a/bindings/Fortran/f2c/adios2_f2c_variable.cpp b/bindings/Fortran/f2c/adios2_f2c_variable.cpp index 27c6ddb5a0..f11603d816 100644 --- a/bindings/Fortran/f2c/adios2_f2c_variable.cpp +++ b/bindings/Fortran/f2c/adios2_f2c_variable.cpp @@ -85,7 +85,7 @@ void FC_GLOBAL(adios2_variable_shape_f2c, return; } - for (auto d = 0; d < ndims; ++d) + for (size_t d = 0; d < ndims; ++d) { shape[d] = static_cast(shapeC[d]); } diff --git a/examples/basics/globalArray/globalArray_write.cpp b/examples/basics/globalArray/globalArray_write.cpp index 172bb47482..8e17a8df42 100644 --- a/examples/basics/globalArray/globalArray_write.cpp +++ b/examples/basics/globalArray/globalArray_write.cpp @@ -76,11 +76,11 @@ int main(int argc, char *argv[]) // but Advance() will append steps to the same file. adios2::Engine writer = io.Open("globalArray.bp", adios2::Mode::Write); - for (int step = 0; step < NSTEPS; step++) + for (size_t step = 0; step < NSTEPS; step++) { writer.BeginStep(); - for (int i = 0; i < Nx; i++) + for (size_t i = 0; i < Nx; i++) { row[i] = step * Nx * nproc * 1.0 + rank * Nx * 1.0 + (double)i; } diff --git a/examples/heatTransfer/read/ReadSettings.cpp b/examples/heatTransfer/read/ReadSettings.cpp index 30f9c91730..7f399142f9 100644 --- a/examples/heatTransfer/read/ReadSettings.cpp +++ b/examples/heatTransfer/read/ReadSettings.cpp @@ -48,7 +48,7 @@ ReadSettings::ReadSettings(int argc, char *argv[], int rank, int nproc) npx = convertToUint("N", argv[4]); npy = convertToUint("M", argv[5]); - if (npx * npy != this->nproc) + if (npx * npy != static_cast(this->nproc)) { throw std::invalid_argument("N*M must equal the number of processes"); } diff --git a/examples/heatTransfer/read/heatRead.cpp b/examples/heatTransfer/read/heatRead.cpp index 8e11750e30..cf653b246f 100644 --- a/examples/heatTransfer/read/heatRead.cpp +++ b/examples/heatTransfer/read/heatRead.cpp @@ -43,7 +43,7 @@ void Compute(const std::vector &Tin, std::vector &Tout, */ if (firstStep) { - for (int i = 0; i < dT.size(); i++) + for (size_t i = 0; i < dT.size(); ++i) { dT[i] = 0; Tout[i] = Tin[i]; @@ -51,7 +51,7 @@ void Compute(const std::vector &Tin, std::vector &Tout, } else { - for (int i = 0; i < dT.size(); i++) + for (size_t i = 0; i < dT.size(); ++i) { dT[i] = Tout[i] - Tin[i]; Tout[i] = Tin[i]; diff --git a/examples/heatTransfer/read_fileonly/PrintData.h b/examples/heatTransfer/read_fileonly/PrintData.h index f18948af61..537a32d0b4 100644 --- a/examples/heatTransfer/read_fileonly/PrintData.h +++ b/examples/heatTransfer/read_fileonly/PrintData.h @@ -34,17 +34,17 @@ void printData(double *xy, T *size, T *offset, int rank, int steps) myfile << " time row columns " << offset[1] << "..." << offset[1] + size[1] - 1 << std::endl; myfile << " "; - for (int j = 0; j < size[1]; j++) + for (int j = 0; j < static_cast(size[1]); j++) { myfile << std::setw(9) << offset[1] + j; } myfile << std::endl; myfile << "------------------------------------------------------------" "--\n"; - for (int i = 0; i < size[0]; i++) + for (int i = 0; i < static_cast(size[0]); i++) { myfile << std::setw(5) << step << std::setw(5) << offset[0] + i; - for (int j = 0; j < size[1]; j++) + for (int j = 0; j < static_cast(size[1]); j++) { myfile << std::setw(9) << std::setprecision(2) << data[i * size[1] + j]; diff --git a/examples/heatTransfer/write/IO.h b/examples/heatTransfer/write/IO.h index 9ea1f4e698..55a4f31037 100644 --- a/examples/heatTransfer/write/IO.h +++ b/examples/heatTransfer/write/IO.h @@ -36,7 +36,7 @@ class IO int step = -1) { std::string name; - int ss = outputfile.size(); + const size_t ss = outputfile.size(); if (rank == -1 && step == -1) { // add suffix if not present already diff --git a/examples/heatTransfer/write/IO_ascii.cpp b/examples/heatTransfer/write/IO_ascii.cpp index 77c486decd..bbeeff5728 100644 --- a/examples/heatTransfer/write/IO_ascii.cpp +++ b/examples/heatTransfer/write/IO_ascii.cpp @@ -53,7 +53,7 @@ void IO::write(int step, const HeatTransfer &ht, const Settings &s, out << " time row columns " << s.offsy << "..." << s.offsy + s.ndy - 1 << std::endl; out << " "; - for (int j = 1; j <= s.ndy; ++j) + for (unsigned int j = 1; j <= s.ndy; ++j) { out << std::setw(9) << s.offsy + j - 1; } @@ -66,10 +66,10 @@ void IO::write(int step, const HeatTransfer &ht, const Settings &s, } out << std::fixed; - for (int i = 1; i <= s.ndx; ++i) + for (unsigned int i = 1; i <= s.ndx; ++i) { out << std::setw(5) << step << std::setw(5) << s.offsx + i - 1; - for (int j = 1; j <= s.ndy; ++j) + for (unsigned int j = 1; j <= s.ndy; ++j) { out << std::setw(9) << std::setprecision(5) << ht.T(i, j); } diff --git a/examples/hello/bpFWriteCRead/CppReader.cpp b/examples/hello/bpFWriteCRead/CppReader.cpp index 7e4c7a012e..49db89a230 100644 --- a/examples/hello/bpFWriteCRead/CppReader.cpp +++ b/examples/hello/bpFWriteCRead/CppReader.cpp @@ -54,9 +54,9 @@ int main(int argc, char *argv[]) bpReader.Close(); std::cout << "Selection size: " << bpData.SelectionSize() << "\n"; - for (auto i = 0; i < bpData.Count()[0]; ++i) + for (size_t i = 0; i < bpData.Count()[0]; ++i) { - for (auto j = 0; j < bpData.Count()[1]; ++j) + for (size_t j = 0; j < bpData.Count()[1]; ++j) { std::cout << data[i * bpData.Count()[1] + j] << " "; } diff --git a/examples/hello/bpFWriteCRead/CppWriter.cpp b/examples/hello/bpFWriteCRead/CppWriter.cpp index 3911b3587d..5cef56f63e 100644 --- a/examples/hello/bpFWriteCRead/CppWriter.cpp +++ b/examples/hello/bpFWriteCRead/CppWriter.cpp @@ -24,9 +24,9 @@ int main(int argc, char *argv[]) const size_t ny = 3; std::vector data(nx * ny); - for (auto i = 0; i < nx; ++i) + for (size_t i = 0; i < nx; ++i) { - for (auto j = 0; j < ny; ++j) + for (size_t j = 0; j < ny; ++j) { data[i * ny + j] = rank * nx * ny + i * ny + j; } diff --git a/examples/hello/bpReader/helloBPReaderHeatMap3D.cpp b/examples/hello/bpReader/helloBPReaderHeatMap3D.cpp index 8caf6ed3c6..0a4272c6b4 100644 --- a/examples/hello/bpReader/helloBPReaderHeatMap3D.cpp +++ b/examples/hello/bpReader/helloBPReaderHeatMap3D.cpp @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) std::cout << "Temperature map selection: "; std::cout << "{ start = [2,2,2], count = [4,4,4] }\n"; - for (auto i = 0; i < inTemperatures.size(); ++i) + for (size_t i = 0; i < inTemperatures.size(); ++i) { std::cout << inTemperatures[i] << " "; if ((i + 1) % inTemperature.Count().back() == 0) diff --git a/examples/hello/datamanReader/helloDataManP2PReader.cpp b/examples/hello/datamanReader/helloDataManP2PReader.cpp index 0c00d7f2d7..8bbeea7fde 100644 --- a/examples/hello/datamanReader/helloDataManP2PReader.cpp +++ b/examples/hello/datamanReader/helloDataManP2PReader.cpp @@ -67,11 +67,10 @@ int main(int argc, char *argv[]) adios2::Engine dataManReader = dataManIO.Open("stream", adios2::Mode::Read); // read data - size_t i = 0; adios2::Variable bpFloats; - auto start_time = std::chrono::system_clock::now(); adios2::StepStatus status; - for (int i = 0; i < steps; ++i) + + for (size_t i = 0; i < steps; ++i) { status = dataManReader.BeginStep(); if (status == adios2::StepStatus::OK) diff --git a/examples/hello/datamanWriter/helloDataManP2PWriter.cpp b/examples/hello/datamanWriter/helloDataManP2PWriter.cpp index 8136f27a99..c4ec786bc4 100644 --- a/examples/hello/datamanWriter/helloDataManP2PWriter.cpp +++ b/examples/hello/datamanWriter/helloDataManP2PWriter.cpp @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) dataManIO.DefineVariable("bpFloats", shape, start, count); // write data - for (int i = 0; i < steps; ++i) + for (size_t i = 0; i < steps; ++i) { dataManWriter.BeginStep(); dataManWriter.Put(bpFloats, myFloats.data(), adios2::Mode::Sync); diff --git a/examples/hello/datamanWriter/helloDataManSubscribeWriter.cpp b/examples/hello/datamanWriter/helloDataManSubscribeWriter.cpp index 524a491f85..8a1858d517 100644 --- a/examples/hello/datamanWriter/helloDataManSubscribeWriter.cpp +++ b/examples/hello/datamanWriter/helloDataManSubscribeWriter.cpp @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) dataManIO.DefineVariable("bpFloats", shape, start, count); // write data - for (int i = 0; i < steps; ++i) + for (size_t i = 0; i < steps; ++i) { dataManWriter.BeginStep(); dataManWriter.Put(bpFloats, myFloats.data(), adios2::Mode::Sync); diff --git a/examples/hello/inlineReaderWriter/helloInlineReaderWriter.cpp b/examples/hello/inlineReaderWriter/helloInlineReaderWriter.cpp index 5bd3872605..065704b7f0 100644 --- a/examples/hello/inlineReaderWriter/helloInlineReaderWriter.cpp +++ b/examples/hello/inlineReaderWriter/helloInlineReaderWriter.cpp @@ -57,7 +57,7 @@ void DoAnalysis(adios2::IO &inlineIO, adios2::Engine &inlineReader, int rank, { adios2::Dims count = info.Count; const float *vectData = info.Data(); - for (int i = 0; i < count[0]; ++i) + for (size_t i = 0; i < count[0]; ++i) { float datum = vectData[i]; std::cout << datum << " "; diff --git a/examples/hello/insituMPI/HelloInsituArgs.cpp b/examples/hello/insituMPI/HelloInsituArgs.cpp index 894f6ec21d..839167f831 100644 --- a/examples/hello/insituMPI/HelloInsituArgs.cpp +++ b/examples/hello/insituMPI/HelloInsituArgs.cpp @@ -88,7 +88,7 @@ HelloInsituArgs::HelloInsituArgs(bool isWriter, int argc, char *argv[], offsy = posy * ndy; } - if (npx * npy != nproc) + if (npx * npy != static_cast(nproc)) { throw std::invalid_argument( "N*M must equal the number of processes"); diff --git a/examples/hello/insituMPI/HelloInsituPrint.h b/examples/hello/insituMPI/HelloInsituPrint.h index f1ed766bde..bd6cadcf59 100644 --- a/examples/hello/insituMPI/HelloInsituPrint.h +++ b/examples/hello/insituMPI/HelloInsituPrint.h @@ -41,17 +41,17 @@ void printDataStep(const float *data, const adios2::Dims &size, myfile << " step row columns " << offset[1] << "..." << offset[1] + size[1] - 1 << std::endl; myfile << " "; - for (int j = 0; j < size[1]; j++) + for (size_t j = 0; j < size[1]; j++) { myfile << std::setw(9) << offset[1] + j; } myfile << std::endl; myfile << "------------------------------------------------------------" "--\n"; - for (int i = 0; i < size[0]; i++) + for (size_t i = 0; i < size[0]; i++) { myfile << std::setw(5) << step << std::setw(5) << offset[0] + i; - for (int j = 0; j < size[1]; j++) + for (size_t j = 0; j < size[1]; j++) { myfile << std::setw(9) << std::setprecision(5) << data[i * size[1] + j]; diff --git a/examples/hello/skeleton/HelloSkeletonArgs.cpp b/examples/hello/skeleton/HelloSkeletonArgs.cpp index ff91b113e6..c35c1c16b8 100644 --- a/examples/hello/skeleton/HelloSkeletonArgs.cpp +++ b/examples/hello/skeleton/HelloSkeletonArgs.cpp @@ -60,7 +60,7 @@ HelloSkeletonArgs::HelloSkeletonArgs(bool isWriter, int argc, char *argv[], npx = npy = ndx = ndy = steps = sleeptime = 0; gndx = gndy = posx = posy = offsx = offsy = 0; int expargs = (isWriter ? 8 : 4); - this->nproc = (unsigned int)nproc; + this->nproc = static_cast(nproc); try { @@ -90,7 +90,7 @@ HelloSkeletonArgs::HelloSkeletonArgs(bool isWriter, int argc, char *argv[], offsy = posy * ndy; } - if (npx * npy != nproc) + if (npx * npy != static_cast(nproc)) { throw std::invalid_argument( "N*M must equal the number of processes"); diff --git a/examples/hello/skeleton/HelloSkeletonPrint.h b/examples/hello/skeleton/HelloSkeletonPrint.h index b3aded5500..9c6a893f90 100644 --- a/examples/hello/skeleton/HelloSkeletonPrint.h +++ b/examples/hello/skeleton/HelloSkeletonPrint.h @@ -39,17 +39,17 @@ void printDataStep(const float *data, const adios2::Dims &size, myfile << " step row columns " << offset[1] << "..." << offset[1] + size[1] - 1 << std::endl; myfile << " "; - for (int j = 0; j < size[1]; j++) + for (size_t j = 0; j < size[1]; j++) { myfile << std::setw(9) << offset[1] + j; } myfile << std::endl; myfile << "------------------------------------------------------------" "--\n"; - for (int i = 0; i < size[0]; i++) + for (size_t i = 0; i < size[0]; i++) { myfile << std::setw(5) << step << std::setw(5) << offset[0] + i; - for (int j = 0; j < size[1]; j++) + for (size_t j = 0; j < size[1]; j++) { myfile << std::setw(9) << std::setprecision(4) << data[i * size[1] + j]; diff --git a/examples/useCases/insituGlobalArrays/insituGlobalArraysReaderNxN.cpp b/examples/useCases/insituGlobalArrays/insituGlobalArraysReaderNxN.cpp index 489b8c2ce2..6bf0b5108c 100644 --- a/examples/useCases/insituGlobalArrays/insituGlobalArraysReaderNxN.cpp +++ b/examples/useCases/insituGlobalArrays/insituGlobalArraysReaderNxN.cpp @@ -39,7 +39,7 @@ typedef struct std::string DimsToString(adios2::Dims &dims) { std::string s = "\""; - for (int i = 0; i < dims.size(); i++) + for (size_t i = 0; i < dims.size(); i++) { if (i > 0) { @@ -66,7 +66,8 @@ void ProcessVariableMetadata(int rank, const std::string &name, for (auto &block : blocks) { /* offset in first dimension is encoding writer's rank */ - if (block.Start.size() > 0 && block.Start[0] == rank) + if (block.Start.size() > 0 && + block.Start[0] == static_cast(rank)) { /*std::cout << " Rank " << rank << " Variable '" << name << "' found a block dimensions = " diff --git a/examples/useCases/insituGlobalArrays/insituGlobalArraysWriter.cpp b/examples/useCases/insituGlobalArrays/insituGlobalArraysWriter.cpp index 09c270ea85..d8869f0b65 100644 --- a/examples/useCases/insituGlobalArrays/insituGlobalArraysWriter.cpp +++ b/examples/useCases/insituGlobalArrays/insituGlobalArraysWriter.cpp @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) #endif const size_t maxProc = VarTree.size(); - if (nproc > maxProc) + if (static_cast(nproc) > maxProc) { if (!rank) { @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) const size_t nvars = VarTree[rank].size(); // A 1D array for each variable std::vector> Vars(nvars); - for (int i = 0; i < nvars; i++) + for (size_t i = 0; i < nvars; i++) { Vars[i].resize(SizesTree[rank][i]); } @@ -160,7 +160,7 @@ int main(int argc, char *argv[]) io.AddTransport(t.first, t.second); } - for (int i = 0; i < nvars; i++) + for (size_t i = 0; i < nvars; i++) { size_t nelems = SizesTree[rank][i]; Vars[i].resize(nelems); @@ -170,14 +170,14 @@ int main(int argc, char *argv[]) adios2::Engine writer = io.Open("output.bp", adios2::Mode::Write); - for (int step = 0; step < NSTEPS; step++) + for (size_t step = 0; step < NSTEPS; step++) { writer.BeginStep(); - for (int i = 0; i < nvars; i++) + for (size_t i = 0; i < nvars; i++) { size_t nelems = SizesTree[rank][i]; - for (int j = 0; j < nelems; j++) + for (size_t j = 0; j < nelems; j++) { Vars[i][j] = ((double)step + 1.0) / 100.0 + (double)rank; } diff --git a/source/adios2/engine/insitumpi/InSituMPIFunctions.cpp b/source/adios2/engine/insitumpi/InSituMPIFunctions.cpp index 61f8c548ea..3439e3d67b 100644 --- a/source/adios2/engine/insitumpi/InSituMPIFunctions.cpp +++ b/source/adios2/engine/insitumpi/InSituMPIFunctions.cpp @@ -259,7 +259,7 @@ std::vector CompleteRequests(std::vector &requests, if (ierr == MPI_ERR_IN_STATUS) { - for (auto i = 0; i < requests.size(); i++) + for (size_t i = 0; i < requests.size(); i++) { if (statuses[i].MPI_ERROR == MPI_ERR_PENDING) { diff --git a/source/adios2/engine/insitumpi/InSituMPISchedules.cpp b/source/adios2/engine/insitumpi/InSituMPISchedules.cpp index 7031f3bd35..ea3616e9ce 100644 --- a/source/adios2/engine/insitumpi/InSituMPISchedules.cpp +++ b/source/adios2/engine/insitumpi/InSituMPISchedules.cpp @@ -308,11 +308,13 @@ void PrintBox(const Box &box) noexcept void PrintDims(const Dims &dims) noexcept { std::cout << "{"; - for (int i = 0; i < dims.size(); i++) + for (size_t i = 0; i < dims.size(); i++) { std::cout << dims[i]; if (i < dims.size() - 1) + { std::cout << ","; + } } std::cout << "}"; } diff --git a/source/adios2/helper/adiosMath.cpp b/source/adios2/helper/adiosMath.cpp index 2ab32c7902..e000c8bfb7 100644 --- a/source/adios2/helper/adiosMath.cpp +++ b/source/adios2/helper/adiosMath.cpp @@ -150,7 +150,7 @@ Box IntersectionStartCount(const Dims &start1, const Dims &count1, Box intersectionStartCount; const size_t dimensionsSize = start1.size(); - for (auto d = 0; d < dimensionsSize; ++d) + for (size_t d = 0; d < dimensionsSize; ++d) { // Don't intercept const size_t end1 = start1[d] + count1[d] - 1; @@ -165,7 +165,7 @@ Box IntersectionStartCount(const Dims &start1, const Dims &count1, intersectionStartCount.first.reserve(dimensionsSize); intersectionStartCount.second.reserve(dimensionsSize); - for (auto d = 0; d < dimensionsSize; ++d) + for (size_t d = 0; d < dimensionsSize; ++d) { const size_t intersectionStart = (start1[d] < start2[d]) ? start2[d] : start1[d]; @@ -226,7 +226,7 @@ bool IsIntersectionContiguousSubarray(const Box &blockBox, dSlowest = static_cast(dimensionsSize - 1); } - for (size_t d = dStart; d <= dEnd; ++d) + for (int d = dStart; d <= dEnd; ++d) { if (blockBox.first[d] != intersectionBox.first[d] || blockBox.second[d] != intersectionBox.second[d]) @@ -263,7 +263,7 @@ size_t LinearIndex(const Dims &start, const Dims &count, const Dims &point, size_t linearIndex = normalizedPoint[0]; // fastest size_t product = 1; - for (auto p = 1; p < countSize; ++p) + for (size_t p = 1; p < countSize; ++p) { product *= count[p - 1]; linearIndex += normalizedPoint[p] * product; diff --git a/source/adios2/helper/adiosMath.inl b/source/adios2/helper/adiosMath.inl index 176aac0f32..d6ab3f1f09 100644 --- a/source/adios2/helper/adiosMath.inl +++ b/source/adios2/helper/adiosMath.inl @@ -217,7 +217,7 @@ void GetMinMaxComplex(const std::complex *values, const size_t size, T minNorm = std::norm(values[0]); T maxNorm = minNorm; - for (auto i = 1; i < size; ++i) + for (size_t i = 1; i < size; ++i) { T norm = std::norm(values[i]); diff --git a/source/adios2/operator/compress/CompressBZIP2.cpp b/source/adios2/operator/compress/CompressBZIP2.cpp index 524144b0cb..3d9795e136 100644 --- a/source/adios2/operator/compress/CompressBZIP2.cpp +++ b/source/adios2/operator/compress/CompressBZIP2.cpp @@ -81,7 +81,7 @@ size_t CompressBZIP2::Compress(const void *dataIn, const Dims &dimensions, unsigned int destOffset = 0; unsigned int sourceOffset = 0; - for (auto b = 0; b < batches; ++b) + for (size_t b = 0; b < batches; ++b) { char *source = const_cast(reinterpret_cast(dataIn)) + @@ -137,7 +137,7 @@ size_t CompressBZIP2::Decompress(const void *bufferIn, const size_t sizeIn, size_t expectedSizeOut = 0; - for (auto b = 0; b < batches; ++b) + for (size_t b = 0; b < batches; ++b) { const std::string bStr = std::to_string(b); diff --git a/source/adios2/operator/compress/CompressMGARD.cpp b/source/adios2/operator/compress/CompressMGARD.cpp index 1dc5791e4a..9ddefd05e9 100644 --- a/source/adios2/operator/compress/CompressMGARD.cpp +++ b/source/adios2/operator/compress/CompressMGARD.cpp @@ -67,7 +67,7 @@ size_t CompressMGARD::Compress(const void *dataIn, const Dims &dimensions, r[1] = 0; r[2] = 0; - for (auto i = 0; i < ndims; i++) + for (size_t i = 0; i < ndims; i++) { r[ndims - i - 1] = static_cast(dimensions[i]); } @@ -134,7 +134,7 @@ size_t CompressMGARD::Decompress(const void *bufferIn, const size_t sizeIn, r[1] = 0; r[2] = 0; - for (auto i = 0; i < ndims; i++) + for (size_t i = 0; i < ndims; i++) { r[ndims - i - 1] = static_cast(dimensions[i]); } diff --git a/source/adios2/operator/compress/CompressPNG.cpp b/source/adios2/operator/compress/CompressPNG.cpp index abb6ebd694..d17ada6adf 100644 --- a/source/adios2/operator/compress/CompressPNG.cpp +++ b/source/adios2/operator/compress/CompressPNG.cpp @@ -137,9 +137,6 @@ size_t CompressPNG::Compress(const void *dataIn, const Dims &dimensions, } } - const size_t sizeIn = - static_cast(helper::GetTotalSize(dimensions) * elementSize); - png_structp pngWrite = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); png_infop pngInfo = png_create_info_struct(pngWrite); diff --git a/source/adios2/operator/compress/CompressSZ.cpp b/source/adios2/operator/compress/CompressSZ.cpp index b93376abb5..2e628389a4 100644 --- a/source/adios2/operator/compress/CompressSZ.cpp +++ b/source/adios2/operator/compress/CompressSZ.cpp @@ -254,7 +254,7 @@ size_t CompressSZ::Compress(const void *dataIn, const Dims &dimensions, } // Get type info - int dtype; + int dtype = -1; if (varType == helper::GetType()) { dtype = SZ_DOUBLE; @@ -277,7 +277,7 @@ size_t CompressSZ::Compress(const void *dataIn, const Dims &dimensions, // r[0] is the fastest changing dimension and r[4] is the lowest changing // dimension // In C, r[0] is the last dimension. In Fortran, r[0] is the first dimension - for (int i = 0; i < ndims; i++) + for (size_t i = 0; i < ndims; i++) { r[ndims - i - 1] = dimensions[i]; /* @@ -330,7 +330,7 @@ size_t CompressSZ::Decompress(const void *bufferIn, const size_t sizeIn, // In C, r[0] is the last dimension. In Fortran, r[0] is the first dimension std::vector rs(5, 0); const size_t ndims = dimensions.size(); - for (auto i = 0; i < ndims; ++i) + for (size_t i = 0; i < ndims; ++i) { rs[ndims - i - 1] = dimensions[i]; } diff --git a/source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp b/source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp index 47de4c7c97..8743a6b245 100644 --- a/source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp +++ b/source/adios2/toolkit/aggregator/mpi/MPIAggregator.cpp @@ -66,14 +66,14 @@ void MPIAggregator::InitComm(const size_t subStreams, const size_t r = processes % subStreams; // Groups [0,r) have size q+1. Groups [r,S) have size q. - const size_t first_in_small_groups = r * (q + 1); + const size_t firstInSmallGroups = r * (q + 1); // Within each group the first process becomes its consumer. - if (process >= first_in_small_groups) + if (process >= firstInSmallGroups) { - m_SubStreamIndex = r + (process - first_in_small_groups) / q; - m_ConsumerRank = static_cast(first_in_small_groups + - (m_SubStreamIndex - r) * q); + m_SubStreamIndex = r + (process - firstInSmallGroups) / q; + m_ConsumerRank = + static_cast(firstInSmallGroups + (m_SubStreamIndex - r) * q); } else { diff --git a/source/adios2/toolkit/format/bp3/BP3Base.tcc b/source/adios2/toolkit/format/bp3/BP3Base.tcc index ac83fb24e8..3e077a1d9a 100644 --- a/source/adios2/toolkit/format/bp3/BP3Base.tcc +++ b/source/adios2/toolkit/format/bp3/BP3Base.tcc @@ -507,7 +507,7 @@ std::map> BP3Base::SetBPOperations( { std::map> bpOperations; - for (auto i = 0; i < operations.size(); ++i) + for (size_t i = 0; i < operations.size(); ++i) { const std::string type = operations[i].Op->m_Type; std::shared_ptr bp3Operation = SetBPOperation(type); diff --git a/source/adios2/toolkit/format/bp3/BP3Deserializer.tcc b/source/adios2/toolkit/format/bp3/BP3Deserializer.tcc index 2de5c57232..4955daaafd 100644 --- a/source/adios2/toolkit/format/bp3/BP3Deserializer.tcc +++ b/source/adios2/toolkit/format/bp3/BP3Deserializer.tcc @@ -72,7 +72,7 @@ BP3Deserializer::InitVariableBlockInfo(core::Variable &variable, auto itStep = std::next(indices.begin(), stepsStart); - for (auto i = 0; i < stepsCount; ++i) + for (size_t i = 0; i < stepsCount; ++i) { if (itStep == indices.end()) { @@ -224,7 +224,7 @@ void BP3Deserializer::SetVariableBlockInfo( ? Dims(blockInfo.Count.size(), 0) : blockInfo.Start; - for (auto i = 0; i < dimensions; ++i) + for (size_t i = 0; i < dimensions; ++i) { if (blockInfoStart[i] + blockInfo.Count[i] > readInCount[i]) { @@ -330,7 +330,7 @@ void BP3Deserializer::SetVariableBlockInfo( std::reverse(readInShape.begin(), readInShape.end()); } - for (auto i = 0; i < dimensions; ++i) + for (size_t i = 0; i < dimensions; ++i) { if (blockInfo.Start[i] + blockInfo.Count[i] > readInShape[i]) { @@ -391,7 +391,7 @@ void BP3Deserializer::SetVariableBlockInfo( auto itStep = std::next(indices.begin(), blockInfo.StepsStart); - for (auto i = 0; i < blockInfo.StepsCount; ++i) + for (size_t i = 0; i < blockInfo.StepsCount; ++i) { const size_t step = itStep->first; const std::vector &blockOffsets = itStep->second; @@ -562,19 +562,24 @@ void BP3Deserializer::PostDataRead( if (!blockInfo.MemoryStart.empty()) { if (endianReverse) - throw std::invalid_argument("BP3Deserializer.tcc: endianReverse " + { + throw std::invalid_argument("ERROR: endianReverse " "not supported with MemorySelection"); + } + if (m_ReverseDimensions) + { throw std::invalid_argument( - "BP3Deserializer.tcc: ReverseDimensions not supported with " + "ERROR: ReverseDimensions not supported with " "MemorySelection"); + } auto intersectStart = subStreamBoxInfo.IntersectionBox.first; auto intersectCount = subStreamBoxInfo.IntersectionBox.second; auto blockStart = subStreamBoxInfo.BlockBox.first; auto blockCount = subStreamBoxInfo.BlockBox.second; auto memoryStart = blockInfoStart; - for (int d = 0; d < intersectStart.size(); d++) + for (size_t d = 0; d < intersectStart.size(); d++) { // change {intersect,block}Count from [start, end] to {start, count} intersectCount[d] -= (intersectStart[d] - 1); diff --git a/source/adios2/toolkit/format/bp3/BP3Serializer.tcc b/source/adios2/toolkit/format/bp3/BP3Serializer.tcc index 7d54681e6c..615f76194e 100644 --- a/source/adios2/toolkit/format/bp3/BP3Serializer.tcc +++ b/source/adios2/toolkit/format/bp3/BP3Serializer.tcc @@ -76,7 +76,7 @@ inline void BP3Serializer::PutVariablePayload( // access operator [] // std::fill_n(itBegin, blockSize, span->m_Value); - for (auto i = 0; i < blockSize; ++i) + for (size_t i = 0; i < blockSize; ++i) { itBegin[i] = span->m_Value; } diff --git a/source/adios2/toolkit/format/bp4/BP4Base.tcc b/source/adios2/toolkit/format/bp4/BP4Base.tcc index 51fcb133d7..b611c59c4e 100644 --- a/source/adios2/toolkit/format/bp4/BP4Base.tcc +++ b/source/adios2/toolkit/format/bp4/BP4Base.tcc @@ -545,7 +545,7 @@ std::map> BP4Base::SetBPOperations( { std::map> bpOperations; - for (auto i = 0; i < operations.size(); ++i) + for (size_t i = 0; i < operations.size(); ++i) { const std::string type = operations[i].Op->m_Type; std::shared_ptr bpOperation = SetBPOperation(type); diff --git a/source/adios2/toolkit/format/bp4/BP4Deserializer.tcc b/source/adios2/toolkit/format/bp4/BP4Deserializer.tcc index f1880441dc..1e1642cf04 100644 --- a/source/adios2/toolkit/format/bp4/BP4Deserializer.tcc +++ b/source/adios2/toolkit/format/bp4/BP4Deserializer.tcc @@ -73,7 +73,7 @@ BP4Deserializer::InitVariableBlockInfo(core::Variable &variable, auto itStep = std::next(indices.begin(), stepsStart); - for (auto i = 0; i < stepsCount; ++i) + for (size_t i = 0; i < stepsCount; ++i) { if (itStep == indices.end()) { @@ -225,7 +225,7 @@ void BP4Deserializer::SetVariableBlockInfo( ? Dims(blockInfo.Count.size(), 0) : blockInfo.Start; - for (auto i = 0; i < dimensions; ++i) + for (size_t i = 0; i < dimensions; ++i) { if (blockInfoStart[i] + blockInfo.Count[i] > readInCount[i]) { @@ -331,7 +331,7 @@ void BP4Deserializer::SetVariableBlockInfo( std::reverse(readInShape.begin(), readInShape.end()); } - for (auto i = 0; i < dimensions; ++i) + for (size_t i = 0; i < dimensions; ++i) { if (blockInfo.Start[i] + blockInfo.Count[i] > readInShape[i]) { @@ -392,7 +392,7 @@ void BP4Deserializer::SetVariableBlockInfo( auto itStep = std::next(indices.begin(), blockInfo.StepsStart); - for (auto i = 0; i < blockInfo.StepsCount; ++i) + for (size_t i = 0; i < blockInfo.StepsCount; ++i) { const size_t step = itStep->first; const std::vector &blockOffsets = itStep->second; @@ -800,7 +800,12 @@ void BP4Deserializer::DefineVariableInEngineIOPerStep( : header.Path + PathSeparator + header.Name; core::Variable *variable = nullptr; - variable = engine.m_IO.InquireVariable(variableName); + { + // to prevent conflict with DefineVariable + std::lock_guard lock(m_Mutex); + variable = engine.m_IO.InquireVariable(variableName); + } + if (variable) { size_t endPositionCurrentStep = diff --git a/source/utils/adios_iotest/decomp.cpp b/source/utils/adios_iotest/decomp.cpp index 9d706fd4f1..9bec72181a 100644 --- a/source/utils/adios_iotest/decomp.cpp +++ b/source/utils/adios_iotest/decomp.cpp @@ -13,7 +13,7 @@ void decompColumnMajor(const size_t ndim, const size_t rank, // pos[k] = rank / prod(decomp[i], i=0..k-1) % decomp[k] size_t prod = 1; - for (int k = 0; k < ndim; ++k) + for (size_t k = 0; k < ndim; ++k) { pos[k] = rank / prod % decomp[k]; prod *= decomp[k]; diff --git a/source/utils/adios_iotest/processConfig.cpp b/source/utils/adios_iotest/processConfig.cpp index 2571560c66..339c11f747 100644 --- a/source/utils/adios_iotest/processConfig.cpp +++ b/source/utils/adios_iotest/processConfig.cpp @@ -586,7 +586,7 @@ Config processConfig(const Settings &settings, size_t *currentConfigLineNumber) } else if (key == "write") { - if (currentAppId == settings.appId) + if (currentAppId == static_cast(settings.appId)) { if (words.size() < 3) { @@ -647,7 +647,7 @@ Config processConfig(const Settings &settings, size_t *currentConfigLineNumber) } else if (key == "read") { - if (currentAppId == settings.appId) + if (currentAppId == static_cast(settings.appId)) { if (words.size() < 4) { diff --git a/source/utils/adios_reorganize/Reorganize.cpp b/source/utils/adios_reorganize/Reorganize.cpp index eacb8eaeae..424e8be339 100644 --- a/source/utils/adios_reorganize/Reorganize.cpp +++ b/source/utils/adios_reorganize/Reorganize.cpp @@ -158,7 +158,7 @@ void Reorganize::Run() steps++; // start counting from 1 - if (rStream.CurrentStep() != curr_step + 1) + if (rStream.CurrentStep() != static_cast(curr_step + 1)) { // we missed some steps std::cout << "rank " << rank << " WARNING: steps " << curr_step @@ -459,8 +459,10 @@ int Reorganize::ProcessMetadata(core::Engine &rStream, core::IO &io, if (variable->GetShape().size() > 0) { std::cout << "[" << variable->GetShape()[0]; - for (int j = 1; j < variable->GetShape().size(); j++) + for (size_t j = 1; j < variable->GetShape().size(); j++) + { std::cout << ", " << variable->GetShape()[j]; + } std::cout << "]" << std::endl; } else diff --git a/source/utils/bpls/bpls.cpp b/source/utils/bpls/bpls.cpp index ccc28ad89c..93ffe60519 100644 --- a/source/utils/bpls/bpls.cpp +++ b/source/utils/bpls/bpls.cpp @@ -1502,7 +1502,7 @@ int readVar(core::Engine *fp, core::IO *io, core::Variable *variable) printf(" j=0, stepStart=%" PRIu64 " stepCount=%" PRIu64 "\n", stepStart, stepCount); - if (stepStart + stepCount > nsteps) + if (stepStart + stepCount > static_cast(nsteps)) { printf("ERROR: The sum of start step (%" PRIu64 ") and step count (%" PRIu64 ") is larger " @@ -2653,7 +2653,7 @@ size_t relative_to_absolute_step(core::Variable *variable, auto itStep = indices.begin(); size_t absstep = itStep->first - 1; - for (int step = 0; step < relstep; step++) + for (size_t step = 0; step < relstep; step++) { ++itStep; absstep = itStep->first - 1; @@ -2676,7 +2676,7 @@ Dims get_global_array_signature(core::Engine *fp, core::IO *io, variable->m_AvailableStepBlockIndexOffsets; auto itStep = indices.begin(); - for (int step = 0; step < nsteps; step++) + for (size_t step = 0; step < nsteps; step++) { const size_t absstep = itStep->first; Dims d = variable->Shape(absstep - 1); @@ -2685,7 +2685,7 @@ Dims get_global_array_signature(core::Engine *fp, core::IO *io, continue; } - for (int k = 0; k < ndim; k++) + for (size_t k = 0; k < ndim; k++) { if (firstStep) { diff --git a/testing/adios2/bindings/C/TestBPWriteReadMultiblock.cpp b/testing/adios2/bindings/C/TestBPWriteReadMultiblock.cpp index 63d01271a0..1efa92deeb 100644 --- a/testing/adios2/bindings/C/TestBPWriteReadMultiblock.cpp +++ b/testing/adios2/bindings/C/TestBPWriteReadMultiblock.cpp @@ -267,7 +267,7 @@ TEST_F(BPWriteReadMultiblockCC, ZeroSizeBlocks) adios2_perform_gets(engineH); - for (auto i = 0; i < data_Nx / 2; ++i) + for (size_t i = 0; i < data_Nx / 2; ++i) { EXPECT_EQ(inI8[i], data_I8[data_Nx / 2 + i]); EXPECT_EQ(inI16[i], data_I16[data_Nx / 2 + i]); diff --git a/testing/adios2/engine/bp/TestBPChangingShape.cpp b/testing/adios2/engine/bp/TestBPChangingShape.cpp index c1c1539243..3ae67db6d6 100644 --- a/testing/adios2/engine/bp/TestBPChangingShape.cpp +++ b/testing/adios2/engine/bp/TestBPChangingShape.cpp @@ -61,7 +61,7 @@ TEST_F(BPChangingShape, BPWriteReadShape2D) auto var = outIO.DefineVariable("v", {dim0, 1}, {off0, 0}, {1, 1}); std::vector buf(nsteps, 0.0); - for (int i = 0; i < buf.size(); i++) + for (size_t i = 0; i < buf.size(); i++) { buf[i] = rank + static_cast(i) / 10.0; } diff --git a/testing/adios2/engine/bp/TestBPLargeMetadata.cpp b/testing/adios2/engine/bp/TestBPLargeMetadata.cpp index d7dbd8820f..783fd73af0 100644 --- a/testing/adios2/engine/bp/TestBPLargeMetadata.cpp +++ b/testing/adios2/engine/bp/TestBPLargeMetadata.cpp @@ -69,7 +69,7 @@ TEST_F(BPLargeMetadata, BPWrite1D_LargeMetadata) std::vector> varsR32(NVars); std::vector> varsR64(NVars); - for (auto i = 0; i < NVars; ++i) + for (size_t i = 0; i < NVars; ++i) { varsR32[i] = io.DefineVariable("varR32_" + std::to_string(i), shape, @@ -81,14 +81,14 @@ TEST_F(BPLargeMetadata, BPWrite1D_LargeMetadata) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { // Generate test data for each process uniquely SmallTestData currentTestData = generateNewSmallTestData( m_TestData, static_cast(step), mpiRank, mpiSize); bpWriter.BeginStep(); - for (auto i = 0; i < NVars; ++i) + for (size_t i = 0; i < NVars; ++i) { bpWriter.Put(varsR32[i], currentTestData.R32.data()); bpWriter.Put(varsR64[i], currentTestData.R64.data()); diff --git a/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp b/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp index fd5203f700..8e109132ff 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp @@ -348,31 +348,55 @@ TEST_F(BPWriteReadAsStreamTestADIOS2, ADIOS2BPWriteRead1D8) std::string msg = ss.str(); if (var_i8) + { EXPECT_EQ(I8[i], currentTestData.I8[i]) << msg; + } if (var_i16) + { EXPECT_EQ(I16[i], currentTestData.I16[i]) << msg; + } if (var_i32) + { EXPECT_EQ(I32[i], currentTestData.I32[i]) << msg; + } if (var_i64) + { EXPECT_EQ(I64[i], currentTestData.I64[i]) << msg; + } if (var_u8) + { EXPECT_EQ(U8[i], currentTestData.U8[i]) << msg; + } if (var_u16) + { EXPECT_EQ(U16[i], currentTestData.U16[i]) << msg; + } if (var_u32) + { EXPECT_EQ(U32[i], currentTestData.U32[i]) << msg; + } if (var_u64) + { EXPECT_EQ(U64[i], currentTestData.U64[i]) << msg; + } if (var_r32) + { EXPECT_EQ(R32[i], currentTestData.R32[i]) << msg; + } if (var_r64) + { EXPECT_EQ(R64[i], currentTestData.R64[i]) << msg; + } if (var_cr32) + { EXPECT_EQ(CR32[i], currentTestData.CR32[i]) << msg; + } if (var_cr64) + { EXPECT_EQ(CR64[i], currentTestData.CR64[i]) << msg; + } } ++t; } diff --git a/testing/adios2/engine/bp/TestBPWriteReadLocalVariables.cpp b/testing/adios2/engine/bp/TestBPWriteReadLocalVariables.cpp index d00f88cec1..347b850122 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadLocalVariables.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadLocalVariables.cpp @@ -233,9 +233,9 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal1D) std::vector rankLocalValueData; bpReader.Get(var_RanksLocalValue, rankLocalValueData); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { - EXPECT_EQ(rankLocalValueData[r], r); + EXPECT_EQ(rankLocalValueData[r], static_cast(r)); } EXPECT_TRUE(var_RanksLocalValueString); @@ -248,7 +248,7 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal1D) bpReader.Get(var_RanksLocalValueString, rankLocalValueDataString, adios2::Mode::Sync); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { EXPECT_EQ(rankLocalValueDataString[r], std::to_string(r)); } @@ -372,31 +372,55 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal1D) std::string msg = ss.str(); if (var_i8) + { EXPECT_EQ(I8[i], currentTestData.I8[i]) << msg; + } if (var_i16) + { EXPECT_EQ(I16[i], currentTestData.I16[i]) << msg; + } if (var_i32) + { EXPECT_EQ(I32[i], currentTestData.I32[i]) << msg; + } if (var_i64) + { EXPECT_EQ(I64[i], currentTestData.I64[i]) << msg; + } if (var_u8) + { EXPECT_EQ(U8[i], currentTestData.U8[i]) << msg; + } if (var_u16) + { EXPECT_EQ(U16[i], currentTestData.U16[i]) << msg; + } if (var_u32) + { EXPECT_EQ(U32[i], currentTestData.U32[i]) << msg; + } if (var_u64) + { EXPECT_EQ(U64[i], currentTestData.U64[i]) << msg; + } if (var_r32) + { EXPECT_EQ(R32[i], currentTestData.R32[i]) << msg; + } if (var_r64) + { EXPECT_EQ(R64[i], currentTestData.R64[i]) << msg; + } if (var_cr32) + { EXPECT_EQ(CR32[i], currentTestData.CR32[i]) << msg; + } if (var_cr64) + { EXPECT_EQ(CR64[i], currentTestData.CR64[i]) << msg; + } } } // block loop @@ -617,9 +641,9 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal2D2x4) std::vector rankLocalValueData; bpReader.Get(var_RanksLocalValue, rankLocalValueData); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { - EXPECT_EQ(rankLocalValueData[r], r); + EXPECT_EQ(rankLocalValueData[r], static_cast(r)); } EXPECT_TRUE(var_RanksLocalValueString); @@ -631,7 +655,7 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal2D2x4) bpReader.Get(var_RanksLocalValueString, rankLocalValueDataString, adios2::Mode::Sync); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { EXPECT_EQ(rankLocalValueDataString[r], std::to_string(r)); } @@ -703,7 +727,7 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal2D2x4) EXPECT_EQ(var_cr64.Count()[0], Ny); EXPECT_EQ(var_cr64.Count()[1], Nx); - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { var_i8.SetBlockSelection(b); var_i16.SetBlockSelection(b); @@ -763,31 +787,55 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal2D2x4) std::string msg = ss.str(); if (var_i8) + { EXPECT_EQ(I8[i], currentTestData.I8[i]) << msg; + } if (var_i16) + { EXPECT_EQ(I16[i], currentTestData.I16[i]) << msg; + } if (var_i32) + { EXPECT_EQ(I32[i], currentTestData.I32[i]) << msg; + } if (var_i64) + { EXPECT_EQ(I64[i], currentTestData.I64[i]) << msg; + } if (var_u8) + { EXPECT_EQ(U8[i], currentTestData.U8[i]) << msg; + } if (var_u16) + { EXPECT_EQ(U16[i], currentTestData.U16[i]) << msg; + } if (var_u32) + { EXPECT_EQ(U32[i], currentTestData.U32[i]) << msg; + } if (var_u64) + { EXPECT_EQ(U64[i], currentTestData.U64[i]) << msg; + } if (var_r32) + { EXPECT_EQ(R32[i], currentTestData.R32[i]) << msg; + } if (var_r64) + { EXPECT_EQ(R64[i], currentTestData.R64[i]) << msg; + } if (var_cr32) + { EXPECT_EQ(CR32[i], currentTestData.CR32[i]) << msg; + } if (var_cr64) + { EXPECT_EQ(CR64[i], currentTestData.CR64[i]) << msg; + } } } // block loop @@ -1008,9 +1056,9 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal2D4x2) std::vector rankLocalValueData; bpReader.Get(var_RanksLocalValue, rankLocalValueData); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { - EXPECT_EQ(rankLocalValueData[r], r); + EXPECT_EQ(rankLocalValueData[r], static_cast(r)); } EXPECT_TRUE(var_RanksLocalValueString); @@ -1023,7 +1071,7 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal2D4x2) bpReader.Get(var_RanksLocalValueString, rankLocalValueDataString, adios2::Mode::Sync); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { EXPECT_EQ(rankLocalValueDataString[r], std::to_string(r)); } @@ -1095,7 +1143,7 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal2D4x2) EXPECT_EQ(var_cr64.Count()[0], Ny); EXPECT_EQ(var_cr64.Count()[1], Nx); - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { var_i8.SetBlockSelection(b); var_i16.SetBlockSelection(b); @@ -1155,31 +1203,55 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal2D4x2) std::string msg = ss.str(); if (var_i8) + { EXPECT_EQ(I8[i], currentTestData.I8[i]) << msg; + } if (var_i16) + { EXPECT_EQ(I16[i], currentTestData.I16[i]) << msg; + } if (var_i32) + { EXPECT_EQ(I32[i], currentTestData.I32[i]) << msg; + } if (var_i64) + { EXPECT_EQ(I64[i], currentTestData.I64[i]) << msg; + } if (var_u8) + { EXPECT_EQ(U8[i], currentTestData.U8[i]) << msg; + } if (var_u16) + { EXPECT_EQ(U16[i], currentTestData.U16[i]) << msg; + } if (var_u32) + { EXPECT_EQ(U32[i], currentTestData.U32[i]) << msg; + } if (var_u64) + { EXPECT_EQ(U64[i], currentTestData.U64[i]) << msg; + } if (var_r32) + { EXPECT_EQ(R32[i], currentTestData.R32[i]) << msg; + } if (var_r64) + { EXPECT_EQ(R64[i], currentTestData.R64[i]) << msg; + } if (var_cr32) + { EXPECT_EQ(CR32[i], currentTestData.CR32[i]) << msg; + } if (var_cr64) + { EXPECT_EQ(CR64[i], currentTestData.CR64[i]) << msg; + } } } // block loop @@ -1386,7 +1458,7 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal1DAllSteps) var_cr32.SetStepSelection({0, var_cr32.Steps()}); var_cr64.SetStepSelection({0, var_cr64.Steps()}); - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { var_i8.SetBlockSelection(b); var_i16.SetBlockSelection(b); @@ -1434,41 +1506,65 @@ TEST_F(BPWriteReadLocalVariables, ADIOS2BPWriteReadLocal1DAllSteps) std::string msg = ss.str(); if (var_i8) + { ASSERT_EQ(I8[s * Nx + i], currentTestData.I8[i]) << msg; + } if (var_i16) + { ASSERT_EQ(I16[s * Nx + i], currentTestData.I16[i]) << msg; + } if (var_i32) + { EXPECT_EQ(I32[s * Nx + i], currentTestData.I32[i]) << msg; + } if (var_i64) + { EXPECT_EQ(I64[s * Nx + i], currentTestData.I64[i]) << msg; + } if (var_u8) + { EXPECT_EQ(U8[s * Nx + i], currentTestData.U8[i]) << msg; + } if (var_u16) + { EXPECT_EQ(U16[s * Nx + i], currentTestData.U16[i]) << msg; + } if (var_u32) + { EXPECT_EQ(U32[s * Nx + i], currentTestData.U32[i]) << msg; + } if (var_u64) + { EXPECT_EQ(U64[s * Nx + i], currentTestData.U64[i]) << msg; + } if (var_r32) + { EXPECT_EQ(R32[s * Nx + i], currentTestData.R32[i]) << msg; + } if (var_r64) + { EXPECT_EQ(R64[s * Nx + i], currentTestData.R64[i]) << msg; + } if (var_cr32) + { EXPECT_EQ(CR32[s * Nx + i], currentTestData.CR32[i]) << msg; + } if (var_cr64) + { EXPECT_EQ(CR64[s * Nx + i], currentTestData.CR64[i]) << msg; + } } } } diff --git a/testing/adios2/engine/bp/TestBPWriteReadLocalVariablesSel.cpp b/testing/adios2/engine/bp/TestBPWriteReadLocalVariablesSel.cpp index 4d5c262e6b..66061f4df0 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadLocalVariablesSel.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadLocalVariablesSel.cpp @@ -226,15 +226,16 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal1DSel) adios2::ShapeID::GlobalArray); EXPECT_EQ(var_RanksLocalValue.Steps(), NSteps); EXPECT_EQ(var_RanksLocalValue.Shape().size(), 1); - EXPECT_EQ(var_RanksLocalValue.Shape()[0], mpiSize); + EXPECT_EQ(var_RanksLocalValue.Shape()[0], + static_cast(mpiSize)); EXPECT_EQ(var_RanksLocalValue.Min(), 0); EXPECT_EQ(var_RanksLocalValue.Max(), mpiSize - 1); std::vector rankLocalValueData; bpReader.Get(var_RanksLocalValue, rankLocalValueData); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { - EXPECT_EQ(rankLocalValueData[r], r); + EXPECT_EQ(rankLocalValueData[r], static_cast(r)); } EXPECT_TRUE(var_RanksLocalValueString); @@ -247,7 +248,7 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal1DSel) bpReader.Get(var_RanksLocalValueString, rankLocalValueDataString, adios2::Mode::Sync); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { EXPECT_EQ(rankLocalValueDataString[r], std::to_string(r)); } @@ -296,7 +297,7 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal1DSel) EXPECT_EQ(var_cr64.Shape().size(), 0); // loop blocks - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { var_i8.SetBlockSelection(b); var_i16.SetBlockSelection(b); @@ -411,42 +412,66 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal1DSel) std::string msg = ss.str(); if (var_i8) + { EXPECT_EQ(I8[i - s], currentTestData.I8[i]) << msg; + } if (var_i16) - ASSERT_EQ(I16[i - s], currentTestData.I16[i]) + { + EXPECT_EQ(I16[i - s], currentTestData.I16[i]) << msg; + } if (var_i32) + { EXPECT_EQ(I32[i - s], currentTestData.I32[i]) << msg; + } if (var_i64) + { EXPECT_EQ(I64[i - s], currentTestData.I64[i]) << msg; + } if (var_u8) + { EXPECT_EQ(U8[i - s], currentTestData.U8[i]) << msg; + } if (var_u16) + { EXPECT_EQ(U16[i - s], currentTestData.U16[i]) << msg; + } if (var_u32) + { EXPECT_EQ(U32[i - s], currentTestData.U32[i]) << msg; + } if (var_u64) + { EXPECT_EQ(U64[i - s], currentTestData.U64[i]) << msg; + } if (var_r32) + { EXPECT_EQ(R32[i - s], currentTestData.R32[i]) << msg; + } if (var_r64) + { EXPECT_EQ(R64[i - s], currentTestData.R64[i]) << msg; + } if (var_cr32) + { EXPECT_EQ(CR32[i - s], currentTestData.CR32[i]) << msg; + } if (var_cr64) + { EXPECT_EQ(CR64[i - s], currentTestData.CR64[i]) << msg; + } } } // selection loop @@ -669,9 +694,9 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal2D2x4Sel) std::vector rankLocalValueData; bpReader.Get(var_RanksLocalValue, rankLocalValueData); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { - EXPECT_EQ(rankLocalValueData[r], r); + EXPECT_EQ(rankLocalValueData[r], static_cast(r)); } EXPECT_TRUE(var_RanksLocalValueString); @@ -683,7 +708,7 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal2D2x4Sel) bpReader.Get(var_RanksLocalValueString, rankLocalValueDataString, adios2::Mode::Sync); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { EXPECT_EQ(rankLocalValueDataString[r], std::to_string(r)); } @@ -731,7 +756,7 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal2D2x4Sel) EXPECT_EQ(var_cr64.Steps(), NSteps); EXPECT_EQ(var_cr64.Shape().size(), 0); - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { var_i8.SetBlockSelection(b); var_i16.SetBlockSelection(b); @@ -879,64 +904,88 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal2D2x4Sel) const size_t indexBlock = q * Nx + p; if (var_i8) - ASSERT_EQ(I8[indexSel], + { + EXPECT_EQ(I8[indexSel], currentTestData.I8[indexBlock]) << msg; + } if (var_i16) - ASSERT_EQ(I16[indexSel], + { + EXPECT_EQ(I16[indexSel], currentTestData.I16[indexBlock]) << msg; + } if (var_i32) - ASSERT_EQ(I32[indexSel], + { + EXPECT_EQ(I32[indexSel], currentTestData.I32[indexBlock]) << msg; + } if (var_i64) - ASSERT_EQ(I64[indexSel], + { + EXPECT_EQ(I64[indexSel], currentTestData.I64[indexBlock]) << msg; + } if (var_u8) - ASSERT_EQ(U8[indexSel], + { + EXPECT_EQ(U8[indexSel], currentTestData.U8[indexBlock]) << msg; + } if (var_u16) - ASSERT_EQ(U16[indexSel], + { + EXPECT_EQ(U16[indexSel], currentTestData.U16[indexBlock]) << msg; + } if (var_u32) - ASSERT_EQ(U32[indexSel], + { + EXPECT_EQ(U32[indexSel], currentTestData.U32[indexBlock]) << msg; + } if (var_u64) - ASSERT_EQ(U64[indexSel], + { + EXPECT_EQ(U64[indexSel], currentTestData.U64[indexBlock]) << msg; + } if (var_r32) - ASSERT_EQ(R32[indexSel], + { + EXPECT_EQ(R32[indexSel], currentTestData.R32[indexBlock]) << msg; + } if (var_r64) - ASSERT_EQ(R64[indexSel], + { + EXPECT_EQ(R64[indexSel], currentTestData.R64[indexBlock]) << msg; + } if (var_cr32) - ASSERT_EQ(CR32[indexSel], + { + EXPECT_EQ(CR32[indexSel], currentTestData.CR32[indexBlock]) << msg; + } if (var_cr64) - ASSERT_EQ(CR64[indexSel], + { + EXPECT_EQ(CR64[indexSel], currentTestData.CR64[indexBlock]) << msg; + } } } } // i selection loop @@ -1159,9 +1208,9 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal2D4x2Sel) std::vector rankLocalValueData; bpReader.Get(var_RanksLocalValue, rankLocalValueData); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { - EXPECT_EQ(rankLocalValueData[r], r); + EXPECT_EQ(rankLocalValueData[r], static_cast(r)); } EXPECT_TRUE(var_RanksLocalValueString); @@ -1173,7 +1222,7 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal2D4x2Sel) bpReader.Get(var_RanksLocalValueString, rankLocalValueDataString, adios2::Mode::Sync); EXPECT_EQ(rankLocalValueData.size(), mpiSize); - for (int32_t r = 0; r < rankLocalValueData.size(); ++r) + for (size_t r = 0; r < rankLocalValueData.size(); ++r) { EXPECT_EQ(rankLocalValueDataString[r], std::to_string(r)); } @@ -1221,7 +1270,7 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal2D4x2Sel) EXPECT_EQ(var_cr64.Steps(), NSteps); EXPECT_EQ(var_cr64.Shape().size(), 0); - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { var_i8.SetBlockSelection(b); var_i16.SetBlockSelection(b); @@ -1369,64 +1418,88 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal2D4x2Sel) const size_t indexBlock = q * Nx + p; if (var_i8) - ASSERT_EQ(I8[indexSel], + { + EXPECT_EQ(I8[indexSel], currentTestData.I8[indexBlock]) << msg; + } if (var_i16) - ASSERT_EQ(I16[indexSel], + { + EXPECT_EQ(I16[indexSel], currentTestData.I16[indexBlock]) << msg; + } if (var_i32) - ASSERT_EQ(I32[indexSel], + { + EXPECT_EQ(I32[indexSel], currentTestData.I32[indexBlock]) << msg; + } if (var_i64) - ASSERT_EQ(I64[indexSel], + { + EXPECT_EQ(I64[indexSel], currentTestData.I64[indexBlock]) << msg; + } if (var_u8) - ASSERT_EQ(U8[indexSel], + { + EXPECT_EQ(U8[indexSel], currentTestData.U8[indexBlock]) << msg; + } if (var_u16) - ASSERT_EQ(U16[indexSel], + { + EXPECT_EQ(U16[indexSel], currentTestData.U16[indexBlock]) << msg; + } if (var_u32) - ASSERT_EQ(U32[indexSel], + { + EXPECT_EQ(U32[indexSel], currentTestData.U32[indexBlock]) << msg; + } if (var_u64) - ASSERT_EQ(U64[indexSel], + { + EXPECT_EQ(U64[indexSel], currentTestData.U64[indexBlock]) << msg; + } if (var_r32) - ASSERT_EQ(R32[indexSel], + { + EXPECT_EQ(R32[indexSel], currentTestData.R32[indexBlock]) << msg; + } if (var_r64) - ASSERT_EQ(R64[indexSel], + { + EXPECT_EQ(R64[indexSel], currentTestData.R64[indexBlock]) << msg; + } if (var_cr32) - ASSERT_EQ(CR32[indexSel], + { + EXPECT_EQ(CR32[indexSel], currentTestData.CR32[indexBlock]) << msg; + } if (var_cr64) - ASSERT_EQ(CR64[indexSel], + { + EXPECT_EQ(CR64[indexSel], currentTestData.CR64[indexBlock]) << msg; + } } } } // i selection loop @@ -1635,7 +1708,7 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal1DAllStepsSel) var_cr32.SetStepSelection({0, var_cr32.Steps()}); var_cr64.SetStepSelection({0, var_cr64.Steps()}); - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { var_i8.SetBlockSelection(b); var_i16.SetBlockSelection(b); @@ -1701,55 +1774,88 @@ TEST_F(BPWriteReadLocalVariablesSel, BPWriteReadLocal1DAllStepsSel) std::string msg = ss.str(); if (var_i8) - ASSERT_EQ(I8[s * (Nx - i) + j - i], + { + EXPECT_EQ(I8[s * (Nx - i) + j - i], currentTestData.I8[j]) << msg; + } + if (var_i16) - ASSERT_EQ(I16[s * (Nx - i) + j - i], + { + EXPECT_EQ(I16[s * (Nx - i) + j - i], currentTestData.I16[j]) << msg; + } + if (var_i32) + { EXPECT_EQ(I32[s * (Nx - i) + j - i], currentTestData.I32[j]) << msg; + } + if (var_i64) + { EXPECT_EQ(I64[s * (Nx - i) + j - i], currentTestData.I64[j]) << msg; + } if (var_u8) + { EXPECT_EQ(U8[s * (Nx - i) + j - i], currentTestData.U8[j]) << msg; + } + if (var_u16) + { EXPECT_EQ(U16[s * (Nx - i) + j - i], currentTestData.U16[j]) << msg; + } + if (var_u32) + { EXPECT_EQ(U32[s * (Nx - i) + j - i], currentTestData.U32[j]) << msg; + } + if (var_u64) + { EXPECT_EQ(U64[s * (Nx - i) + j - i], currentTestData.U64[j]) << msg; + } + if (var_r32) + { EXPECT_EQ(R32[s * (Nx - i) + j - i], currentTestData.R32[j]) << msg; + } + if (var_r64) + { EXPECT_EQ(R64[s * (Nx - i) + j - i], currentTestData.R64[j]) << msg; + } if (var_cr32) + { EXPECT_EQ(CR32[s * (Nx - i) + j - i], currentTestData.CR32[j]) << msg; + } + if (var_cr64) + { EXPECT_EQ(CR64[s * (Nx - i) + j - i], currentTestData.CR64[j]) << msg; + } } } // steps loop } // selection loop diff --git a/testing/adios2/engine/bp/TestBPWriteReadLocalVariablesSelHighLevel.cpp b/testing/adios2/engine/bp/TestBPWriteReadLocalVariablesSelHighLevel.cpp index d94e447926..a3db2a784a 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadLocalVariablesSelHighLevel.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadLocalVariablesSelHighLevel.cpp @@ -128,7 +128,7 @@ TEST_F(BPWriteReadLocalVariablesSelHighLevel, BPWriteReadLocal1DSel) iStep.read("ranksLocalValueString"); // loop blocks - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { SmallTestData currentTestData = generateNewSmallTestData( m_TestData, static_cast(currentStep), @@ -294,7 +294,7 @@ TEST_F(BPWriteReadLocalVariablesSelHighLevel, BPWriteReadLocal2D2x4Sel) iStep.read("ranksLocalValueString"); // loop blocks - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { SmallTestData currentTestData = generateNewSmallTestData( m_TestData, static_cast(currentStep), @@ -509,7 +509,7 @@ TEST_F(BPWriteReadLocalVariablesSelHighLevel, BPWriteReadLocal1DAllStepsSel) stepCount); // loop blocks - for (size_t b = 0; b < mpiSize; ++b) + for (size_t b = 0; b < static_cast(mpiSize); ++b) { // loop selections for (size_t i = 0; i < Nx; ++i) diff --git a/testing/adios2/engine/bp/TestBPWriteReadMultiblock.cpp b/testing/adios2/engine/bp/TestBPWriteReadMultiblock.cpp index ee04ef15a1..b5069f6942 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadMultiblock.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadMultiblock.cpp @@ -393,13 +393,13 @@ TEST_F(BPWriteReadMultiblockTest, ADIOS2BPWriteReadMultiblock1D8) EXPECT_EQ(cr64Info.size(), 2 * mpiSize); // String - for (size_t i = 0; i < mpiSize; ++i) + for (size_t i = 0; i < static_cast(mpiSize); ++i) { EXPECT_TRUE(iStringInfo[i].IsValue); EXPECT_EQ(iStringInfo[i].Value, "Testing ADIOS2 String type"); } - for (size_t i = 0; i < 2 * mpiSize; ++i) + for (size_t i = 0; i < 2 * static_cast(mpiSize); ++i) { EXPECT_FALSE(i8Info[0].IsValue); EXPECT_EQ(i8Info[i].Count[0], Nx / 2); @@ -1533,7 +1533,7 @@ TEST_F(BPWriteReadMultiblockTest, ADIOS2BPWriteReadMultiblock2D4x2) EXPECT_EQ(cr32Info.size(), 2 * mpiSize); EXPECT_EQ(cr64Info.size(), 2 * mpiSize); - for (size_t i = 0; i < 2 * mpiSize; ++i) + for (size_t i = 0; i < 2 * static_cast(mpiSize); ++i) { EXPECT_FALSE(i8Info[0].IsValue); EXPECT_FALSE(i16Info[0].IsValue); diff --git a/testing/adios2/engine/bp/TestStreamWriteReadHighLevelAPI.cpp b/testing/adios2/engine/bp/TestStreamWriteReadHighLevelAPI.cpp index 742dbb8da9..ad1afc9a2e 100644 --- a/testing/adios2/engine/bp/TestStreamWriteReadHighLevelAPI.cpp +++ b/testing/adios2/engine/bp/TestStreamWriteReadHighLevelAPI.cpp @@ -304,12 +304,12 @@ TEST_F(StreamWriteReadHighLevelAPI, ADIOS2BPWriteRead1D8) auto vattrr64array = iStep.read_attribute("attrr64array"); - for (auto i = 0; i < vattrStrarray.size(); ++i) + for (size_t i = 0; i < vattrStrarray.size(); ++i) { EXPECT_EQ(vattrStrarray[i], m_TestData.S3[i]); } - for (auto i = 0; i < vattri8array.size(); ++i) + for (size_t i = 0; i < vattri8array.size(); ++i) { EXPECT_EQ(vattri8array[i], m_TestData.I8[i]); EXPECT_EQ(vattri16array[i], m_TestData.I16[i]); @@ -380,12 +380,12 @@ TEST_F(StreamWriteReadHighLevelAPI, ADIOS2BPWriteRead1D8) auto vvarattrr64array = iStep.read_attribute("attrr64array", "r64", "::"); - for (auto i = 0; i < vvarattrStrarray.size(); ++i) + for (size_t i = 0; i < vvarattrStrarray.size(); ++i) { EXPECT_EQ(vvarattrStrarray[i], m_TestData.S3[i]); } - for (auto i = 0; i < vvarattri8array.size(); ++i) + for (size_t i = 0; i < vvarattri8array.size(); ++i) { EXPECT_EQ(vvarattri8array[i], m_TestData.I8[i]); EXPECT_EQ(vvarattri16array[i], m_TestData.I16[i]); diff --git a/testing/adios2/engine/bp/operations/TestBPWriteReadBZIP2.cpp b/testing/adios2/engine/bp/operations/TestBPWriteReadBZIP2.cpp index 80c1e055f9..0c63f3954d 100644 --- a/testing/adios2/engine/bp/operations/TestBPWriteReadBZIP2.cpp +++ b/testing/adios2/engine/bp/operations/TestBPWriteReadBZIP2.cpp @@ -214,7 +214,7 @@ void BZIP2Accuracy2D(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -353,7 +353,7 @@ void BZIP2Accuracy3D(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -411,7 +411,7 @@ void BZIP2Accuracy3D(const std::string accuracy) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx * Ny * Nz; ++i) + for (size_t i = 0; i < Nx * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -628,7 +628,7 @@ void BZIP2Accuracy2DSel(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -767,7 +767,7 @@ void BZIP2Accuracy3DSel(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -825,7 +825,7 @@ void BZIP2Accuracy3DSel(const std::string accuracy) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx / 2 * Ny * Nz; ++i) + for (size_t i = 0; i < Nx / 2 * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; diff --git a/testing/adios2/engine/bp/operations/TestBPWriteReadBlosc.cpp b/testing/adios2/engine/bp/operations/TestBPWriteReadBlosc.cpp index 9ba83a7ba2..f3d82b2287 100644 --- a/testing/adios2/engine/bp/operations/TestBPWriteReadBlosc.cpp +++ b/testing/adios2/engine/bp/operations/TestBPWriteReadBlosc.cpp @@ -214,7 +214,7 @@ void BloscAccuracy2D(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -353,7 +353,7 @@ void BloscAccuracy3D(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -411,7 +411,7 @@ void BloscAccuracy3D(const std::string accuracy) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx * Ny * Nz; ++i) + for (size_t i = 0; i < Nx * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -628,7 +628,7 @@ void BloscAccuracy2DSel(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -767,7 +767,7 @@ void BloscAccuracy3DSel(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -825,7 +825,7 @@ void BloscAccuracy3DSel(const std::string accuracy) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx / 2 * Ny * Nz; ++i) + for (size_t i = 0; i < Nx / 2 * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; diff --git a/testing/adios2/engine/bp/operations/TestBPWriteReadMGARD.cpp b/testing/adios2/engine/bp/operations/TestBPWriteReadMGARD.cpp index 243fd8eae2..9c06b184be 100644 --- a/testing/adios2/engine/bp/operations/TestBPWriteReadMGARD.cpp +++ b/testing/adios2/engine/bp/operations/TestBPWriteReadMGARD.cpp @@ -73,7 +73,7 @@ void MGARDAccuracy1D(const std::string tolerance) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); // bpWriter.Put("r32", r32s.data()); @@ -213,7 +213,7 @@ void MGARDAccuracy2D(const std::string tolerance) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); // bpWriter.Put("r32", r32s.data()); @@ -355,7 +355,7 @@ void MGARDAccuracy3D(const std::string tolerance) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); // bpWriter.Put("r32", r32s.data()); @@ -628,7 +628,7 @@ void MGARDAccuracy2DSel(const std::string tolerance) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); // bpWriter.Put("r32", r32s.data()); @@ -762,7 +762,7 @@ void MGARDAccuracy3DSel(const std::string tolerance) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); // bpWriter.Put("r32", r32s.data()); @@ -817,7 +817,7 @@ void MGARDAccuracy3DSel(const std::string tolerance) double maxDiff = 0; - for (auto i = 0; i < Nx / 2 * Ny * Nz; ++i) + for (size_t i = 0; i < Nx / 2 * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -909,7 +909,7 @@ void MGARDAccuracy2DSmallSel(const std::string tolerance) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); // bpWriter.Put("r32", r32s.data()); diff --git a/testing/adios2/engine/bp/operations/TestBPWriteReadPNG.cpp b/testing/adios2/engine/bp/operations/TestBPWriteReadPNG.cpp index 154a29886b..8b2a022dec 100644 --- a/testing/adios2/engine/bp/operations/TestBPWriteReadPNG.cpp +++ b/testing/adios2/engine/bp/operations/TestBPWriteReadPNG.cpp @@ -45,7 +45,7 @@ void PNGAccuracy2D(const std::string compressionLevel) std::vector r32s(height * width); // range 0 to 100*50 - for (auto i = 0; i < height * width; ++i) + for (size_t i = 0; i < height * width; ++i) { i8s[i] = Random100(); i16s[i] = Random100(); @@ -146,7 +146,7 @@ void PNGAccuracy2D(const std::string compressionLevel) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("i8", i8s.data()); @@ -354,7 +354,7 @@ void PNGAccuracy2DSel(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); diff --git a/testing/adios2/engine/bp/operations/TestBPWriteReadSZ.cpp b/testing/adios2/engine/bp/operations/TestBPWriteReadSZ.cpp index a23b65b1cb..e8a7be557b 100644 --- a/testing/adios2/engine/bp/operations/TestBPWriteReadSZ.cpp +++ b/testing/adios2/engine/bp/operations/TestBPWriteReadSZ.cpp @@ -218,7 +218,7 @@ void SZAccuracy2D(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -361,7 +361,7 @@ void SZAccuracy3D(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -419,7 +419,7 @@ void SZAccuracy3D(const std::string accuracy) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx * Ny * Nz; ++i) + for (size_t i = 0; i < Nx * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -644,7 +644,7 @@ void SZAccuracy2DSel(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -787,7 +787,7 @@ void SZAccuracy3DSel(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -845,7 +845,7 @@ void SZAccuracy3DSel(const std::string accuracy) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx / 2 * Ny * Nz; ++i) + for (size_t i = 0; i < Nx / 2 * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -934,7 +934,7 @@ void SZAccuracy2DSmallSel(const std::string accuracy) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); diff --git a/testing/adios2/engine/bp/operations/TestBPWriteReadZfp.cpp b/testing/adios2/engine/bp/operations/TestBPWriteReadZfp.cpp index 39a83c2190..774b8fe032 100644 --- a/testing/adios2/engine/bp/operations/TestBPWriteReadZfp.cpp +++ b/testing/adios2/engine/bp/operations/TestBPWriteReadZfp.cpp @@ -205,7 +205,7 @@ void ZFPRate2D(const std::string rate) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -338,7 +338,7 @@ void ZFPRate3D(const std::string rate) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -397,7 +397,7 @@ void ZFPRate3D(const std::string rate) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx * Ny * Nz; ++i) + for (size_t i = 0; i < Nx * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -472,7 +472,7 @@ void ZFPRate1DSel(const std::string rate) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -604,7 +604,7 @@ void ZFPRate2DSel(const std::string rate) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -735,7 +735,7 @@ void ZFPRate3DSel(const std::string rate) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -789,7 +789,7 @@ void ZFPRate3DSel(const std::string rate) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx / 2 * Ny * Nz; ++i) + for (size_t i = 0; i < Nx / 2 * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -871,7 +871,7 @@ void ZFPRate2DSmallSel(const std::string rate) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); diff --git a/testing/adios2/engine/bp/operations/TestBPWriteReadZfpConfig.cpp b/testing/adios2/engine/bp/operations/TestBPWriteReadZfpConfig.cpp index bca8e24618..35eefd56ce 100644 --- a/testing/adios2/engine/bp/operations/TestBPWriteReadZfpConfig.cpp +++ b/testing/adios2/engine/bp/operations/TestBPWriteReadZfpConfig.cpp @@ -184,7 +184,7 @@ void ZfpRate2D(const std::string configFile) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -301,7 +301,7 @@ void ZfpRate3D(const std::string configFile) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -349,7 +349,7 @@ void ZfpRate3D(const std::string configFile) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx * Ny * Nz; ++i) + for (size_t i = 0; i < Nx * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -418,7 +418,7 @@ void ZfpRate1DSel(const std::string configFile) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -540,7 +540,7 @@ void ZfpRate2DSel(const std::string configFile) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -661,7 +661,7 @@ void ZfpRate3DSel(const std::string configFile) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); @@ -710,7 +710,7 @@ void ZfpRate3DSel(const std::string configFile) bpReader.Get(var_r64, decompressedR64s); bpReader.EndStep(); - for (auto i = 0; i < Nx / 2 * Ny * Nz; ++i) + for (size_t i = 0; i < Nx / 2 * Ny * Nz; ++i) { std::stringstream ss; ss << "t=" << t << " i=" << i << " rank=" << mpiRank; @@ -787,7 +787,7 @@ void ZfpRate2DSmallSel(const std::string configFile) adios2::Engine bpWriter = io.Open(fname, adios2::Mode::Write); - for (auto step = 0; step < NSteps; ++step) + for (size_t step = 0; step < NSteps; ++step) { bpWriter.BeginStep(); bpWriter.Put("r32", r32s.data()); diff --git a/testing/adios2/engine/skeleton/TestSkeletonReader.cpp b/testing/adios2/engine/skeleton/TestSkeletonReader.cpp index dd40c7bb0c..99cdbb9362 100644 --- a/testing/adios2/engine/skeleton/TestSkeletonReader.cpp +++ b/testing/adios2/engine/skeleton/TestSkeletonReader.cpp @@ -31,17 +31,17 @@ static void printDataStep(const float *data, const size_t start, myfile << " step row columns " << start << "..." << start + count - 1 << std::endl; myfile << " "; - for (int j = 0; j < count; j++) + for (size_t j = 0; j < count; j++) { myfile << std::setw(9) << start + j; } myfile << std::endl; myfile << "------------------------------------------------------------" "--\n"; - for (int i = 0; i < count; i++) + for (size_t i = 0; i < count; i++) { myfile << std::setw(5) << step << std::setw(5) << start + i; - for (int j = 0; j < count; j++) + for (size_t j = 0; j < count; j++) { myfile << std::setw(9) << std::setprecision(4) << data[i * count + j]; diff --git a/testing/adios2/engine/staging-common/TestCommonReadLocal.cpp b/testing/adios2/engine/staging-common/TestCommonReadLocal.cpp index 4d7278dc36..55f315b828 100644 --- a/testing/adios2/engine/staging-common/TestCommonReadLocal.cpp +++ b/testing/adios2/engine/staging-common/TestCommonReadLocal.cpp @@ -77,7 +77,7 @@ TEST_F(CommonReadTest, ADIOS2CommonRead1D8) // std::cout << "Writer size is " << writerSize << std::endl; int rankToRead = mpiRank; - if (writerSize < mpiSize) + if (writerSize < static_cast(mpiSize)) { rankToRead = mpiRank % writerSize; } diff --git a/testing/adios2/engine/staging-common/TestStagingMPMD.cpp b/testing/adios2/engine/staging-common/TestStagingMPMD.cpp index 90b093f02b..f7ad2acfe9 100644 --- a/testing/adios2/engine/staging-common/TestStagingMPMD.cpp +++ b/testing/adios2/engine/staging-common/TestStagingMPMD.cpp @@ -108,7 +108,7 @@ class TestStagingMPMD : public ::testing::TestWithParam adios2::Engine writer = io.Open(streamName, adios2::Mode::Write, comm); - for (size_t step = 0; step < steps; ++step) + for (int step = 0; step < steps; ++step) { size_t idx = 0; for (size_t x = 0; x < ndx; ++x) diff --git a/testing/adios2/interface/TestADIOSInterface.cpp b/testing/adios2/interface/TestADIOSInterface.cpp index e5c13d9009..6a072114e4 100644 --- a/testing/adios2/interface/TestADIOSInterface.cpp +++ b/testing/adios2/interface/TestADIOSInterface.cpp @@ -169,7 +169,7 @@ struct MyData explicit MyData(const std::vector &selections) : m_Blocks(selections.size()), m_Selections(selections) { - for (int b = 0; b < NBlocks(); ++b) + for (int b = 0; b < static_cast(NBlocks()); ++b) { m_Blocks[b].resize(selections[b].second[0]); } @@ -257,7 +257,7 @@ class ADIOS2_CXX11_API_MultiBlock : public ADIOS2_CXX11_API_IO MyData myData(m_Selections); - for (int b = 0; b < myData.NBlocks(); ++b) + for (int b = 0; b < static_cast(myData.NBlocks()); ++b) { PopulateBlock(myData, b); @@ -309,7 +309,7 @@ TYPED_TEST(ADIOS2_CXX11_API_MultiBlock, Put) auto var = this->m_Io.template DefineVariable("var", this->m_Shape); MyData myData(this->m_Selections); - for (int b = 0; b < myData.NBlocks(); ++b) + for (int b = 0; b < static_cast(myData.NBlocks()); ++b) { this->PopulateBlock(myData, b); var.SetSelection(myData.Selection(b)); @@ -368,17 +368,17 @@ TYPED_TEST(ADIOS2_CXX11_API_MultiBlock, PutZeroCopy) } #else std::vector::Span> spans; - for (int b = 0; b < myData.NBlocks(); ++b) + for (int b = 0; b < static_cast(myData.NBlocks()); ++b) { var.SetSelection(myData.Selection(b)); spans.push_back(writer.Put(var)); } - for (int b = 0; b < myData.NBlocks(); ++b) + for (int b = 0; b < static_cast(myData.NBlocks()); ++b) { myData.Place(b, spans[b].data()); } #endif - for (int b = 0; b < myData.NBlocks(); ++b) + for (int b = 0; b < static_cast(myData.NBlocks()); ++b) { this->PopulateBlock(myData, b); } @@ -398,7 +398,7 @@ TYPED_TEST(ADIOS2_CXX11_API_MultiBlock, PutZeroCopyMixed) MyDataView myData(this->m_Selections); std::unique_ptr lastBlock; - for (int b = 0; b < myData.NBlocks(); ++b) + for (int b = 0; b < static_cast(myData.NBlocks()); ++b) { if (b < 1) { @@ -413,7 +413,7 @@ TYPED_TEST(ADIOS2_CXX11_API_MultiBlock, PutZeroCopyMixed) } } - for (int b = 0; b < myData.NBlocks(); ++b) + for (int b = 0; b < static_cast(myData.NBlocks()); ++b) { this->PopulateBlock(myData, b); } diff --git a/testing/utils/changingshape/TestUtilsChangingShape.cpp b/testing/utils/changingshape/TestUtilsChangingShape.cpp index 0dd67200ae..96113c304f 100644 --- a/testing/utils/changingshape/TestUtilsChangingShape.cpp +++ b/testing/utils/changingshape/TestUtilsChangingShape.cpp @@ -74,7 +74,7 @@ int main(int argc, char **argv) } for (size_t i = 0; i < nsteps; i++) { - for (int j = 0; j < buf.size(); j++) + for (size_t j = 0; j < buf.size(); j++) { buf[j] = i + rank / 10.0 + static_cast(j) / 100.0; }