void CommIsendSimcall::serialize(std::stringstream& stream) const
{
stream << (short)mc::Transition::Type::COMM_SEND << ' ';
- stream << (uintptr_t)comm_ << ' ' << mbox_->get_id() << ' ' << (uintptr_t)src_buff_ << ' ' << src_buff_size_;
- XBT_DEBUG("SendObserver comm:%p mbox:%u buff:%p size:%zu", comm_, mbox_->get_id(), src_buff_, src_buff_size_);
+ stream << (uintptr_t)comm_ << ' ' << mbox_->get_id() << ' ' << (uintptr_t)src_buff_ << ' ' << src_buff_size_ << ' '
+ << tag_;
+ XBT_DEBUG("SendObserver comm:%p mbox:%u buff:%p size:%zu tag:%d", comm_, mbox_->get_id(), src_buff_, src_buff_size_,
+ tag_);
}
void CommIrecvSimcall::serialize(std::stringstream& stream) const
{
stream << (short)mc::Transition::Type::COMM_RECV << ' ';
- stream << (uintptr_t)comm_ << ' ' << mbox_->get_id() << ' ' << (uintptr_t)dst_buff_;
- XBT_DEBUG("RecvObserver comm:%p mbox:%u buff:%p", comm_, mbox_->get_id(), dst_buff_);
+ stream << (uintptr_t)comm_ << ' ' << mbox_->get_id() << ' ' << (uintptr_t)dst_buff_ << ' ' << tag_;
+ XBT_DEBUG("RecvObserver comm:%p mbox:%u buff:%p tag:%d", comm_, mbox_->get_id(), dst_buff_, tag_);
}
} // namespace actor
void* payload_;
bool detached_;
activity::CommImpl* comm_;
+ int tag_;
bool (*match_fun_)(void*, void*, activity::CommImpl*);
void (*clean_fun_)(void*); // used to free the synchro in case of problem after a detached send
void* get_payload() const { return payload_; }
bool is_detached() const { return detached_; }
void set_comm(activity::CommImpl* comm) { comm_ = comm; }
+ void set_tag(int tag) { tag_ = tag; }
auto get_match_fun() const { return match_fun_; }
auto get_clean_fun() const { return clean_fun_; }
size_t* dst_buff_size_;
void* payload_;
double rate_;
+ int tag_;
activity::CommImpl* comm_;
bool (*match_fun_)(void*, void*, activity::CommImpl*);
size_t* get_dst_buff_size() const { return dst_buff_size_; }
void* get_payload() const { return payload_; }
void set_comm(activity::CommImpl* comm) { comm_ = comm; }
+ void set_tag(int tag) { tag_ = tag; }
auto get_match_fun() const { return match_fun_; };
auto get_copy_data_fun() const { return copy_data_fun_; }
CommRecvTransition::CommRecvTransition(aid_t issuer, int times_considered, std::stringstream& stream)
: Transition(Type::COMM_RECV, issuer, times_considered)
{
- xbt_assert(stream >> comm_ >> mbox_ >> rbuff_);
+ xbt_assert(stream >> comm_ >> mbox_ >> rbuff_ >> tag_);
}
std::string CommRecvTransition::to_string(bool verbose) const
{
CommSendTransition::CommSendTransition(aid_t issuer, int times_considered, std::stringstream& stream)
: Transition(Type::COMM_SEND, issuer, times_considered)
{
- xbt_assert(stream >> comm_ >> mbox_ >> sbuff_ >> size_);
+ xbt_assert(stream >> comm_ >> mbox_ >> sbuff_ >> size_ >> tag_);
XBT_DEBUG("SendTransition comm:%" PRIxPTR " mbox:%u sbuff:%" PRIxPTR " size:%zu", comm_, mbox_, sbuff_, size_);
}
std::string CommSendTransition::to_string(bool verbose = false) const
uintptr_t comm_; /* Addr of the CommImpl */
unsigned mbox_;
uintptr_t rbuff_;
+ int tag_;
public:
CommRecvTransition(aid_t issuer, int times_considered, std::stringstream& stream);
unsigned get_mailbox() const { return mbox_; }
/** Receiver buffer */
uintptr_t get_rbuff() const { return rbuff_; }
+ /** If using SMPI, the tag */
+ int get_tag() const { return tag_; }
};
class CommSendTransition : public Transition {
unsigned mbox_;
uintptr_t sbuff_;
size_t size_;
+ int tag_;
public:
CommSendTransition(aid_t issuer, int times_considered, std::stringstream& stream);
uintptr_t get_sbuff() const { return sbuff_; }
/** data size */
size_t get_size() const { return size_; }
+ /** If using SMPI, the tag */
+ int get_tag() const { return tag_; }
};
class TestAnyTransition : public Transition {
// num?
res.comm_addr = this->comm_addr;
res.type = this->type;
- // src_proc?
- // dst_proc?
+ res.src_proc = this->src_proc;
res.dst_proc = this->dst_proc;
res.mbox = this->mbox;
- // tag?
+ res.tag = this->tag;
res.index = this->index;
return res;
}
pattern->comm_addr = send->get_comm();
pattern->mbox = send->get_mailbox();
pattern->src_proc = send->aid_;
-
-#if HAVE_SMPI
- pattern->tag = 0; // FIXME: replace it by the real tag from the observer
-#endif
+ pattern->tag = send->get_tag();
#if HAVE_SMPI
// auto send_detached = api::get().check_send_request_detached(request);
pattern->type = PatternCommunicationType::receive;
pattern->comm_addr = recv->get_comm();
-
-#if HAVE_SMPI
- pattern->tag = 0; // FIXME: replace it by the real tag from the observer
-#endif
+ pattern->tag = recv->get_tag();
pattern->mbox = recv->get_mailbox();
pattern->dst_proc = recv->aid_;
}
: smpi_comm_copy_data_callback,
this,
-1.0};
+ observer.set_tag(tag_);
action_ = kernel::actor::simcall([&observer] { return kernel::activity::CommImpl::irecv(&observer); }, &observer);
process->replaying() ? &smpi_comm_null_copy_buffer_callback : smpi_comm_copy_data_callback, this,
// detach if msg size < eager/rdv switch limit
detached_};
+ observer.set_tag(tag_);
action_ = kernel::actor::simcall([&observer] { return kernel::activity::CommImpl::isend(&observer); }, &observer);
XBT_DEBUG("send simcall posted");