Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merging changes done by Steven, Samuel and Luka, regarding simulation of StarPU-MPI
[simgrid.git] / src / surf / surf_routing_none.cpp
1 /* Copyright (c) 2009-2011, 2013-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include "surf_routing_none.hpp"
8
9 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_none, surf, "Routing part of surf");
10
11 AS_t model_none_create(void)
12 {
13   return new simgrid::surf::AsNone();
14 }
15
16 namespace simgrid {
17 namespace surf {
18
19 xbt_dynar_t AsNone::getOneLinkRoutes() {
20   return NULL;
21 }
22
23 void AsNone::getRouteAndLatency(RoutingEdge * /*src*/, RoutingEdge * /*dst*/,
24                                 sg_platf_route_cbarg_t /*res*/, double *lat)
25 {
26   *lat = 0.0;
27 }
28
29 void AsNone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /*edges*/)
30 {
31         XBT_INFO("No routing no graph");
32 }
33
34 sg_platf_route_cbarg_t AsNone::getBypassRoute(RoutingEdge * /*src*/, RoutingEdge * /*dst*/, double * /*lat*/) {
35   return NULL;
36 }
37
38 int AsNone::parsePU(RoutingEdge *elm) {
39   XBT_DEBUG("Load process unit \"%s\"", elm->getName());
40   xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
41   /* don't care about PUs */
42   return -1;
43 }
44
45 int AsNone::parseAS(RoutingEdge *elm) {
46   XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
47   xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
48   /* even don't care about sub-ASes -- I'm as nihilist as an old punk*/
49   return -1;
50 }
51
52 void AsNone::parseRoute(sg_platf_route_cbarg_t /*route*/){
53   THROW_IMPOSSIBLE;
54 }
55
56 void AsNone::parseASroute(sg_platf_route_cbarg_t /*route*/){
57   THROW_IMPOSSIBLE;
58 }
59 void AsNone::parseBypassroute(sg_platf_route_cbarg_t /*e_route*/){
60   THROW_IMPOSSIBLE;
61 }
62
63 /* Creation routing model functions */
64 AsNone::AsNone() {
65   p_routingSons = xbt_dict_new_homogeneous(NULL);
66   p_indexNetworkElm = xbt_dynar_new(sizeof(char*),NULL);
67   p_linkUpDownList = NULL;
68 }
69
70 AsNone::~AsNone() {
71   xbt_dict_free(&p_routingSons);
72   xbt_dynar_free(&p_indexNetworkElm);
73   xbt_dynar_free(&p_linkUpDownList);
74 }
75
76 }
77 }