Add support for explicit guiderate for injection groups

With this commit the guiderate logic used for the production groups is also used for injectors
This allows for setting guiderates explicit at different group levels
Only RATE, NETV and VOID guiderate type is suppored.
This commit is contained in:
Tor Harald Sandve
2021-03-10 14:26:04 +01:00
parent 8adea8c68a
commit f4ac7f555b
8 changed files with 518 additions and 459 deletions

View File

@@ -260,16 +260,24 @@ public:
(*this)(d);
};
auto keyHandle = [&](auto& d)
{
if constexpr (is_pair<Key>::value)
pair(d);
else
(*this)(d);
};
if (m_op == Operation::PACKSIZE) {
m_packSize += Mpi::packSize(data.size(), m_comm);
for (auto& it : data) {
m_packSize += Mpi::packSize(it.first, m_comm);
keyHandle(it.first);
handle(it.second);
}
} else if (m_op == Operation::PACK) {
Mpi::pack(data.size(), m_buffer, m_position, m_comm);
for (auto& it : data) {
Mpi::pack(it.first, m_buffer, m_position, m_comm);
keyHandle(it.first);
handle(it.second);
}
} else if (m_op == Operation::UNPACK) {
@@ -277,7 +285,7 @@ public:
Mpi::unpack(size, m_buffer, m_position, m_comm);
for (size_t i = 0; i < size; ++i) {
Key key;
Mpi::unpack(key, m_buffer, m_position, m_comm);
keyHandle(key);
Data entry;
handle(entry);
data.insert(std::make_pair(key, entry));