Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prepare to debug the depends
[simgrid.git] / src / mc / Transition.cpp
index a0c37f2..28779c3 100644 (file)
@@ -50,12 +50,13 @@ 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 %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_);
@@ -76,7 +77,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<const CommWaitTransition*>(other)) {
-    if (timeout_ > 0 || wait->timeout_ > 0)
+    if (timeout_ || wait->timeout_)
       return true;
 
     if (src_buff_ == wait->src_buff_ && dst_buff_ == wait->dst_buff_)
@@ -97,7 +98,7 @@ CommRecvTransition::CommRecvTransition(aid_t issuer, int times_considered, char*
 }
 std::string CommRecvTransition::to_string(bool verbose)
 {
-  textual_ = xbt::string_printf("%ld: Recv(mbox=%u", aid_, mbox_);
+  textual_ = xbt::string_printf("%ld: iRecv(mbox=%u", aid_, mbox_);
   if (verbose)
     textual_ += ", buff=" + xbt::string_printf("%p", dst_buff_);
   textual_ += ")";
@@ -115,7 +116,7 @@ bool CommRecvTransition::depends(const Transition* other) const
     return isend->depends(this);
 
   if (auto* wait = dynamic_cast<const CommWaitTransition*>(other)) {
-    if (wait->timeout_ > 0)
+    if (wait->timeout_)
       return true;
 
     if (mbox_ != wait->mbox_)
@@ -143,10 +144,11 @@ CommSendTransition::CommSendTransition(aid_t issuer, int times_considered, char*
 {
   std::stringstream stream(buffer);
   stream >> mbox_ >> src_buff_ >> size_;
+  XBT_DEBUG("SendTransition mbox:%u buff:%p size:%zu", mbox_, src_buff_, size_);
 }
 std::string CommSendTransition::to_string(bool verbose = false)
 {
-  textual_ = xbt::string_printf("%ld: Send(mbox=%u", aid_, mbox_);
+  textual_ = xbt::string_printf("%ld: iSend(mbox=%u", aid_, mbox_);
   if (verbose)
     textual_ += ", buff=" + xbt::string_printf("%p", src_buff_) + ", size=" + std::to_string(size_);
   textual_ += ")";
@@ -165,7 +167,7 @@ bool CommSendTransition::depends(const Transition* other) const
     return false;
 
   if (const auto* wait = dynamic_cast<const CommWaitTransition*>(other)) {
-    if (wait->timeout_ > 0)
+    if (wait->timeout_)
       return true;
 
     if (mbox_ != wait->mbox_)