Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge tag 'v3_9_90' into hypervisor
[simgrid.git] / src / simix / smx_network.c
index 2c0e3a1..ab6151a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -31,7 +31,7 @@ void SIMIX_network_init(void)
 {
   rdv_points = xbt_dict_new_homogeneous(SIMIX_rdv_free);
   if(MC_is_active())
-    MC_ignore_data_bss(&smx_total_comms, sizeof(smx_total_comms));
+    MC_ignore_global_variable("smx_total_comms");
 }
 
 void SIMIX_network_exit(void)
@@ -199,7 +199,9 @@ smx_action_t SIMIX_fifo_get_comm(xbt_fifo_t fifo, e_smx_comm_type_t type,
       xbt_fifo_remove_item(fifo, item);
       xbt_fifo_free_item(item);
       action->comm.refcount++;
+#ifdef HAVE_MC
       action->comm.rdv_cpy = action->comm.rdv;
+#endif
       action->comm.rdv = NULL;
       return action;
     }
@@ -338,17 +340,17 @@ void SIMIX_comm_destroy_internal_actions(smx_action_t action)
 #ifdef HAVE_LATENCY_BOUND_TRACKING
     action->latency_limited = SIMIX_comm_is_latency_bounded(action);
 #endif
-    action->comm.surf_comm->model_type->action_unref(action->comm.surf_comm);
+    action->comm.surf_comm->model_obj->action_unref(action->comm.surf_comm);
     action->comm.surf_comm = NULL;
   }
 
   if (action->comm.src_timeout){
-    action->comm.src_timeout->model_type->action_unref(action->comm.src_timeout);
+    action->comm.src_timeout->model_obj->action_unref(action->comm.src_timeout);
     action->comm.src_timeout = NULL;
   }
 
   if (action->comm.dst_timeout){
-    action->comm.dst_timeout->model_type->action_unref(action->comm.dst_timeout);
+    action->comm.dst_timeout->model_obj->action_unref(action->comm.dst_timeout);
     action->comm.dst_timeout = NULL;
   }
 }
@@ -693,7 +695,6 @@ smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int src,
 
 void SIMIX_pre_comm_wait(smx_simcall_t simcall, smx_action_t action, double timeout)
 {
-  int idx = simcall->mc_value;
   /* the simcall may be a wait, a send or a recv */
   surf_action_t sleep;
 
@@ -704,6 +705,7 @@ void SIMIX_pre_comm_wait(smx_simcall_t simcall, smx_action_t action, double time
   simcall->issuer->waiting_action = action;
 
   if (MC_is_active()) {
+    int idx = simcall->mc_value;
     if (idx == 0) {
       action->state = SIMIX_DONE;
     } else {
@@ -762,12 +764,12 @@ void SIMIX_pre_comm_test(smx_simcall_t simcall, smx_action_t action)
 
 void SIMIX_pre_comm_testany(smx_simcall_t simcall, xbt_dynar_t actions)
 {
-  int idx = simcall->mc_value;
   unsigned int cursor;
   smx_action_t action;
   simcall_comm_testany__set__result(simcall, -1);
 
   if (MC_is_active()){
+    int idx = simcall->mc_value;
     if(idx == -1){
       SIMIX_simcall_answer(simcall);
     }else{
@@ -793,11 +795,11 @@ void SIMIX_pre_comm_testany(smx_simcall_t simcall, xbt_dynar_t actions)
 
 void SIMIX_pre_comm_waitany(smx_simcall_t simcall, xbt_dynar_t actions)
 {
-  int idx = simcall->mc_value;
   smx_action_t action;
   unsigned int cursor = 0;
 
   if (MC_is_active()){
+    int idx = simcall->mc_value;
     action = xbt_dynar_get_as(actions, idx, smx_action_t);
     xbt_fifo_push(action->simcalls, simcall);
     simcall_comm_waitany__set__result(simcall, idx);