Skip to content

Commit

Permalink
Merge pull request #1010 from chuckatkins/misc-msvc-fixes
Browse files Browse the repository at this point in the history
Address a number of MSVC build issues
  • Loading branch information
Chuck Atkins committed Nov 28, 2018
2 parents 1c3338b + d3d2061 commit d8f3529
Show file tree
Hide file tree
Showing 20 changed files with 50 additions and 40 deletions.
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestBPFileMx1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ add_test(NAME HeatTransfer.BPFile.Dump.Mx1
-DARGS=-d
-DINPUT_FILE=HeatTransfer.BPFile.Read.Mx1.bp
-DOUTPUT_FILE=HeatTransfer.BPFile.Dump.Mx1.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.BPFile.Dump.Mx1
PROPERTY DEPENDS HeatTransfer.BPFile.Read.Mx1
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestBPFileMx1_zfp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ add_test(NAME HeatTransfer.BPFile.Dump.Mx1_zfp
-DARGS=-d
-DINPUT_FILE=HeatTransfer.BPFile.Read.Mx1_zfp.bp
-DOUTPUT_FILE=HeatTransfer.BPFile.Dump.Mx1_zfp.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.BPFile.Dump.Mx1_zfp
PROPERTY DEPENDS HeatTransfer.BPFile.Read.Mx1_zfp
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestBPFileMxM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ add_test(NAME HeatTransfer.BPFile.Dump.MxM
-DARGS=-d
-DINPUT_FILE=HeatTransfer.BPFile.Read.MxM.bp
-DOUTPUT_FILE=HeatTransfer.BPFile.Dump.MxM.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.BPFile.Dump.MxM
PROPERTY DEPENDS HeatTransfer.BPFile.Read.MxM
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestBPFileMxN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ add_test(NAME HeatTransfer.BPFile.Dump.MxN
-DARGS=-d
-DINPUT_FILE=HeatTransfer.BPFile.Read.MxN.bp
-DOUTPUT_FILE=HeatTransfer.BPFile.Dump.MxN.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.BPFile.Dump.MxN
PROPERTY DEPENDS HeatTransfer.BPFile.Read.MxN
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestInsituMPIMx1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.InsituMPI.Dump.Mx1
-DARGS=-d
-DINPUT_FILE=HeatTransfer.InsituMPI.Read.Mx1.bp
-DOUTPUT_FILE=HeatTransfer.InsituMPI.Dump.Mx1.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.InsituMPI.Dump.Mx1
PROPERTY DEPENDS HeatTransfer.InsituMPI.Read.Mx1
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestInsituMPIMxM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.InsituMPI.Dump.MxM
-DARGS=-d
-DINPUT_FILE=HeatTransfer.InsituMPI.Read.MxM.bp
-DOUTPUT_FILE=HeatTransfer.InsituMPI.Dump.MxM.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.InsituMPI.Dump.MxM
PROPERTY DEPENDS HeatTransfer.InsituMPI.Read.MxM
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestInsituMPIMxN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.InsituMPI.Dump.MxN
-DARGS=-d
-DINPUT_FILE=HeatTransfer.InsituMPI.Read.MxN.bp
-DOUTPUT_FILE=HeatTransfer.InsituMPI.Dump.MxN.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.InsituMPI.Dump.MxN
PROPERTY DEPENDS HeatTransfer.InsituMPI.Read.MxN
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestSSTBPMx1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.SST.BP.Dump.Mx1
-DARGS=-d
-DINPUT_FILE=HeatTransfer.SST.BP.Read.Mx1.bp
-DOUTPUT_FILE=HeatTransfer.SST.BP.Dump.Mx1.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.SST.BP.Dump.Mx1
PROPERTY DEPENDS HeatTransfer.SST.BP.Read.Mx1
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestSSTBPMxM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.SST.BP.Dump.MxM
-DARGS=-d
-DINPUT_FILE=HeatTransfer.SST.BP.Read.MxM.bp
-DOUTPUT_FILE=HeatTransfer.SST.BP.Dump.MxM.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.SST.BP.Dump.MxM
PROPERTY DEPENDS HeatTransfer.SST.BP.Read.MxM
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestSSTBPMxN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.SST.BP.Dump.MxN
-DARGS=-d
-DINPUT_FILE=HeatTransfer.SST.BP.Read.MxN.bp
-DOUTPUT_FILE=HeatTransfer.SST.BP.Dump.MxN.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.SST.BP.Dump.MxN
PROPERTY DEPENDS HeatTransfer.SST.BP.Read.MxN
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestSSTFFSMx1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.SST.FFS.Dump.Mx1
-DARGS=-d
-DINPUT_FILE=HeatTransfer.SST.FFS.Read.Mx1.bp
-DOUTPUT_FILE=HeatTransfer.SST.FFS.Dump.Mx1.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.SST.FFS.Dump.Mx1
PROPERTY DEPENDS HeatTransfer.SST.FFS.Read.Mx1
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestSSTFFSMxM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.SST.FFS.Dump.MxM
-DARGS=-d
-DINPUT_FILE=HeatTransfer.SST.FFS.Read.MxM.bp
-DOUTPUT_FILE=HeatTransfer.SST.FFS.Dump.MxM.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.SST.FFS.Dump.MxM
PROPERTY DEPENDS HeatTransfer.SST.FFS.Read.MxM
Expand Down
2 changes: 1 addition & 1 deletion examples/heatTransfer/TestSSTFFSMxN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_test(NAME HeatTransfer.SST.FFS.Dump.MxN
-DARGS=-d
-DINPUT_FILE=HeatTransfer.SST.FFS.Read.MxN.bp
-DOUTPUT_FILE=HeatTransfer.SST.FFS.Dump.MxN.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST HeatTransfer.SST.FFS.Dump.MxN
PROPERTY DEPENDS HeatTransfer.SST.FFS.Read.MxN
Expand Down
13 changes: 6 additions & 7 deletions source/adios2/engine/insitumpi/InSituMPISchedules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ void SerializeLocalReadSchedule(std::vector<char> &buffer,
const std::string varName,
const LocalReadSchedule lrs) noexcept
{
const int nameLen = varName.size();
const int nameLen = static_cast<int>(varName.size());
helper::InsertToBuffer(buffer, &nameLen, 1);
helper::InsertToBuffer(buffer, varName.data(), nameLen);
const int nSubFileInfos = lrs.size();
const int nSubFileInfos = static_cast<int>(lrs.size());
helper::InsertToBuffer(buffer, &nSubFileInfos, 1);
for (const auto &blockInfo : lrs)
{
Expand All @@ -153,7 +153,7 @@ void SerializeSubFileInfo(std::vector<char> &buffer,

void SerializeBox(std::vector<char> &buffer, const Box<Dims> box) noexcept
{
const int nDims = box.first.size();
const int nDims = static_cast<int>(box.first.size());
helper::InsertToBuffer(buffer, &nDims, 1);
helper::InsertToBuffer(buffer, box.first.data(), nDims);
helper::InsertToBuffer(buffer, box.second.data(), nDims);
Expand Down Expand Up @@ -212,17 +212,16 @@ DeserializeReadSchedule(const std::vector<char> &buffer) noexcept
for (int i = 0; i < nVars; i++)
{
int nameLen = helper::ReadValue<int>(buffer, pos);
char name[nameLen + 1];
helper::CopyFromBuffer(buffer, pos, name, nameLen);
name[nameLen] = '\0';
std::vector<char> name(nameLen + 1, '\0');
helper::CopyFromBuffer(buffer, pos, name.data(), nameLen);
int nSubFileInfos = helper::ReadValue<int>(buffer, pos);
std::vector<helper::SubFileInfo> sfis;
sfis.reserve(nSubFileInfos);
for (int j = 0; j < nSubFileInfos; j++)
{
sfis.push_back(DeserializeSubFileInfo(buffer, pos));
}
map[name] = sfis;
map[name.data()] = sfis;
}
return map;
}
Expand Down
2 changes: 1 addition & 1 deletion source/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ configure_file(
@ONLY
)
file(GENERATE
OUTPUT ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake
OUTPUT ${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake
INPUT ${PROJECT_BINARY_DIR}/bpls.cmake.gen
)

Expand Down
3 changes: 3 additions & 0 deletions source/utils/adios_iotest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/iotest-config

add_executable(adios_iotest settings.cpp decomp.cpp processConfig.cpp ioGroup.cpp stream.cpp adiosStream.cpp adios_iotest.cpp)
target_link_libraries(adios_iotest adios2 MPI::MPI_C)
if(WIN32)
target_link_libraries(adios_iotest getopt)
endif()

if(ADIOS2_HAVE_HDF5)
if(HDF5_C_INCLUDE_DIRS)
Expand Down
20 changes: 12 additions & 8 deletions source/utils/adios_iotest/processConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,15 @@ VariableInfo processArray(std::vector<std::string> &words,
{
if (settings.isStrongScaling)
{
ov.shape.push_back(stringToSizet(
words, 4 + i, "dimension " + std::to_string(i + 1)));
ov.shape.push_back(
stringToSizet(words, static_cast<int>(4 + i),
"dimension " + std::to_string(i + 1)));
}
else
{
ov.count.push_back(stringToSizet(
words, 4 + i, "dimension " + std::to_string(i + 1)));
ov.count.push_back(
stringToSizet(words, static_cast<int>(4 + i),
"dimension " + std::to_string(i + 1)));
}
}

Expand Down Expand Up @@ -379,7 +381,7 @@ void globalChecks(const Config &cfg, const Settings &settings)
{
const auto f = cfg.condMap.at(cmd->conditionalStream);
}
catch (std::exception &e)
catch (std::exception &)
{
throw std::invalid_argument(
"Name used in conditional is not a read stream: '" +
Expand All @@ -393,7 +395,7 @@ void globalChecks(const Config &cfg, const Settings &settings)
{
const auto f = cfg.condMap.at(it.first);
}
catch (std::exception &e)
catch (std::exception &)
{
throw std::invalid_argument(
"Name used in step over command is not a read stream: '" +
Expand Down Expand Up @@ -718,10 +720,12 @@ Config processConfig(const Settings &settings, size_t *currentConfigLineNumber)
// process config line and get global array info
VariableInfo ov = processArray(words, settings);
ov.datasize = ov.elemsize;
size_t pos[ov.ndim]; // Position of rank in N-dim space
std::vector<size_t> pos(
ov.ndim); // Position of rank in N-dim space

// Calculate rank's position in N-dim space
decompRowMajor(ov.ndim, settings.myRank, ov.decomp.data(), pos);
decompRowMajor(ov.ndim, settings.myRank, ov.decomp.data(),
pos.data());

if (settings.isStrongScaling)
{
Expand Down
4 changes: 4 additions & 0 deletions testing/adios2/performance/manyvars/manyVars.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
#include <stdlib.h>
#include <string.h>

#ifdef WIN32
#define strncasecmp _strnicmp
#endif

#ifdef DMALLOC
#include "dmalloc.h"
#endif
Expand Down
14 changes: 7 additions & 7 deletions testing/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ add_test(NAME Utils.Bpls.h.Dump
-DARGS=-h
-DINPUT_FILE=TestUtilsCWriter.bp
-DOUTPUT_FILE=TestUtilsCWriter.bplsh.result.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST Utils.Bpls.h.Dump
PROPERTY DEPENDS Utils.C.Writer
Expand All @@ -50,7 +50,7 @@ add_test(NAME Utils.Bpls.la.Screen
COMMAND ${CMAKE_COMMAND}
-DARGS=-la
-DINPUT_FILE=TestUtilsCWriter.bp
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST Utils.Bpls.la.Screen
PROPERTY DEPENDS Utils.C.Writer
Expand All @@ -63,7 +63,7 @@ add_test(NAME Utils.Bpls.la.Dump
-DARGS=-la
-DINPUT_FILE=TestUtilsCWriter.bp
-DOUTPUT_FILE=TestUtilsCWriter.bplsla.result.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST Utils.Bpls.la.Dump
PROPERTY DEPENDS Utils.C.Writer
Expand All @@ -90,7 +90,7 @@ add_test(NAME Utils.Bpls.Al.Dump
-DARGS=-Al
-DINPUT_FILE=TestUtilsCWriter.bp
-DOUTPUT_FILE=TestUtilsCWriter.bplsAl.result.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST Utils.Bpls.Al.Dump
PROPERTY DEPENDS Utils.C.Writer
Expand All @@ -116,7 +116,7 @@ add_test(NAME Utils.Bpls.ldDav.Dump
-DARGS='-ldDav'
-DINPUT_FILE=TestUtilsCWriter.bp
-DOUTPUT_FILE=TestUtilsCWriter.bplsldDav.result.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST Utils.Bpls.ldDav.Dump
PROPERTY DEPENDS Utils.C.Writer
Expand Down Expand Up @@ -144,7 +144,7 @@ add_test(NAME Utils.Bpls.ldDavvv.Dump
-DARGS='-ldDavvv'
-DINPUT_FILE=TestUtilsCWriter.bp
-DOUTPUT_FILE=TestUtilsCWriter.bplsldDavvv.result.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
)
set_property(TEST Utils.Bpls.ldDavvv.Dump
PROPERTY DEPENDS Utils.C.Writer
Expand Down Expand Up @@ -172,7 +172,7 @@ endif(ADIOS2_HAVE_MPI)
# -DARGS=-ld varI16 -n 10
# -DINPUT_FILE=TestUtilsCWriter.bp
# -DOUTPUT_FILE=TestUtilsCWriter.bplsldvarI16.result.txt
# -P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
# -P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
#)
#set_property(TEST Utils.Bpls.la.Dump
# PROPERTY DEPENDS Utils.C.Writer
Expand Down
8 changes: 4 additions & 4 deletions testing/utils/iotest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ add_test(NAME Utils.IOTest.Pipe2.BP.DumpWrite
-DARGS=-laD
-DINPUT_FILE=pipe2_write.bp
-DOUTPUT_FILE=IOTest.Pipe2.BP.Write.bpls.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
WORKING_DIRECTORY ${WORKDIR}
)

Expand Down Expand Up @@ -63,7 +63,7 @@ add_test(NAME Utils.IOTest.Pipe2.BP.DumpRead
-DARGS=-laD
-DINPUT_FILE=pipe2_read.bp
-DOUTPUT_FILE=IOTest.Pipe2.BP.Read.bpls.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
WORKING_DIRECTORY ${WORKDIR}
)

Expand Down Expand Up @@ -103,7 +103,7 @@ if (${HAVE_2_PROCS})
-DARGS=-laD
-DINPUT_FILE=pipe2_read.bp
-DOUTPUT_FILE=IOTest.Pipe2.InSituMPI.bpls.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
WORKING_DIRECTORY ${WORKDIR}
)

Expand Down Expand Up @@ -140,7 +140,7 @@ if (${HAVE_2_PROCS})
-DARGS=-laD
-DINPUT_FILE=pipe2_read.bp
-DOUTPUT_FILE=IOTest.Pipe2.SST.bpls.txt
-P "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bpls.cmake"
-P "${PROJECT_BINARY_DIR}/$<CONFIG>/bpls.cmake"
WORKING_DIRECTORY ${WORKDIR}
)

Expand Down

0 comments on commit d8f3529

Please sign in to comment.