Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
start to s/trace/profile/ in the public API
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 21 Jan 2019 12:32:09 +0000 (13:32 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 21 Jan 2019 12:32:09 +0000 (13:32 +0100)
14 files changed:
include/simgrid/kernel/resource/Resource.hpp
include/simgrid/s4u/Link.hpp
src/kernel/resource/Resource.cpp
src/s4u/s4u_Link.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/sg_platf.cpp
src/surf/xml/surfxml_parseplatf.cpp

index 6e1119e..ecfd29d 100644 (file)
@@ -64,7 +64,15 @@ public:
   /** @brief Turn off the current Resource */
   virtual void turn_off();
   /** @brief setup the trace file with states events (ON or OFF). Trace must contain boolean values. */
-  virtual void set_state_trace(profile::Profile* trace);
+  virtual void set_state_profile(profile::Profile* profile);
+
+#ifndef DOXYGEN
+  XBT_ATTRIB_DEPRECATED_v325("Please use Resource::set_state_profile()") virtual void set_state_trace(
+      profile::Profile* profile)
+  {
+    set_state_profile(profile);
+  }
+#endif
 
 private:
   std::string name_;
index fbac2c0..8029280 100644 (file)
@@ -65,15 +65,32 @@ public:
   void* get_data(); /** Should be used only from the C interface. Prefer extensions in C++ */
   void set_data(void* d);
 
-  void set_state_trace(
-      kernel::profile::Profile* trace); /*< setup the trace file with states events (ON or OFF). Trace must contain
-                             boolean values. */
-  void set_bandwidth_trace(
-      kernel::profile::Profile* trace); /*< setup the trace file with bandwidth events (peak speed changes due to
-                             external load). Trace must contain percentages (value between 0 and 1). */
-  void set_latency_trace(
-      kernel::profile::Profile* trace); /*< setup the trace file with latency events (peak latency changes due to
-                             external load). Trace must contain absolute values */
+#ifndef DOXYGEN
+  XBT_ATTRIB_DEPRECATED_v325("Please use Link::set_state_profile()") void set_state_trace(
+      kernel::profile::Profile* profile)
+  {
+    set_state_profile(profile);
+  }
+  XBT_ATTRIB_DEPRECATED_v325("Please use Link::set_bandwidth_profile()") void set_bandwidth_trace(
+      kernel::profile::Profile* profile)
+  {
+    set_bandwidth_profile(profile);
+  }
+  XBT_ATTRIB_DEPRECATED_v325("Please use Link::set_latency_profile()") void set_latency_trace(
+      kernel::profile::Profile* profile)
+  {
+    set_latency_profile(profile);
+  }
+#endif
+
+  /** Setup the profile file with states events (ON or OFF). The profile must contain boolean values. */
+  void set_state_profile(kernel::profile::Profile* profile);
+  /** Setup the profile file with bandwidth events (peak speed changes due to external load).
+   * The profile must contain percentages (value between 0 and 1). */
+  void set_bandwidth_profile(kernel::profile::Profile* profile);
+  /** Setup the profile file with latency events (peak latency changes due to external load).
+   * The profile must contain absolute values */
+  void set_latency_profile(kernel::profile::Profile* profile);
 
   const char* get_property(std::string key);
   void set_property(std::string key, std::string value);
@@ -133,22 +150,22 @@ public:
   XBT_ATTRIB_DEPRECATED_v323("Please use Link::set_data()") void setData(void* d) {set_data(d);}
 
   /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_state_trace()") void setStateTrace(
+  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_state_profile()") void setStateTrace(
       simgrid::kernel::profile::Profile* trace)
   {
-    set_state_trace(trace);
+    set_state_profile(trace);
   }
   /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_bandwidth_trace()") void setBandwidthTrace(
+  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_bandwidth_profile()") void setBandwidthTrace(
       simgrid::kernel::profile::Profile* trace)
   {
-    set_bandwidth_trace(trace);
+    set_bandwidth_profile(trace);
   }
   /** @deprecated */
-  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_latency_trace()") void setLatencyTrace(
+  XBT_ATTRIB_DEPRECATED_v323("Please use Link::get_latency_profile()") void setLatencyTrace(
       simgrid::kernel::profile::Profile* trace)
   {
-    set_latency_trace(trace);
+    set_latency_profile(trace);
   }
 #endif
 };
