X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/502bb030cd47bc68852ec1e55c50151c468a83a6..d9c1e4df4ecfc39d84e55527fa05e9bd19f70c6c:/src/kernel/activity/CommImpl.cpp diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index f3b7f48ac1..e5c1ddf071 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -23,6 +23,17 @@ namespace simgrid::kernel::activity { 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 CommImpl::copy_data_callback_ = [](kernel::activity::CommImpl* comm, void* buff, size_t buff_size) { xbt_assert((buff_size == sizeof(void*)), "Cannot copy %zu bytes: must be sizeof(void*)", buff_size); @@ -111,6 +122,8 @@ CommImpl::~CommImpl() } else if (mbox_) { mbox_->remove(this); } + + MC_unignore((void*)&id_, sizeof(id_)); } /** @brief Starts the simulation of a communication synchro. */ @@ -473,8 +486,8 @@ void CommImpl::finish() if (get_iface()) { const auto& piface = static_cast(*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); + piface.fire_on_completion_for_real(); + piface.fire_on_this_completion_for_real(); } /* Update synchro state */