Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use consistent naming scheme.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 20 Oct 2020 19:23:04 +0000 (21:23 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 20 Oct 2020 19:23:04 +0000 (21:23 +0200)
iface() becomes get_iface() for ActorImpl too.

12 files changed:
src/bindings/java/jmsg_process.cpp
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/ActorImpl.hpp
src/plugins/host_dvfs.cpp
src/s4u/s4u_Actor.cpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_Engine.cpp
src/s4u/s4u_Mailbox.cpp
src/simix/libsmx.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/mpi/smpi_comm.cpp
src/surf/HostImpl.cpp

index 2e6c77b..2db8fdf 100644 (file)
@@ -85,11 +85,11 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv* env, jobject
   env->ReleaseStringUTFChars(jname, name);
 
   /* Retrieve the kill time from the actor */
-  actor->ciface()->set_kill_time((double)env->GetDoubleField(jprocess, jprocess_field_Process_killTime));
+  actor->get_ciface()->set_kill_time((double)env->GetDoubleField(jprocess, jprocess_field_Process_killTime));
 
   /* sets the PID and the PPID of the actor */
-  env->SetIntField(jprocess, jprocess_field_Process_pid, (jint)actor->ciface()->get_pid());
-  env->SetIntField(jprocess, jprocess_field_Process_ppid, (jint)actor->ciface()->get_ppid());
+  env->SetIntField(jprocess, jprocess_field_Process_pid, (jint)actor->get_ciface()->get_pid());
+  env->SetIntField(jprocess, jprocess_field_Process_ppid, (jint)actor->get_ciface()->get_ppid());
 }
 
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_daemonize(JNIEnv* env, jobject jprocess)
index e01aa34..50855cb 100644 (file)
@@ -62,7 +62,7 @@ ActorImpl::ActorImpl(xbt::string name, s4u::Host* host) : host_(host), name_(std
 ActorImpl::~ActorImpl()
 {
   if (simix_global != nullptr && this != simix_global->maestro_)
-    s4u::Actor::on_destruction(*ciface());
+    s4u::Actor::on_destruction(*get_ciface());
 }
 
 /* Become an actor in the simulation
@@ -112,7 +112,7 @@ ActorImplPtr ActorImpl::attach(const std::string& name, void* data, s4u::Host* h
   context->attach_start();
 
   /* The on_creation() signal must be delayed until there, where the pid and everything is set */
-  s4u::Actor::on_creation(*actor->ciface());
+  s4u::Actor::on_creation(*actor->get_ciface());
 
   return ActorImplPtr(actor);
 }
@@ -190,7 +190,7 @@ void ActorImpl::cleanup()
   cleanup_from_simix();
 
   context_->set_wannadie(false); // don't let the simcall's yield() do a Context::stop(), to avoid infinite loops
-  actor::simcall([this] { s4u::Actor::on_termination(*ciface()); });
+  actor::simcall([this] { s4u::Actor::on_termination(*get_ciface()); });
   context_->set_wannadie();
 }
 
@@ -310,7 +310,7 @@ void ActorImpl::yield()
   }
 
   if (SMPI_switch_data_segment && not finished_) {
-    SMPI_switch_data_segment(iface());
+    SMPI_switch_data_segment(get_iface());
   }
 }
 
@@ -356,7 +356,7 @@ s4u::Actor* ActorImpl::restart()
   actor->set_kill_time(arg.kill_time);
   actor->set_auto_restart(arg.auto_restart);
 
-  return actor->ciface();
+  return actor->get_ciface();
 }
 
 void ActorImpl::suspend()
@@ -461,7 +461,7 @@ ActorImplPtr ActorImpl::init(const std::string& name, s4u::Host* host) const
 
   intrusive_ptr_add_ref(actor);
   /* The on_creation() signal must be delayed until there, where the pid and everything is set */
-  s4u::Actor::on_creation(*actor->ciface());
+  s4u::Actor::on_creation(*actor->get_ciface());
 
   return ActorImplPtr(actor);
 }
index 6e9691f..a10604d 100644 (file)
@@ -114,8 +114,8 @@ private:
   void undaemonize();
 
 public:
-  s4u::ActorPtr iface() { return s4u::ActorPtr(&piface_); }
-  s4u::Actor* ciface() { return &piface_; }
+  s4u::ActorPtr get_iface() { return s4u::ActorPtr(&piface_); }
+  s4u::Actor* get_ciface() { return &piface_; }
 
   ActorImplPtr init(const std::string& name, s4u::Host* host) const;
   ActorImpl* start(const ActorCode& code);
