Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] add Actor::getPPid and this_actor::getPPid()
authoradfaure <adrien.faure2@gmail.com>
Thu, 11 Aug 2016 08:50:28 +0000 (10:50 +0200)
committeradfaure <adrien.faure2@gmail.com>
Thu, 11 Aug 2016 09:05:42 +0000 (11:05 +0200)
include/simgrid/s4u/Actor.hpp
src/s4u/s4u_actor.cpp

index 5fbd5f8..a858bdf 100644 (file)
@@ -223,6 +223,8 @@ public:
   s4u::Host *getHost();
   /** Retrieves the PID of that actor */
   int getPid();
+  /** Retrieves the PPID of that actor */
+  int getPpid();
 
   /** If set to true, the actor will automatically restart when its host reboots */
   void setAutoRestart(bool autorestart);
@@ -305,6 +307,11 @@ namespace this_actor {
    * Return the PID of the current actor.
    */
   XBT_PUBLIC(int) getPid();
+  
+  /**
+   * Return the PPID of the current actor.
+   */
+  int getPpid();
 
 };
 
index d14a9bf..444fa6c 100644 (file)
@@ -74,6 +74,10 @@ int Actor::getPid(){
   return pimpl_->pid;
 }
 
+int Actor::getPpid() {
+  return pimpl_->ppid;
+}
+
 void Actor::setKillTime(double time) {
   simcall_process_set_kill_time(pimpl_,time);
 }
@@ -158,6 +162,10 @@ int getPid() {
   return SIMIX_process_self()->pid;
 }
 
+int getPpid() {
+  return SIMIX_process_self()->ppid;
+}
+
 }
 }
 }