XBT_DEBUG("Receive already pushed");
other_comm->state_ = simgrid::kernel::activity::State::READY;
- other_comm->set_type(simgrid::kernel::activity::CommImpl::Type::READY);
}
if (detached) {
if (other_comm->surf_action_ && other_comm->get_remaining() < 1e-12) {
XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get());
other_comm->state_ = simgrid::kernel::activity::State::DONE;
- other_comm->set_type(simgrid::kernel::activity::CommImpl::Type::DONE).set_mailbox(nullptr);
+ other_comm->set_mailbox(nullptr);
}
}
} else {
XBT_DEBUG("Match my %p with the existing %p", this_synchro.get(), other_comm.get());
other_comm->state_ = simgrid::kernel::activity::State::READY;
- other_comm->set_type(simgrid::kernel::activity::CommImpl::Type::READY);
}
receiver->activities_.emplace_back(other_comm);
}
namespace kernel {
namespace activity {
-CommImpl& CommImpl::set_type(CommImpl::Type type)
-{
- type_ = type;
- return *this;
-}
-
CommImpl& CommImpl::set_size(double size)
{
size_ = size;
MailboxImpl* mbox_ = nullptr; /* Rendez-vous where the comm is queued */
public:
- enum class Type { SEND = 0, RECEIVE, READY, DONE };
+ enum class Type { SEND, RECEIVE };
CommImpl(Type type) : type_(type) {}
CommImpl(s4u::Host* from, s4u::Host* to, double bytes);
- CommImpl& set_type(CommImpl::Type type);
CommImpl& set_size(double size);
CommImpl& set_src_buff(unsigned char* buff, size_t size);
CommImpl& set_dst_buff(unsigned char* buff, size_t* size);
void post() override;
void finish() override;
- CommImpl::Type type_; /* Type of the communication (SEND or RECEIVE) */
+ const CommImpl::Type type_; /* Type of the communication (SEND or RECEIVE) */
#if SIMGRID_HAVE_MC
MailboxImpl* mbox_cpy = nullptr; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR
const simgrid::kernel::activity::CommImpl* act = temp_act.get_buffer();
if (act->src_actor_.get() && act->dst_actor_.get())
state->transition_.argument_ = 0; // OK
- else if (act->src_actor_.get() == nullptr && act->type_ == simgrid::kernel::activity::CommImpl::Type::READY &&
+ else if (act->src_actor_.get() == nullptr && act->state_ == simgrid::kernel::activity::State::READY &&
act->detached())
state->transition_.argument_ = 0; // OK
else
return true;
}
/* On the other hand if it hasn't a timeout, check if the comm is ready.*/
- else if (act->detached() && act->src_actor_ == nullptr &&
- act->type_ == simgrid::kernel::activity::CommImpl::Type::READY)
+ else if (act->detached() && act->src_actor_ == nullptr && act->state_ == simgrid::kernel::activity::State::READY)
return (act->dst_actor_ != nullptr);
return (act->src_actor_ && act->dst_actor_);
}