Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 8 Jul 2018 09:57:25 +0000 (11:57 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 8 Jul 2018 09:57:25 +0000 (11:57 +0200)
12 files changed:
.travis.yml
include/simgrid/kernel/resource/Model.hpp
src/include/surf/surf.hpp
src/instr/instr_private.hpp
src/kernel/resource/Model.cpp
src/kernel/routing/DijkstraZone.cpp
src/simdag/sd_global.cpp
src/simix/smx_global.cpp
src/surf/cpu_ti.hpp
src/surf/surf_c_bindings.cpp
teshsuite/surf/surf_usage2/surf_usage2.cpp
tools/appveyor-irc-notify.py

index de7da30..04e7224 100644 (file)
@@ -14,6 +14,7 @@ compiler:
 addons:
   apt:
     update: true
+    allow_unauthenticated: yes
     sources:
     - sourceline: ppa:samuel-bachmann/boost # Get boost 1.60 for Trusty
     packages:
index 59a0cce..ce391af 100644 (file)
@@ -71,6 +71,13 @@ public:
   virtual double next_occuring_event_lazy(double now);
   virtual double next_occuring_event_full(double now);
 
+private:
+  Action* extract_action(Action::StateSet* list);
+
+public:
+  Action* extract_done_action();
+  Action* extract_failed_action();
+
   /**
    * @brief Update action to the current time
    *
index a936a3b..0d9f99a 100644 (file)
@@ -7,54 +7,6 @@
 #define SURF_SURF_H
 
 #include "simgrid/forward.h"
-#include "xbt/graph.h"
-
-/***************************/
-/* Generic model object */
-/***************************/
-
-/** @{ @ingroup SURF_c_bindings */
-
-/**
- * @brief Pop an action from the done actions set
- *
- * @param model The model from which the action is extracted
- * @return An action in done state
- */
-XBT_PUBLIC simgrid::kernel::resource::Action*
-surf_model_extract_done_action_set(simgrid::kernel::resource::Model* model);
-
-/**
- * @brief Pop an action from the failed actions set
- *
- * @param model The model from which the action is extracted
- * @return An action in failed state
- */
-XBT_PUBLIC simgrid::kernel::resource::Action*
-surf_model_extract_failed_action_set(simgrid::kernel::resource::Model* model);
-
-/**
- * @brief Get the size of the running action set of a model
- *
- * @param model The model
- * @return The size of the running action set
- */
-XBT_PUBLIC int surf_model_running_action_set_size(simgrid::kernel::resource::Model* model);
-
-/**
- * @brief [brief description]
- * @details [long description]
- *
- * @param action The surf cpu action
- * @param bound [description]
- */
-XBT_PUBLIC void surf_cpu_action_set_bound(simgrid::kernel::resource::Action* action, double bound);
-
-/** @} */
-
-/**************************************/
-/* Implementations of model object */
-/**************************************/
 
 /** \ingroup SURF_models
  *  \brief The CPU model object for the physical machine layer
@@ -129,10 +81,4 @@ XBT_PUBLIC void surf_exit();
 /* surf parse file related (public because called from a test suite) */
 XBT_PUBLIC void parse_platform_file(const char* file);
 
-/********** Tracing **********/
-
-/* instr_routing.c */
-xbt_graph_t instr_routing_platform_graph();
-void instr_routing_platform_graph_export_graphviz(xbt_graph_t g, const char* filename);
-
 #endif
index 4bdfd3e..1fc86db 100644 (file)
@@ -279,4 +279,8 @@ XBT_PRIVATE void dump_comment(std::string comment);
 
 XBT_PRIVATE std::string TRACE_get_filename();
 
+/* instr_platform */
+xbt_graph_t instr_routing_platform_graph();
+void instr_routing_platform_graph_export_graphviz(xbt_graph_t g, const char* filename);
+
 #endif
index 65c0350..d7c6645 100644 (file)
@@ -141,6 +141,28 @@ void Model::update_actions_state(double now, double delta)
     xbt_die("Invalid cpu update mechanism!");
 }
 
