-void MC_state_copy_index_communications_pattern(mc_state_t state)
-{
- state->index_comm = xbt_dynar_new(sizeof(unsigned int), NULL);
- mc_list_comm_pattern_t list_process_comm;
- unsigned int cursor;
- xbt_dynar_foreach(initial_communications_pattern, cursor, list_process_comm){
- xbt_dynar_push_as(state->index_comm, unsigned int, list_process_comm->index_comm);
- }
-}
-
-void MC_handle_comm_pattern(
- e_mc_call_type_t call_type, smx_simcall_t req,
- int value, xbt_dynar_t pattern, int backtracking)
-{
-
- switch(call_type) {
- case MC_CALL_TYPE_NONE:
- break;
- case MC_CALL_TYPE_SEND:
- case MC_CALL_TYPE_RECV:
- MC_get_comm_pattern(pattern, req, call_type, backtracking);
- break;
- case MC_CALL_TYPE_WAIT:
- case MC_CALL_TYPE_WAITANY:
- {
- smx_synchro_t comm_addr = NULL;
- if (call_type == MC_CALL_TYPE_WAIT)
- comm_addr = simcall_comm_wait__get__comm(req);
- else
- // comm_addr = REMOTE(xbt_dynar_get_as(simcall_comm_waitany__get__comms(req), value, smx_synchro_t)):
- simgrid::mc::read_element(mc_model_checker->process(), &comm_addr,
- remote(simcall_comm_waitany__get__comms(req)), value, sizeof(comm_addr));
- MC_complete_comm_pattern(pattern, comm_addr,
- MC_smx_simcall_get_issuer(req)->pid, backtracking);
- }
- break;
- default:
- xbt_die("Unexpected call type %i", (int)call_type);
- }
-
-}
-
-void MC_comm_pattern_free(mc_comm_pattern_t p)
-{
- xbt_free(p->rdv);
- xbt_free(p->data);
- xbt_free(p);
- p = NULL;
-}
-
-static void MC_list_comm_pattern_free(mc_list_comm_pattern_t l)
-{
- xbt_dynar_free(&(l->list));
- xbt_free(l);
- l = NULL;
-}
-
-void MC_comm_pattern_free_voidp(void *p)
-{
- MC_comm_pattern_free((mc_comm_pattern_t) * (void **) p);
-}
-
-void MC_list_comm_pattern_free_voidp(void *p)
-{
- MC_list_comm_pattern_free((mc_list_comm_pattern_t) * (void **) p);
-}
-
-}