index d019241..0a448db 100644 (file)
@@ -63,11 +63,11 @@ bool Resource::operator==(const Resource& other) const
   return name_ == other.name_;
 }
 
-void Resource::set_state_trace(profile::Profile* trace)
+void Resource::set_state_profile(profile::Profile* profile)
 {
-  xbt_assert(state_event_ == nullptr, "Cannot set a second state trace to %s", get_cname());
+  xbt_assert(state_event_ == nullptr, "Cannot set a second state profile to %s", get_cname());
 
-  state_event_ = future_evt_set.add_trace(trace, this);
+  state_event_ = future_evt_set.add_trace(profile, this);
 }
 
 kernel::lmm::Constraint* Resource::get_constraint() const
index 32d98e8..2019f74 100644 (file)
@@ -87,17 +87,17 @@ void Link::set_data(void* d)
   simgrid::simix::simcall([this, d]() { this->pimpl_->set_data(d); });
 }
 
-void Link::set_state_trace(kernel::profile::Profile* trace)
+void Link::set_state_profile(kernel::profile::Profile* profile)
 {
-  simgrid::simix::simcall([this, trace]() { this->pimpl_->set_state_trace(trace); });
+  simgrid::simix::simcall([this, profile]() { this->pimpl_->set_state_profile(profile); });
 }
-void Link::set_bandwidth_trace(kernel::profile::Profile* trace)
+void Link::set_bandwidth_profile(kernel::profile::Profile* profile)
 {
-  simgrid::simix::simcall([this, trace]() { this->pimpl_->set_bandwidth_trace(trace); });
+  simgrid::simix::simcall([this, profile]() { this->pimpl_->set_bandwidth_profile(profile); });
 }
-void Link::set_latency_trace(kernel::profile::Profile* trace)
+void Link::set_latency_profile(kernel::profile::Profile* trace)
 {
-  simgrid::simix::simcall([this, trace]() { this->pimpl_->set_latency_trace(trace); });
+  simgrid::simix::simcall([this, trace]() { this->pimpl_->set_latency_profile(trace); });
 }
 
 const char* Link::get_property(std::string key)
index 0784446..01e7347 100644 (file)
@@ -134,11 +134,11 @@ int Cpu::get_core_count()
   return core_count_;
 }
 
-void Cpu::set_speed_trace(kernel::profile::Profile* trace)
+void Cpu::set_speed_profile(kernel::profile::Profile* profile)
 {
   xbt_assert(speed_.event == nullptr, "Cannot set a second speed trace to Host %s", host_->get_cname());
 
-  speed_.event = future_evt_set.add_trace(trace, this);
+  speed_.event = future_evt_set.add_trace(profile, this);
 }
 
 
index 1f2be79..38ccfc9 100644 (file)
@@ -148,7 +148,7 @@ public:
   /*< @brief Setup the trace file with availability events (peak speed changes due to external load).
    * Trace must contain relative values (ratio between 0 and 1)
    */
-  virtual void set_speed_trace(kernel::profile::Profile* trace);
+  virtual void set_speed_profile(kernel::profile::Profile* profile);
 
 protected:
   Metric speed_                  = {1.0, 0, nullptr};
index 34eaa72..9a08026 100644 (file)
@@ -367,7 +367,7 @@ CpuTi::~CpuTi()
   set_modified(false);
   delete speed_integrated_trace_;
 }
-void CpuTi::set_speed_trace(kernel::profile::Profile* profile)
+void CpuTi::set_speed_profile(kernel::profile::Profile* profile)
 {
   delete speed_integrated_trace_;
   speed_integrated_trace_ = new CpuTiTmgr(profile, speed_.scale);
index 2a4435b..14455c1 100644 (file)
@@ -103,7 +103,7 @@ public:
   CpuTi(CpuTiModel* model, simgrid::s4u::Host* host, std::vector<double>* speed_per_pstate, int core);
   ~CpuTi() override;
 
-  void set_speed_trace(kernel::profile::Profile* profile) override;
+  void set_speed_profile(kernel::profile::Profile* profile) override;
 
   void apply_event(kernel::profile::Event* event, double value) override;
   void update_actions_finish_time(double now);
index a552f54..999afe5 100644 (file)
@@ -145,16 +145,16 @@ void LinkImpl::on_bandwidth_change()
   s4u::Link::on_bandwidth_change(this->piface_);
 }
 
