Skip to content

Commit

Permalink
Merge pull request #1756 from williamfgc/bp4_async_open
Browse files Browse the repository at this point in the history
Adding async open to BP4 engine
  • Loading branch information
williamfgc authored Sep 18, 2019
2 parents 04083b7 + ec3c414 commit b2c97e1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
12 changes: 6 additions & 6 deletions source/adios2/engine/bp3/BP3Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,17 @@ void BP3Writer::InitTransports()
if (m_BP3Serializer.m_Aggregator.m_IsConsumer)
{
if (m_BP3Serializer.m_Parameters.AsyncTasks)
{
m_FileDataManager.OpenFiles(bpSubStreamNames, m_OpenMode,
m_IO.m_TransportsParameters,
m_BP3Serializer.m_Profiler.m_IsActive);
}
else
{
m_FutureOpenFiles = m_FileDataManager.OpenFilesAsync(
bpSubStreamNames, m_OpenMode, m_IO.m_TransportsParameters,
m_BP3Serializer.m_Profiler.m_IsActive);
}
else
{
m_FileDataManager.OpenFiles(bpSubStreamNames, m_OpenMode,
m_IO.m_TransportsParameters,
m_BP3Serializer.m_Profiler.m_IsActive);
}
}
}

Expand Down
21 changes: 16 additions & 5 deletions source/adios2/engine/bp4/BP4Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,18 @@ void BP4Writer::InitTransports()

if (m_BP4Serializer.m_Aggregator.m_IsConsumer)
{
// std::cout << "rank " << m_BP4Serializer.m_RankMPI << ": " <<
// bpSubStreamNames[0] << std::endl;
m_FileDataManager.OpenFiles(bpSubStreamNames, m_OpenMode,
m_IO.m_TransportsParameters,
m_BP4Serializer.m_Profiler.m_IsActive);
if (m_BP4Serializer.m_Parameters.AsyncTasks)
{
m_FutureOpenFiles = m_FileDataManager.OpenFilesAsync(
bpSubStreamNames, m_OpenMode, m_IO.m_TransportsParameters,
m_BP4Serializer.m_Profiler.m_IsActive);
}
else
{
m_FileDataManager.OpenFiles(bpSubStreamNames, m_OpenMode,
m_IO.m_TransportsParameters,
m_BP4Serializer.m_Profiler.m_IsActive);
}
}

if (m_BP4Serializer.m_RankMPI == 0)
Expand Down Expand Up @@ -281,6 +288,10 @@ void BP4Writer::InitBPBuffer()

if (m_BP4Serializer.m_Aggregator.m_IsConsumer)
{
if (m_FutureOpenFiles.valid())
{
m_FutureOpenFiles.get();
}
m_BP4Serializer.m_PreDataFileLength =
m_FileDataManager.GetFileSize(0);
}
Expand Down

0 comments on commit b2c97e1

Please sign in to comment.