Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanup after the split of kernel/resource/profile into several classes
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 31 May 2019 13:11:22 +0000 (15:11 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 31 May 2019 13:11:22 +0000 (15:11 +0200)
25 files changed:
src/kernel/resource/Resource.cpp
src/kernel/resource/profile/DatedValue.cpp
src/kernel/resource/profile/DatedValue.hpp
src/kernel/resource/profile/FutureEvtSet.cpp
src/kernel/resource/profile/FutureEvtSet.hpp
src/kernel/resource/profile/Profile.cpp
src/kernel/resource/profile/Profile.hpp
src/kernel/resource/profile/trace_mgr.cpp [deleted file]
src/kernel/resource/profile/trace_mgr.hpp [deleted file]
src/kernel/resource/profile/trace_mgr_test.cpp
src/surf/StorageImpl.hpp
src/surf/cpu_cas01.cpp
src/surf/cpu_interface.cpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/network_cm02.cpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/ptask_L07.cpp
src/surf/sg_platf.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/xml/surfxml_sax_cb.cpp
tools/cmake/DefinePackages.cmake

index 16851b2..a8e7f5d 100644 (file)
@@ -5,7 +5,8 @@
 
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "src/kernel/lmm/maxmin.hpp" // Constraint
 
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "src/kernel/lmm/maxmin.hpp" // Constraint
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 
 namespace simgrid {
 #include "src/surf/surf_interface.hpp"
 
 namespace simgrid {
@@ -22,7 +23,7 @@ double Resource::get_load() const
 void Resource::set_state_profile(profile::Profile* profile)
 {
   xbt_assert(state_event_ == nullptr, "Cannot set a second state profile to %s", get_cname());
 void Resource::set_state_profile(profile::Profile* profile)
 {
   xbt_assert(state_event_ == nullptr, "Cannot set a second state profile to %s", get_cname());
-  state_event_ = profile->schedule(&future_evt_set, this);
+  state_event_ = profile->schedule(&profile::future_evt_set, this);
 }
 
 } // namespace resource
 }
 
 } // namespace resource
index b104af7..62cb065 100644 (file)
@@ -3,7 +3,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-//#include "src/kernel/resource/profile/DatedValue.hpp"
+#include "src/kernel/resource/profile/DatedValue.hpp"
 #include <math.h>
 
 namespace simgrid {
 #include <math.h>
 
 namespace simgrid {
@@ -22,4 +22,4 @@ std::ostream& operator<<(std::ostream& out, const DatedValue& e)
 
 } // namespace profile
 } // namespace kernel
 
 } // namespace profile
 } // namespace kernel
-} // namespace simgrid
\ No newline at end of file
+} // namespace simgrid
index 8530fb7..84bdf99 100644 (file)
@@ -3,6 +3,10 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#ifndef SIMGRID_KERNEL_PROFILE_DATEDVALUE
+#define SIMGRID_KERNEL_PROFILE_DATEDVALUE
+
+#include "simgrid/forward.h"
 #include <iostream>
 
 namespace simgrid {
 #include <iostream>
 
 namespace simgrid {
@@ -32,4 +36,6 @@ std::ostream& operator<<(std::ostream& out, const DatedValue& e);
 
 } // namespace profile
 } // namespace kernel
 
 } // namespace profile
 } // namespace kernel
