Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
code simplification around simgrid::surf::NetCardImpl
[simgrid.git] / src / mc / mc_comm_pattern.cpp
index 0141625..d29df34 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2014. The SimGrid Team.
+/* Copyright (c) 2007-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -9,8 +9,11 @@
 #include <xbt/sysdep.h>
 #include <xbt/dynar.h>
 
-#include "mc_comm_pattern.h"
-#include "mc_smx.h"
+#include "src/mc/mc_comm_pattern.h"
+#include "src/mc/mc_smx.h"
+#include "src/mc/mc_xbt.hpp"
+
+using simgrid::mc::remote;
 
 extern "C" {
 
@@ -23,7 +26,7 @@ mc_comm_pattern_t MC_comm_pattern_dup(mc_comm_pattern_t comm)
   res->index = comm->index;
   res->type = comm->type;
   res->comm_addr = comm->comm_addr;
-  res->rdv = strdup(comm->rdv);
+  res->rdv = xbt_strdup(comm->rdv);
   res->data_size = -1;
   res->data = NULL;
   if (comm->type == SIMIX_COMM_SEND) {
@@ -125,8 +128,8 @@ void MC_handle_comm_pattern(
         comm_addr = simcall_comm_wait__get__comm(req);
       else
         // comm_addr = REMOTE(xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_synchro_t)):
-        MC_process_read_dynar_element(&mc_model_checker->process, &comm_addr,
-          simcall_comm_waitany__get__comms(req), value, sizeof(comm_addr));
+        simgrid::mc::read_element(mc_model_checker->process(), &comm_addr,
+          remote(simcall_comm_waitany__get__comms(req)), value, sizeof(comm_addr));
       MC_complete_comm_pattern(pattern, comm_addr,
         MC_smx_simcall_get_issuer(req)->pid, backtracking);
     }