Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename simgrid::kernel::model into simgrid::kernel::resource
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 11 Mar 2018 12:09:06 +0000 (13:09 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 11 Mar 2018 12:09:06 +0000 (13:09 +0100)
13 files changed:
include/simgrid/forward.h
src/kernel/model/Resource.cpp
src/kernel/model/Resource.hpp
src/surf/StorageImpl.hpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/ptask_L07.cpp
src/surf/surf_c_bindings.cpp
src/surf/trace_mgr.cpp
src/surf/trace_mgr.hpp
src/surf/trace_mgr_test.cpp

index 67ba458..b13224f 100644 (file)
@@ -47,7 +47,7 @@ class Constraint;
 class ConstraintLight;
 class System;
 }
-namespace model {
+namespace resource {
 class Resource;
 }
 namespace routing {
@@ -83,7 +83,7 @@ typedef simgrid::s4u::NetZone s4u_NetZone;
 typedef simgrid::s4u::VirtualMachine s4u_VM;
 typedef boost::intrusive_ptr<simgrid::kernel::activity::ActivityImpl> smx_activity_t;
 typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
-typedef simgrid::kernel::model::Resource surf_Resource;
+typedef simgrid::kernel::resource::Resource surf_Resource;
 typedef simgrid::trace_mgr::trace tmgr_Trace;
 
 typedef simgrid::kernel::context::Context* smx_context_t;
index f7b290c..6367a23 100644 (file)
@@ -9,7 +9,7 @@
 
 namespace simgrid {
 namespace kernel {
-namespace model {
+namespace resource {
 
 Resource::Resource(surf::Model* model, const std::string& name, lmm::Constraint* constraint)
     : name_(name), model_(model), constraint_(constraint)
index b34bcc0..4bdbfe2 100644 (file)
@@ -10,7 +10,7 @@
 
 namespace simgrid {
 namespace kernel {
-namespace model {
+namespace resource {
 
 /** @ingroup SURF_interface
  * @brief SURF resource interface class
@@ -86,9 +86,9 @@ protected:
 } // namespace simgrid
 
 namespace std {
-template <> class hash<simgrid::kernel::model::Resource> {
+template <> class hash<simgrid::kernel::resource::Resource> {
 public:
-  std::size_t operator()(const simgrid::kernel::model::Resource& r) const
+  std::size_t operator()(const simgrid::kernel::resource::Resource& r) const
   {
     return (std::size_t)xbt_str_hash(r.getCname());
   }
index e290906..b877e34 100644 (file)
@@ -81,7 +81,7 @@ public:
  * @brief SURF storage interface class
  * @details A Storage represent a storage unit (e.g.: hard drive, usb key)
  */
-class StorageImpl : public kernel::model::Resource, public PropertyHolder {
+class StorageImpl : public kernel::resource::Resource, public PropertyHolder {
 public:
   /** @brief Storage constructor */
   StorageImpl(Model* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
index e5a9266..1fcf505 100644 (file)
@@ -225,8 +225,8 @@ std::list<Cpu*> CpuAction::cpus() {
   for (int i = 0; i < llen; i++) {
     /* Beware of composite actions: ptasks put links and cpus together */
     // extra pb: we cannot dynamic_cast from void*...
-    kernel::model::Resource* resource =
-        static_cast<kernel::model::Resource*>(getVariable()->get_constraint(i)->get_id());
+    kernel::resource::Resource* resource =
+        static_cast<kernel::resource::Resource*>(getVariable()->get_constraint(i)->get_id());
     Cpu* cpu           = dynamic_cast<Cpu*>(resource);
     if (cpu != nullptr)
       retlist.push_back(cpu);
index 5b97cf2..b0ff040 100644 (file)
@@ -46,7 +46,7 @@ public:
 * @brief SURF cpu resource interface class
 * @details A Cpu represent a cpu associated to a host
 */
-XBT_PUBLIC_CLASS Cpu : public simgrid::kernel::model::Resource
+XBT_PUBLIC_CLASS Cpu : public simgrid::kernel::resource::Resource
 {
 public:
   /**
index 86202a2..c53c07d 100644 (file)
@@ -202,8 +202,8 @@ namespace simgrid {
       for (int i = 0; i < llen; i++) {
         /* Beware of composite actions: ptasks put links and cpus together */
         // extra pb: we cannot dynamic_cast from void*...
-        kernel::model::Resource* resource =
-            static_cast<kernel::model::Resource*>(getVariable()->get_constraint(i)->get_id());
+        kernel::resource::Resource* resource =
+            static_cast<kernel::resource::Resource*>(getVariable()->get_constraint(i)->get_id());
         LinkImpl* link     = dynamic_cast<LinkImpl*>(resource);
         if (link != nullptr)
           retlist.push_back(link);
index 87f37e0..b17ddad 100644 (file)
@@ -114,7 +114,7 @@ public:
  * @brief SURF network link interface class
  * @details A Link represents the link between two [hosts](\ref simgrid::surf::HostImpl)
  */
-class LinkImpl : public simgrid::kernel::model::Resource, public simgrid::surf::PropertyHolder {
+class LinkImpl : public simgrid::kernel::resource::Resource, public simgrid::surf::PropertyHolder {
 protected:
   LinkImpl(simgrid::surf::NetworkModel* model, const std::string& name, kernel::lmm::Constraint* constraint);
   ~LinkImpl() override;
index 5d968fc..d4eb8a2 100644 (file)
@@ -124,7 +124,7 @@ void HostL07Model::updateActionsState(double /*now*/, double delta)
       while (cnst != nullptr) {
         i++;
         void* constraint_id = cnst->get_id();
-        if (static_cast<simgrid::kernel::model::Resource*>(constraint_id)->isOff()) {
+        if (static_cast<simgrid::kernel::resource::Resource*>(constraint_id)->isOff()) {
           XBT_DEBUG("Action (%p) Failed!!", &action);
           action.finish(Action::State::failed);
           break;
index aeba3b6..98b5dd9 100644 (file)
@@ -21,7 +21,7 @@ void surf_presolve()
   double next_event_date = -1.0;
   tmgr_trace_event_t event          = nullptr;
   double value = -1.0;
-  simgrid::kernel::model::Resource* resource = nullptr;
+  simgrid::kernel::resource::Resource* resource = nullptr;
 
   XBT_DEBUG ("Consume all trace events occurring before the starting time.");
   while ((next_event_date = future_evt_set->next_date()) != -1.0) {
@@ -44,7 +44,7 @@ double surf_solve(double max_date)
   double time_delta = -1.0; /* duration */
   double model_next_action_end = -1.0;
   double value = -1.0;
-  simgrid::kernel::model::Resource* resource = nullptr;
+  simgrid::kernel::resource::Resource* resource = nullptr;
   tmgr_trace_event_t event          = nullptr;
 
   if (max_date > 0.0) {
index c5b9e2f..07c5ba6 100644 (file)
@@ -121,7 +121,8 @@ tmgr_trace_t tmgr_trace_new_from_file(std::string filename)
 }
 
 /** @brief Registers a new trace into the future event set, and get an iterator over the integrated trace  */
-tmgr_trace_event_t simgrid::trace_mgr::future_evt_set::add_trace(tmgr_trace_t trace, kernel::model::Resource* resource)
+tmgr_trace_event_t simgrid::trace_mgr::future_evt_set::add_trace(tmgr_trace_t trace,
+                                                                 kernel::resource::Resource* resource)
 {
   tmgr_trace_event_t trace_iterator = nullptr;
 
@@ -146,7 +147,7 @@ double simgrid::trace_mgr::future_evt_set::next_date() const
 
 /** @brief Retrieves the next occurring event, or nullptr if none happens before #date */
 tmgr_trace_event_t simgrid::trace_mgr::future_evt_set::pop_leq(double date, double* value,
-                                                               kernel::model::Resource** resource)
+                                                               kernel::resource::Resource** resource)
 {
   double event_date = next_date();
   if (event_date > date)
index a3a8aa0..36ce190 100644 (file)
@@ -87,8 +87,8 @@ public:
   future_evt_set();
   virtual ~future_evt_set();
   double next_date() const;
-  tmgr_trace_event_t pop_leq(double date, double* value, simgrid::kernel::model::Resource** resource);
-  tmgr_trace_event_t add_trace(tmgr_trace_t trace, simgrid::kernel::model::Resource * resource);
+  tmgr_trace_event_t pop_leq(double date, double* value, simgrid::kernel::resource::Resource** resource);
+  tmgr_trace_event_t add_trace(tmgr_trace_t trace, simgrid::kernel::resource::Resource * resource);
 
 private:
   typedef std::pair<double, tmgr_trace_event_t> Qelt;
index d8bc1c9..d9a54b3 100644 (file)
@@ -24,9 +24,9 @@ namespace tmgr = simgrid::trace_mgr;
 XBT_LOG_NEW_DEFAULT_CATEGORY(unit, "Unit tests of the Trace Manager");
 
 double thedate;
-class MockedResource : public simgrid::kernel::model::Resource {
+class MockedResource : public simgrid::kernel::resource::Resource {
 public:
-  explicit MockedResource() : simgrid::kernel::model::Resource(nullptr, "fake", nullptr) {}
+  explicit MockedResource() : simgrid::kernel::resource::Resource(nullptr, "fake", nullptr) {}
   void apply_event(tmgr_trace_event_t event, double value)
   {
     XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", thedate, value, event->idx);
@@ -50,7 +50,7 @@ static void trace2vector(const char* str, std::vector<tmgr::DatedValue>* whereto
   while (fes.next_date() <= 20.0 && fes.next_date() >= 0) {
     thedate = fes.next_date();
     double value;
-    simgrid::kernel::model::Resource* res;
+    simgrid::kernel::resource::Resource* res;
     tmgr_trace_event_t it = fes.pop_leq(thedate, &value, &res);
     if (it == nullptr)
       continue;