-} // namespace simgrid
\ No newline at end of file
+} // namespace simgrid
+
+#endif
index 3579fe8..19937f4 100644 (file)
@@ -4,11 +4,15 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/resource/profile/FutureEvtSet.hpp"
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/resource/profile/FutureEvtSet.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 
 namespace simgrid {
 namespace kernel {
 namespace profile {
 
 
 namespace simgrid {
 namespace kernel {
 namespace profile {
 
+simgrid::kernel::profile::FutureEvtSet future_evt_set; // FIXME: singleton antipattern
+
 FutureEvtSet::FutureEvtSet() = default;
 FutureEvtSet::~FutureEvtSet()
 {
 FutureEvtSet::FutureEvtSet() = default;
 FutureEvtSet::~FutureEvtSet()
 {
@@ -50,4 +54,4 @@ Event* FutureEvtSet::pop_leq(double date, double* value, resource::Resource** re
 }
 } // namespace profile
 } // namespace kernel
 }
 } // namespace profile
 } // namespace kernel
-} // namespace simgrid
\ No newline at end of file
+} // namespace simgrid
index f565f0a..a324d57 100644 (file)
@@ -3,10 +3,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include <queue>
 #ifndef FUTUREEVTSET_HPP
 #define FUTUREEVTSET_HPP
 
 #ifndef FUTUREEVTSET_HPP
 #define FUTUREEVTSET_HPP
 
+#include "simgrid/forward.h"
+#include <queue>
+
 namespace simgrid {
 namespace kernel {
 namespace profile {
 namespace simgrid {
 namespace kernel {
 namespace profile {
@@ -28,8 +30,11 @@ private:
   std::priority_queue<Qelt, std::vector<Qelt>, std::greater<Qelt>> heap_;
 };
 
   std::priority_queue<Qelt, std::vector<Qelt>, std::greater<Qelt>> heap_;
 };
 
+// FIXME: kill that singleton
+extern XBT_PRIVATE simgrid::kernel::profile::FutureEvtSet future_evt_set;
+
 } // namespace profile
 } // namespace kernel
 } // namespace simgrid
 
 } // namespace profile
 } // namespace kernel
 } // namespace simgrid
 
-#endif
\ No newline at end of file
+#endif
index a73c4c0..288d618 100644 (file)
@@ -5,12 +5,15 @@
 
 #include "src/kernel/resource/profile/Profile.hpp"
 #include "simgrid/forward.h"
 
 #include "src/kernel/resource/profile/Profile.hpp"
 #include "simgrid/forward.h"
-#include "src/kernel/resource/profile/DatedValue.cpp"
-#include "src/kernel/resource/profile/FutureEvtSet.cpp"
-#include "xbt/log.h"
-#include "xbt/sysdep.h"
+#include "src/kernel/resource/profile/DatedValue.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
+#include "src/surf/surf_interface.hpp"
+
 #include <boost/algorithm/string.hpp>
 #include <boost/algorithm/string.hpp>
+#include <fstream>
 #include <ostream>
 #include <ostream>
+#include <unordered_map>
 #include <vector>
 
 static std::unordered_map<std::string, simgrid::kernel::profile::Profile*> trace_list;
 #include <vector>
 
 static std::unordered_map<std::string, simgrid::kernel::profile::Profile*> trace_list;
@@ -126,3 +129,18 @@ Profile* Profile::from_file(const std::string& path)
 } // namespace profile
 } // namespace kernel
 } // namespace simgrid
 } // namespace profile
 } // namespace kernel
 } // namespace simgrid
+
+void tmgr_finalize()
+{
+  for (auto const& kv : trace_list)
+    delete kv.second;
+  trace_list.clear();
+}
+
+void tmgr_trace_event_unref(simgrid::kernel::profile::Event** event)
+{
+  if ((*event)->free_me) {
+    delete *event;
+    *event = nullptr;
+  }
+}
index fdae8c5..3c173db 100644 (file)
@@ -3,11 +3,13 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#ifndef PROFILE_HPP
-#define PROFILE_HPP
+#ifndef SIMGRID_KERNEL_PROFILE_HPP
+#define SIMGRID_KERNEL_PROFILE_HPP
 
 
+#include "simgrid/forward.h"
 #include "src/kernel/resource/profile/DatedValue.hpp"
 #include "src/kernel/resource/profile/FutureEvtSet.hpp"
 #include "src/kernel/resource/profile/DatedValue.hpp"
 #include "src/kernel/resource/profile/FutureEvtSet.hpp"
+
 #include <queue>
 #include <vector>
 
 #include <queue>
 #include <vector>
 
