X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/46bee330f12265d985ada4464d888145afcf7170..14fc68d1ad374e551851d1ec09a8e09c42265f3c:/src/mc/checker/CommunicationDeterminismChecker.cpp diff --git a/src/mc/checker/CommunicationDeterminismChecker.cpp b/src/mc/checker/CommunicationDeterminismChecker.cpp index 678544e23e..73df3d8cd3 100644 --- a/src/mc/checker/CommunicationDeterminismChecker.cpp +++ b/src/mc/checker/CommunicationDeterminismChecker.cpp @@ -111,17 +111,18 @@ static char* print_determinism_result(simgrid::mc::CommPatternDifference diff, a } static void update_comm_pattern(simgrid::mc::PatternCommunication* comm_pattern, - const simgrid::kernel::activity::CommImpl* comm_addr) + simgrid::mc::RemotePtr const& comm_addr) { - auto src_proc = api::get().get_src_actor(comm_addr); - auto dst_proc = api::get().get_dst_actor(comm_addr); + auto src_proc = api::get().get_src_actor(comm_addr.local()); + auto dst_proc = api::get().get_dst_actor(comm_addr.local()); comm_pattern->src_proc = src_proc->get_pid(); comm_pattern->dst_proc = dst_proc->get_pid(); comm_pattern->src_host = api::get().get_actor_host_name(src_proc); comm_pattern->dst_host = api::get().get_actor_host_name(dst_proc); - if (comm_pattern->data.empty()) + if (comm_pattern->data.empty()) { comm_pattern->data = api::get().get_pattern_comm_data(comm_addr); + } } namespace simgrid { @@ -192,13 +193,13 @@ void CommunicationDeterminismChecker::get_comm_pattern(smx_simcall_t request, Ca pattern->type = PatternCommunicationType::send; pattern->comm_addr = api::get().get_comm_isend_raw_addr(request).local(); pattern->rdv = api::get().get_pattern_comm_rdv(remote(pattern->comm_addr)); - pattern->src_proc = api::get().get_pattern_comm_src_proc(pattern->comm_addr); + pattern->src_proc = api::get().get_pattern_comm_src_proc(remote(pattern->comm_addr)); pattern->src_host = Api::get().get_actor_host_name(issuer); #if HAVE_SMPI pattern->tag = api::get().get_smpi_request_tag(request, simgrid::simix::Simcall::COMM_ISEND); #endif - pattern->data = api::get().get_pattern_comm_data(pattern->comm_addr); + pattern->data = api::get().get_pattern_comm_data(remote(pattern->comm_addr)); #if HAVE_SMPI auto send_detached = api::get().check_send_request_detached(request); @@ -223,7 +224,7 @@ void CommunicationDeterminismChecker::get_comm_pattern(smx_simcall_t request, Ca #endif auto comm_addr = pattern->comm_addr; pattern->rdv = api::get().get_pattern_comm_rdv(remote(comm_addr)); - pattern->dst_proc = api::get().get_pattern_comm_dst_proc(comm_addr); + pattern->dst_proc = api::get().get_pattern_comm_dst_proc(remote(comm_addr)); pattern->dst_host = api::get().get_actor_host_name(issuer); } else xbt_die("Unexpected call_type %i", (int)call_type); @@ -232,18 +233,18 @@ void CommunicationDeterminismChecker::get_comm_pattern(smx_simcall_t request, Ca incomplete_communications_pattern[issuer->get_pid()].push_back(pattern.release()); } -void CommunicationDeterminismChecker::complete_comm_pattern(const kernel::activity::CommImpl* comm_addr, aid_t issuer, +void CommunicationDeterminismChecker::complete_comm_pattern(RemotePtr const& comm_addr, aid_t issuer, int backtracking) { /* Complete comm pattern */ std::vector& incomplete_pattern = incomplete_communications_pattern[issuer]; auto current_comm_pattern = std::find_if(begin(incomplete_pattern), end(incomplete_pattern), - [&comm_addr](const PatternCommunication* comm) { return api::get().comm_addr_equal(comm->comm_addr, comm_addr); }); + [&comm_addr](const PatternCommunication* comm) { return api::get().comm_addr_equal(comm->comm_addr, comm_addr.local()); }); if (current_comm_pattern == std::end(incomplete_pattern)) xbt_die("Corresponding communication not found!"); - update_comm_pattern(*current_comm_pattern, comm_addr); + update_comm_pattern(*current_comm_pattern, remote(comm_addr.local())); std::unique_ptr comm_pattern(*current_comm_pattern); XBT_DEBUG("Remove incomplete comm pattern for process %ld at cursor %zd", issuer, std::distance(begin(incomplete_pattern), current_comm_pattern)); @@ -398,13 +399,13 @@ void CommunicationDeterminismChecker::handle_comm_pattern(simgrid::mc::CallType break; case CallType::WAIT: case CallType::WAITANY: { - const simgrid::kernel::activity::CommImpl* comm_addr = nullptr; + simgrid::kernel::activity::CommImpl* comm_addr = nullptr; if (call_type == CallType::WAIT) comm_addr = api::get().get_comm_wait_raw_addr(req); else comm_addr = api::get().get_comm_waitany_raw_addr(req, value); auto simcall_issuer = api::get().simcall_get_issuer(req); - complete_comm_pattern(comm_addr, simcall_issuer->get_pid(), backtracking); + complete_comm_pattern(remote(comm_addr), simcall_issuer->get_pid(), backtracking); } break; default: xbt_die("Unexpected call type %i", (int)call_type);