From: Martin Quinson Date: Sun, 8 Jul 2018 09:57:25 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_21~523 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4c8cdcc7c2a4629350cbc3d61f36d63c5bbd4341?hp=1e9ab493417bab7283ad57e9982dc91bd4b54f7e Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/.travis.yml b/.travis.yml index de7da306ec..04e7224476 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/include/simgrid/kernel/resource/Model.hpp b/include/simgrid/kernel/resource/Model.hpp index 59a0ccec1b..ce391afc37 100644 --- a/include/simgrid/kernel/resource/Model.hpp +++ b/include/simgrid/kernel/resource/Model.hpp @@ -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 * diff --git a/src/include/surf/surf.hpp b/src/include/surf/surf.hpp index a936a3b7f1..0d9f99a5e7 100644 --- a/src/include/surf/surf.hpp +++ b/src/include/surf/surf.hpp @@ -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 diff --git a/src/instr/instr_private.hpp b/src/instr/instr_private.hpp index 4bdfd3ea64..1fc86dbc29 100644 --- a/src/instr/instr_private.hpp +++ b/src/instr/instr_private.hpp @@ -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 diff --git a/src/kernel/resource/Model.cpp b/src/kernel/resource/Model.cpp index 65c0350da5..d7c664570b 100644 --- a/src/kernel/resource/Model.cpp +++ b/src/kernel/resource/Model.cpp @@ -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; diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index 54396c5492..1c5833652b 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -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 */ }; diff --git a/src/simdag/sd_global.cpp b/src/simdag/sd_global.cpp index 7a2b1a9348..193b5f444b 100644 --- a/src/simdag/sd_global.cpp +++ b/src/simdag/sd_global.cpp @@ -57,7 +57,7 @@ std::set* 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(action->get_data()); XBT_VERB("Task '%s' done", SD_task_get_name(task)); @@ -103,17 +103,17 @@ std::set* 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(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(); } } } diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 6e7b575410..4a1b82ab8f 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -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(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); diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index b81507b6b8..014789a0fc 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -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; diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 07e3030275..1e8f2cd079 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -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(action)->set_bound(bound); -} diff --git a/teshsuite/surf/surf_usage2/surf_usage2.cpp b/teshsuite/surf/surf_usage2/surf_usage2.cpp index 9ddc811823..ad7afbc40f 100644 --- a/teshsuite/surf/surf_usage2/surf_usage2.cpp +++ b/teshsuite/surf/surf_usage2/surf_usage2.cpp @@ -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); diff --git a/tools/appveyor-irc-notify.py b/tools/appveyor-irc-notify.py index e4795f0f11..84b70b7f4c 100644 --- a/tools/appveyor-irc-notify.py +++ b/tools/appveyor-irc-notify.py @@ -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: