rdv->name = name ? xbt_strdup(name) : NULL;
rdv->comm_fifo = xbt_fifo_new();
- if (name)
- xbt_dict_set(rdv_points, name, rdv, SIMIX_rdv_free);
+ if (rdv->name)
+ xbt_dict_set(rdv_points, rdv->name, rdv, SIMIX_rdv_free);
}
return rdv;
}
void SIMIX_rdv_destroy(smx_rdv_t rdv)
{
if (rdv->name)
- xbt_dict_remove(rdv_points, rdv->name);
+ xbt_dict_remove(rdv_points, rdv->name);
}
void SIMIX_rdv_free(void *data)
req->issuer->waiting_action = action;
if (MC_IS_ENABLED){
- action->state = SIMIX_DONE;
+ if(action->comm.src_proc && action->comm.dst_proc){
+ action->state = SIMIX_DONE;
+ }else{
+ /* If we reached this point, the wait request must have a timeout */
+ /* Otherwise it shouldn't be enabled and executed by the MC */
+ if(timeout == -1)
+ THROW_IMPOSSIBLE;
+
+ if(action->comm.src_proc == req->issuer)
+ action->state = SIMIX_SRC_TIMEOUT;
+ else
+ action->state = SIMIX_DST_TIMEOUT;
+ }
+
SIMIX_comm_finish(action);
return;
}
SIMIX_rdv_remove(action->comm.rdv, action);
action->state = SIMIX_FAILED;
} else {
- surf_workstation_model->action_cancel(action->comm.surf_comm);
+ /* When running the MC there are no surf actions */
+ if(!MC_IS_ENABLED)
+ surf_workstation_model->action_cancel(action->comm.surf_comm);
}
}