X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/299c52751d8bf7ed4f9fc40f668025a5cb425901..8f14731685bc7fea43ca95def23ab2031e7a32eb:/src/kernel/activity/CommImpl.cpp diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index ef42412ba0..73cf3acba0 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -71,13 +71,13 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend( other_comm->state_ = SIMIX_READY; other_comm->set_type(simgrid::kernel::activity::CommImpl::Type::READY); } - src_proc->comms.push_back(other_comm); if (detached) { other_comm->detached = true; other_comm->clean_fun = clean_fun; } else { other_comm->clean_fun = nullptr; + src_proc->comms.push_back(other_comm); } /* Setup the communication synchro */ @@ -88,12 +88,10 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend( other_comm->match_fun = match_fun; other_comm->copy_data_fun = copy_data_fun; - if (MC_is_active() || MC_record_replay_is_active()) { + if (MC_is_active() || MC_record_replay_is_active()) other_comm->state_ = SIMIX_RUNNING; - return (detached ? nullptr : other_comm); - } - - other_comm->start(); + else + other_comm->start(); return (detached ? nullptr : other_comm); } @@ -136,7 +134,7 @@ XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv( other_comm = std::move(this_synchro); mbox->push(other_comm); } else { - if (other_comm->surf_action_ && other_comm->remains() < 1e-12) { + 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_ = SIMIX_DONE; other_comm->set_type(simgrid::kernel::activity::CommImpl::Type::DONE); @@ -426,6 +424,7 @@ CommImpl* CommImpl::start() surf_action_ = surf_network_model->communicate(sender, receiver, size_, rate_); surf_action_->set_data(this); + surf_action_->set_category(get_tracing_category()); state_ = SIMIX_RUNNING; XBT_DEBUG("Starting communication %p from '%s' to '%s' (surf_action: %p)", this, sender->get_cname(), @@ -519,12 +518,6 @@ void CommImpl::cancel() } } -/** @brief get the amount remaining from the communication */ -double CommImpl::remains() -{ - return surf_action_->get_remains(); -} - /** @brief This is part of the cleanup process, probably an internal command */ void CommImpl::cleanupSurf() {