X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1d5439c122fc2718dc2ef620fbdccec5ca83ab5c..31a999f9a0f6420f98301e553cb0e5f0c8b2a1c8:/src/mc/mc_comm_determinism.c diff --git a/src/mc/mc_comm_determinism.c b/src/mc/mc_comm_determinism.c index 91c32f46f2..79bff80723 100644 --- a/src/mc/mc_comm_determinism.c +++ b/src/mc/mc_comm_determinism.c @@ -146,7 +146,7 @@ static void print_communications_pattern(xbt_dynar_t comms_pattern) } } -static void update_comm_pattern(mc_comm_pattern_t comm_pattern, smx_action_t comm) +static void update_comm_pattern(mc_comm_pattern_t comm_pattern, smx_synchro_t comm) { void *addr_pointed; comm_pattern->src_proc = comm->comm.src_proc->pid; @@ -207,7 +207,7 @@ void get_comm_pattern(xbt_dynar_t list, smx_simcall_t request, mc_call_type call } -void complete_comm_pattern(xbt_dynar_t list, smx_action_t comm) +void complete_comm_pattern(xbt_dynar_t list, smx_synchro_t comm) { mc_comm_pattern_t current_comm_pattern; unsigned int cursor = 0; @@ -317,7 +317,6 @@ void MC_modelcheck_comm_determinism(void) smx_simcall_t req = NULL; smx_process_t process = NULL; mc_state_t state = NULL, next_state = NULL; - smx_action_t current_comm; xbt_dynar_t current_pattern; while (xbt_fifo_size(mc_stack) > 0) { @@ -357,23 +356,11 @@ void MC_modelcheck_comm_determinism(void) } /* Answer the request */ - SIMIX_simcall_enter(req, value); /* After this call req is no longer usefull */ + SIMIX_simcall_handle(req, value); /* After this call req is no longer useful */ MC_SET_MC_HEAP; current_pattern = !initial_global_state->initial_communications_pattern_done ? initial_communications_pattern : communications_pattern; - if (call == MC_CALL_TYPE_SEND) { /* Send */ - get_comm_pattern(current_pattern, req, call); - } else if (call == MC_CALL_TYPE_RECV) { /* Recv */ - get_comm_pattern(current_pattern, req, call); - } else if (call == MC_CALL_TYPE_WAIT) { /* Wait */ - current_comm = simcall_comm_wait__get__comm(req); - if (current_comm->comm.refcount == 1) /* First wait only must be considered */ - complete_comm_pattern(current_pattern, current_comm); - } else if (call == MC_CALL_TYPE_WAITANY) { /* WaitAny */ - current_comm = xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_action_t); - if (current_comm->comm.refcount == 1) /* First wait only must be considered */ - complete_comm_pattern(current_pattern, current_comm); - } + mc_update_comm_pattern(call, req, value, current_pattern); MC_SET_STD_HEAP; /* Wait for requests (schedules processes) */