@@ -15,14 +17,6 @@ namespace simgrid {
 namespace kernel {
 namespace profile {
 
 namespace kernel {
 namespace profile {
 
-class Event {
-public:
-  Profile* profile;
-  unsigned int idx;
-  resource::Resource* resource;
-  bool free_me;
-};
-
 /** @brief A profile is a set of timed values, encoding the value that a variable takes at what time
  *
  * It is useful to model dynamic platforms, where an external load that makes the resource availability change over
 /** @brief A profile is a set of timed values, encoding the value that a variable takes at what time
  *
  * It is useful to model dynamic platforms, where an external load that makes the resource availability change over
@@ -50,4 +44,7 @@ private:
 } // namespace kernel
 } // namespace simgrid
 
 } // namespace kernel
 } // namespace simgrid
 
-#endif
\ No newline at end of file
+/** Module finalizer: frees all profiles */
+XBT_PUBLIC void tmgr_finalize();
+
+#endif
diff --git a/src/kernel/resource/profile/trace_mgr.cpp b/src/kernel/resource/profile/trace_mgr.cpp
deleted file mode 100644 (file)
index 6c0d0db..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include "xbt/log.h"
-#include "xbt/sysdep.h"
-
-#include "src/kernel/resource/profile/trace_mgr.hpp"
-#include "src/surf/surf_interface.hpp"
-#include <boost/algorithm/string.hpp>
-#include <boost/algorithm/string/join.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <cmath>
-#include <fstream>
-#include <sstream>
-#include <unordered_map>
-
-#include "src/kernel/resource/profile/Profile.cpp"
-
-/** This file has been splitted into three different files:
-  - Profile, defining the class Profile and functions that allow to use provided profiles;
-  - DatedValue, the class of a DatedValue (a value and a timestamp);
-  - FutureEvtSet, a set of events happening in the future. **/
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(profile, resource, "Surf profile management");
-void tmgr_finalize()
-{
-  for (auto const& kv : trace_list)
-    delete kv.second;
-  trace_list.clear();
-}
-
-void tmgr_trace_event_unref(simgrid::kernel::profile::Event** event)
-{
-  if ((*event)->free_me) {
-    delete *event;
-    *event = nullptr;
-  }
-}
\ No newline at end of file
diff --git a/src/kernel/resource/profile/trace_mgr.hpp b/src/kernel/resource/profile/trace_mgr.hpp
deleted file mode 100644 (file)
index 5ed634a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (c) 2004-2019. The SimGrid Team. All rights reserved.          */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#ifndef SURF_PMGR_H
-#define SURF_PMGR_H
-
-#include "simgrid/forward.h"
-#include "src/kernel/resource/profile/Profile.hpp"
-#include "xbt/sysdep.h"
-
-#include <queue>
-#include <vector>
-
-extern XBT_PRIVATE simgrid::kernel::profile::FutureEvtSet future_evt_set;
-
-/**
- * @brief Free a trace event structure
- *
- * This function frees a trace_event if it can be freed, ie, if it has the free_me flag set to 1.
- * This flag indicates whether the structure is still used somewhere or not.
- * When the structure is freed, the argument is set to nullptr
- */
-XBT_PUBLIC void tmgr_trace_event_unref(simgrid::kernel::profile::Event** trace_event);
-XBT_PUBLIC void tmgr_finalize();
-
-#endif /* SURF_PMGR_H */
index 97a9317..c995ef8 100644 (file)
@@ -6,7 +6,9 @@
 #include "catch.hpp"
 
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "catch.hpp"
 
 #include "simgrid/kernel/resource/Resource.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/DatedValue.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 
 #include "xbt/log.h"
 #include "src/surf/surf_interface.hpp"
 
 #include "xbt/log.h"
index 1e38c51..3590cae 100644 (file)
@@ -8,7 +8,6 @@
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Io.hpp"
 #include "simgrid/s4u/Storage.hpp"
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Io.hpp"
 #include "simgrid/s4u/Storage.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
 #include "src/surf/PropertyHolder.hpp"
 #include "surf_interface.hpp"
 
 #include "src/surf/PropertyHolder.hpp"
 #include "surf_interface.hpp"
 
index 1bb85a7..18fc64d 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "cpu_cas01.hpp"
 #include "simgrid/sg_config.hpp"
 
 #include "cpu_cas01.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
 #include "src/surf/cpu_ti.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 #include "src/surf/cpu_ti.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
index 8325194..7342a03 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "cpu_interface.hpp"
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "cpu_interface.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
@@ -129,7 +130,7 @@ 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());
 
 {
   xbt_assert(speed_.event == nullptr, "Cannot set a second speed trace to Host %s", host_->get_cname());
 
-  speed_.event = profile->schedule(&future_evt_set, this);
+  speed_.event = profile->schedule(&profile::future_evt_set, this);
 }
 
 
 }
 
 
index a011ad3..10a4cf4 100644 (file)
@@ -10,7 +10,6 @@
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
 
 #include <list>
 
 
 #include <list>
 
index 997b716..eb5574a 100644 (file)
@@ -4,7 +4,8 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "cpu_ti.hpp"
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "cpu_ti.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
@@ -350,7 +351,7 @@ void CpuTi::set_speed_profile(kernel::profile::Profile* profile)
     kernel::profile::DatedValue val = profile->event_list.back();
     if (val.date_ < 1e-12) {
       simgrid::kernel::profile::Profile* prof = new simgrid::kernel::profile::Profile();
     kernel::profile::DatedValue val = profile->event_list.back();
     if (val.date_ < 1e-12) {
       simgrid::kernel::profile::Profile* prof = new simgrid::kernel::profile::Profile();
-      speed_.event                            = prof->schedule(&future_evt_set, this);
+      speed_.event                            = prof->schedule(&profile::future_evt_set, this);
     }
   }
 }
     }
   }
 }
