Skip to content

Commit

Permalink
#410: pending send: more improvements for serialized msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Dec 18, 2019
1 parent 7bab11f commit eea3771
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/vt/messaging/pending_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ void PendingSend::produceConsumeMsg(PendingTermEnum op) {
auto const is_epoch = envelopeIsEpochType(msg_->env);
auto const is_term = envelopeIsTerm(msg_->env);
if (is_epoch and not is_term) {
auto ep = envelopeGetEpoch(msg_->env);
bool const is_produce = op == PendingTermEnum::Produce;
auto const ep = is_produce ? envelopeGetEpoch(msg_->env) : epoch_produced_;
if (ep != no_epoch and ep != term::any_epoch_sentinel) {
if (op == PendingTermEnum::Produce) {
if (is_produce) {
theTerm()->produce(ep,1);
epoch_produced_ = ep;
} else {
theTerm()->consume(ep,1);
}
Expand Down
4 changes: 3 additions & 1 deletion src/vt/messaging/pending_send.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ struct PendingSend final {
PendingSend(PendingSend&& in)
: msg_(std::move(in.msg_)),
msg_size_(std::move(in.msg_size_)),
send_action_(std::move(in.send_action_))
send_action_(std::move(in.send_action_)),
epoch_produced_(std::move(in.epoch_produced_))
{
in.msg_ = nullptr;
in.send_action_ = nullptr;
Expand All @@ -105,6 +106,7 @@ struct PendingSend final {
MsgVirtualPtr<BaseMsgType> msg_ = nullptr;
ByteType msg_size_ = no_byte;
SendActionType send_action_ = nullptr;
EpochType epoch_produced_ = no_epoch;
};

}} /* end namespace vt::messaging */
Expand Down

0 comments on commit eea3771

Please sign in to comment.