From: Martin Quinson Date: Fri, 11 Feb 2022 10:21:20 +0000 (+0100) Subject: MC does not need the exact value of the timeout, only where a timeout was specified X-Git-Tag: v3.31~452 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1fc00f9191d59272a95af5955981316e7c351b01 MC does not need the exact value of the timeout, only where a timeout was specified --- diff --git a/src/kernel/actor/SimcallObserver.cpp b/src/kernel/actor/SimcallObserver.cpp index f7f77f4ab7..bb1dada3a4 100644 --- a/src/kernel/actor/SimcallObserver.cpp +++ b/src/kernel/actor/SimcallObserver.cpp @@ -223,7 +223,7 @@ void ActivityWaitSimcall::serialize(Simcall& type, char* buffer) std::stringstream stream; if (auto* comm = dynamic_cast(activity_)) { type = Simcall::COMM_WAIT; - stream << timeout_ << ' ' << comm; + stream << (timeout_ > 0) << ' ' << comm; stream << ' ' << (comm->src_actor_ != nullptr ? comm->src_actor_->get_pid() : -1); stream << ' ' << (comm->dst_actor_ != nullptr ? comm->dst_actor_->get_pid() : -1); stream << ' ' << (comm->get_mailbox() != nullptr ? comm->get_mailbox()->get_id() : 666); diff --git a/src/mc/Transition.cpp b/src/mc/Transition.cpp index b08eb1853f..29a4196b3c 100644 --- a/src/mc/Transition.cpp +++ b/src/mc/Transition.cpp @@ -50,14 +50,14 @@ CommWaitTransition::CommWaitTransition(aid_t issuer, int times_considered, char* { std::stringstream stream(buffer); stream >> timeout_ >> comm_ >> sender_ >> receiver_ >> mbox_ >> src_buff_ >> dst_buff_ >> size_; - XBT_DEBUG("CommWaitTransition tout:%f comm:%p, sender:%ld receiver:%ld mbox:%u sbuff:%p rbuff:%p size:%zu", timeout_, - comm_, sender_, receiver_, mbox_, src_buff_, dst_buff_, size_); + XBT_DEBUG("CommWaitTransition %s comm:%p, sender:%ld receiver:%ld mbox:%u sbuff:%p rbuff:%p size:%zu", + (timeout_ ? "timeout" : "no-timeout"), comm_, sender_, receiver_, mbox_, src_buff_, dst_buff_, size_); } std::string CommWaitTransition::to_string(bool verbose) { textual_ = Transition::to_string(verbose); - textual_ += - xbt::string_printf("%ld: WaitComm(from %ld to %ld, mbox=%u, tout=%f", aid_, sender_, receiver_, mbox_, timeout_); + textual_ += xbt::string_printf("%ld: WaitComm(from %ld to %ld, mbox=%u, %s", aid_, sender_, receiver_, mbox_, + (timeout_ ? "timeout" : "no timeout")); if (verbose) { textual_ += ", src_buff=" + xbt::string_printf("%p", src_buff_) + ", size=" + std::to_string(size_); textual_ += ", dst_buff=" + xbt::string_printf("%p", dst_buff_); @@ -78,7 +78,7 @@ bool CommWaitTransition::depends(const Transition* other) const /* Timeouts in wait transitions are not considered by the independence theorem, thus assumed dependent */ if (const auto* wait = dynamic_cast(other)) { - if (timeout_ > 0 || wait->timeout_ > 0) + if (timeout_ || wait->timeout_) return true; if (src_buff_ == wait->src_buff_ && dst_buff_ == wait->dst_buff_) @@ -117,7 +117,7 @@ bool CommRecvTransition::depends(const Transition* other) const return isend->depends(this); if (auto* wait = dynamic_cast(other)) { - if (wait->timeout_ > 0) + if (wait->timeout_) return true; if (mbox_ != wait->mbox_) @@ -168,7 +168,7 @@ bool CommSendTransition::depends(const Transition* other) const return false; if (const auto* wait = dynamic_cast(other)) { - if (wait->timeout_ > 0) + if (wait->timeout_) return true; if (mbox_ != wait->mbox_) diff --git a/src/mc/Transition.hpp b/src/mc/Transition.hpp index 8bf38a96df..3ec28b26f1 100644 --- a/src/mc/Transition.hpp +++ b/src/mc/Transition.hpp @@ -69,7 +69,7 @@ class CommSendTransition; class CommRecvTransition; class CommWaitTransition : public Transition { - double timeout_; + bool timeout_; void* comm_; aid_t sender_; aid_t receiver_;