Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix the dependency of inter-comm transitions
[simgrid.git] / src / mc / transition / TransitionComm.cpp
index 8aaf811..1ddabd1 100644 (file)
@@ -30,7 +30,7 @@ CommWaitTransition::CommWaitTransition(aid_t issuer, int times_considered, std::
 }
 std::string CommWaitTransition::to_string(bool verbose) const
 {
-  auto res = xbt::string_printf("%ld: WaitComm(from %ld to %ld, mbox=%u, %s", aid_, sender_, receiver_, mbox_,
+  auto res = xbt::string_printf("WaitComm(from %ld to %ld, mbox=%u, %s", sender_, receiver_, mbox_,
                                 (timeout_ ? "timeout" : "no timeout"));
   if (verbose) {
     res += ", sbuff=" + xbt::string_printf("%" PRIxPTR, sbuff_) + ", size=" + std::to_string(size_);
@@ -56,9 +56,11 @@ bool CommWaitTransition::depends(const Transition* other) const
     if (sbuff_ != 0 && rbuff_ != 0 && wait->sbuff_ != 0 && wait->rbuff_ != 0 && rbuff_ != wait->sbuff_ &&
         rbuff_ != wait->rbuff_ && rbuff_ != sbuff_)
       return false;
+
+    return true;
   }
 
-  return true;
+  return false; // Comm transitions are INDEP with non-comm transitions
 }
 CommTestTransition::CommTestTransition(aid_t issuer, int times_considered, std::stringstream& stream)
     : Transition(Type::COMM_TEST, issuer, times_considered)
@@ -70,7 +72,7 @@ CommTestTransition::CommTestTransition(aid_t issuer, int times_considered, std::
 }
 std::string CommTestTransition::to_string(bool verbose) const
 {
-  auto res = xbt::string_printf("%ld: TestComm(from %ld to %ld, mbox=%u", aid_, sender_, receiver_, mbox_);
+  auto res = xbt::string_printf("TestComm(from %ld to %ld, mbox=%u", sender_, receiver_, mbox_);
   if (verbose) {
     res += ", sbuff=" + xbt::string_printf("%" PRIxPTR, sbuff_) + ", size=" + std::to_string(size_);
     res += ", rbuff=" + xbt::string_printf("%" PRIxPTR, rbuff_);
@@ -97,7 +99,7 @@ bool CommTestTransition::depends(const Transition* other) const
     return false;
   }
 
-  return true;
+  return false; // Comm transitions are INDEP with non-comm transitions
 }
 
 CommRecvTransition::CommRecvTransition(aid_t issuer, int times_considered, std::stringstream& stream)
@@ -107,7 +109,7 @@ CommRecvTransition::CommRecvTransition(aid_t issuer, int times_considered, std::
 }
 std::string CommRecvTransition::to_string(bool verbose) const
 {
-  auto res = xbt::string_printf("%ld: iRecv(mbox=%u", aid_, mbox_);
+  auto res = xbt::string_printf("iRecv(mbox=%u", mbox_);
   if (verbose)
     res += ", rbuff=" + xbt::string_printf("%" PRIxPTR, rbuff_);
   res += ")";
@@ -133,6 +135,8 @@ bool CommRecvTransition::depends(const Transition* other) const
 
     if ((aid_ != test->sender_) && (aid_ != test->receiver_) && (test->rbuff_ != rbuff_))
       return false;
+
+    return true; // DEP with other send transitions
   }
 
   if (auto* wait = dynamic_cast<const CommWaitTransition*>(other)) {
@@ -144,9 +148,11 @@ bool CommRecvTransition::depends(const Transition* other) const
 
     if ((aid_ != wait->sender_) && (aid_ != wait->receiver_) && (wait->rbuff_ != rbuff_))
       return false;
+
+    return true; // DEP with other wait transitions
   }
 
-  return true;
+  return false; // Comm transitions are INDEP with non-comm transitions
 }
 
 CommSendTransition::CommSendTransition(aid_t issuer, int times_considered, std::stringstream& stream)
@@ -157,7 +163,7 @@ CommSendTransition::CommSendTransition(aid_t issuer, int times_considered, std::
 }
 std::string CommSendTransition::to_string(bool verbose = false) const
 {
-  auto res = xbt::string_printf("%ld: iSend(mbox=%u", aid_, mbox_);
+  auto res = xbt::string_printf("iSend(mbox=%u", mbox_);
   if (verbose)
     res += ", sbuff=" + xbt::string_printf("%" PRIxPTR, sbuff_) + ", size=" + std::to_string(size_);
   res += ")";
@@ -184,6 +190,8 @@ bool CommSendTransition::depends(const Transition* other) const
 
     if ((aid_ != test->sender_) && (aid_ != test->receiver_) && (test->sbuff_ != sbuff_))
       return false;
+
+    return true; // DEP with other test transitions
   }
 
   if (const auto* wait = dynamic_cast<const CommWaitTransition*>(other)) {
@@ -195,9 +203,11 @@ bool CommSendTransition::depends(const Transition* other) const
 
     if ((aid_ != wait->sender_) && (aid_ != wait->receiver_) && (wait->sbuff_ != sbuff_))
       return false;
+
+    return true; // DEP with other wait transitions
   }
 
-  return true;
+  return false; // Comm transitions are INDEP with non-comm transitions
 }
 
 } // namespace mc