-void LinkImpl::set_bandwidth_trace(profile::Profile* trace)
+void LinkImpl::set_bandwidth_profile(profile::Profile* profile)
 {
-  xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth trace to Link %s", get_cname());
-  bandwidth_.event = future_evt_set.add_trace(trace, this);
+  xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth profile to Link %s", get_cname());
+  bandwidth_.event = future_evt_set.add_trace(profile, this);
 }
 
-void LinkImpl::set_latency_trace(profile::Profile* trace)
+void LinkImpl::set_latency_profile(profile::Profile* profile)
 {
-  xbt_assert(latency_.event == nullptr, "Cannot set a second latency trace to Link %s", get_cname());
-  latency_.event = future_evt_set.add_trace(trace, this);
+  xbt_assert(latency_.event == nullptr, "Cannot set a second latency profile to Link %s", get_cname());
+  latency_.event = future_evt_set.add_trace(profile, this);
 }
 
 /**********
index 7419f0b..fda1a61 100644 (file)
@@ -147,11 +147,12 @@ public:
 
   void on_bandwidth_change();
 
-  virtual void set_bandwidth_trace(kernel::profile::Profile* trace); /*< setup the trace file with bandwidth events
-                                                                (peak speed changes due to external load). Trace must
-                                                                contain percentages (value between 0 and 1). */
   virtual void
-  set_latency_trace(kernel::profile::Profile* trace); /*< setup the trace file with latency events (peak
+  set_bandwidth_profile(kernel::profile::Profile* profile); /*< setup the profile file with bandwidth events
+                                                   (peak speed changes due to external load). Trace must
+                                                   contain percentages (value between 0 and 1). */
+  virtual void
+  set_latency_profile(kernel::profile::Profile* profile); /*< setup the trace file with latency events (peak
                                                  latency changes due to external load).   Trace must contain
                                                  absolute values */
 
index b2a1877..d33067f 100644 (file)
@@ -281,13 +281,13 @@ void LinkNS3::apply_event(profile::Event* event, double value)
 {
   THROW_UNIMPLEMENTED;
 }
-void LinkNS3::set_bandwidth_trace(profile::Profile* profile)
+void LinkNS3::set_bandwidth_profile(profile::Profile* profile)
 {
-  xbt_die("The NS3 network model doesn't support bandwidth traces");
+  xbt_die("The NS3 network model doesn't support bandwidth profiles");
 }
-void LinkNS3::set_latency_trace(profile::Profile* profile)
+void LinkNS3::set_latency_profile(profile::Profile* profile)
 {
-  xbt_die("The NS3 network model doesn't support latency traces");
+  xbt_die("The NS3 network model doesn't support latency profiles");
 }
 
 /**********
index 26ef8f1..632fe81 100644 (file)
@@ -37,8 +37,8 @@ public:
   void apply_event(simgrid::kernel::profile::Event* event, double value) override;
   void set_bandwidth(double value) override { THROW_UNIMPLEMENTED; }
   void set_latency(double value) override { THROW_UNIMPLEMENTED; }
-  void set_bandwidth_trace(profile::Profile* profile) override;
-  void set_latency_trace(profile::Profile* profile) override;
+  void set_bandwidth_profile(profile::Profile* profile) override;
+  void set_latency_profile(profile::Profile* profile) override;
 };
 
 /**********
index 570ba54..b5d0b2d 100644 (file)
@@ -81,9 +81,9 @@ void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args)
 
   /* Change from the defaults */
   if (args->state_trace)
-    host->pimpl_cpu->set_state_trace(args->state_trace);
+    host->pimpl_cpu->set_state_profile(args->state_trace);
   if (args->speed_trace)
-    host->pimpl_cpu->set_speed_trace(args->speed_trace);
+    host->pimpl_cpu->set_speed_profile(args->speed_trace);
   if (args->pstate != 0)
     host->pimpl_cpu->set_pstate(args->pstate);
   if (args->coord && strcmp(args->coord, ""))
