Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mc_api::get_dst_actor() defined,
[simgrid.git] / src / mc / mc_api.cpp
index 017982caf148a83f437722f9a39b3a10b9209c99..8e305f460a90cd2fda7e6f13f2b1b315f7e2bccd 100644 (file)
@@ -290,6 +290,16 @@ smx_actor_t mc_api::get_src_actor(mc::RemotePtr<kernel::activity::CommImpl> cons
   return src_proc;
 }
 
   return src_proc;
 }
 
+smx_actor_t mc_api::get_dst_actor(mc::RemotePtr<kernel::activity::CommImpl> const& comm_addr) const
+{
+  simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
+  mc_model_checker->get_remote_simulation().read(temp_comm, comm_addr);
+  const simgrid::kernel::activity::CommImpl* comm = temp_comm.get_buffer();
+
+  auto dst_proc = mc_model_checker->get_remote_simulation().resolve_actor(simgrid::mc::remote(comm->dst_actor_.get()));
+  return dst_proc;
+}
+
 std::size_t mc_api::get_remote_heap_bytes() const
 {
   RemoteSimulation& process = mc_model_checker->get_remote_simulation();
 std::size_t mc_api::get_remote_heap_bytes() const
 {
   RemoteSimulation& process = mc_model_checker->get_remote_simulation();