Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further snake_case Actor (::this_actor remains)
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 9 Apr 2018 20:24:19 +0000 (22:24 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 9 Apr 2018 20:27:13 +0000 (22:27 +0200)
17 files changed:
examples/s4u/actor-kill/s4u-actor-kill.cpp
examples/s4u/platform-properties/s4u-platform-properties.cpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Mailbox.hpp
src/bindings/java/jmsg_process.cpp
src/kernel/activity/MailboxImpl.cpp
src/mc/remote/Client.cpp
src/msg/msg_gos.cpp
src/msg/msg_process.cpp
src/s4u/s4u_actor.cpp
src/s4u/s4u_comm.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/internals/smpi_process.cpp
src/smpi/mpi/smpi_comm.cpp
src/smpi/mpi/smpi_request.cpp
teshsuite/s4u/actor/actor.cpp
teshsuite/s4u/pid/pid.cpp

index fb1efa6..f2dd73d 100644 (file)
@@ -60,7 +60,7 @@ static void killer()
   simgrid::s4u::this_actor::sleep_for(1);
 
   XBT_INFO("Killing everybody but myself");
   simgrid::s4u::this_actor::sleep_for(1);
 
   XBT_INFO("Killing everybody but myself");
-  simgrid::s4u::Actor::killAll();
+  simgrid::s4u::Actor::kill_all();
 
   XBT_INFO("OK, goodbye now. I commit a suicide.");
   simgrid::s4u::this_actor::kill();
 
   XBT_INFO("OK, goodbye now. I commit a suicide.");
   simgrid::s4u::this_actor::kill();
index 05a510e..d04311c 100644 (file)
@@ -78,7 +78,7 @@ static int bob(int argc, char* argv[])
   XBT_INFO("   Zone property: author -> %s", root->getProperty("author"));
 
   /* Get the property list of current bob process */
   XBT_INFO("   Zone property: author -> %s", root->getProperty("author"));
 
   /* Get the property list of current bob process */
-  std::map<std::string, std::string>* props = simgrid::s4u::Actor::self()->getProperties();
+  std::map<std::string, std::string>* props = simgrid::s4u::Actor::self()->get_properties();
   const char* noexist = "UnknownProcessProp";
   XBT_ATTRIB_UNUSED const char* value;
 
   const char* noexist = "UnknownProcessProp";
   XBT_ATTRIB_UNUSED const char* value;
 
@@ -88,8 +88,8 @@ static int bob(int argc, char* argv[])
 
   XBT_INFO("== Try to get an actor property that does not exist");
 
 
   XBT_INFO("== Try to get an actor property that does not exist");
 
-  value = simgrid::s4u::Actor::self()->getProperty(noexist);
-  xbt_assert(not value, "The property is defined (it shouldnt)");
+  value = simgrid::s4u::Actor::self()->get_property(noexist);
+  xbt_assert(not value, "The property is defined (it should not)");
   return 0;
 }
 
   return 0;
 }
 
index 87e2f59..22a5199 100644 (file)
@@ -213,11 +213,11 @@ public:
   /** Retrieves the PID of that actor
    *
    * aid_t is an alias for long */
   /** Retrieves the PID of that actor
    *
    * aid_t is an alias for long */
-  aid_t get_pid();
+  aid_t get_pid() const;
   /** Retrieves the PPID of that actor
    *
    * aid_t is an alias for long */
   /** Retrieves the PPID of that actor
    *
    * aid_t is an alias for long */
-  aid_t get_ppid();
+  aid_t get_ppid() const;
 
   /** Suspend an actor by suspending the task on which it was waiting for the completion. */
   void suspend();
 
   /** Suspend an actor by suspending the task on which it was waiting for the completion. */
   void suspend();
@@ -228,20 +228,20 @@ public:
   void yield();
 
   /** Returns true if the actor is suspended. */
   void yield();
 
   /** Returns true if the actor is suspended. */
-  int isSuspended();
+  int is_suspended();
 
   /** If set to true, the actor will automatically restart when its host reboots */
 
   /** If set to true, the actor will automatically restart when its host reboots */
-  void setAutoRestart(bool autorestart);
+  void set_auto_restart(bool autorestart);
 
   /** Add a function to the list of "on_exit" functions for the current actor. The on_exit functions are the functions
    * executed when your actor is killed. You should use them to free the data used by your actor.
    */
 
   /** Add a function to the list of "on_exit" functions for the current actor. The on_exit functions are the functions
    * executed when your actor is killed. You should use them to free the data used by your actor.
    */
-  void onExit(int_f_pvoid_pvoid_t fun, void* data);
+  void on_exit(int_f_pvoid_pvoid_t fun, void* data);
 
   /** Sets the time at which that actor should be killed */
 
   /** Sets the time at which that actor should be killed */
-  void setKillTime(double time);
+  void set_kill_time(double time);
   /** Retrieves the time at which that actor will be killed (or -1 if not set) */
   /** Retrieves the time at which that actor will be killed (or -1 if not set) */
-  double getKillTime();
+  double get_kill_time();
 
   void migrate(Host * new_host);
 
 
   void migrate(Host * new_host);
 
