XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_network, kernel, "Kernel network-related synchronization");
namespace simgrid::kernel::activity {
-xbt::signal<void(CommImpl const&)> CommImpl::on_start;
-xbt::signal<void(CommImpl const&)> CommImpl::on_completion;
+
+unsigned CommImpl::next_id_ = 0;
+
+/* In stateful MC, we need to ignore some private memory that is not relevant to the application state */
+void CommImpl::setup_mc()
+{
+ MC_ignore(&CommImpl::next_id_, sizeof(CommImpl::next_id_));
+}
+
+CommImpl::CommImpl()
+{
+ MC_ignore((void*)&id_, sizeof(id_));
+}
std::function<void(CommImpl*, void*, size_t)> CommImpl::copy_data_callback_ = [](kernel::activity::CommImpl* comm,
void* buff, size_t buff_size) {
} else if (mbox_) {
mbox_->remove(this);
}
+
+ MC_unignore((void*)&id_, sizeof(id_));
}
/** @brief Starts the simulation of a communication synchro. */
XBT_DEBUG("CommImpl::finish() comm %p, state %s, src_proc %p, dst_proc %p, detached: %d", this, get_state_str(),
src_actor_.get(), dst_actor_.get(), detached_);
- s4u::Comm::on_completion(static_cast<const s4u::Comm&>(*this->get_iface()));
+ if (get_iface()) {
+ const auto& piface = static_cast<const s4u::Comm&>(*get_iface());
+ set_iface(nullptr); // reset iface to protect against multiple trigger of the on_completion signals
+ s4u::Comm::on_completion(piface);
+ piface.on_this_completion(piface);
+ }
/* Update synchro state */
if (src_timeout_ && src_timeout_->get_state() == resource::Action::State::FINISHED)