added: eclmpiserializer::append

this broadcasts from the root rank, and then appends
the results to existing data on the others
This commit is contained in:
Arne Morten Kvarving 2022-09-06 15:36:30 +02:00
parent 42384c8052
commit ee0d482b32

View File

@ -386,6 +386,25 @@ public:
}
}
//! \brief Serialize and broadcast on root process, de-serialize and append on
//! others.
//!
//! \tparam T Type of class to broadcast
//! \param data Class to broadcast
template<class T>
void append(T& data)
{
if (m_comm.size() == 1)
return;
T tmp;
T& bcast = m_comm.rank() == 0 ? data : tmp;
broadcast(bcast);
if (m_comm.rank() != 0)
data.append(tmp);
}
//! \brief Returns current position in buffer.
size_t position() const
{