-/* 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
int (*match_fun)(void *, void *,smx_action_t),
void *user_data, smx_action_t my_action);
static void SIMIX_rdv_free(void *data);
+static void SIMIX_comm_start(smx_action_t action);
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));
}
void SIMIX_network_exit(void)
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;
simcall->issuer->waiting_action = action;
if (MC_is_active()) {
+ int idx = simcall->mc_value;
if (idx == 0) {
action->state = SIMIX_DONE;
} else {
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{
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);
* \brief Starts the simulation of a communication action.
* \param action the communication action
*/
-XBT_INLINE void SIMIX_comm_start(smx_action_t action)
+static XBT_INLINE void SIMIX_comm_start(smx_action_t action)
{
/* If both the sender and the receiver are already there, start the communication */
if (action->state == SIMIX_READY) {