- mc_state_t state = NULL;
-
- state = xbt_new0(s_mc_state_t, 1);
- state->created_transitions = xbt_setset_new_set(mc_setset);
- state->transitions = xbt_setset_new_set(mc_setset);
- state->enabled_transitions = xbt_setset_new_set(mc_setset);
- state->interleave = xbt_setset_new_set(mc_setset);
- state->done = xbt_setset_new_set(mc_setset);
- state->executed_transition = NULL;
-
- mc_stats->expanded_states++;
-
- return state;
-}
-/**
- * \brief Deletes a state data structure
- * \param trans The state to be deleted
- */
-void MC_state_delete(mc_state_t state)
-{
- xbt_setset_cursor_t cursor;
- mc_transition_t trans;
-
- xbt_setset_foreach(state->created_transitions, cursor, trans){
- MC_transition_delete(trans);
- }
-
- xbt_setset_destroy_set(state->created_transitions);
- xbt_setset_destroy_set(state->transitions);
- xbt_setset_destroy_set(state->enabled_transitions);
- xbt_setset_destroy_set(state->interleave);
- xbt_setset_destroy_set(state->done);
-
- xbt_free(state);
-}
-
-/************************** SURF Emulation ************************************/
-
-/* Dirty hack, we manipulate surf's clock to simplify the integration of the
- model-checker */
-extern double NOW;
-
-/**
- * \brief Executes all the actions at every model
- */
-void MC_execute_surf_actions(void)
-{
- unsigned int iter;
- surf_action_t action = NULL;
- surf_model_t model = NULL;
- smx_action_t smx_action = NULL;
-
- /* Execute all the actions in every model */
- xbt_dynar_foreach(model_list, iter, model){
- while ((action = xbt_swag_extract(model->states.running_action_set))){
- /* FIXME: timeouts are not calculated correctly */
- if(NOW >= action->max_duration){
- surf_action_state_set(action, SURF_ACTION_DONE);
- smx_action = action->data;
- DEBUG5("Resource [%s] (%d): Executing RUNNING action \"%s\" (%p) MaxDuration %lf",
- model->name, xbt_swag_size(model->states.running_action_set),
- smx_action->name, smx_action, action->max_duration);
-
- /* Copy the transfered data of the completed network actions */
- /* FIXME: be carefull it might not be an action of the network model */
- if(smx_action && smx_action->data != NULL)
- SIMIX_network_copy_data((smx_comm_t)smx_action->data);
-
- if(smx_action)
- SIMIX_action_signal_all(smx_action);
+ char *req_str = NULL;
+ smx_req_t req = NULL;
+
+ do {
+ SIMIX_context_runall(simix_global->process_to_run);
+ while((req = SIMIX_request_pop())){
+ if(!SIMIX_request_is_visible(req))
+ SIMIX_request_pre(req);
+ else if(req->call == REQ_COMM_WAITANY)
+ THROW_UNIMPLEMENTED;
+ else if(XBT_LOG_ISENABLED(mc_global, xbt_log_priority_debug)){
+ req_str = MC_request_to_string(req);
+ DEBUG1("Got: %s", req_str);
+ xbt_free(req_str);