Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Use RAII std::string for s_mc_comm_pattern::rdv
[simgrid.git] / src / mc / CommunicationDeterminismChecker.cpp
index a817ff9..f2fb17e 100644 (file)
@@ -38,7 +38,7 @@ xbt_dynar_t incomplete_communications_pattern;
 static e_mc_comm_pattern_difference_t compare_comm_pattern(mc_comm_pattern_t comm1, mc_comm_pattern_t comm2) {
   if(comm1->type != comm2->type)
     return TYPE_DIFF;
-  if (strcmp(comm1->rdv, comm2->rdv) != 0)
+  if (comm1->rdv != comm2->rdv)
     return RDV_DIFF;
   if (comm1->src_proc != comm2->src_proc)
     return SRC_PROC_DIFF;
@@ -184,7 +184,7 @@ void MC_get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, e_mc_call_type
   xbt_dynar_t incomplete_pattern = xbt_dynar_get_as(
     incomplete_communications_pattern, issuer->pid, xbt_dynar_t);
 
-  mc_comm_pattern_t pattern = xbt_new0(s_mc_comm_pattern_t, 1);
+  mc_comm_pattern_t pattern = new s_mc_comm_pattern_t();
   pattern->data_size = -1;
   pattern->data = nullptr;
   pattern->index =
@@ -408,9 +408,9 @@ int CommunicationDeterminismChecker::main(void)
     simgrid::mc::State* state = stack_.back().get();
 
     XBT_DEBUG("**************************************************");
-    XBT_DEBUG("Exploration depth = %zi (state = %d, interleaved processes = %d)",
+    XBT_DEBUG("Exploration depth = %zi (state = %d, interleaved processes = %zd)",
               stack_.size(), state->num,
-              MC_state_interleave_size(state));
+              state->interleaveSize());
 
     /* Update statistics */
     mc_stats->visited_states++;
@@ -505,7 +505,7 @@ int CommunicationDeterminismChecker::main(void)
       while (!stack_.empty()) {
         std::unique_ptr<simgrid::mc::State> state = std::move(stack_.back());
         stack_.pop_back();
-        if (MC_state_interleave_size(state.get())
+        if (state->interleaveSize()
             && stack_.size() < (std::size_t) _sg_mc_max_depth) {
           /* We found a back-tracking point, let's loop */
           XBT_DEBUG("Back-tracking to state %d at depth %zi",