Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless specialized exceptions from simgrid::mc.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 12 Apr 2023 12:23:15 +0000 (14:23 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 12 Apr 2023 13:03:50 +0000 (15:03 +0200)
src/mc/api/RemoteApp.cpp
src/mc/api/RemoteApp.hpp
src/mc/explo/DFSExplorer.cpp
src/mc/explo/LivenessChecker.cpp
src/mc/mc_exit.hpp

index 61fca1e..959d191 100644 (file)
@@ -178,7 +178,7 @@ void RemoteApp::check_deadlock() const
              "--cfg=model-check/replay:'%s'",
              explo->get_record_trace().to_string().c_str());
     explo->log_state();
-    throw DeadlockError();
+    throw McError(ExitStatus::DEADLOCK);
   }
 }
 
index 82a93db..0773721 100644 (file)
@@ -57,7 +57,7 @@ public:
   void restore_initial_state();
   void wait_for_requests();
 
-  /** Ask to the application to check for a deadlock. If so, do an error message and throw a DeadlockError. */
+  /** Ask to the application to check for a deadlock. If so, do an error message and throw a McError(DEADLOCK). */
   void check_deadlock() const;
 
   /** Ask the application to run post-mortem analysis, and maybe to stop ASAP */
index a19d17a..5903739 100644 (file)
@@ -60,7 +60,7 @@ void DFSExplorer::check_non_termination(const State* current_state)
                get_record_trace().to_string().c_str());
       log_state();
 
-      throw TerminationError();
+      throw McError(ExitStatus::NON_TERMINATION);
     }
   }
 #endif
index 3638fd6..071c1e4 100644 (file)
@@ -384,7 +384,7 @@ void LivenessChecker::run()
       reached_pair = this->insert_acceptance_pair(current_pair.get());
       if (reached_pair == nullptr) {
         this->show_acceptance_cycle(current_pair->depth);
-        throw LivenessError();
+        throw McError(ExitStatus::LIVENESS);
       }
     }
 
index 6d1ec7c..3bb6cdd 100644 (file)
@@ -25,16 +25,6 @@ struct McError : public std::exception {
   const ExitStatus value;
   McError(ExitStatus v = ExitStatus::ERROR) : value(v) {}
 };
-
-struct DeadlockError : public McError {
-  DeadlockError() : McError(ExitStatus::DEADLOCK) {}
-};
-struct TerminationError : public McError {
-  TerminationError() : McError(ExitStatus::NON_TERMINATION) {}
-};
-struct LivenessError : public McError {
-  LivenessError() : McError(ExitStatus::LIVENESS) {}
-};
 } // namespace simgrid::mc
 
 #endif