X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5a2092b20ade8cd9ba54125b5528260f123de8ce..648ed185a1cfef73179102bd7340785a4fd5d2a6:/src/s4u/s4u_Actor.cpp diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index 45239547be..e4744b6638 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -461,6 +461,19 @@ int sg_actor_get_PPID(sg_actor_t actor) return actor->get_ppid(); } +/** \ingroup m_actor_management + * + * \brief Return a #sg_actor_t given its PID. + * + * This function search in the list of all the created sg_actor_t for a sg_actor_t whose PID is equal to \a PID. + * If none is found, \c nullptr is returned. + Note that the PID are unique in the whole simulation, not only on a given host. + */ +sg_actor_t sg_actor_by_PID(aid_t pid) +{ + return simgrid::s4u::Actor::by_pid(pid).get(); +} + /** \ingroup m_actor_management * \brief Return the name of an actor. */