Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revalidate all SafetyChecker tesh now that the output changed
[simgrid.git] / src / mc / api / TransitionComm.hpp
index f65f282..2c244f6 100644 (file)
@@ -22,12 +22,12 @@ class CommTestTransition;
 
 class CommWaitTransition : public Transition {
   bool timeout_;
-  void* comm_;
+  uintptr_t comm_;
   aid_t sender_;
   aid_t receiver_;
   unsigned mbox_;
-  void* src_buff_;
-  void* dst_buff_;
+  uintptr_t sbuff_;
+  uintptr_t rbuff_;
   size_t size_;
   friend CommRecvTransition;
   friend CommSendTransition;
@@ -37,14 +37,30 @@ public:
   CommWaitTransition(aid_t issuer, int times_considered, std::stringstream& stream);
   std::string to_string(bool verbose) const override;
   bool depends(const Transition* other) const override;
+
+  bool get_timeout() const { return timeout_; }
+  /** Address of the corresponding Communication object in the application */
+  uintptr_t get_comm() const { return comm_; }
+  /** Sender ID */
+  aid_t get_sender() const { return sender_; }
+  /** Receiver ID */
+  aid_t get_receiver() const { return receiver_; }
+  /** Mailbox ID */
+  unsigned get_mailbox() const { return mbox_; }
+  /** Sender buffer */
+  uintptr_t get_sbuff() const { return sbuff_; }
+  /** Receiver buffer */
+  uintptr_t get_rbuff() const { return rbuff_; }
+  /** data size */
+  size_t get_size() const { return size_; }
 };
 class CommTestTransition : public Transition {
-  void* comm_;
+  uintptr_t comm_;
   aid_t sender_;
   aid_t receiver_;
   unsigned mbox_;
-  void* src_buff_;
-  void* dst_buff_;
+  uintptr_t sbuff_;
+  uintptr_t rbuff_;
   size_t size_;
   friend CommSendTransition;
   friend CommRecvTransition;
@@ -53,27 +69,66 @@ public:
   CommTestTransition(aid_t issuer, int times_considered, std::stringstream& stream);
   std::string to_string(bool verbose) const override;
   bool depends(const Transition* other) const override;
+
+  /** Address of the corresponding Communication object in the application */
+  uintptr_t get_comm() const { return comm_; }
+  /** Sender ID */
+  aid_t get_sender() const { return sender_; }
+  /** Receiver ID */
+  aid_t get_receiver() const { return receiver_; }
+  /** Mailbox ID */
+  unsigned get_mailbox() const { return mbox_; }
+  /** Sender buffer */
+  uintptr_t get_sbuff() const { return sbuff_; }
+  /** Receiver buffer */
+  uintptr_t get_rbuff() const { return rbuff_; }
+  /** data size */
+  size_t get_size() const { return size_; }
 };
 
 class CommRecvTransition : public Transition {
+  uintptr_t comm_; /* Addr of the CommImpl */
   unsigned mbox_;
-  void* dst_buff_;
+  uintptr_t rbuff_;
+  int tag_;
 
 public:
   CommRecvTransition(aid_t issuer, int times_considered, std::stringstream& stream);
   std::string to_string(bool verbose) const override;
   bool depends(const Transition* other) const override;
+
+  /** Address of the corresponding Communication object in the application */
+  uintptr_t get_comm() const { return comm_; }
+  /** Mailbox ID */
+  unsigned get_mailbox() const { return mbox_; }
+  /** Receiver buffer */
+  uintptr_t get_rbuff() const { return rbuff_; }
+  /** If using SMPI, the tag */
+  int get_tag() const { return tag_; }
 };
 
 class CommSendTransition : public Transition {
+  uintptr_t comm_; /* Addr of the CommImpl */
   unsigned mbox_;
-  void* src_buff_;
+  uintptr_t sbuff_;
   size_t size_;
+  int tag_;
 
 public:
   CommSendTransition(aid_t issuer, int times_considered, std::stringstream& stream);
   std::string to_string(bool verbose) const override;
   bool depends(const Transition* other) const override;
+
+  /** Address of the corresponding Communication object in the application */
+  uintptr_t get_comm() const { return comm_; }
+  /** Mailbox ID */
+  unsigned get_mailbox() const { return mbox_; }
+  /** Sender buffer */
+  uintptr_t get_sbuff() const { return sbuff_; }
+  /** data size */
+  size_t get_size() const { return size_; }
+  /** If using SMPI, the tag */
+  int get_tag() const { return tag_; }
 };
 
 class TestAnyTransition : public Transition {
@@ -83,10 +138,23 @@ public:
   TestAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream);
   std::string to_string(bool verbose) const override;
   bool depends(const Transition* other) const override;
+
+  Transition* get_current_transition() const { return transitions_.at(times_considered_); }
+};
+
+class WaitAnyTransition : public Transition {
+  std::vector<Transition*> transitions_;
+
+public:
+  WaitAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream);
+  std::string to_string(bool verbose) const override;
+  bool depends(const Transition* other) const override;
+
+  Transition* get_current_transition() const { return transitions_.at(times_considered_); }
 };
 
 /** Make a new transition from serialized description */
-Transition* recv_transition(aid_t issuer, int times_considered, std::stringstream& stream);
+Transition* deserialize_transition(aid_t issuer, int times_considered, std::stringstream& stream);
 
 } // namespace mc
 } // namespace simgrid