X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9f9eacbd59910b9bce3a39e41ce1d966f9a60c4c..e6dcda80c72f6c1c092cf257c308812fe4442599:/src/mc/checker/CommunicationDeterminismChecker.cpp diff --git a/src/mc/checker/CommunicationDeterminismChecker.cpp b/src/mc/checker/CommunicationDeterminismChecker.cpp index 42e0f62613..4b56822d56 100644 --- a/src/mc/checker/CommunicationDeterminismChecker.cpp +++ b/src/mc/checker/CommunicationDeterminismChecker.cpp @@ -372,7 +372,7 @@ void CommunicationDeterminismChecker::restoreState() /* TODO : handle test and testany simcalls */ CallType call = MC_get_call_type(req); mcapi::get().handle_simcall(state->transition_); - MC_handle_comm_pattern(call, req, req_num, 1); + handle_comm_pattern(call, req, req_num, 1); mcapi::get().mc_wait_for_requests(); /* Update statistics */ @@ -381,6 +381,31 @@ void CommunicationDeterminismChecker::restoreState() } } +void CommunicationDeterminismChecker::handle_comm_pattern(simgrid::mc::CallType call_type, smx_simcall_t req, int value, int backtracking) +{ + using simgrid::mc::CallType; + switch(call_type) { + case CallType::NONE: + break; + case CallType::SEND: + case CallType::RECV: + get_comm_pattern(req, call_type, backtracking); + break; + case CallType::WAIT: + case CallType::WAITANY: { + simgrid::mc::RemotePtr comm_addr{nullptr}; + if (call_type == CallType::WAIT) + comm_addr = mcapi::get().get_comm_wait_raw_addr(req); + else + comm_addr = mcapi::get().get_comm_waitany_raw_addr(req, value); + auto simcall_issuer = mcapi::get().simcall_get_issuer(req); + complete_comm_pattern(comm_addr, simcall_issuer->get_pid(), backtracking); + } break; + default: + xbt_die("Unexpected call type %i", (int)call_type); + } +} + void CommunicationDeterminismChecker::real_run() { std::unique_ptr visited_state = nullptr; @@ -422,7 +447,7 @@ void CommunicationDeterminismChecker::real_run() mcapi::get().handle_simcall(cur_state->transition_); /* After this call req is no longer useful */ - MC_handle_comm_pattern(call, req, req_num, 0); + handle_comm_pattern(call, req, req_num, 0); /* Wait for requests (schedules processes) */ mcapi::get().mc_wait_for_requests();