@@ -131,11 +131,11 @@ void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link)
     }
 
     if (link->latency_trace)
-      l->set_latency_trace(link->latency_trace);
+      l->set_latency_profile(link->latency_trace);
     if (link->bandwidth_trace)
-      l->set_bandwidth_trace(link->bandwidth_trace);
+      l->set_bandwidth_profile(link->bandwidth_trace);
     if (link->state_trace)
-      l->set_state_trace(link->state_trace);
+      l->set_state_profile(link->state_trace);
   }
   delete link->properties;
 }
@@ -489,9 +489,9 @@ void sg_platf_new_peer(simgrid::kernel::routing::PeerCreationArgs* peer)
 
   /* Change from the defaults */
   if (peer->state_trace)
-    host->pimpl_cpu->set_state_trace(peer->state_trace);
+    host->pimpl_cpu->set_state_profile(peer->state_trace);
   if (peer->speed_trace)
-    host->pimpl_cpu->set_speed_trace(peer->speed_trace);
+    host->pimpl_cpu->set_speed_profile(peer->speed_trace);
 }
 
 /* Pick the right models for CPU, net and host, and call their model_init_preparse */
index 4937509..ad85acb 100644 (file)
@@ -104,49 +104,49 @@ void parse_platform_file(std::string file)
   /* connect all profiles relative to hosts */
   for (auto const& elm : trace_connect_list_host_avail) {
     xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
-    simgrid::kernel::profile::Profile* trace = traces_set_list.at(elm.first);
+    simgrid::kernel::profile::Profile* profile = traces_set_list.at(elm.first);
 
     simgrid::s4u::Host* host = sg_host_by_name(elm.second.c_str());
     xbt_assert(host, "Host %s undefined", elm.second.c_str());
     simgrid::surf::Cpu* cpu = host->pimpl_cpu;
 
-    cpu->set_state_trace(trace);
+    cpu->set_state_profile(profile);
   }
 
   for (auto const& elm : trace_connect_list_host_speed) {
     xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
-    simgrid::kernel::profile::Profile* trace = traces_set_list.at(elm.first);
+    simgrid::kernel::profile::Profile* profile = traces_set_list.at(elm.first);
 
     simgrid::s4u::Host* host = sg_host_by_name(elm.second.c_str());
     xbt_assert(host, "Host %s undefined", elm.second.c_str());
     simgrid::surf::Cpu* cpu = host->pimpl_cpu;
 
-    cpu->set_speed_trace(trace);
+    cpu->set_speed_profile(profile);
   }
 
   for (auto const& elm : trace_connect_list_link_avail) {
     xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
-    simgrid::kernel::profile::Profile* trace = traces_set_list.at(elm.first);
+    simgrid::kernel::profile::Profile* profile = traces_set_list.at(elm.first);
 
     sg_link_t link = simgrid::s4u::Link::by_name(elm.second.c_str());
     xbt_assert(link, "Link %s undefined", elm.second.c_str());
-    link->set_state_trace(trace);
+    link->set_state_profile(profile);
   }
 
   for (auto const& elm : trace_connect_list_link_bw) {
     xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
-    simgrid::kernel::profile::Profile* trace = traces_set_list.at(elm.first);
+    simgrid::kernel::profile::Profile* profile = traces_set_list.at(elm.first);
     sg_link_t link     = simgrid::s4u::Link::by_name(elm.second.c_str());
     xbt_assert(link, "Link %s undefined", elm.second.c_str());
-    link->set_bandwidth_trace(trace);
+    link->set_bandwidth_profile(profile);
   }
 
   for (auto const& elm : trace_connect_list_link_lat) {
     xbt_assert(traces_set_list.find(elm.first) != traces_set_list.end(), "Trace %s undefined", elm.first.c_str());
-    simgrid::kernel::profile::Profile* trace = traces_set_list.at(elm.first);
+    simgrid::kernel::profile::Profile* profile = traces_set_list.at(elm.first);
     sg_link_t link     = simgrid::s4u::Link::by_name(elm.second.c_str());
     xbt_assert(link, "Link %s undefined", elm.second.c_str());
-    link->set_latency_trace(trace);
+    link->set_latency_profile(profile);
   }
 
   surf_parse_close();