Unverified Commit aa0af807 authored by Wang, Ruonan's avatar Wang, Ruonan Committed by GitHub
Browse files

Merge pull request #2027 from JasonRuonanWang/ssc-common-staging

bring some common-staging tests back to SSC
parents b1f1ac08 10cb84e8
......@@ -197,13 +197,14 @@ void SscReader::SyncMpiPattern()
m_MaxFilenameLength, m_RendezvousAppCount,
CommAsMPI(m_Comm));
m_MpiAllWritersGroup = m_MpiHandshake.GetAllWritersGroup(m_Name);
std::vector<int> allStreamRanks;
std::vector<int> allWriterRanks;
for (const auto &app : m_MpiHandshake.GetWriterMap(m_Name))
{
for (int rank : app.second)
{
allWriterRanks.push_back(rank);
allStreamRanks.push_back(rank);
}
}
......@@ -217,6 +218,10 @@ void SscReader::SyncMpiPattern()
}
MPI_Group worldGroup;
MPI_Comm_group(MPI_COMM_WORLD, &worldGroup);
MPI_Group_incl(worldGroup, allWriterRanks.size(), allWriterRanks.data(),
&m_MpiAllWritersGroup);
MPI_Comm_group(MPI_COMM_WORLD, &worldGroup);
std::sort(allStreamRanks.begin(), allStreamRanks.end());
MPI_Group allWorkersGroup;
......
......@@ -127,21 +127,18 @@ SscReader::BlocksInfoCommon(const Variable<T> &variable,
{
TAU_SCOPED_TIMER_FUNC();
std::vector<typename Variable<T>::Info> ret;
for (const auto &r : m_AllReceivingWriterRanks)
for (const auto &r : m_GlobalWritePattern)
{
for (auto &v : m_GlobalWritePattern[r.first])
for (auto &v : r)
{
if (v.name != variable.m_Name)
{
continue;
}
if (v.overlapCount.empty())
{
continue;
}
typename Variable<T>::Info b;
b.Start = v.overlapStart;
b.Count = v.overlapCount;
b.Start = v.start;
b.Count = v.count;
b.Shape = v.shape;
b.IsValue = false;
if (v.shape.size() == 1)
......
......@@ -196,9 +196,8 @@ void SscWriter::SyncMpiPattern()
m_MaxFilenameLength, m_RendezvousAppCount,
CommAsMPI(m_Comm));
m_MpiAllReadersGroup = m_MpiHandshake.GetAllReadersGroup(m_Name);
std::vector<int> allStreamRanks;
std::vector<int> allReaderRanks;
for (const auto &app : m_MpiHandshake.GetWriterMap(m_Name))
{
......@@ -213,10 +212,15 @@ void SscWriter::SyncMpiPattern()
for (int rank : app.second)
{
allStreamRanks.push_back(rank);
allReaderRanks.push_back(rank);
}
}
MPI_Group worldGroup;
MPI_Group allReadersGroup;
MPI_Comm_group(MPI_COMM_WORLD, &worldGroup);
MPI_Group_incl(worldGroup, allReaderRanks.size(), allReaderRanks.data(),
&m_MpiAllReadersGroup);
MPI_Comm_group(MPI_COMM_WORLD, &worldGroup);
std::sort(allStreamRanks.begin(), allStreamRanks.end());
MPI_Group allWorkersGroup;
......
......@@ -256,46 +256,6 @@ MpiHandshake::GetReaderMap(const std::string &filename)
return m_ReadersMap[filename];
}
MPI_Group MpiHandshake::GetAllReadersGroup(const std::string &filename)
{
std::vector<int> allReaderRanks;
for (const auto &app : GetReaderMap(filename))
{
for (int rank : app.second)
{
allReaderRanks.push_back(rank);
}
}
MPI_Group worldGroup;
MPI_Group allReadersGroup;
MPI_Comm_group(MPI_COMM_WORLD, &worldGroup);
MPI_Group_incl(worldGroup, allReaderRanks.size(), allReaderRanks.data(),
&allReadersGroup);
return allReadersGroup;
}
MPI_Group MpiHandshake::GetAllWritersGroup(const std::string &filename)
{
std::vector<int> allWriterRanks;
for (const auto &app : GetWriterMap(filename))
{
for (int rank : app.second)
{
allWriterRanks.push_back(rank);
}
}
MPI_Group worldGroup;
MPI_Group allWritersGroup;
MPI_Comm_group(MPI_COMM_WORLD, &worldGroup);
MPI_Group_incl(worldGroup, allWriterRanks.size(), allWriterRanks.data(),
&allWritersGroup);
return allWritersGroup;
}
void MpiHandshake::PrintMaps(const int printRank, const std::string &filename)
{
if (m_WorldRank == printRank)
......
......@@ -95,24 +95,6 @@ public:
static const std::map<int, std::vector<int>> &
GetReaderMap(const std::string &filename);
/**
* Get the MPI group for all readers in the stream filename
*
* @param filename: name of the staging stream
*
* @return the MPI group
*/
static MPI_Group GetAllReadersGroup(const std::string &filename);
/**
* Get the MPI group for all writers in the stream filename
*
* @param filename: name of the staging stream
*
* @return the MPI group
*/
static MPI_Group GetAllWritersGroup(const std::string &filename);
private:
static void Test();
static bool Check(const std::string &filename);
......
......@@ -235,6 +235,13 @@ if(ADIOS2_HAVE_MPI)
endforeach()
endif()
if(ADIOS2_HAVE_SSC)
set (SSC_TESTS "1x1;TimeoutOnOpen;1x1.Attrs;2x1;1x2;2x1ZeroDataVar;2x1ZeroDataR64")
foreach(test ${SSC_TESTS})
add_common_test(${test} SSC)
endforeach()
endif()
#
# Setup tests for BP engines
#
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment