Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Podhorszki, Norbert
ADIOS2
Commits
843a788a
Commit
843a788a
authored
Mar 08, 2020
by
Ruonan Wang
Browse files
moved stream communicator creation back to SSC engine to pass windows build
parent
67a6946f
Changes
5
Hide whitespace changes
Inline
Side-by-side
source/adios2/CMakeLists.txt
View file @
843a788a
...
...
@@ -162,7 +162,6 @@ endif()
if
(
ADIOS2_HAVE_SSC
)
target_sources
(
adios2 PRIVATE
helper/adiosMpiHandshake.h helper/adiosMpiHandshake.cpp
engine/ssc/SscReader.cpp
engine/ssc/SscReader.tcc
engine/ssc/SscWriter.cpp
...
...
@@ -232,6 +231,7 @@ if(ADIOS2_HAVE_MPI)
target_sources
(
adios2 PRIVATE
core/IOMPI.cpp
helper/adiosCommMPI.h helper/adiosCommMPI.cpp
helper/adiosMpiHandshake.h helper/adiosMpiHandshake.cpp
engine/insitumpi/InSituMPIWriter.cpp engine/insitumpi/InSituMPIWriter.tcc
engine/insitumpi/InSituMPIReader.cpp engine/insitumpi/InSituMPIReader.tcc
engine/insitumpi/InSituMPIFunctions.cpp engine/insitumpi/InSituMPISchedules.cpp
...
...
source/adios2/engine/ssc/SscReader.cpp
View file @
843a788a
...
...
@@ -198,7 +198,31 @@ void SscReader::SyncMpiPattern()
CommAsMPI
(
m_Comm
));
m_MpiAllWritersGroup
=
m_MpiHandshake
.
GetAllWritersGroup
(
m_Name
);
m_StreamComm
=
m_MpiHandshake
.
GetStreamComm
(
m_Name
);
std
::
vector
<
int
>
allStreamRanks
;
for
(
const
auto
&
app
:
m_MpiHandshake
.
GetWriterMap
(
m_Name
))
{
for
(
int
rank
:
app
.
second
)
{
allStreamRanks
.
push_back
(
rank
);
}
}
for
(
const
auto
&
app
:
m_MpiHandshake
.
GetReaderMap
(
m_Name
))
{
for
(
int
rank
:
app
.
second
)
{
allStreamRanks
.
push_back
(
rank
);
}
}
MPI_Group
worldGroup
;
MPI_Comm_group
(
MPI_COMM_WORLD
,
&
worldGroup
);
std
::
sort
(
allStreamRanks
.
begin
(),
allStreamRanks
.
end
());
MPI_Group
allWorkersGroup
;
MPI_Group_incl
(
worldGroup
,
allStreamRanks
.
size
(),
allStreamRanks
.
data
(),
&
allWorkersGroup
);
MPI_Comm_create_group
(
MPI_COMM_WORLD
,
allWorkersGroup
,
0
,
&
m_StreamComm
);
}
void
SscReader
::
SyncWritePattern
()
...
...
source/adios2/engine/ssc/SscWriter.cpp
View file @
843a788a
...
...
@@ -198,7 +198,31 @@ void SscWriter::SyncMpiPattern()
m_MpiAllReadersGroup
=
m_MpiHandshake
.
GetAllReadersGroup
(
m_Name
);
m_StreamComm
=
m_MpiHandshake
.
GetStreamComm
(
m_Name
);
std
::
vector
<
int
>
allStreamRanks
;
for
(
const
auto
&
app
:
m_MpiHandshake
.
GetWriterMap
(
m_Name
))
{
for
(
int
rank
:
app
.
second
)
{
allStreamRanks
.
push_back
(
rank
);
}
}
for
(
const
auto
&
app
:
m_MpiHandshake
.
GetReaderMap
(
m_Name
))
{
for
(
int
rank
:
app
.
second
)
{
allStreamRanks
.
push_back
(
rank
);
}
}
MPI_Group
worldGroup
;
MPI_Comm_group
(
MPI_COMM_WORLD
,
&
worldGroup
);
std
::
sort
(
allStreamRanks
.
begin
(),
allStreamRanks
.
end
());
MPI_Group
allWorkersGroup
;
MPI_Group_incl
(
worldGroup
,
allStreamRanks
.
size
(),
allStreamRanks
.
data
(),
&
allWorkersGroup
);
MPI_Comm_create_group
(
MPI_COMM_WORLD
,
allWorkersGroup
,
0
,
&
m_StreamComm
);
}
void
SscWriter
::
SyncWritePattern
()
...
...
source/adios2/helper/adiosMpiHandshake.cpp
View file @
843a788a
...
...
@@ -254,37 +254,6 @@ MpiHandshake::GetReaderMap(const std::string &filename)
return
m_ReadersMap
[
filename
];
}
MPI_Comm
MpiHandshake
::
GetStreamComm
(
const
std
::
string
&
filename
)
{
std
::
vector
<
int
>
allStreamRanks
;
for
(
const
auto
&
app
:
GetWriterMap
(
filename
))
{
for
(
int
rank
:
app
.
second
)
{
allStreamRanks
.
push_back
(
rank
);
}
}
for
(
const
auto
&
app
:
GetReaderMap
(
filename
))
{
for
(
int
rank
:
app
.
second
)
{
allStreamRanks
.
push_back
(
rank
);
}
}
MPI_Group
worldGroup
;
MPI_Comm_group
(
MPI_COMM_WORLD
,
&
worldGroup
);
std
::
sort
(
allStreamRanks
.
begin
(),
allStreamRanks
.
end
());
MPI_Group
allWorkersGroup
;
MPI_Group_incl
(
worldGroup
,
allStreamRanks
.
size
(),
allStreamRanks
.
data
(),
&
allWorkersGroup
);
MPI_Comm
streamComm
;
MPI_Comm_create_group
(
MPI_COMM_WORLD
,
allWorkersGroup
,
0
,
&
streamComm
);
return
streamComm
;
}
MPI_Group
MpiHandshake
::
GetAllReadersGroup
(
const
std
::
string
&
filename
)
{
std
::
vector
<
int
>
allReaderRanks
;
...
...
source/adios2/helper/adiosMpiHandshake.h
View file @
843a788a
...
...
@@ -95,16 +95,6 @@ public:
static
const
std
::
map
<
int
,
std
::
vector
<
int
>>
&
GetReaderMap
(
const
std
::
string
&
filename
);
/**
* Get the MPI communicator for the stream, containing all writer ranks and
* reader ranks that work on the stream filename
*
* @param filename: name of the staging stream
*
* @return the communicator for the stream
*/
static
MPI_Comm
GetStreamComm
(
const
std
::
string
&
filename
);
/**
* Get the MPI group for all readers in the stream filename
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment