From 1868242b011e8ce07ec403af0b5df30fd214ff09 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 12 Aug 2020 01:59:15 -0400 Subject: [PATCH 1/6] enable msvc for ssc, dataman and table --- cmake/DetectOptions.cmake | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/cmake/DetectOptions.cmake b/cmake/DetectOptions.cmake index 91425da305..d192efa964 100644 --- a/cmake/DetectOptions.cmake +++ b/cmake/DetectOptions.cmake @@ -166,35 +166,29 @@ if(ZeroMQ_FOUND) endif() # DataMan -if(NOT MSVC) - if(ZeroMQ_FOUND) - if(ADIOS2_USE_DataMan STREQUAL AUTO) - set(ADIOS2_HAVE_DataMan TRUE) - elseif(ADIOS2_USE_DataMan) - set(ADIOS2_HAVE_DataMan TRUE) - endif() +if(ZeroMQ_FOUND) + if(ADIOS2_USE_DataMan STREQUAL AUTO) + set(ADIOS2_HAVE_DataMan TRUE) + elseif(ADIOS2_USE_DataMan) + set(ADIOS2_HAVE_DataMan TRUE) endif() endif() # SSC -if(NOT MSVC) - if(ADIOS2_HAVE_MPI) - if(ADIOS2_USE_SSC STREQUAL AUTO) - set(ADIOS2_HAVE_SSC TRUE) - elseif(ADIOS2_USE_SSC) - set(ADIOS2_HAVE_SSC TRUE) - endif() +if(ADIOS2_HAVE_MPI) + if(ADIOS2_USE_SSC STREQUAL AUTO) + set(ADIOS2_HAVE_SSC TRUE) + elseif(ADIOS2_USE_SSC) + set(ADIOS2_HAVE_SSC TRUE) endif() endif() # Table -if(NOT MSVC) - if(ZeroMQ_FOUND) - if(ADIOS2_USE_Table STREQUAL AUTO) - set(ADIOS2_HAVE_Table TRUE) - elseif(ADIOS2_USE_Table) - set(ADIOS2_HAVE_Table TRUE) - endif() +if(ZeroMQ_FOUND) + if(ADIOS2_USE_Table STREQUAL AUTO) + set(ADIOS2_HAVE_Table TRUE) + elseif(ADIOS2_USE_Table) + set(ADIOS2_HAVE_Table TRUE) endif() endif() From 44b22610a3ead078f36d19b20643faa4e617438d Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 12 Aug 2020 02:52:25 -0400 Subject: [PATCH 2/6] fixed compiler warnings --- source/adios2/engine/ssc/SscReader.cpp | 28 ++++++++++++++------------ source/adios2/engine/ssc/SscWriter.cpp | 17 +++++++++------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/source/adios2/engine/ssc/SscReader.cpp b/source/adios2/engine/ssc/SscReader.cpp index 9bb5cf5469..3dc753806b 100644 --- a/source/adios2/engine/ssc/SscReader.cpp +++ b/source/adios2/engine/ssc/SscReader.cpp @@ -190,9 +190,9 @@ void SscReader::EndStep() for (const auto &i : m_AllReceivingWriterRanks) { m_MpiRequests.emplace_back(); - MPI_Irecv(m_Buffer.data() + i.second.first, i.second.second, - MPI_CHAR, i.first, 0, m_StreamComm, - &m_MpiRequests.back()); + MPI_Irecv(m_Buffer.data() + i.second.first, + static_cast(i.second.second), MPI_CHAR, i.first, + 0, m_StreamComm, &m_MpiRequests.back()); } } else if (m_MpiMode == "onesidedfencepush") @@ -208,9 +208,9 @@ void SscReader::EndStep() MPI_Win_fence(0, m_MpiWin); for (const auto &i : m_AllReceivingWriterRanks) { - MPI_Get(m_Buffer.data() + i.second.first, i.second.second, - MPI_CHAR, i.first, 0, i.second.second, MPI_CHAR, - m_MpiWin); + MPI_Get(m_Buffer.data() + i.second.first, + static_cast(i.second.second), MPI_CHAR, i.first, 0, + static_cast(i.second.second), MPI_CHAR, m_MpiWin); } } else if (m_MpiMode == "onesidedpostpull") @@ -218,9 +218,9 @@ void SscReader::EndStep() MPI_Win_start(m_MpiAllWritersGroup, 0, m_MpiWin); for (const auto &i : m_AllReceivingWriterRanks) { - MPI_Get(m_Buffer.data() + i.second.first, i.second.second, - MPI_CHAR, i.first, 0, i.second.second, MPI_CHAR, - m_MpiWin); + MPI_Get(m_Buffer.data() + i.second.first, + static_cast(i.second.second), MPI_CHAR, i.first, 0, + static_cast(i.second.second), MPI_CHAR, m_MpiWin); } } } @@ -267,8 +267,9 @@ bool SscReader::SyncWritePattern() m_StreamComm); std::vector localVec(maxLocalSize, '\0'); std::vector globalVec(maxLocalSize * m_StreamSize); - MPI_Allgather(localVec.data(), maxLocalSize, MPI_CHAR, globalVec.data(), - maxLocalSize, MPI_CHAR, m_StreamComm); + MPI_Allgather(localVec.data(), static_cast(maxLocalSize), MPI_CHAR, + globalVec.data(), static_cast(maxLocalSize), MPI_CHAR, + m_StreamComm); ssc::LocalJsonToGlobalJson(globalVec, maxLocalSize, m_StreamSize, m_GlobalWritePatternJson); @@ -416,8 +417,9 @@ void SscReader::SyncReadPattern() std::vector localVec(maxLocalSize, '\0'); std::memcpy(localVec.data(), localStr.c_str(), localStr.size()); std::vector globalVec(maxLocalSize * m_StreamSize); - MPI_Allgather(localVec.data(), maxLocalSize, MPI_CHAR, globalVec.data(), - maxLocalSize, MPI_CHAR, m_StreamComm); + MPI_Allgather(localVec.data(), static_cast(maxLocalSize), MPI_CHAR, + globalVec.data(), static_cast(maxLocalSize), MPI_CHAR, + m_StreamComm); // deserialize global metadata Json nlohmann::json globalJson; diff --git a/source/adios2/engine/ssc/SscWriter.cpp b/source/adios2/engine/ssc/SscWriter.cpp index 88a131533f..7a36bc3a25 100644 --- a/source/adios2/engine/ssc/SscWriter.cpp +++ b/source/adios2/engine/ssc/SscWriter.cpp @@ -109,7 +109,8 @@ void SscWriter::EndStep() for (const auto &i : m_AllSendingReaderRanks) { m_MpiRequests.emplace_back(); - MPI_Isend(m_Buffer.data(), m_Buffer.size(), MPI_CHAR, + MPI_Isend(m_Buffer.data(), + static_cast(m_Buffer.size()), MPI_CHAR, i.first, 0, m_StreamComm, &m_MpiRequests.back()); } } @@ -118,8 +119,9 @@ void SscWriter::EndStep() MPI_Win_fence(0, m_MpiWin); for (const auto &i : m_AllSendingReaderRanks) { - MPI_Put(m_Buffer.data(), m_Buffer.size(), MPI_CHAR, i.first, - i.second.first, m_Buffer.size(), MPI_CHAR, + MPI_Put(m_Buffer.data(), static_cast(m_Buffer.size()), + MPI_CHAR, i.first, i.second.first, + static_cast(m_Buffer.size()), MPI_CHAR, m_MpiWin); } } @@ -128,8 +130,9 @@ void SscWriter::EndStep() MPI_Win_start(m_MpiAllReadersGroup, 0, m_MpiWin); for (const auto &i : m_AllSendingReaderRanks) { - MPI_Put(m_Buffer.data(), m_Buffer.size(), MPI_CHAR, i.first, - i.second.first, m_Buffer.size(), MPI_CHAR, + MPI_Put(m_Buffer.data(), static_cast(m_Buffer.size()), + MPI_CHAR, i.first, i.second.first, + static_cast(m_Buffer.size()), MPI_CHAR, m_MpiWin); } } @@ -160,8 +163,8 @@ void SscWriter::MpiWait() { if (m_MpiMode == "twosided") { - MPI_Status statuses[m_MpiRequests.size()]; - MPI_Waitall(m_MpiRequests.size(), m_MpiRequests.data(), statuses); + MPI_Waitall(m_MpiRequests.size(), m_MpiRequests.data(), + MPI_STATUSES_IGNORE); m_MpiRequests.clear(); } else if (m_MpiMode == "onesidedfencepush") From 6e511167d969f4f63a0748b4b5d075d647a0b8b5 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 12 Aug 2020 03:12:27 -0400 Subject: [PATCH 3/6] fixed more compiler warnings --- source/adios2/engine/ssc/SscWriter.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/adios2/engine/ssc/SscWriter.cpp b/source/adios2/engine/ssc/SscWriter.cpp index 7a36bc3a25..63a3555dcf 100644 --- a/source/adios2/engine/ssc/SscWriter.cpp +++ b/source/adios2/engine/ssc/SscWriter.cpp @@ -163,8 +163,8 @@ void SscWriter::MpiWait() { if (m_MpiMode == "twosided") { - MPI_Waitall(m_MpiRequests.size(), m_MpiRequests.data(), - MPI_STATUSES_IGNORE); + MPI_Waitall(static_cast(m_MpiRequests.size()), + m_MpiRequests.data(), MPI_STATUSES_IGNORE); m_MpiRequests.clear(); } else if (m_MpiMode == "onesidedfencepush") @@ -233,8 +233,9 @@ void SscWriter::SyncWritePattern(bool finalStep) std::vector localVec(maxLocalSize, '\0'); std::memcpy(localVec.data(), localStr.data(), localStr.size()); std::vector globalVec(maxLocalSize * m_StreamSize, '\0'); - MPI_Allgather(localVec.data(), maxLocalSize, MPI_CHAR, globalVec.data(), - maxLocalSize, MPI_CHAR, m_StreamComm); + MPI_Allgather(localVec.data(), static_cast(maxLocalSize), MPI_CHAR, + globalVec.data(), static_cast(maxLocalSize), MPI_CHAR, + m_StreamComm); // deserialize global metadata Json nlohmann::json globalJson; @@ -261,8 +262,9 @@ void SscWriter::SyncReadPattern() m_StreamComm); std::vector localVec(maxLocalSize, '\0'); std::vector globalVec(maxLocalSize * m_StreamSize); - MPI_Allgather(localVec.data(), maxLocalSize, MPI_CHAR, globalVec.data(), - maxLocalSize, MPI_CHAR, m_StreamComm); + MPI_Allgather(localVec.data(), static_cast(maxLocalSize), MPI_CHAR, + globalVec.data(), static_cast(maxLocalSize), MPI_CHAR, + m_StreamComm); // deserialize global metadata Json nlohmann::json globalJson; @@ -324,7 +326,7 @@ void SscWriter::CalculatePosition(ssc::BlockVecVec &writerVecVec, auto currentReaderOverlapWriterRanks = CalculateOverlap(writerVecVec, readerRankMap); size_t bufferPosition = 0; - for (size_t rank = 0; rank < writerVecVec.size(); ++rank) + for (int rank = 0; rank < writerVecVec.size(); ++rank) { bool hasOverlap = false; for (const auto r : currentReaderOverlapWriterRanks) From b2a6a55e6b25848b50f97e2b63ebc7adb9946592 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 12 Aug 2020 04:06:42 -0400 Subject: [PATCH 4/6] fixed more compiler warnings --- source/adios2/engine/ssc/SscHelper.cpp | 9 +++++---- source/adios2/engine/ssc/SscReader.tcc | 9 ++++----- source/adios2/engine/ssc/SscWriter.cpp | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/source/adios2/engine/ssc/SscHelper.cpp b/source/adios2/engine/ssc/SscHelper.cpp index 926d1236d3..5596843b40 100644 --- a/source/adios2/engine/ssc/SscHelper.cpp +++ b/source/adios2/engine/ssc/SscHelper.cpp @@ -348,7 +348,8 @@ void MPI_Gatherv64(const void *sendbuf, uint64_t sendcount, } } - MPI_Waitall(requests.size(), requests.data(), MPI_STATUSES_IGNORE); + MPI_Waitall(static_cast(requests.size()), requests.data(), + MPI_STATUSES_IGNORE); } void MPI_Gatherv64OneSidedPull(const void *sendbuf, uint64_t sendcount, @@ -447,9 +448,9 @@ void MPI_Gatherv64OneSidedPush(const void *sendbuf, uint64_t sendcount, { MPI_Put(reinterpret_cast(sendbuf) + (sendcount - sendcountvar) * sendTypeSize, - sendcountvar, sendtype, root, - displs[mpiRank] + sendcount - sendcountvar, sendcountvar, - sendtype, win); + static_cast(sendcountvar), sendtype, root, + displs[mpiRank] + sendcount - sendcountvar, + static_cast(sendcountvar), sendtype, win); sendcountvar = 0; } } diff --git a/source/adios2/engine/ssc/SscReader.tcc b/source/adios2/engine/ssc/SscReader.tcc index 0009128117..a0ee25ddd0 100644 --- a/source/adios2/engine/ssc/SscReader.tcc +++ b/source/adios2/engine/ssc/SscReader.tcc @@ -67,17 +67,16 @@ void SscReader::GetDeferredCommon(Variable &variable, for (const auto &i : m_AllReceivingWriterRanks) { MPI_Win_lock(MPI_LOCK_SHARED, i.first, 0, m_MpiWin); - MPI_Get(m_Buffer.data() + i.second.first, i.second.second, - MPI_CHAR, i.first, 0, i.second.second, MPI_CHAR, - m_MpiWin); + MPI_Get(m_Buffer.data() + i.second.first, + static_cast(i.second.second), MPI_CHAR, i.first, 0, + static_cast(i.second.second), MPI_CHAR, m_MpiWin); MPI_Win_unlock(i.first, m_MpiWin); } } for (const auto &i : m_AllReceivingWriterRanks) { - const auto &v = m_GlobalWritePattern[i.first]; - for (const auto &b : v) + for (const auto &b : m_GlobalWritePattern[i.first]) { if (b.name == variable.m_Name) { diff --git a/source/adios2/engine/ssc/SscWriter.cpp b/source/adios2/engine/ssc/SscWriter.cpp index 63a3555dcf..b28ae974ad 100644 --- a/source/adios2/engine/ssc/SscWriter.cpp +++ b/source/adios2/engine/ssc/SscWriter.cpp @@ -387,8 +387,7 @@ void SscWriter::DoClose(const int transportIndex) MPI_Isend(m_Buffer.data(), 1, MPI_CHAR, i.first, 0, m_StreamComm, &requests.back()); } - MPI_Status statuses[requests.size()]; - MPI_Waitall(requests.size(), requests.data(), statuses); + MPI_Waitall(requests.size(), requests.data(), MPI_STATUS_IGNORE); } else if (m_MpiMode == "onesidedfencepush") { From 95c9243c8fba9578d4d7279e48b026c3ab2acc52 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 12 Aug 2020 09:54:44 -0400 Subject: [PATCH 5/6] added missing header --- source/adios2/engine/ssc/SscReader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/adios2/engine/ssc/SscReader.cpp b/source/adios2/engine/ssc/SscReader.cpp index 3dc753806b..72b13155db 100644 --- a/source/adios2/engine/ssc/SscReader.cpp +++ b/source/adios2/engine/ssc/SscReader.cpp @@ -13,6 +13,7 @@ #include "adios2/helper/adiosCommMPI.h" #include "adios2/helper/adiosFunctions.h" #include "adios2/helper/adiosJSONcomplex.h" +#include "adios2/helper/adiosMpiHandshake.h" #include "nlohmann/json.hpp" namespace adios2 @@ -77,8 +78,8 @@ StepStatus SscReader::BeginStep(const StepMode stepMode, { if (m_MpiMode == "twosided") { - MPI_Status statuses[m_MpiRequests.size()]; - MPI_Waitall(m_MpiRequests.size(), m_MpiRequests.data(), statuses); + MPI_Waitall(m_MpiRequests.size(), m_MpiRequests.data(), + MPI_STATUS_IGNORE); m_MpiRequests.clear(); } else if (m_MpiMode == "onesidedfencepush") From d25a69108c441ff84c2b6d05aaa771bc3b913f76 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 12 Aug 2020 10:46:49 -0400 Subject: [PATCH 6/6] disable mscv for ssc --- cmake/DetectOptions.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/DetectOptions.cmake b/cmake/DetectOptions.cmake index d192efa964..7dbaeedf58 100644 --- a/cmake/DetectOptions.cmake +++ b/cmake/DetectOptions.cmake @@ -175,11 +175,13 @@ if(ZeroMQ_FOUND) endif() # SSC -if(ADIOS2_HAVE_MPI) - if(ADIOS2_USE_SSC STREQUAL AUTO) - set(ADIOS2_HAVE_SSC TRUE) - elseif(ADIOS2_USE_SSC) - set(ADIOS2_HAVE_SSC TRUE) +if(NOT MSVC) + if(ADIOS2_HAVE_MPI) + if(ADIOS2_USE_SSC STREQUAL AUTO) + set(ADIOS2_HAVE_SSC TRUE) + elseif(ADIOS2_USE_SSC) + set(ADIOS2_HAVE_SSC TRUE) + endif() endif() endif()