index dbadd85..82c38aa 100644 (file)
@@ -297,7 +297,7 @@ public:
     });
     simgrid::s4u::Exec::on_completion.connect([this](simgrid::s4u::Actor const&, simgrid::s4u::Exec const& activity) {
       // For more than one host (not yet supported), we can access the host via
-      // simcalls_.front()->issuer->iface()->get_host()
+      // simcalls_.front()->issuer->get_iface()->get_host()
       if (activity.get_host() == get_host() && iteration_running) {
         comp_timer += activity.get_finish_time() - activity.get_start_time();
       }
index d6a2499..a6db8ff 100644 (file)
@@ -45,7 +45,7 @@ Actor* Actor::self()
   if (self_context == nullptr)
     return nullptr;
 
-  return self_context->get_actor()->ciface();
+  return self_context->get_actor()->get_ciface();
 }
 
 ActorPtr Actor::init(const std::string& name, s4u::Host* host)
@@ -53,7 +53,7 @@ ActorPtr Actor::init(const std::string& name, s4u::Host* host)
   kernel::actor::ActorImpl* self = kernel::actor::ActorImpl::self();
   kernel::actor::ActorImpl* actor =
       kernel::actor::simcall([self, &name, host] { return self->init(name, host).get(); });
-  return actor->iface();
+  return actor->get_iface();
 }
 
 /** Set a non-default stack size for this context (in Kb)
@@ -77,7 +77,7 @@ ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::func
   kernel::actor::ActorImpl* actor =
       kernel::actor::simcall([self, &name, host, &code] { return self->init(name, host)->start(code); });
 
-  return actor->iface();
+  return actor->get_iface();
 }
 
 ActorPtr Actor::create(const std::string& name, s4u::Host* host, const std::string& function,
@@ -262,7 +262,7 @@ ActorPtr Actor::by_pid(aid_t pid)
 {
   kernel::actor::ActorImpl* actor = SIMIX_process_from_PID(pid);
   if (actor != nullptr)
-    return actor->iface();
+    return actor->get_iface();
   else
     return ActorPtr();
 }
@@ -318,7 +318,7 @@ void sleep_for(double duration)
 
   if (duration > 0) {
     kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
-    Actor::on_sleep(*issuer->ciface());
+    Actor::on_sleep(*issuer->get_ciface());
 
     kernel::actor::simcall_blocking<void>([issuer, duration]() {
       if (MC_is_active() || MC_record_replay_is_active()) {
@@ -330,7 +330,7 @@ void sleep_for(double duration)
       sync->register_simcall(&issuer->simcall_);
     });
 
-    Actor::on_wake_up(*issuer->ciface());
+    Actor::on_wake_up(*issuer->get_ciface());
   }
 }
 
@@ -438,7 +438,7 @@ Host* get_host()
 void suspend()
 {
   kernel::actor::ActorImpl* self = simgrid::kernel::actor::ActorImpl::self();
-  s4u::Actor::on_suspend(*self->ciface());
+  s4u::Actor::on_suspend(*self->get_ciface());
   kernel::actor::simcall_blocking<void>([self] { self->suspend(); });
 }
 
@@ -450,7 +450,7 @@ void exit()
 
 void on_exit(const std::function<void(bool)>& fun)
 {
-  simgrid::kernel::actor::ActorImpl::self()->iface()->on_exit(fun);
+  simgrid::kernel::actor::ActorImpl::self()->get_iface()->on_exit(fun);
 }
 
 /** @brief Moves the current actor to another host
@@ -459,7 +459,7 @@ void on_exit(const std::function<void(bool)>& fun)
  */
 void set_host(Host* new_host)
 {
-  simgrid::kernel::actor::ActorImpl::self()->iface()->set_host(new_host);
+  simgrid::kernel::actor::ActorImpl::self()->get_iface()->set_host(new_host);
 }
 void migrate(Host* new_host) // deprecated
 {
@@ -738,7 +738,7 @@ sg_actor_t sg_actor_attach(const char* name, void* data, sg_host_t host, xbt_dic
   }
 
   simgrid::s4u::this_actor::yield();
-  return actor->ciface();
+  return actor->get_ciface();
 }
 
 void sg_actor_detach()
index 46515ea..6f2602c 100644 (file)
@@ -256,7 +256,7 @@ Actor* Comm::get_sender() const
   kernel::actor::ActorImplPtr sender = nullptr;
   if (pimpl_)
     sender = boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->src_actor_;
-  return sender ? sender->ciface() : nullptr;
+  return sender ? sender->get_ciface() : nullptr;
 }
 
 } // namespace s4u
