Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bp4 doclose fix #1568

Merged
merged 3 commits into from
Jun 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions source/adios2/engine/bp4/BP4Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,13 @@ void BP4Writer::DoClose(const int transportIndex)
{
PerformPuts();

DoFlush(false, transportIndex);
// DoFlush(false, transportIndex);

if (m_BP4Serializer.m_CollectiveMetadata &&
m_FileDataManager.AllTransportsClosed())
{
WriteCollectiveMetadataFile(false);
}
// if (m_BP4Serializer.m_CollectiveMetadata &&
// m_FileDataManager.AllTransportsClosed())
// {
// WriteCollectiveMetadataFile(false);
// }
}

DoFlush(true, transportIndex);
Expand Down Expand Up @@ -485,12 +485,14 @@ void BP4Writer::WriteCollectiveMetadataFile(const bool isFinal)
{

TAU_SCOPED_TIMER("BP4Writer::WriteCollectiveMetadataFile");
if (m_BP4Serializer.m_RankMPI == 0)

if (isFinal && m_BP4Serializer.m_MetadataSet.DataPGCount == 0)
{
if (isFinal && m_BP4Serializer.m_MetadataSet.metadataFileLength > 0)
// If data pg count is zero, it means all metadata
// has already been written, don't need to write it again.

if (m_BP4Serializer.m_RankMPI == 0)
{
// If run with BeginStep() and EndStep(), when close, metadata of
// last step has already been written, don't need to write it again.
// But the flag in the header of metadata index table needs to be
// modified to indicate current run is over.
BufferSTL metadataIndex;
Expand All @@ -505,8 +507,8 @@ void BP4Writer::WriteCollectiveMetadataFile(const bool isFinal)
m_FileMetadataIndexManager.WriteFileAt(
metadataIndex.m_Buffer.data(), metadataIndex.m_Position, 56, 0);
m_FileMetadataIndexManager.FlushFiles();
return;
}
return;
}
m_BP4Serializer.AggregateCollectiveMetadata(
m_MPIComm, m_BP4Serializer.m_Metadata, true);
Expand Down Expand Up @@ -543,7 +545,7 @@ void BP4Writer::WriteCollectiveMetadataFile(const bool isFinal)
metadataIndex.m_Position = 0;

uint64_t currentStep;
if (isFinal && m_BP4Serializer.m_MetadataSet.metadataFileLength == 0)
if (isFinal && m_BP4Serializer.m_MetadataSet.DataPGCount > 0)
{
// Not run with BeginStep() and EndStep().
// Only one step of metadata is generated at close.
Expand Down