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

Fix bp5 aggregation #2793

Merged
merged 2 commits into from
Jul 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/adios2/engine/bp5/BP5Engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class BP5Engine
MACRO(NodeLocal, Bool, bool, false) \
MACRO(verbose, Int, int, 0) \
MACRO(CollectiveMetadata, Bool, bool, true) \
MACRO(NumAggregators, UInt, unsigned int, 999999) \
MACRO(NumAggregators, UInt, unsigned int, 0) \
MACRO(NumSubFiles, UInt, unsigned int, 999999) \
MACRO(FileSystemPageSize, UInt, unsigned int, 4096) \
MACRO(AggregationType, AggregationType, int, \
Expand Down
10 changes: 8 additions & 2 deletions source/adios2/toolkit/aggregator/mpi/MPIShmChain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ MPIShmChain::ShmDataBuffer *MPIShmChain::LockProducerBuffer()

void MPIShmChain::UnlockProducerBuffer()
{
m_Shm->lockSegment.lock();
++m_Shm->NumBuffersFull;
m_Shm->lockSegment.unlock();

if (m_Shm->producerBuffer == LastBufferUsed::A)
{
m_Shm->lockA.unlock();
Expand All @@ -316,7 +320,6 @@ void MPIShmChain::UnlockProducerBuffer()
{
m_Shm->lockB.unlock();
}
++m_Shm->NumBuffersFull;
}

MPIShmChain::ShmDataBuffer *MPIShmChain::LockConsumerBuffer()
Expand Down Expand Up @@ -365,6 +368,10 @@ MPIShmChain::ShmDataBuffer *MPIShmChain::LockConsumerBuffer()

void MPIShmChain::UnlockConsumerBuffer()
{
m_Shm->lockSegment.lock();
--m_Shm->NumBuffersFull;
m_Shm->lockSegment.unlock();

if (m_Shm->consumerBuffer == LastBufferUsed::A)
{
m_Shm->lockA.unlock();
Expand All @@ -373,7 +380,6 @@ void MPIShmChain::UnlockConsumerBuffer()
{
m_Shm->lockB.unlock();
}
--m_Shm->NumBuffersFull;
}

} // end namespace aggregator
Expand Down