+/** Pops and returns the first action of that state set (or nullptr if none exist) */
+Action* Model::extract_action(Action::StateSet* list)
+{
+  if (list->empty())
+    return nullptr;
+  simgrid::kernel::resource::Action* res = &list->front();
+  list->pop_front();
+  return res;
+}
+
+/** Pops and returns the first finished action (or nullptr if none exist) */
+Action* Model::extract_done_action()
+{
+  return extract_action(get_finished_action_set());
+}
+
+/** Pops and returns the failed finished action (or nullptr if none exist) */
+Action* Model::extract_failed_action()
+{
+  return extract_action(get_failed_action_set());
+}
+
 void Model::update_actions_state_lazy(double /*now*/, double /*delta*/)
 {
   THROW_UNIMPLEMENTED;
index 54396c5..1c58336 100644 (file)
@@ -21,7 +21,7 @@ namespace routing {
 
 class GraphNodeData {
 public:
-  GraphNodeData(int id) : id_(id) {}
+  explicit GraphNodeData(int id) : id_(id) {}
   int id_;
   int graph_id_ = -1; /* used for caching internal graph id's */
 };
index 7a2b1a9..193b5f4 100644 (file)
@@ -57,7 +57,7 @@ std::set<SD_task_t>* simulate(double how_long){
 
     /* let's see which tasks are done */
     for (auto const& model : *all_existing_models) {
-      simgrid::kernel::resource::Action* action = surf_model_extract_done_action_set(model);
+      simgrid::kernel::resource::Action* action = model->extract_done_action();
       while (action != nullptr && action->get_data() != nullptr) {
         SD_task_t task = static_cast<SD_task_t>(action->get_data());
         XBT_VERB("Task '%s' done", SD_task_get_name(task));
@@ -103,17 +103,17 @@ std::set<SD_task_t>* simulate(double how_long){
             SD_task_run(output);
         }
         task->outputs->clear();
-        action = surf_model_extract_done_action_set(model);
+        action = model->extract_done_action();
       }
 
       /* let's see which tasks have just failed */
-      action = surf_model_extract_failed_action_set(model);
+      action = model->extract_failed_action();
       while (action != nullptr) {
         SD_task_t task = static_cast<SD_task_t>(action->get_data());
         XBT_VERB("Task '%s' failed", SD_task_get_name(task));
         SD_task_set_state(task, SD_FAILED);
         sd_global->return_set->insert(task);
-        action = surf_model_extract_failed_action_set(model);
+        action = model->extract_failed_action();
       }
     }
   }
index 6e7b575..4a1b82a 100644 (file)
@@ -311,12 +311,12 @@ static void SIMIX_wake_processes()
     simgrid::kernel::resource::Action* action;
 
     XBT_DEBUG("Handling the processes whose action failed (if any)");
-    while ((action = surf_model_extract_failed_action_set(model))) {
+    while ((action = model->extract_failed_action())) {
       XBT_DEBUG("   Handling Action %p",action);
       SIMIX_simcall_exit(static_cast<simgrid::kernel::activity::ActivityImpl*>(action->get_data()));
     }
     XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
-    while ((action = surf_model_extract_done_action_set(model))) {
+    while ((action = model->extract_done_action())) {
       XBT_DEBUG("   Handling Action %p",action);
       if (action->get_data() == nullptr)
         XBT_DEBUG("probably vcpu's action %p, skip", action);
index b81507b..014789a 100644 (file)
@@ -47,7 +47,7 @@ class CpuTiTmgr {
   };
 
 public:
-  CpuTiTmgr(double value) : type_(Type::FIXED), value_(value){};
+  explicit CpuTiTmgr(double value) : type_(Type::FIXED), value_(value){};
   CpuTiTmgr(tmgr_trace_t speed_trace, double value);
   CpuTiTmgr(const CpuTiTmgr&) = delete;
   CpuTiTmgr& operator=(const CpuTiTmgr&) = delete;
index 07e3030..1e8f2cd 100644 (file)
@@ -148,35 +148,3 @@ double surf_solve(double max_date)
 
   return time_delta;
 }
-
-/*********
- * MODEL *
- *********/
-static simgrid::kernel::resource::Action* ActionListExtract(simgrid::kernel::resource::Action::StateSet* list)
-{
-  if (list->empty())
-    return nullptr;
-  simgrid::kernel::resource::Action* res = &list->front();
-  list->pop_front();
-  return res;
-}
-
-simgrid::kernel::resource::Action* surf_model_extract_done_action_set(simgrid::kernel::resource::Model* model)
-{
-  return ActionListExtract(model->get_finished_action_set());
-}
-
-simgrid::kernel::resource::Action* surf_model_extract_failed_action_set(simgrid::kernel::resource::Model* model)
-{
-  return ActionListExtract(model->get_failed_action_set());
-}
-
-int surf_model_running_action_set_size(simgrid::kernel::resource::Model* model)
-{
-  return model->get_started_action_set()->size();
-}
-
-void surf_cpu_action_set_bound(simgrid::kernel::resource::Action* action, double bound)
-{
-  static_cast<simgrid::surf::CpuAction*>(action)->set_bound(bound);
-}
index 9ddc811..ad7afbc 100644 (file)
@@ -46,25 +46,25 @@ int main(int argc, char **argv)
     XBT_INFO("Next Event : %g", now);
 
     for (auto const& model : *all_existing_models) {
-      if (surf_model_running_action_set_size(model)) {
+      if (model->get_started_action_set()->size() != 0) {
         XBT_DEBUG("\t Running that model");
         running = 1;
       }
 
-      action = surf_model_extract_failed_action_set(model);
+      action = model->extract_failed_action();
       while (action != nullptr) {
         XBT_INFO("   * Done Action");
         XBT_DEBUG("\t * Failed Action: %p", action);
         action->unref();
-        action = surf_model_extract_failed_action_set(model);
+        action = model->extract_failed_action();
       }
 
-      action = surf_model_extract_done_action_set(model);
+      action = model->extract_done_action();
       while (action != nullptr){
         XBT_INFO("   * Done Action");
         XBT_DEBUG("\t * Done Action: %p", action);
         action->unref();
-        action = surf_model_extract_done_action_set(model);
+        action = model->extract_done_action();
       }
     }
   } while (running && surf_solve(-1.0) >= 0.0);
index e4795f0..84b70b7 100644 (file)
@@ -33,7 +33,7 @@ expanded automatically, replaced with a corresponding Appveyor environment varia
 value. se commas to delineate multiple messages.
 
 Modified by Martin Quinson on June 2018:
-  
+
  - Use OFTC instead of Freenode
 
 Example: