Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Lowercase PID in function name (1/2 - private part).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 17 Mar 2021 22:33:33 +0000 (23:33 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 17 Mar 2021 22:47:15 +0000 (23:47 +0100)
Changed: ActorImpl::by_PID

include/simgrid/simix.h
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/mc/mc_record.cpp
src/mc/remote/AppSide.cpp
src/s4u/s4u_Actor.cpp

index bb3763a..c4ef37c 100644 (file)
@@ -23,8 +23,8 @@ extern unsigned smx_context_guard_size;
 
 SG_BEGIN_DECL
 
-XBT_ATTRIB_DEPRECATED_v331("Please use sg_actor_by_PID instead.") XBT_PUBLIC smx_actor_t
-    SIMIX_process_from_PID(aid_t PID);
+XBT_ATTRIB_DEPRECATED_v331("Please use sg_actor_by_pid() instead.") XBT_PUBLIC smx_actor_t
+    SIMIX_process_from_PID(aid_t pid);
 
 /* parallelism */
 XBT_PUBLIC int SIMIX_context_is_parallel();
index 9bd5961..0fcaa4b 100644 (file)
@@ -49,15 +49,15 @@ void* get_maxpid_addr()
 {
   return &maxpid;
 }
-ActorImpl* ActorImpl::by_PID(aid_t PID)
+ActorImpl* ActorImpl::by_pid(aid_t pid)
 {
-  auto item = simix_global->process_list.find(PID);
+  auto item = simix_global->process_list.find(pid);
   if (item != simix_global->process_list.end())
     return item->second;
 
   // Search the trash
   for (auto& a : simix_global->actors_to_destroy)
-    if (a.get_pid() == PID)
+    if (a.get_pid() == pid)
       return &a;
   return nullptr; // Not found, even in the trash
 }
@@ -583,9 +583,9 @@ const char* SIMIX_process_self_get_name()
 }
 
 /** @brief Returns the process from PID. */
-smx_actor_t SIMIX_process_from_PID(aid_t PID)
+smx_actor_t SIMIX_process_from_PID(aid_t pid)
 {
-  return simgrid::kernel::actor::ActorImpl::by_PID(PID);
+  return simgrid::kernel::actor::ActorImpl::by_pid(pid);
 }
 
 void SIMIX_process_on_exit(smx_actor_t actor,
index 307527e..ee6d968 100644 (file)
@@ -36,7 +36,7 @@ public:
   ~ActorImpl();
 
   /** Retrieve the actor implementation from its PID (or nullptr if non-existent) */
-  static ActorImpl* by_PID(aid_t PID);
+  static ActorImpl* by_pid(aid_t pid);
 
   static ActorImpl* self();
   double get_kill_time() const;
index 6ff4d15..46d642f 100644 (file)
@@ -29,7 +29,7 @@ void replay(RecordTrace const& trace)
     XBT_DEBUG("Executing %i$%i", transition.pid_, transition.times_considered_);
 
     // Choose a request:
-    kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_PID(transition.pid_);
+    kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(transition.pid_);
     if (actor == nullptr)
       xbt_die("Unexpected actor (id:%d).", transition.pid_);
     const s_smx_simcall* simcall = &(actor->simcall_);
index 4518895..f822160 100644 (file)
@@ -95,7 +95,7 @@ void AppSide::handle_continue(const s_mc_message_t*) const
 }
 void AppSide::handle_simcall(const s_mc_message_simcall_handle_t* message) const
 {
-  kernel::actor::ActorImpl* process = kernel::actor::ActorImpl::by_PID(message->pid_);
+  kernel::actor::ActorImpl* process = kernel::actor::ActorImpl::by_pid(message->pid_);
   xbt_assert(process != nullptr, "Invalid pid %lu", message->pid_);
   process->simcall_handle(message->times_considered_);
   if (channel_.send(MessageType::WAITING))
@@ -104,7 +104,7 @@ void AppSide::handle_simcall(const s_mc_message_simcall_handle_t* message) const
 
 void AppSide::handle_actor_enabled(const s_mc_message_actor_enabled_t* msg) const
 {
-  bool res = simgrid::mc::actor_is_enabled(kernel::actor::ActorImpl::by_PID(msg->aid));
+  bool res = simgrid::mc::actor_is_enabled(kernel::actor::ActorImpl::by_pid(msg->aid));
   s_mc_message_int_t answer{MessageType::ACTOR_ENABLED_REPLY, res};
   channel_.send(answer);
 }
@@ -143,7 +143,7 @@ void AppSide::handle_messages() const
       case MessageType::SIMCALL_IS_VISIBLE: {
         assert_msg_size("SIMCALL_IS_VISIBLE", s_mc_message_simcall_is_visible_t);
         auto msg_simcall                = (s_mc_message_simcall_is_visible_t*)message_buffer.data();
-        const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_PID(msg_simcall->aid);
+        const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(msg_simcall->aid);
         xbt_assert(actor != nullptr, "Invalid pid %d", msg_simcall->aid);
         xbt_assert(actor->simcall_.observer_, "The transition of %s has no observer", actor->get_cname());
         bool value = actor->simcall_.observer_->is_visible();
@@ -157,7 +157,7 @@ void AppSide::handle_messages() const
       case MessageType::SIMCALL_TO_STRING: {
         assert_msg_size("SIMCALL_TO_STRING", s_mc_message_simcall_to_string_t);
         auto msg_simcall                = (s_mc_message_simcall_to_string_t*)message_buffer.data();
-        const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_PID(msg_simcall->aid);
+        const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(msg_simcall->aid);
         xbt_assert(actor != nullptr, "Invalid pid %d", msg_simcall->aid);
         xbt_assert(actor->simcall_.observer_, "The transition of %s has no observer", actor->get_cname());
         std::string value = actor->simcall_.observer_->to_string(msg_simcall->time_considered);
@@ -172,7 +172,7 @@ void AppSide::handle_messages() const
       case MessageType::SIMCALL_DOT_LABEL: {
         assert_msg_size("SIMCALL_DOT_LABEL", s_mc_message_simcall_to_string_t);
         auto msg_simcall                = (s_mc_message_simcall_to_string_t*)message_buffer.data();
-        const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_PID(msg_simcall->aid);
+        const kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(msg_simcall->aid);
         xbt_assert(actor != nullptr, "Invalid pid %d", msg_simcall->aid);
         xbt_assert(actor->simcall_.observer_, "The transition of %s has no observer", actor->get_cname());
         std::string value = actor->simcall_.observer_->dot_label();
index 8fdb474..7e619bb 100644 (file)
@@ -262,7 +262,7 @@ void Actor::kill()
 
 ActorPtr Actor::by_pid(aid_t pid)
 {
-  kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_PID(pid);
+  kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(pid);
   if (actor != nullptr)
     return actor->get_iface();
   else