@@ -258,7 +258,7 @@ public:
   static void kill(aid_t pid);
 
   /** Retrieves the actor that have the given PID (or nullptr if not existing) */
   static void kill(aid_t pid);
 
   /** Retrieves the actor that have the given PID (or nullptr if not existing) */
-  static ActorPtr byPid(aid_t pid);
+  static ActorPtr by_pid(aid_t pid);
 
   /** @brief Wait for the actor to finish.
    *
 
   /** @brief Wait for the actor to finish.
    *
@@ -266,21 +266,18 @@ public:
    */
   void join();
   void join(double timeout);
    */
   void join();
   void join(double timeout);
-
-  // Static methods on all actors:
+  Actor* restart();
 
   /** Ask kindly to all actors to die. Only the issuer will survive. */
 
   /** Ask kindly to all actors to die. Only the issuer will survive. */
-  static void killAll();
-  static void killAll(int resetPid);
+  static void kill_all();
 
   /** Returns the internal implementation of this actor */
 
   /** Returns the internal implementation of this actor */
-  kernel::actor::ActorImpl* getImpl();
+  kernel::actor::ActorImpl* get_impl();
 
   /** Retrieve the property value (or nullptr if not set) */
 
   /** Retrieve the property value (or nullptr if not set) */
-  std::map<std::string, std::string>* getProperties();
-  const char* getProperty(const char* key);
-  void setProperty(const char* key, const char* value);
-  Actor* restart();
+  std::map<std::string, std::string>* get_properties(); // FIXME: do not export the map, but only the keys or something
+  const char* get_property(const char* key);
+  void set_property(const char* key, const char* value);
 
   XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr
       createActor(const char* name, s4u::Host* host, std::function<void()> code)
 
   XBT_ATTRIB_DEPRECATED_v323("Please use Actor::create()") static ActorPtr
       createActor(const char* name, s4u::Host* host, std::function<void()> code)
