Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
adding option for sleep set
[simgrid.git] / src / mc / transition / TransitionComm.cpp
index 5907f7f95ba6b63244061a4dc180f9f39afe3064..dd0cb88666c867e9c37f85dfd472c0c3fc74b44c 100644 (file)
@@ -1,14 +1,15 @@
-/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/mc/transition/TransitionComm.hpp"
+#include "simgrid/config.h"
 #include "xbt/asserts.h"
-#include <simgrid/config.h>
+#include "xbt/string.hpp"
 #if SIMGRID_HAVE_MC
 #include "src/mc/ModelChecker.hpp"
-#include "src/mc/Session.hpp"
+#include "src/mc/api/RemoteApp.hpp"
 #include "src/mc/api/State.hpp"
 #endif
 
@@ -17,8 +18,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_trans_comm, mc_transition,
                                 "Logging specific to MC transitions about communications");
 
-namespace simgrid {
-namespace mc {
+namespace simgrid::mc {
 
 CommWaitTransition::CommWaitTransition(aid_t issuer, int times_considered, std::stringstream& stream)
     : Transition(Type::COMM_WAIT, issuer, times_considered)
@@ -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)
@@ -97,11 +99,11 @@ 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)
-    : Transition(Type::COMM_RECV, issuer, times_considered)
+    : Transition(Type::COMM_ASYNC_RECV, issuer, times_considered)
 {
   xbt_assert(stream >> comm_ >> mbox_ >> rbuff_ >> tag_);
 }
@@ -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,13 +148,15 @@ 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)
-    : Transition(Type::COMM_SEND, issuer, times_considered)
+    : Transition(Type::COMM_ASYNC_SEND, issuer, times_considered)
 {
   xbt_assert(stream >> comm_ >> mbox_ >> sbuff_ >> size_ >> tag_);
   XBT_DEBUG("SendTransition comm:%" PRIxPTR " mbox:%u sbuff:%" PRIxPTR " size:%zu", comm_, mbox_, sbuff_, size_);
@@ -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,10 +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
-} // namespace simgrid
+} // namespace simgrid::mc