XBT_PUBLIC int sg_actor_get_PID(sg_actor_t actor);
XBT_PUBLIC int sg_actor_get_PPID(sg_actor_t actor);
+XBT_PUBLIC sg_actor_t sg_actor_by_PID(aid_t pid);
XBT_PUBLIC const char* sg_actor_get_name(sg_actor_t actor);
XBT_PUBLIC sg_host_t sg_actor_get_host(sg_actor_t actor);
XBT_PUBLIC const char* sg_actor_get_property_value(sg_actor_t actor, const char* name);
XBT_PUBLIC int MSG_process_get_PID(msg_process_t process);
XBT_PUBLIC int MSG_process_get_PPID(msg_process_t process);
+XBT_PUBLIC sg_actor_t MSG_process_from_PID(int pid);
XBT_PUBLIC const char* MSG_process_get_name(msg_process_t process);
XBT_PUBLIC sg_host_t MSG_process_get_host(msg_process_t process);
XBT_PUBLIC void MSG_process_yield();
XBT_PUBLIC void MSG_process_set_data_cleanup(void_f_pvoid_t data_cleanup);
-XBT_PUBLIC msg_process_t MSG_process_from_PID(int PID);
XBT_PUBLIC int MSG_process_self_PID();
XBT_PUBLIC int MSG_process_self_PPID();
XBT_PUBLIC const char* MSG_process_self_name();
{
return sg_actor_get_PPID(actor);
}
+msg_process_t MSG_process_from_PID(int PID)
+{
+ return sg_actor_by_PID(PID);
+}
const char* MSG_process_get_name(sg_actor_t actor)
{
return sg_actor_get_name(actor);
msg_global->process_data_cleanup = data_cleanup;
}
-/** \ingroup m_process_management
- *
- * \brief Return a #msg_process_t given its PID.
- *
- * This function search in the list of all the created msg_process_t for a msg_process_t whose PID is equal to \a PID.
- * If no host is found, \c nullptr is returned.
- Note that the PID are uniq in the whole simulation, not only on a given host.
- */
-msg_process_t MSG_process_from_PID(int PID)
-{
- return SIMIX_process_from_PID(PID)->ciface();
-}
-
/** @brief returns a list of all currently existing processes */
xbt_dynar_t MSG_processes_as_dynar() {
xbt_dynar_t res = xbt_dynar_new(sizeof(smx_actor_t), nullptr);
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.
*/