@@ -313,6 +310,36 @@ public:
   XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_host()") Host* getHost() { return get_host(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_pid()") aid_t getPid() { return get_pid(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_ppid()") aid_t getPpid() { return get_ppid(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_host()") Host* getHost() { return get_host(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_pid()") aid_t getPid() { return get_pid(); }
   XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_ppid()") aid_t getPpid() { return get_ppid(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::is_suspended()") int isSuspended() { return is_suspended(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::set_auto_restart()") void setAutoRestart(bool a)
+  {
+    set_auto_restart(a);
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::on_exit()") void onExit(int_f_pvoid_pvoid_t fun, void* data)
+  {
+    on_exit(fun, data);
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::set_kill_time()") void setKillTime(double time) { set_kill_time(time); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_kill_time()") double getKillTime() { return get_kill_time(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::by_pid()") static ActorPtr byPid(aid_t pid) { return by_pid(pid); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::kill_all()") static void killAll() { kill_all(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::kill_all() with no parameter") static void killAll(int resetPid)
+  {
+    kill_all();
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_impl()") kernel::actor::ActorImpl* getImpl() { return get_impl(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_property()") const char* getProperty(const char* key)
+  {
+    return get_property(key);
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_properties()") std::map<std::string, std::string>* getProperties()
+  {
+    return get_properties();
+  }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_properties()") void setProperty(const char* key, const char* value)
+  {
+    set_property(key, value);
+  }
 };
 
 /** @ingroup s4u_api
 };
 
 /** @ingroup s4u_api
index 827bc8a..f27b582 100644 (file)
@@ -118,13 +118,17 @@ class XBT_PUBLIC Mailbox {
   friend void intrusive_ptr_release(Mailbox*) {}
 public:
   /** private function, do not use. FIXME: make me protected */
   friend void intrusive_ptr_release(Mailbox*) {}
 public:
   /** private function, do not use. FIXME: make me protected */
-  kernel::activity::MailboxImpl* getImpl() { return pimpl_; }
+  kernel::activity::MailboxImpl* get_impl() { return pimpl_; }
 
   XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_name()") const simgrid::xbt::string& getName() const
   {
     return get_name();
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_cname()") const char* getCname() const { return get_cname(); }
 
   XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_name()") const simgrid::xbt::string& getName() const
   {
     return get_name();
   }
   XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_cname()") const char* getCname() const { return get_cname(); }
+  XBT_ATTRIB_DEPRECATED_v323("Please use Mailbox::get_impl()") kernel::activity::MailboxImpl* getImpl()
+  {
+    return get_impl();
+  }
 
   /** @brief Retrieves the name of that mailbox as a C++ string */
   const simgrid::xbt::string& get_name() const;
 
   /** @brief Retrieves the name of that mailbox as a C++ string */
   const simgrid::xbt::string& get_name() const;
index a25eb46..edc2a4b 100644 (file)
@@ -195,7 +195,7 @@ JNICALL Java_org_simgrid_msg_Process_setAutoRestart (JNIEnv *env, jobject jproce
     return;
   }
 
     return;
   }
 
-  process->setAutoRestart(jauto_restart == JNI_TRUE);
+  process->set_auto_restart(jauto_restart == JNI_TRUE);
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart (JNIEnv *env, jobject jprocess) {
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart (JNIEnv *env, jobject jprocess) {
@@ -219,7 +219,7 @@ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended(JNIEnv * env
   }
 
   /* true is the process is suspended, false otherwise */
   }
 
   /* true is the process is suspended, false otherwise */
-  return (jboolean)process->isSuspended();
+  return (jboolean)process->is_suspended();
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep(JNIEnv *env, jclass cls, jlong jmillis, jint jnanos)
index d07fe99..d859649 100644 (file)
@@ -54,7 +54,7 @@ MailboxImpl* MailboxImpl::byNameOrCreate(const char* name)
 void MailboxImpl::setReceiver(s4u::ActorPtr actor)
 {
   if (actor != nullptr)
 void MailboxImpl::setReceiver(s4u::ActorPtr actor)
 {
   if (actor != nullptr)
-    this->permanent_receiver = actor.get()->getImpl();
+    this->permanent_receiver = actor.get()->get_impl();
   else
     this->permanent_receiver = nullptr;
 }
   else
     this->permanent_receiver = nullptr;
 }
index 9c741c4..4d009a3 100644 (file)
@@ -114,7 +114,7 @@ void Client::handleSimcall(s_mc_message_simcall_handle_t* message)
 void Client::handleRestore(s_mc_message_restore_t* message)
 {
 #if HAVE_SMPI
 void Client::handleRestore(s_mc_message_restore_t* message)
 {
 #if HAVE_SMPI
-  smpi_really_switch_data_segment(simgrid::s4u::Actor::byPid(message->index));
+  smpi_really_switch_data_segment(simgrid::s4u::Actor::by_pid(message->index));
 #endif
 }
 void Client::handleActorEnabled(s_mc_message_actor_enabled_t* msg)
 #endif
 }
 void Client::handleActorEnabled(s_mc_message_actor_enabled_t* msg)
index 970a0fc..5415b72 100644 (file)
@@ -279,7 +279,8 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t * task, const char *alias, d
 
   /* Try to receive it by calling SIMIX network layer */
   try {
 
   /* Try to receive it by calling SIMIX network layer */
   try {
-    simcall_comm_recv(MSG_process_self()->getImpl(), mailbox->getImpl(), task, nullptr, nullptr, nullptr, nullptr, timeout, rate);
+    simcall_comm_recv(MSG_process_self()->get_impl(), mailbox->get_impl(), task, nullptr, nullptr, nullptr, nullptr,
+                      timeout, rate);
     XBT_DEBUG("Got task %s from %s", (*task)->name, mailbox->get_cname());
     (*task)->simdata->setNotUsed();
   }
     XBT_DEBUG("Got task %s from %s", (*task)->name, mailbox->get_cname());
     (*task)->simdata->setNotUsed();
   }
@@ -325,7 +326,7 @@ static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char* al
 
   /* Send it by calling SIMIX network layer */
   smx_activity_t act =
 
   /* Send it by calling SIMIX network layer */
   smx_activity_t act =
-      simcall_comm_isend(myself->getImpl(), mailbox->getImpl(), t_simdata->bytes_amount, t_simdata->rate, task,
+      simcall_comm_isend(myself->get_impl(), mailbox->get_impl(), t_simdata->bytes_amount, t_simdata->rate, task,
                          sizeof(void*), nullptr, cleanup, nullptr, nullptr, detached);
   t_simdata->comm = boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(act);
 
                          sizeof(void*), nullptr, cleanup, nullptr, nullptr, detached);
   t_simdata->comm = boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(act);
 
@@ -461,9 +462,9 @@ msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name, double rat
     XBT_CRITICAL("MSG_task_irecv() was asked to write in a non empty task struct.");
 
   /* Try to receive it by calling SIMIX network layer */
     XBT_CRITICAL("MSG_task_irecv() was asked to write in a non empty task struct.");
 
   /* Try to receive it by calling SIMIX network layer */
-  msg_comm_t comm =
-      new simgrid::msg::Comm(nullptr, task, simcall_comm_irecv(SIMIX_process_self(), mbox->getImpl(), task, nullptr,
-                                                               nullptr, nullptr, nullptr, rate));
+  msg_comm_t comm = new simgrid::msg::Comm(
+      nullptr, task,
+      simcall_comm_irecv(SIMIX_process_self(), mbox->get_impl(), task, nullptr, nullptr, nullptr, nullptr, rate));
 
   return comm;
 }
 
   return comm;
 }
@@ -794,7 +795,7 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl
   /* Try to send it by calling SIMIX network layer */
   try {
     smx_activity_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simix call  */
   /* Try to send it by calling SIMIX network layer */
   try {
     smx_activity_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simix call  */
-    comm = simcall_comm_isend(SIMIX_process_self(), mailbox->getImpl(), t_simdata->bytes_amount, t_simdata->rate, task,
+    comm = simcall_comm_isend(SIMIX_process_self(), mailbox->get_impl(), t_simdata->bytes_amount, t_simdata->rate, task,
                               sizeof(void*), nullptr, nullptr, nullptr, nullptr, 0);
     if (TRACE_is_enabled())
       simcall_set_category(comm, task->category);
                               sizeof(void*), nullptr, nullptr, nullptr, nullptr, 0);
     if (TRACE_is_enabled())
       simcall_set_category(comm, task->category);
index 94f03ff..ce9f382 100644 (file)
@@ -57,7 +57,7 @@ smx_actor_t MSG_process_create_from_SIMIX(const char* name, std::function<void()
                                           smx_actor_t /*parent_process*/)
 {
   msg_process_t p = MSG_process_create_from_stdfunc(name, std::move(code), data, host, properties);
                                           smx_actor_t /*parent_process*/)
 {
   msg_process_t p = MSG_process_create_from_stdfunc(name, std::move(code), data, host, properties);
-  return p == nullptr ? nullptr : p->getImpl();
+  return p == nullptr ? nullptr : p->get_impl();
 }
 
 /** \ingroup m_process_management
 }
 
 /** \ingroup m_process_management
@@ -212,7 +212,7 @@ void* MSG_process_get_data(msg_process_t process)
   xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
 
   /* get from SIMIX the MSG process data, and then the user data */
   xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
 
   /* get from SIMIX the MSG process data, and then the user data */
-  simgrid::msg::ActorExt* msgExt = (simgrid::msg::ActorExt*)process->getImpl()->userdata;
+  simgrid::msg::ActorExt* msgExt = (simgrid::msg::ActorExt*)process->get_impl()->userdata;
   if (msgExt)
     return msgExt->data;
   else
   if (msgExt)
     return msgExt->data;
   else
@@ -228,7 +228,7 @@ msg_error_t MSG_process_set_data(msg_process_t process, void *data)
 {
   xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
 
 {
   xbt_assert(process != nullptr, "Invalid parameter: first parameter must not be nullptr!");
 
-  static_cast<simgrid::msg::ActorExt*>(process->getImpl()->userdata)->data = data;
+  static_cast<simgrid::msg::ActorExt*>(process->get_impl()->userdata)->data = data;
 
   return MSG_OK;
 }
 
   return MSG_OK;
 }
@@ -311,7 +311,7 @@ msg_process_t MSG_process_self()
 }
 
 smx_context_t MSG_process_get_smx_ctx(msg_process_t process) { // deprecated -- smx_context_t should die afterward
 }
 
 smx_context_t MSG_process_get_smx_ctx(msg_process_t process) { // deprecated -- smx_context_t should die afterward
-  return process->getImpl()->context;
+  return process->get_impl()->context;
 }
 /**
  * \ingroup m_process_management
 }
 /**
  * \ingroup m_process_management
@@ -329,7 +329,7 @@ void MSG_process_on_exit(int_f_pvoid_pvoid_t fun, void *data) {
  */
 XBT_PUBLIC void MSG_process_auto_restart_set(msg_process_t process, int auto_restart)
 {
  */
 XBT_PUBLIC void MSG_process_auto_restart_set(msg_process_t process, int auto_restart)
 {
-  process->setAutoRestart(auto_restart);
+  process->set_auto_restart(auto_restart);
 }
 
 /** @ingroup m_process_management
 }
 
 /** @ingroup m_process_management
index 4ed7584..f0d1a57 100644 (file)
@@ -61,11 +61,12 @@ void Actor::join(double timeout)
   simcall_process_join(this->pimpl_, timeout);
 }
 
   simcall_process_join(this->pimpl_, timeout);
 }
 
-void Actor::setAutoRestart(bool autorestart) {
+void Actor::set_auto_restart(bool autorestart)
+{
   simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; });
 }
 
   simgrid::simix::kernelImmediate([this, autorestart]() { pimpl_->auto_restart = autorestart; });
 }
 
-void Actor::onExit(int_f_pvoid_pvoid_t fun, void* data)
+void Actor::on_exit(int_f_pvoid_pvoid_t fun, void* data)
 {
   simcall_process_on_exit(pimpl_, fun, data);
 }
 {
   simcall_process_on_exit(pimpl_, fun, data);
 }
@@ -143,12 +144,12 @@ const char* Actor::get_cname() const
   return this->pimpl_->get_cname();
 }
 
   return this->pimpl_->get_cname();
 }
 
-aid_t Actor::get_pid()
+aid_t Actor::get_pid() const
 {
   return this->pimpl_->pid;
 }
 
 {
   return this->pimpl_->pid;
 }
 
-aid_t Actor::get_ppid()
+aid_t Actor::get_ppid() const
 {
   return this->pimpl_->ppid;
 }
 {
   return this->pimpl_->ppid;
 }
@@ -168,17 +169,18 @@ void Actor::resume()
     simgrid::instr::Container::byName(instr_pid(this))->getState("ACTOR_STATE")->popEvent();
 }
 
     simgrid::instr::Container::byName(instr_pid(this))->getState("ACTOR_STATE")->popEvent();
 }
 
-int Actor::isSuspended()
+int Actor::is_suspended()
 {
   return simgrid::simix::kernelImmediate([this] { return pimpl_->suspended; });
 }
 
 {
   return simgrid::simix::kernelImmediate([this] { return pimpl_->suspended; });
 }
 
-void Actor::setKillTime(double time) {
+void Actor::set_kill_time(double time)
+{
   simcall_process_set_kill_time(pimpl_,time);
 }
 
 /** \brief Get the kill time of an actor(or 0 if unset). */
   simcall_process_set_kill_time(pimpl_,time);
 }
 
 /** \brief Get the kill time of an actor(or 0 if unset). */
-double Actor::getKillTime()
+double Actor::get_kill_time()
 {
   return SIMIX_timer_get_date(pimpl_->kill_timer);
 }
 {
   return SIMIX_timer_get_date(pimpl_->kill_timer);
 }
@@ -202,14 +204,14 @@ void Actor::kill() {
       [this, process] { SIMIX_process_kill(pimpl_, (pimpl_ == simix_global->maestro_process) ? pimpl_ : process); });
 }
 
       [this, process] { SIMIX_process_kill(pimpl_, (pimpl_ == simix_global->maestro_process) ? pimpl_ : process); });
 }
 
-smx_actor_t Actor::getImpl()
+smx_actor_t Actor::get_impl()
 {
   return pimpl_;
 }
 
 // ***** Static functions *****
 
 {
   return pimpl_;
 }
 
 // ***** Static functions *****
 
-ActorPtr Actor::byPid(aid_t pid)
+ActorPtr Actor::by_pid(aid_t pid)
 {
   smx_actor_t process = SIMIX_process_from_PID(pid);
   if (process != nullptr)
 {
   smx_actor_t process = SIMIX_process_from_PID(pid);
   if (process != nullptr)
@@ -218,23 +220,23 @@ ActorPtr Actor::byPid(aid_t pid)
     return ActorPtr();
 }
 
     return ActorPtr();
 }
 
-void Actor::killAll()
+void Actor::kill_all()
 {
   simcall_process_killall();
 }
 
 {
   simcall_process_killall();
 }
 
-std::map<std::string, std::string>* Actor::getProperties()
+std::map<std::string, std::string>* Actor::get_properties()
 {
   return simgrid::simix::kernelImmediate([this] { return this->pimpl_->getProperties(); });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
 {
   return simgrid::simix::kernelImmediate([this] { return this->pimpl_->getProperties(); });
 }
 
 /** Retrieve the property value (or nullptr if not set) */
-const char* Actor::getProperty(const char* key)
+const char* Actor::get_property(const char* key)
 {
   return simgrid::simix::kernelImmediate([this, key] { return pimpl_->getProperty(key); });
 }
 
 {
   return simgrid::simix::kernelImmediate([this, key] { return pimpl_->getProperty(key); });
 }
 
-void Actor::setProperty(const char* key, const char* value)
+void Actor::set_property(const char* key, const char* value)
 {
   simgrid::simix::kernelImmediate([this, key, value] { pimpl_->setProperty(key, value); });
 }
 {
   simgrid::simix::kernelImmediate([this, key, value] { pimpl_->setProperty(key, value); });
 }
@@ -406,7 +408,7 @@ int sg_actor_get_PID(sg_actor_t actor)
 {
   /* Do not raise an exception here: this function is called by the logs
    * and the exceptions, so it would be called back again and again */
 {
   /* Do not raise an exception here: this function is called by the logs
    * and the exceptions, so it would be called back again and again */
-  if (actor == nullptr || actor->getImpl() == nullptr)
+  if (actor == nullptr || actor->get_impl() == nullptr)
     return 0;
   return actor->get_pid();
 }
     return 0;
   return actor->get_pid();
 }
@@ -444,7 +446,7 @@ sg_host_t sg_actor_get_host(sg_actor_t actor)
  */
 const char* sg_actor_get_property_value(sg_actor_t actor, const char* name)
 {
  */
 const char* sg_actor_get_property_value(sg_actor_t actor, const char* name)
 {
-  return actor->getProperty(name);
+  return actor->get_property(name);
 }
 
 /** \ingroup m_actor_management
 }
 
 /** \ingroup m_actor_management
@@ -456,7 +458,7 @@ xbt_dict_t sg_actor_get_properties(sg_actor_t actor)
 {
   xbt_assert(actor != nullptr, "Invalid parameter: First argument must not be nullptr");
   xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
 {
   xbt_assert(actor != nullptr, "Invalid parameter: First argument must not be nullptr");
   xbt_dict_t as_dict = xbt_dict_new_homogeneous(xbt_free_f);
-  std::map<std::string, std::string>* props = actor->getProperties();
+  std::map<std::string, std::string>* props = actor->get_properties();
   if (props == nullptr)
     return nullptr;
   for (auto const& elm : *props) {
   if (props == nullptr)
     return nullptr;
   for (auto const& elm : *props) {
@@ -494,7 +496,7 @@ void sg_actor_resume(sg_actor_t actor)
  */
 int sg_actor_is_suspended(sg_actor_t actor)
 {
  */
 int sg_actor_is_suspended(sg_actor_t actor)
 {
-  return actor->isSuspended();
+  return actor->is_suspended();
 }
 
 /**
 }
 
 /**
@@ -548,5 +550,5 @@ void sg_actor_kill(sg_actor_t actor)
  */
 void sg_actor_set_kill_time(sg_actor_t actor, double kill_time)
 {
  */
 void sg_actor_set_kill_time(sg_actor_t actor, double kill_time)
 {
-  actor->setKillTime(kill_time);
+  actor->set_kill_time(kill_time);
 }
 }
index 7287f78..9e068cc 100644 (file)
@@ -80,11 +80,11 @@ Activity* Comm::start()
   xbt_assert(state_ == State::inited);
 
   if (srcBuff_ != nullptr) { // Sender side
   xbt_assert(state_ == State::inited);
 
   if (srcBuff_ != nullptr) { // Sender side
-    pimpl_ = simcall_comm_isend(sender_, mailbox_->getImpl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_,
+    pimpl_ = simcall_comm_isend(sender_, mailbox_->get_impl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_,
                                 cleanFunction_, copyDataFunction_, user_data_, detached_);
   } else if (dstBuff_ != nullptr) { // Receiver side
     xbt_assert(not detached_, "Receive cannot be detached");
                                 cleanFunction_, copyDataFunction_, user_data_, detached_);
   } else if (dstBuff_ != nullptr) { // Receiver side
     xbt_assert(not detached_, "Receive cannot be detached");
-    pimpl_ = simcall_comm_irecv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, matchFunction_,
+    pimpl_ = simcall_comm_irecv(receiver_, mailbox_->get_impl(), dstBuff_, &dstBuffSize_, matchFunction_,
                                 copyDataFunction_, user_data_, rate_);
 
   } else {
                                 copyDataFunction_, user_data_, rate_);
 
   } else {
@@ -114,10 +114,10 @@ Activity* Comm::wait(double timeout)
 
     case State::inited: // It's not started yet. Do it in one simcall
       if (srcBuff_ != nullptr) {
 
     case State::inited: // It's not started yet. Do it in one simcall
       if (srcBuff_ != nullptr) {
-        simcall_comm_send(sender_, mailbox_->getImpl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_,
+        simcall_comm_send(sender_, mailbox_->get_impl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_,
                           copyDataFunction_, user_data_, timeout);
       } else { // Receiver
                           copyDataFunction_, user_data_, timeout);
       } else { // Receiver
-        simcall_comm_recv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, matchFunction_, copyDataFunction_,
+        simcall_comm_recv(receiver_, mailbox_->get_impl(), dstBuff_, &dstBuffSize_, matchFunction_, copyDataFunction_,
                           user_data_, timeout, rate_);
       }
       state_ = State::finished;
                           user_data_, timeout, rate_);
       }
       state_ = State::finished;
index ebf13d8..de0b17c 100644 (file)
@@ -96,7 +96,7 @@ simgrid::smpi::Process* smpi_process()
   ActorPtr me = Actor::self();
   if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...)
     return nullptr;
   ActorPtr me = Actor::self();
   if (me == nullptr) // This happens sometimes (eg, when linking against NS3 because it pulls openMPI...)
     return nullptr;
-  simgrid::msg::ActorExt* msgExt = static_cast<simgrid::msg::ActorExt*>(me->getImpl()->userdata);
+  simgrid::msg::ActorExt* msgExt = static_cast<simgrid::msg::ActorExt*>(me->get_impl()->userdata);
   return static_cast<simgrid::smpi::Process*>(msgExt->data);
 }
 
   return static_cast<simgrid::smpi::Process*>(msgExt->data);
 }
 
index eda3a68..e391eee 100644 (file)
@@ -69,7 +69,7 @@ void Process::set_data(int* argc, char*** argv)
     finalization_barrier_ = barrier;
 
   process_                                                                  = simgrid::s4u::Actor::self();
     finalization_barrier_ = barrier;
 
   process_                                                                  = simgrid::s4u::Actor::self();
-  static_cast<simgrid::msg::ActorExt*>(process_->getImpl()->userdata)->data = this;
+  static_cast<simgrid::msg::ActorExt*>(process_->get_impl()->userdata)->data = this;
 
   if (*argc > 3) {
     memmove(&(*argv)[0], &(*argv)[2], sizeof(char*) * (*argc - 2));
 
   if (*argc > 3) {
     memmove(&(*argv)[0], &(*argv)[2], sizeof(char*) * (*argc - 2));
@@ -168,12 +168,12 @@ MPI_Comm Process::comm_world()
 
 smx_mailbox_t Process::mailbox()
 {
 
 smx_mailbox_t Process::mailbox()
 {
-  return mailbox_->getImpl();
+  return mailbox_->get_impl();
 }
 
 smx_mailbox_t Process::mailbox_small()
 {
 }
 
 smx_mailbox_t Process::mailbox_small()
 {
-  return mailbox_small_->getImpl();
+  return mailbox_small_->get_impl();
 }
 
 xbt_mutex_t Process::mailboxes_mutex()
 }
 
 xbt_mutex_t Process::mailboxes_mutex()
@@ -249,7 +249,7 @@ void Process::init(int *argc, char ***argv){
   }
   if (argc != nullptr && argv != nullptr) {
     simgrid::s4u::ActorPtr proc = simgrid::s4u::Actor::self();
   }
   if (argc != nullptr && argv != nullptr) {
     simgrid::s4u::ActorPtr proc = simgrid::s4u::Actor::self();
-    proc->getImpl()->context->set_cleanup(&MSG_process_cleanup_from_SIMIX);
+    proc->get_impl()->context->set_cleanup(&MSG_process_cleanup_from_SIMIX);
 
     char* instance_id = (*argv)[1];
     try {
 
     char* instance_id = (*argv)[1];
     try {
index b50587d..af7bd41 100644 (file)
@@ -370,7 +370,7 @@ void Comm::init_smp(){
   if(MPI_COMM_WORLD!=MPI_COMM_UNINITIALIZED && this!=MPI_COMM_WORLD){
     //create leader_communicator
     for (i=0; i< leader_group_size;i++)
   if(MPI_COMM_WORLD!=MPI_COMM_UNINITIALIZED && this!=MPI_COMM_WORLD){
     //create leader_communicator
     for (i=0; i< leader_group_size;i++)
-      leaders_group->set_mapping(simgrid::s4u::Actor::byPid(leader_list[i]), i);
+      leaders_group->set_mapping(simgrid::s4u::Actor::by_pid(leader_list[i]), i);
     leader_comm = new  Comm(leaders_group, nullptr);
     this->set_leaders_comm(leader_comm);
     this->set_intra_comm(comm_intra);
     leader_comm = new  Comm(leaders_group, nullptr);
     this->set_leaders_comm(leader_comm);
     this->set_intra_comm(comm_intra);
@@ -378,7 +378,7 @@ void Comm::init_smp(){
     // create intracommunicator
   }else{
     for (i=0; i< leader_group_size;i++)
     // create intracommunicator
   }else{
     for (i=0; i< leader_group_size;i++)
-      leaders_group->set_mapping(simgrid::s4u::Actor::byPid(leader_list[i]), i);
+      leaders_group->set_mapping(simgrid::s4u::Actor::by_pid(leader_list[i]), i);
 
     if(this->get_leaders_comm()==MPI_COMM_NULL){
       leader_comm = new  Comm(leaders_group, nullptr);
 
     if(this->get_leaders_comm()==MPI_COMM_NULL){
       leader_comm = new  Comm(leaders_group, nullptr);
index b8fa3db..5739c1c 100644 (file)
@@ -343,7 +343,7 @@ void Request::start()
   if ((flags_ & RECV) != 0) {
     this->print_request("New recv");
 
   if ((flags_ & RECV) != 0) {
     this->print_request("New recv");
 
-    simgrid::smpi::Process* process = smpi_process_remote(simgrid::s4u::Actor::byPid(dst_));
+    simgrid::smpi::Process* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
 
     int async_small_thresh = xbt_cfg_get_int("smpi/async-small-thresh");
 
 
     int async_small_thresh = xbt_cfg_get_int("smpi/async-small-thresh");
 
@@ -388,14 +388,14 @@ void Request::start()
     // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
     real_size_=size_;
     action_   = simcall_comm_irecv(
     // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
     real_size_=size_;
     action_   = simcall_comm_irecv(
-        process->process()->getImpl(), mailbox, buf_, &real_size_, &match_recv,
+        process->process()->get_impl(), mailbox, buf_, &real_size_, &match_recv,
         process->replaying() ? &smpi_comm_null_copy_buffer_callback : smpi_comm_copy_data_callback, this, -1.0);
     XBT_DEBUG("recv simcall posted");
 
     if (async_small_thresh != 0 || (flags_ & RMA) != 0 )
       xbt_mutex_release(mut);
   } else { /* the RECV flag was not set, so this is a send */
         process->replaying() ? &smpi_comm_null_copy_buffer_callback : smpi_comm_copy_data_callback, this, -1.0);
     XBT_DEBUG("recv simcall posted");
 
     if (async_small_thresh != 0 || (flags_ & RMA) != 0 )
       xbt_mutex_release(mut);
   } else { /* the RECV flag was not set, so this is a send */
-    simgrid::smpi::Process* process = smpi_process_remote(simgrid::s4u::Actor::byPid(dst_));
+    simgrid::smpi::Process* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
     int rank = src_;
     if (TRACE_smpi_view_internals()) {
       TRACE_smpi_send(rank, rank, dst_, tag_, size_);
     int rank = src_;
     if (TRACE_smpi_view_internals()) {
       TRACE_smpi_send(rank, rank, dst_, tag_, size_);
@@ -416,7 +416,7 @@ void Request::start()
               (static_cast<char*>(buf_) >= smpi_data_exe_start) &&
               (static_cast<char*>(buf_) < smpi_data_exe_start + smpi_data_exe_size)) {
             XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
               (static_cast<char*>(buf_) >= smpi_data_exe_start) &&
               (static_cast<char*>(buf_) < smpi_data_exe_start + smpi_data_exe_size)) {
             XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
-            smpi_switch_data_segment(simgrid::s4u::Actor::byPid(src_));
+            smpi_switch_data_segment(simgrid::s4u::Actor::by_pid(src_));
           }
           buf = xbt_malloc(size_);
           memcpy(buf,oldbuf,size_);
           }
           buf = xbt_malloc(size_);
           memcpy(buf,oldbuf,size_);
@@ -476,7 +476,7 @@ void Request::start()
     // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
     real_size_=size_;
     action_   = simcall_comm_isend(
     // we make a copy here, as the size is modified by simix, and we may reuse the request in another receive later
     real_size_=size_;
     action_   = simcall_comm_isend(
-        simgrid::s4u::Actor::byPid(src_)->getImpl(), mailbox, size_, -1.0, buf, real_size_, &match_send,
+        simgrid::s4u::Actor::by_pid(src_)->get_impl(), mailbox, size_, -1.0, buf, real_size_, &match_send,
         &xbt_free_f, // how to free the userdata if a detached send fails
         not process->replaying() ? smpi_comm_copy_data_callback : &smpi_comm_null_copy_buffer_callback, this,
         // detach if msg size < eager/rdv switch limit
         &xbt_free_f, // how to free the userdata if a detached send fails
         not process->replaying() ? smpi_comm_copy_data_callback : &smpi_comm_null_copy_buffer_callback, this,
         // detach if msg size < eager/rdv switch limit
@@ -644,7 +644,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   if (smpi_iprobe_sleep > 0) {
     smx_activity_t iprobe_sleep = simcall_execution_start(
         "iprobe", /* flops to executek*/ nsleeps * smpi_iprobe_sleep * speed * maxrate, /* priority */ 1.0,
   if (smpi_iprobe_sleep > 0) {
     smx_activity_t iprobe_sleep = simcall_execution_start(
         "iprobe", /* flops to executek*/ nsleeps * smpi_iprobe_sleep * speed * maxrate, /* priority */ 1.0,
-        /* performance bound */ maxrate * speed, smpi_process()->process()->getImpl()->host);
+        /* performance bound */ maxrate * speed, smpi_process()->process()->get_impl()->host);
     simcall_execution_wait(iprobe_sleep);
   }
   // behave like a receive, but don't do it
     simcall_execution_wait(iprobe_sleep);
   }
   // behave like a receive, but don't do it
index 259f917..ccf99d5 100644 (file)
@@ -38,13 +38,13 @@ static void master()
   XBT_INFO("Suspend Actor (pid=%ld)", actor->get_pid());
   actor->suspend();
 
   XBT_INFO("Suspend Actor (pid=%ld)", actor->get_pid());
   actor->suspend();
 
-  XBT_INFO("Actor (pid=%ld) is %ssuspended", actor->get_pid(), actor->isSuspended() ? "" : "not ");
+  XBT_INFO("Actor (pid=%ld) is %ssuspended", actor->get_pid(), actor->is_suspended() ? "" : "not ");
   simgrid::s4u::this_actor::sleep_for(2);
 
   XBT_INFO("Resume Actor (pid=%ld)", actor->get_pid());
   actor->resume();
 
   simgrid::s4u::this_actor::sleep_for(2);
 
   XBT_INFO("Resume Actor (pid=%ld)", actor->get_pid());
   actor->resume();
 
-  XBT_INFO("Actor (pid=%ld) is %ssuspended", actor->get_pid(), actor->isSuspended() ? "" : "not ");
+  XBT_INFO("Actor (pid=%ld) is %ssuspended", actor->get_pid(), actor->is_suspended() ? "" : "not ");
   simgrid::s4u::this_actor::sleep_for(2);
   actor->kill();
 
   simgrid::s4u::this_actor::sleep_for(2);
   actor->kill();
 
index 881bcbe..1d70216 100644 (file)
@@ -33,7 +33,7 @@ static void killall()
   for (int i = 0; i < 3; i++) {
     int* pid = static_cast<int*>(mailbox->get());
     XBT_INFO("Killing process \"%d\".", *pid);
   for (int i = 0; i < 3; i++) {
     int* pid = static_cast<int*>(mailbox->get());
     XBT_INFO("Killing process \"%d\".", *pid);
-    simgrid::s4u::Actor::byPid(*pid)->kill();
+    simgrid::s4u::Actor::by_pid(*pid)->kill();
   }
 }
 
   }
 }
 
@@ -42,7 +42,7 @@ int main(int argc, char* argv[])
   simgrid::s4u::Engine e(&argc, argv);
   e.loadPlatform(argv[1]);
 
   simgrid::s4u::Engine e(&argc, argv);
   e.loadPlatform(argv[1]);
 
-  simgrid::s4u::Actor::killAll();
+  simgrid::s4u::Actor::kill_all();
 
   simgrid::s4u::Actor::create("sendpid", simgrid::s4u::Host::by_name("Tremblay"), sendpid);
   simgrid::s4u::Actor::create("sendpid", simgrid::s4u::Host::by_name("Tremblay"), sendpid);
 
   simgrid::s4u::Actor::create("sendpid", simgrid::s4u::Host::by_name("Tremblay"), sendpid);
   simgrid::s4u::Actor::create("sendpid", simgrid::s4u::Host::by_name("Tremblay"), sendpid);