Skip to content

Commit

Permalink
Merge pull request #2793 from pnorbert/fix-bp5-aggregation
Browse files Browse the repository at this point in the history
Fix bp5 aggregation
  • Loading branch information
pnorbert authored Jul 20, 2021
2 parents 0d7d045 + 072e469 commit 01ec6c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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

0 comments on commit 01ec6c3

Please sign in to comment.