From: Paul Bédaride Date: Fri, 18 Oct 2013 16:27:31 +0000 (+0200) Subject: Fix Network Constant X-Git-Tag: v3_11_beta~297^2~8 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/dc4066f005c4827b8169f71ea0c500b6dc311721?hp=c978b9fe22c4e00793169fbe9d5f22825b96f894 Fix Network Constant --- diff --git a/src/surf/network.cpp b/src/surf/network.cpp index e9930f21c6..60e6b0333e 100644 --- a/src/surf/network.cpp +++ b/src/surf/network.cpp @@ -374,7 +374,7 @@ xbt_dynar_t NetworkCm02Model::getRoute(RoutingEdgePtr src, RoutingEdgePtr dst) return route; } -NetworkCm02ActionPtr NetworkCm02Model::communicate(RoutingEdgePtr src, RoutingEdgePtr dst, +ActionPtr NetworkCm02Model::communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate) { unsigned int i; diff --git a/src/surf/network.hpp b/src/surf/network.hpp index 6b4ab46fe6..f1b2338759 100644 --- a/src/surf/network.hpp +++ b/src/surf/network.hpp @@ -51,7 +51,7 @@ public: xbt_dict_t properties); void updateActionsStateLazy(double now, double delta); virtual void gapAppend(double size, const NetworkCm02LinkLmmPtr link, NetworkCm02ActionLmmPtr action) {}; - NetworkCm02ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, + virtual ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate); xbt_dynar_t getRoute(RoutingEdgePtr src, RoutingEdgePtr dst); //FIXME: kill field? That is done by the routing nowadays //FIXME: virtual void addTraces() =0; diff --git a/src/surf/network_constant.cpp b/src/surf/network_constant.cpp index 4509a743b3..6b177d6ab4 100644 --- a/src/surf/network_constant.cpp +++ b/src/surf/network_constant.cpp @@ -20,12 +20,12 @@ void surf_network_model_init_Constant() if (!random_latency) random_latency = random_new(RAND, 100, 0.0, 1.0, .125, .034); - //FIXME:sg_platf_host_add_cb(netcste_count_hosts); + sg_platf_host_add_cb(netcste_count_hosts); ModelPtr model = static_cast(surf_network_model); xbt_dynar_push(model_list, &model); - //FIXME:routing_model_create(NULL); + routing_model_create(NULL); } double NetworkConstantModel::shareResources(double now) @@ -35,7 +35,7 @@ double NetworkConstantModel::shareResources(double now) double min = -1.0; xbt_swag_foreach(_action, p_runningActionSet) { - action = (NetworkConstantActionLmmPtr) _action; + action = dynamic_cast(static_cast(_action)); if (action->m_latency > 0) { if (min < 0) min = action->m_latency; @@ -53,7 +53,7 @@ void NetworkConstantModel::updateActionsState(double now, double delta) NetworkConstantActionLmmPtr action = NULL; xbt_swag_foreach_safe(_action, _next_action, p_runningActionSet) { - action = (NetworkConstantActionLmmPtr) _action; + action = dynamic_cast(static_cast(_action)); if (action->m_latency > 0) { if (action->m_latency > delta) { double_update(&(action->m_latency), delta); @@ -77,7 +77,7 @@ void NetworkConstantModel::updateActionsState(double now, double delta) } } -NetworkCm02ActionLmmPtr NetworkConstantModel::communicate(RoutingEdgePtr src, RoutingEdgePtr dst, +ActionPtr NetworkConstantModel::communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate) { char *src_name = src->p_name; diff --git a/src/surf/network_constant.hpp b/src/surf/network_constant.hpp index ef9344b95f..c9c140d8f7 100644 --- a/src/surf/network_constant.hpp +++ b/src/surf/network_constant.hpp @@ -24,7 +24,7 @@ public: NetworkCm02LinkLmmPtr createResource(string name); double shareResources(double now); void updateActionsState(double now, double delta); - NetworkCm02ActionLmmPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, + ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate); void gapRemove(ActionLmmPtr action); //FIXME:virtual void addTraces() =0; @@ -49,7 +49,7 @@ public: class NetworkConstantActionLmm : public NetworkCm02ActionLmm { public: NetworkConstantActionLmm(NetworkConstantModelPtr model, double latency): - NetworkCm02ActionLmm(model, 0, false), m_latInit(latency) { + Action(model, 0, false), NetworkCm02ActionLmm(model, 0, false), m_latInit(latency) { m_latency = latency; if (m_latency <= 0.0) { p_stateSet = p_model->p_doneActionSet; diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index de9093fefb..c45386e78c 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -247,7 +247,7 @@ xbt_dynar_t surf_workstation_model_get_route(surf_workstation_model_t model, } surf_action_t surf_network_model_communicate(surf_network_model_t model, sg_routing_edge_t src, sg_routing_edge_t dst, double size, double rate){ - model->communicate(src, dst, size, rate); + return model->communicate(src, dst, size, rate); } const char *surf_resource_name(surf_cpp_resource_t resource){ diff --git a/src/surf/surf_routing_cluster.cpp b/src/surf/surf_routing_cluster.cpp index 12ecc7ae35..0e7a67a306 100644 --- a/src/surf/surf_routing_cluster.cpp +++ b/src/surf/surf_routing_cluster.cpp @@ -22,11 +22,6 @@ AS_t model_cluster_create(void) /* Creation routing model functions */ AsCluster::AsCluster() : AsNone() { - /*result->get_route_and_latency = cluster_get_route_and_latency; - result->finalize = model_cluster_finalize; - result->get_graph = cluster_get_graph; - result->parse_AS = cluster_parse_AS; - result->parse_PU = cluster_parse_PU;*/ } /* Business methods */ diff --git a/src/surf/workstation_ptask_L07.hpp b/src/surf/workstation_ptask_L07.hpp index cff52739ab..c195fdf787 100644 --- a/src/surf/workstation_ptask_L07.hpp +++ b/src/surf/workstation_ptask_L07.hpp @@ -88,10 +88,9 @@ public: tmgr_trace_t state_trace, e_surf_link_sharing_policy_t policy, xbt_dict_t properties); - NetworkCm02ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, - double size, double rate); + xbt_dynar_t getRoute(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst) {DIE_IMPOSSIBLE;}; - ActionPtr communicate(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst, double size, double rate) {DIE_IMPOSSIBLE;}; + ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate) {DIE_IMPOSSIBLE;}; void addTraces() {DIE_IMPOSSIBLE;}; WorkstationL07ModelPtr p_workstationModel; };