Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mc: snake_case a class
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 28 May 2019 08:34:49 +0000 (10:34 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Tue, 28 May 2019 09:23:24 +0000 (11:23 +0200)
src/mc/ModelChecker.cpp
src/mc/Session.cpp
src/mc/Session.hpp
src/mc/checker/CommunicationDeterminismChecker.cpp
src/mc/checker/LivenessChecker.cpp
src/mc/checker/SafetyChecker.cpp
src/mc/mc_global.cpp

index 2f38676..874875a 100644 (file)
@@ -153,7 +153,7 @@ static void MC_report_crash(int status)
   for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
     XBT_INFO("  %s", s.c_str());
   simgrid::mc::dumpRecordPath();
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
   XBT_INFO("Stack trace:");
   mc_model_checker->process().dumpStack();
 }
@@ -167,7 +167,7 @@ static void MC_report_assertion_error()
   for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
     XBT_INFO("  %s", s.c_str());
   simgrid::mc::dumpRecordPath();
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 bool ModelChecker::handle_message(char* buffer, ssize_t size)
index e79fa47..96f377a 100644 (file)
@@ -86,9 +86,9 @@ Session::Session(pid_t pid, int socket)
 #else
   process->privatized(false);
 #endif
-  modelChecker_.reset(new simgrid::mc::ModelChecker(std::move(process)));
+  model_checker_.reset(new simgrid::mc::ModelChecker(std::move(process)));
   xbt_assert(mc_model_checker == nullptr);
-  mc_model_checker = modelChecker_.get();
+  mc_model_checker = model_checker_.get();
   mc_model_checker->start();
 }
 
@@ -99,23 +99,23 @@ Session::~Session()
 
 void Session::initialize()
 {
-  xbt_assert(initialSnapshot_ == nullptr);
+  xbt_assert(initial_snapshot_ == nullptr);
   mc_model_checker->wait_for_requests();
-  initialSnapshot_ = simgrid::mc::take_snapshot(0);
+  initial_snapshot_ = simgrid::mc::take_snapshot(0);
 }
 
 void Session::execute(Transition const& transition)
 {
-  modelChecker_->handle_simcall(transition);
-  modelChecker_->wait_for_requests();
+  model_checker_->handle_simcall(transition);
+  model_checker_->wait_for_requests();
 }
 
-void Session::restoreInitialState()
+void Session::restore_initial_state()
 {
-  this->initialSnapshot_->restore(&mc_model_checker->process());
+  this->initial_snapshot_->restore(&mc_model_checker->process());
 }
 
-void Session::logState()
+void Session::log_state()
 {
   mc_model_checker->getChecker()->logState();
 
@@ -172,10 +172,10 @@ Session* Session::spawnvp(const char *file, char *const argv[])
 
 void Session::close()
 {
-  initialSnapshot_ = nullptr;
-  if (modelChecker_) {
-    modelChecker_->shutdown();
-    modelChecker_ = nullptr;
+  initial_snapshot_ = nullptr;
+  if (model_checker_) {
+    model_checker_->shutdown();
+    model_checker_   = nullptr;
     mc_model_checker = nullptr;
   }
 }
index 6806c0c..283366c 100644 (file)
@@ -23,8 +23,8 @@ namespace mc {
  */
 class Session {
 private:
-  std::unique_ptr<ModelChecker> modelChecker_;
-  std::shared_ptr<simgrid::mc::Snapshot> initialSnapshot_;
+  std::unique_ptr<ModelChecker> model_checker_;
+  std::shared_ptr<simgrid::mc::Snapshot> initial_snapshot_;
 
   Session(pid_t pid, int socket);
 
@@ -38,9 +38,9 @@ public:
 
   void initialize();
   void execute(Transition const& transition);
-  void logState();
+  void log_state();
 
-  void restoreInitialState();
+  void restore_initial_state();
 
   // static constructors
 
index 84f3f18..24bdad1 100644 (file)
@@ -143,7 +143,7 @@ void CommunicationDeterminismChecker::deterministic_comm_pattern(int process, si
         XBT_INFO("%s", this->send_diff);
         xbt_free(this->send_diff);
         this->send_diff = nullptr;
-        simgrid::mc::session->logState();
+        simgrid::mc::session->log_state();
         mc_model_checker->exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
       } else if (_sg_mc_comms_determinism && (not this->send_deterministic && not this->recv_deterministic)) {
         XBT_INFO("****************************************************");
@@ -155,7 +155,7 @@ void CommunicationDeterminismChecker::deterministic_comm_pattern(int process, si
         this->send_diff = nullptr;
         xbt_free(this->recv_diff);
         this->recv_diff = nullptr;
-        simgrid::mc::session->logState();
+        simgrid::mc::session->log_state();
         mc_model_checker->exit(SIMGRID_MC_EXIT_NON_DETERMINISM);
       }
     }
@@ -365,7 +365,7 @@ void CommunicationDeterminismChecker::restoreState()
   }
 
   /* Restore the initial state */
-  simgrid::mc::session->restoreInitialState();
+  simgrid::mc::session->restore_initial_state();
 
   unsigned n = MC_smx_get_maxpid();
   assert(n == incomplete_communications_pattern.size());
@@ -524,7 +524,7 @@ void CommunicationDeterminismChecker::real_run()
     }
   }
 
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 void CommunicationDeterminismChecker::run()
index 411e4f5..2f7a6a9 100644 (file)
@@ -138,7 +138,7 @@ void LivenessChecker::replay()
   }
 
   /* Restore the initial state */
-  simgrid::mc::session->restoreInitialState();
+  simgrid::mc::session->restore_initial_state();
 
   /* Traverse the stack from the initial state and re-execute the transitions */
   int depth = 1;
@@ -261,7 +261,7 @@ void LivenessChecker::showAcceptanceCycle(std::size_t depth)
   for (auto const& s : this->getTextualTrace())
     XBT_INFO("  %s", s.c_str());
   simgrid::mc::dumpRecordPath();
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
   XBT_INFO("Counter-example depth: %zu", depth);
 }
 
@@ -439,7 +439,7 @@ void LivenessChecker::run()
   }
 
   XBT_INFO("No property violation found.");
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 Checker* createLivenessChecker(Session& s)
index bd9ccd8..6b1c4da 100644 (file)
@@ -50,7 +50,7 @@ void SafetyChecker::checkNonTermination(simgrid::mc::State* current_state)
       for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
         XBT_INFO("  %s", s.c_str());
       simgrid::mc::dumpRecordPath();
-      simgrid::mc::session->logState();
+      simgrid::mc::session->log_state();
 
       throw simgrid::mc::TerminationError();
     }
@@ -182,7 +182,7 @@ void SafetyChecker::run()
   }
 
   XBT_INFO("No property violation found.");
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 void SafetyChecker::backtrack()
@@ -276,7 +276,7 @@ void SafetyChecker::restoreState()
   }
 
   /* Restore the initial state */
-  simgrid::mc::session->restoreInitialState();
+  simgrid::mc::session->restore_initial_state();
 
   /* Traverse the stack from the state at position start and re-execute the transitions */
   for (std::unique_ptr<simgrid::mc::State> const& state : stack_) {
index d34df46..5e8fff4 100644 (file)
@@ -92,7 +92,7 @@ void MC_show_deadlock()
   for (auto const& s : mc_model_checker->getChecker()->getTextualTrace())
     XBT_INFO("  %s", s.c_str());
   simgrid::mc::dumpRecordPath();
-  simgrid::mc::session->logState();
+  simgrid::mc::session->log_state();
 }
 
 void MC_automaton_load(const char *file)