Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to fix the windows build
[simgrid.git] / src / mc / mc_global.cpp
index 898da3f..6f985f1 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "src/simix/smx_process_private.h"
 
-#ifdef HAVE_MC
+#if HAVE_MC
 #include <libunwind.h>
 #include "src/mc/mc_comm_pattern.h"
 #include "src/mc/mc_request.h"
 
 #include "src/mc/mc_record.h"
 #include "src/mc/mc_protocol.h"
-#include "src/mc/mc_client.h"
+#include "src/mc/Client.hpp"
 
-extern "C" {
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc,
-                                "Logging specific to MC (global)");
-
-}
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_global, mc, "Logging specific to MC (global)");
 
 e_mc_mode_t mc_mode;
 
@@ -59,12 +54,12 @@ std::vector<double> processes_time;
 }
 }
 
-#ifdef HAVE_MC
+#if HAVE_MC
 int user_max_depth_reached = 0;
 
 /* MC global data structures */
 mc_state_t mc_current_state = nullptr;
-char mc_replay_mode = FALSE;
+char mc_replay_mode = false;
 
 mc_stats_t mc_stats = nullptr;
 mc_global_t initial_global_state = nullptr;
@@ -117,7 +112,7 @@ void MC_init_dot_output()
 
 }
 
-#ifdef HAVE_MC
+#if HAVE_MC
 void MC_init()
 {
   simgrid::mc::processes_time.resize(simix_process_maxpid);
@@ -144,7 +139,7 @@ void MC_run()
 {
   mc_mode = MC_MODE_CLIENT;
   MC_init();
-  MC_client_main_loop();
+  simgrid::mc::Client::get()->mainLoop();
 }
 
 void MC_exit(void)
@@ -154,15 +149,15 @@ void MC_exit(void)
   //xbt_abort();
 }
 
-#ifdef HAVE_MC
+#if HAVE_MC
 int MC_deadlock_check()
 {
   if (mc_mode == MC_MODE_SERVER) {
     int res;
-    if ((res = mc_model_checker->process().send_message(MC_MESSAGE_DEADLOCK_CHECK)))
+    if ((res = mc_model_checker->process().getChannel().send(MC_MESSAGE_DEADLOCK_CHECK)))
       xbt_die("Could not check deadlock state");
     s_mc_int_message_t message;
-    ssize_t s = mc_model_checker->process().receive_message(message);
+    ssize_t s = mc_model_checker->process().getChannel().receive(message);
     if (s == -1)
       xbt_die("Could not receive message");
     if (s != sizeof(message) || message.type != MC_MESSAGE_DEADLOCK_CHECK_REPLY)
@@ -175,13 +170,13 @@ int MC_deadlock_check()
     return message.value;
   }
 
-  int deadlock = FALSE;
+  bool deadlock = false;
   smx_process_t process;
   if (xbt_swag_size(simix_global->process_list)) {
-    deadlock = TRUE;
+    deadlock = true;
     xbt_swag_foreach(process, simix_global->process_list)
       if (simgrid::mc::process_is_enabled(process)) {
-        deadlock = FALSE;
+        deadlock = false;
         break;
       }
   }
@@ -538,7 +533,7 @@ void MC_process_clock_add(smx_process_t process, double amount)
   simgrid::mc::processes_time[process->pid] += amount;
 }
 
-#ifdef HAVE_MC
+#if HAVE_MC
 void MC_report_assertion_error(void)
 {
   XBT_INFO("**************************");