X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4d27a92b07b781ad03da0848332a26c289358bc9..8a6229b1219b87682cf66abc13f5c2c0cd4fdb17:/src/mc/mc_state.c diff --git a/src/mc/mc_state.c b/src/mc/mc_state.c index 29621f18fa..c7ff71ce1b 100644 --- a/src/mc/mc_state.c +++ b/src/mc/mc_state.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2012 Da SimGrid Team. All rights reserved. */ +/* Copyright (c) 2008-2013 Da SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -18,20 +18,8 @@ mc_state_t MC_state_new() state->max_pid = simix_process_maxpid; state->proc_status = xbt_new0(s_mc_procstate_t, state->max_pid); state->system_state = NULL; - - mc_stats->expanded_states++; - return state; -} - -mc_state_t MC_state_pair_new(void) -{ - mc_state_t state = NULL; + state->num = ++mc_stats->expanded_states; - state = xbt_new0(s_mc_state_t, 1); - state->max_pid = simix_process_maxpid; - state->proc_status = xbt_new0(s_mc_procstate_t, state->max_pid); - - //mc_stats->expanded_states++; return state; } @@ -121,12 +109,11 @@ void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req, int valu case SIMCALL_MC_RANDOM: state->internal_req = *req; - simcall_mc_random__set__result(&state->internal_req, value); - if(value == 0){ + if(value != simcall_mc_random__get__max(req)){ xbt_swag_foreach(process, simix_global->process_list){ procstate = &state->proc_status[process->pid]; if(process->pid == req->issuer->pid){ - procstate->state = MC_MORE_INTERLEAVE; + procstate->state = MC_MORE_INTERLEAVE; break; } } @@ -212,8 +199,10 @@ smx_simcall_t MC_state_get_request(mc_state_t state, int *value) case SIMCALL_MC_RANDOM: if(procstate->state == MC_INTERLEAVE) *value = 0; - else - *value = 1; + else{ + if(state->req_num < simcall_mc_random__get__max(&process->simcall)) + *value = state->req_num + 1; + } procstate->state = MC_DONE; return &process->simcall; break;