- /* Execute the selected transition by scheduling it's associated process.
- Then schedule every process that got ready to run due to the execution
- of the transition */
- DEBUG1("Executing transition %s", trans->name);
- SIMIX_process_schedule(trans->process);
- MC_execute_surf_actions(); /* Do surf's related black magic */
- MC_schedule_enabled_processes();
-
- if(trans->type == mc_random && trans->current_value < trans->max ){
- trans->current_value++;
- }else{
- trans->current_value = trans->min;
- xbt_setset_set_remove(mc_current_state->interleave, trans);
- xbt_setset_set_insert(mc_current_state->done, trans);
- }
-
- /* Calculate the enabled transitions set of the next state:
- -add the transition sets of the current state and the next state
- -remove the executed transition from that set
- -remove all the transitions that are disabled (mc_wait only)
- -use the resulting set as the enabled transitions of the next state */
- MC_SET_RAW_MEM;
- xbt_setset_add(next_state->transitions, mc_current_state->transitions);
- xbt_setset_set_remove(next_state->transitions, trans);
- xbt_setset_add(next_state->enabled_transitions, next_state->transitions);
- xbt_setset_foreach(next_state->enabled_transitions, cursor, trans){
- if(trans->type == mc_wait
- && (trans->comm->src_proc == NULL || trans->comm->dst_proc == NULL)){
- xbt_setset_set_remove(next_state->enabled_transitions, trans);
+ /* Get an enabled process and insert it in the interleave set of the next state */
+ xbt_swag_foreach(process, simix_global->process_list){
+ if(MC_process_is_enabled(process)){
+ MC_state_interleave_process(next_state, process);
+ break;