A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
routing: inline method routing_get_network_element_type
[simgrid.git]
/
src
/
surf
/
surf_routing.cpp
diff --git
a/src/surf/surf_routing.cpp
b/src/surf/surf_routing.cpp
index
ad2a748
..
dee4649
100644
(file)
--- a/
src/surf/surf_routing.cpp
+++ b/
src/surf/surf_routing.cpp
@@
-39,14
+39,19
@@
namespace surf {
xbt_dynar_free(&vertices_);
xbt_dynar_free(&upDownLinks);
xbt_free(name_);
xbt_dynar_free(&vertices_);
xbt_dynar_free(&upDownLinks);
xbt_free(name_);
- if (netcard_)
- delete netcard_;
+ delete netcard_;
+ }
+ void As::Seal()
+ {
+ sealed_ = true;
}
sg_platf_route_cbarg_t As::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) {
return NULL;
}
}
sg_platf_route_cbarg_t As::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) {
return NULL;
}
-
+ xbt_dynar_t As::getOneLinkRoutes() {
+ return NULL;
+ }
int As::addComponent(NetCard *elm) {
XBT_DEBUG("Load component \"%s\"", elm->name());
int As::addComponent(NetCard *elm) {
XBT_DEBUG("Load component \"%s\"", elm->name());
@@
-55,10
+60,10
@@
namespace surf {
}
void As::addRoute(sg_platf_route_cbarg_t /*route*/){
}
void As::addRoute(sg_platf_route_cbarg_t /*route*/){
- THROW_IMPOSSIBLE; /* No. */
+ xbt_die("AS %s does not accept new routes (wrong class).",name_);
}
void As::parseBypassroute(sg_platf_route_cbarg_t /*e_route*/){
}
void As::parseBypassroute(sg_platf_route_cbarg_t /*e_route*/){
-
THROW_IMPOSSIBLE
;
+
xbt_die("AS %s does not accept new bypass routes (wrong class).",name_)
;
}
}} // namespace simgrid::surf
}
}} // namespace simgrid::surf
@@
-89,10
+94,10
@@
int ROUTING_PROP_ASR_LEVEL; //Where the properties are stored
simgrid::surf::NetCard *sg_netcard_by_name_or_null(const char *name)
{
sg_host_t h = sg_host_by_name(name);
simgrid::surf::NetCard *sg_netcard_by_name_or_null(const char *name)
{
sg_host_t h = sg_host_by_name(name);
- simgrid::surf::NetCard *net
_elm = h==NULL?
NULL: h->pimpl_netcard;
- if (!net
_elm
)
- net
_elm
= (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
- return net
_elm
;
+ simgrid::surf::NetCard *net
card = h==NULL ?
NULL: h->pimpl_netcard;
+ if (!net
card
)
+ net
card
= (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
+ return net
card
;
}
/* Global vars */
}
/* Global vars */
@@
-161,7
+166,7
@@
void routing_AS_begin(sg_platf_AS_cbarg_t AS)
{
XBT_DEBUG("routing_AS_begin");
{
XBT_DEBUG("routing_AS_begin");
- xbt_assert(
NULL
== xbt_lib_get_or_null(as_router_lib, AS->id, ROUTING_ASR_LEVEL),
+ xbt_assert(
nullptr
== xbt_lib_get_or_null(as_router_lib, AS->id, ROUTING_ASR_LEVEL),
"Refusing to create a second AS called \"%s\".", AS->id);
_sg_cfg_init_status = 2; /* HACK: direct access to the global controlling the level of configuration to prevent
"Refusing to create a second AS called \"%s\".", AS->id);
_sg_cfg_init_status = 2; /* HACK: direct access to the global controlling the level of configuration to prevent
@@
-209,8
+214,7
@@
void routing_AS_begin(sg_platf_AS_cbarg_t AS)
THROWF(arg_error, 0, "All defined components must belong to a AS");
}
THROWF(arg_error, 0, "All defined components must belong to a AS");
}
- xbt_lib_set(as_router_lib, netcard->name(), ROUTING_ASR_LEVEL,
- (void *) netcard);
+ xbt_lib_set(as_router_lib, netcard->name(), ROUTING_ASR_LEVEL, (void *) netcard);
XBT_DEBUG("Having set name '%s' id '%d'", new_as->name_, netcard->id());
/* set the new current component of the tree */
XBT_DEBUG("Having set name '%s' id '%d'", new_as->name_, netcard->id());
/* set the new current component of the tree */
@@
-427,15
+431,6
@@
xbt_dynar_t RoutingPlatf::getOneLinkRoutes(){
}
}
}
}
-e_surf_network_element_type_t routing_get_network_element_type(const char *name)
-{
- simgrid::surf::NetCard *rc = sg_netcard_by_name_or_null(name);
- if (rc)
- return rc->getRcType();
-
- return SURF_NETWORK_ELEMENT_NULL;
-}
-
/** @brief create the root AS */
void routing_model_create( void *loopback)
{
/** @brief create the root AS */
void routing_model_create( void *loopback)
{