index f0e47bd..c18f1cb 100644 (file)
@@ -312,7 +312,7 @@ std::vector<ActorPtr> Engine::get_all_actors() const
 {
   std::vector<ActorPtr> actor_list;
   for (auto const& kv : simix_global->process_list) {
-    actor_list.push_back(kv.second->iface());
+    actor_list.push_back(kv.second->get_iface());
   }
   return actor_list;
 }
@@ -321,8 +321,8 @@ std::vector<ActorPtr> Engine::get_filtered_actors(const std::function<bool(Actor
 {
   std::vector<ActorPtr> actor_list;
   for (auto const& kv : simix_global->process_list) {
-    if (filter(kv.second->iface()))
-      actor_list.push_back(kv.second->iface());
+    if (filter(kv.second->get_iface()))
+      actor_list.push_back(kv.second->get_iface());
   }
   return actor_list;
 }
index 01cb3eb..9739967 100644 (file)
@@ -80,7 +80,7 @@ ActorPtr Mailbox::get_receiver() const
 {
   if (pimpl_->permanent_receiver_ == nullptr)
     return ActorPtr();
-  return pimpl_->permanent_receiver_->iface();
+  return pimpl_->permanent_receiver_->get_iface();
 }
 
 CommPtr Mailbox::put_init()
index 12b03ff..3f40747 100644 (file)
@@ -69,7 +69,7 @@ void simcall_process_join(smx_actor_t process, double timeout) // XBT_DEPRECATED
 
 void simcall_process_suspend(smx_actor_t process) // XBT_DEPRECATED_v328
 {
-  process->iface()->suspend();
+  process->get_iface()->suspend();
 }
 
 simgrid::kernel::activity::State simcall_process_sleep(double duration) // XBT_ATTRIB_DEPRECATED_v329
index 73413f5..f148f0c 100644 (file)
@@ -195,7 +195,7 @@ void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, v
       (static_cast<char*>(buff) >= smpi_data_exe_start) &&
       (static_cast<char*>(buff) < smpi_data_exe_start + smpi_data_exe_size)) {
     XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
-    smpi_switch_data_segment(comm->src_actor_->iface());
+    smpi_switch_data_segment(comm->src_actor_->get_iface());
     tmpbuff = xbt_malloc(buff_size);
     memcpy_private(tmpbuff, buff, private_blocks);
   }
@@ -204,7 +204,7 @@ void smpi_comm_copy_buffer_callback(simgrid::kernel::activity::CommImpl* comm, v
       ((char*)comm->dst_buff_ >= smpi_data_exe_start) &&
       ((char*)comm->dst_buff_ < smpi_data_exe_start + smpi_data_exe_size)) {
     XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment");
-    smpi_switch_data_segment(comm->dst_actor_->iface());
+    smpi_switch_data_segment(comm->dst_actor_->get_iface());
   }
   XBT_DEBUG("Copying %zu bytes from %p to %p", buff_size, tmpbuff, comm->dst_buff_);
   memcpy_private(comm->dst_buff_, tmpbuff, private_blocks);
index b7cca36..dcd7d83 100644 (file)
@@ -348,7 +348,7 @@ MPI_Comm Comm::find_intra_comm(int * leader){
   int min_index           = INT_MAX; // the minimum index will be the leader
   for (auto& actor : actor_list) {
     int index = actor.get_pid();
-    if (this->group()->rank(actor.ciface()) != MPI_UNDEFINED) { // Is this process in the current group?
+    if (this->group()->rank(actor.get_ciface()) != MPI_UNDEFINED) { // Is this process in the current group?
       intra_comm_size++;
       if (index < min_index)
         min_index = index;
@@ -358,8 +358,8 @@ MPI_Comm Comm::find_intra_comm(int * leader){
   auto* group_intra = new Group(intra_comm_size);
   int i = 0;
   for (auto& actor : actor_list) {
-    if (this->group()->rank(actor.ciface()) != MPI_UNDEFINED) {
-      group_intra->set_mapping(actor.ciface(), i);
+    if (this->group()->rank(actor.get_ciface()) != MPI_UNDEFINED) {
+      group_intra->set_mapping(actor.get_ciface(), i);
       i++;
     }
   }
index f701211..20a0394 100644 (file)
@@ -95,7 +95,7 @@ std::vector<s4u::ActorPtr> HostImpl::get_all_actors()
 {
   std::vector<s4u::ActorPtr> res;
   for (auto& actor : actor_list_)
-    res.emplace_back(actor.ciface());
+    res.emplace_back(actor.get_ciface());
   return res;
 }
 size_t HostImpl::get_actor_count() const