From f369ede376801d20323abaf6a7f72fe230acd562 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20B=C3=A9daride?= Date: Wed, 11 Jun 2014 15:26:45 +0200 Subject: [PATCH] Network::shareResourcesFull revival --- src/surf/network_interface.cpp | 28 ++++++++++++++++++++++++++++ src/surf/network_interface.hpp | 3 ++- src/surf/network_smpi.cpp | 1 - 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index 4694f9ddbe..63f13561a8 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -77,6 +77,34 @@ double NetworkModel::bandwidthConstraint(double rate, double /*bound*/, double / return rate; } +double NetworkModel::shareResourcesFull(double now) +{ + NetworkActionPtr action = NULL; + ActionListPtr runningActions = surf_network_model->getRunningActionSet(); + double minRes; + + minRes = shareResourcesMaxMin(runningActions, surf_network_model->p_maxminSystem, surf_network_model->f_networkSolve); + + for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end()) + ; it != itend ; ++it) { + action = static_cast(&*it); +#ifdef HAVE_LATENCY_BOUND_TRACKING + if (lmm_is_variable_limited_by_latency(action->getVariable())) { + action->m_latencyLimited = 1; + } else { + action->m_latencyLimited = 0; + } +#endif + if (action->m_latency > 0) { + minRes = (minRes < 0) ? action->m_latency : min(minRes, action->m_latency); + } + } + + XBT_DEBUG("Min of share resources %f", minRes); + + return minRes; +} + /************ * Resource * ************/ diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index 3c20de2209..770acf898d 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -10,7 +10,6 @@ #ifndef SURF_NETWORK_INTERFACE_HPP_ #define SURF_NETWORK_INTERFACE_HPP_ - /*********** * Classes * ***********/ @@ -77,6 +76,7 @@ public: * @brief NetworkModel constructor */ NetworkModel() : Model("network") { + f_networkSolve = lmm_solve; }; /** @@ -181,6 +181,7 @@ public: * @return The new bandwidth. */ virtual double bandwidthConstraint(double rate, double bound, double size); + double shareResourcesFull(double now); bool m_haveGap; }; diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index 68174dae76..e5967be727 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -80,7 +80,6 @@ void surf_network_model_init_SMPI(void) surf_network_model = new NetworkSmpiModel(); net_define_callbacks(); xbt_dynar_push(model_list, &surf_network_model); - //network_solve = lmm_solve; xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", 10e-6); xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775); -- 2.20.1