index f304375..0378104 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
 
 #ifndef SURF_MODEL_CPUTI_H_
 #define SURF_MODEL_CPUTI_H_
 
-#include "src/kernel/resource/profile/trace_mgr.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/cpu_interface.hpp"
 
 #include <boost/intrusive/list.hpp>
 #include "src/surf/cpu_interface.hpp"
 
 #include <boost/intrusive/list.hpp>
index 0145c1f..3a09e28 100644 (file)
@@ -9,6 +9,7 @@
 #include "network_cm02.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/sg_config.hpp"
 #include "network_cm02.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
index 530b483..33d0764 100644 (file)
@@ -6,6 +6,7 @@
 #include "network_interface.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
 #include "network_interface.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
@@ -148,13 +149,13 @@ void LinkImpl::on_bandwidth_change()
 void LinkImpl::set_bandwidth_profile(profile::Profile* profile)
 {
   xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth profile to Link %s", get_cname());
 void LinkImpl::set_bandwidth_profile(profile::Profile* profile)
 {
   xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth profile to Link %s", get_cname());
-  bandwidth_.event = profile->schedule(&future_evt_set, this);
+  bandwidth_.event = profile->schedule(&profile::future_evt_set, this);
 }
 
 void LinkImpl::set_latency_profile(profile::Profile* profile)
 {
   xbt_assert(latency_.event == nullptr, "Cannot set a second latency profile to Link %s", get_cname());
 }
 
 void LinkImpl::set_latency_profile(profile::Profile* profile)
 {
   xbt_assert(latency_.event == nullptr, "Cannot set a second latency profile to Link %s", get_cname());
-  latency_.event = profile->schedule(&future_evt_set, this);
+  latency_.event = profile->schedule(&profile::future_evt_set, this);
 }
 
 /**********
 }
 
 /**********
index a83d5e5..c92e3d6 100644 (file)
@@ -10,7 +10,6 @@
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Link.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "simgrid/s4u/Link.hpp"
 #include "src/kernel/lmm/maxmin.hpp"
-#include "src/kernel/resource/profile/trace_mgr.hpp"
 #include "src/surf/PropertyHolder.hpp"
 
 #include <list>
 #include "src/surf/PropertyHolder.hpp"
 
 #include <list>
index 384656c..b31f4de 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "ptask_L07.hpp"
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "ptask_L07.hpp"
+#include "src/kernel/resource/profile/Event.hpp"
 #include "surf/surf.hpp"
 #include "xbt/config.hpp"
 
 #include "surf/surf.hpp"
 #include "xbt/config.hpp"
 
index 83178f8..21dd6c1 100644 (file)
@@ -19,6 +19,7 @@
 #include "src/include/simgrid/sg_config.hpp"
 #include "src/include/surf/surf.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/include/simgrid/sg_config.hpp"
 #include "src/include/surf/surf.hpp"
 #include "src/kernel/EngineImpl.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/simix/smx_private.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf_private.hpp"
 #include "src/simix/smx_private.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf_private.hpp"
index 0a12d85..b0a8280 100644 (file)
@@ -6,6 +6,7 @@
 #include "simgrid/s4u/Engine.hpp"
 #include "src/include/surf/surf.hpp"
 #include "src/instr/instr_private.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "src/include/surf/surf.hpp"
 #include "src/instr/instr_private.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 
 #include <algorithm>
 #include "src/plugins/vm/VirtualMachineImpl.hpp"
 
 #include <algorithm>
@@ -26,11 +27,11 @@ void surf_presolve()
   simgrid::kernel::resource::Resource* resource = nullptr;
 
   XBT_DEBUG ("Consume all trace events occurring before the starting time.");
   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) {
+  while ((next_event_date = simgrid::kernel::profile::future_evt_set.next_date()) != -1.0) {
     if (next_event_date > NOW)
       break;
 
     if (next_event_date > NOW)
       break;
 
-    while ((event = future_evt_set.pop_leq(next_event_date, &value, &resource))) {
+    while ((event = simgrid::kernel::profile::future_evt_set.pop_leq(next_event_date, &value, &resource))) {
       if (value >= 0)
         resource->apply_event(event, value);
     }
       if (value >= 0)
         resource->apply_event(event, value);
     }
@@ -82,7 +83,7 @@ double surf_solve(double max_date)
   XBT_DEBUG("Looking for next trace event");
 
   while (1) { // Handle next occurring events until none remains
   XBT_DEBUG("Looking for next trace event");
 
   while (1) { // Handle next occurring events until none remains
-    double next_event_date = future_evt_set.next_date();
+    double next_event_date = simgrid::kernel::profile::future_evt_set.next_date();
     XBT_DEBUG("Next TRACE event: %f", next_event_date);
 
     if (not surf_network_model->next_occuring_event_is_idempotent()) { // NS3, I see you
     XBT_DEBUG("Next TRACE event: %f", next_event_date);
 
     if (not surf_network_model->next_occuring_event_is_idempotent()) { // NS3, I see you
@@ -109,7 +110,7 @@ double surf_solve(double max_date)
 
     XBT_DEBUG("Updating models (min = %g, NOW = %g, next_event_date = %g)", time_delta, NOW, next_event_date);
 
 
     XBT_DEBUG("Updating models (min = %g, NOW = %g, next_event_date = %g)", time_delta, NOW, next_event_date);
 
-    while ((event = future_evt_set.pop_leq(next_event_date, &value, &resource))) {
+    while ((event = simgrid::kernel::profile::future_evt_set.pop_leq(next_event_date, &value, &resource))) {
       if (resource->is_used() || (watched_hosts.find(resource->get_cname()) != watched_hosts.end())) {
         time_delta = next_event_date - NOW;
         XBT_DEBUG("This event invalidates the next_occuring_event() computation of models. Next event set to %f", time_delta);
       if (resource->is_used() || (watched_hosts.find(resource->get_cname()) != watched_hosts.end())) {
         time_delta = next_event_date - NOW;
         XBT_DEBUG("This event invalidates the next_occuring_event() computation of models. Next event set to %f", time_delta);
index dc56933..1cd5f1e 100644 (file)
@@ -7,6 +7,8 @@
 #include "mc/mc.h"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
 #include "mc/mc.h"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/simgrid/version.h"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf.hpp"
 #include "src/simgrid/version.h"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf.hpp"
index 811474e..7d0f2fc 100644 (file)
@@ -6,6 +6,8 @@
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/sg_config.hpp"
+#include "src/kernel/resource/profile/FutureEvtSet.hpp"
+#include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "src/surf/xml/platf_private.hpp"
index 7e12ac3..d42372c 100644 (file)
@@ -312,8 +312,14 @@ set(SURF_SRC
   src/kernel/resource/Action.cpp
   src/kernel/resource/Model.cpp
   src/kernel/resource/Resource.cpp
   src/kernel/resource/Action.cpp
   src/kernel/resource/Model.cpp
   src/kernel/resource/Resource.cpp
-  src/kernel/resource/profile/trace_mgr.hpp
-  src/kernel/resource/profile/trace_mgr.cpp
+
+  src/kernel/resource/profile/DatedValue.cpp
+  src/kernel/resource/profile/DatedValue.hpp
+  src/kernel/resource/profile/Event.hpp
+  src/kernel/resource/profile/FutureEvtSet.cpp
+  src/kernel/resource/profile/FutureEvtSet.hpp
+  src/kernel/resource/profile/Profile.cpp
+  src/kernel/resource/profile/Profile.hpp
 
   src/kernel/routing/ClusterZone.cpp
   src/kernel/routing/DijkstraZone.cpp
 
   src/kernel/routing/ClusterZone.cpp
   src/kernel/routing/DijkstraZone.cpp