<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1011977604.157358594" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.368132295" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.1122260779" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
- <builder id="cdt.managedbuild.target.gnu.builder.base.1747533038" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
+ <builder buildPath="${workspace_loc:/simgrid}/build/simple" id="cdt.managedbuild.target.gnu.builder.base.1747533038" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.374652938" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.738159103" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<option id="gnu.cpp.compiler.option.include.paths.216814103" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
namespace simgrid {
XBT_PUBLIC_CLASS Host :
- public simgrid::xbt::Extendable<Host> {
+public simgrid::xbt::Extendable<Host> {
- public:
- surf::Cpu *p_cpu;
+public:
+ surf::Cpu *p_cpu = nullptr;
+ surf::NetCard *p_netcard = nullptr;
private:
- simgrid::xbt::string name_;
+ simgrid::xbt::string name_ = "noname";
public:
Host(std::string const& name);
~Host();
XBT_PUBLIC(void) sg_host_simix_set(sg_host_t host, smx_host_priv_t priv);
XBT_PUBLIC(void) sg_host_simix_destroy(sg_host_t host);
-// ========== RoutingEdge ============
-XBT_PUBLIC(sg_netcard_t) sg_host_edge(sg_host_t host);
-XBT_PUBLIC(void) sg_host_edge_set(sg_host_t host, sg_netcard_t edge);
-XBT_PUBLIC(void) sg_host_edge_destroy(sg_host_t host, int do_callback);
-
-
// Module initializer. Won't survive the conversion to C++. Hopefully.
XBT_PUBLIC(void) sg_host_init(void);
return storage->key;
}
-XBT_PUBLIC(sg_netcard_t) sg_routing_edge_by_name_or_null(const char *name);
+XBT_PUBLIC(sg_netcard_t) sg_netcard_by_name_or_null(const char *name);
XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(const char *filename);
XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char *id,
XBT_PUBLIC(void) sg_platf_new_AS_end(void); // That AS is fully described
XBT_PUBLIC(void) sg_platf_new_host (sg_platf_host_cbarg_t host); // Add an host to the currently described AS
-XBT_PUBLIC(void) sg_platf_new_host_link(sg_platf_host_link_cbarg_t h); // Add an host_link to the currently described AS
+XBT_PUBLIC(void) sg_platf_new_netcard(sg_platf_host_link_cbarg_t h); // Add an host_link to the currently described AS
XBT_PUBLIC(void) sg_platf_new_router (sg_platf_router_cbarg_t router); // Add a router to the currently described AS
XBT_PUBLIC(void) sg_platf_new_link (sg_platf_link_cbarg_t link); // Add a link to the currently described AS
XBT_PUBLIC(void) sg_platf_new_peer (sg_platf_peer_cbarg_t peer); // Add a peer to the currently described AS
/** @defgroup SD_simulation Simulation
* @brief Functions for creating the environment and launching the simulation
*
- * This section describes the functions for initialising SimDag, launching
+ * This section describes the functions for initializing SimDag, launching
* the simulation and exiting SimDag.
*
* @{
/** @} */
+SG_END_DECL()
+
#include "simgrid/instr.h"
-SG_END_DECL()
#endif
InstrUserVariable what)
{
xbt_dynar_t route=NULL;
- sg_netcard_t src_elm = sg_routing_edge_by_name_or_null(src);
+ sg_netcard_t src_elm = sg_netcard_by_name_or_null(src);
if(!src_elm) xbt_die("Element '%s' not found!",src);
- sg_netcard_t dst_elm = sg_routing_edge_by_name_or_null(dst);
+ sg_netcard_t dst_elm = sg_netcard_by_name_or_null(dst);
if(!dst_elm) xbt_die("Element '%s' not found!",dst);
routing_get_route_and_latency (src_elm, dst_elm, &route,NULL);
//Search for network_element_t
switch (kind){
case INSTR_HOST:
- newContainer->net_elm = sg_host_edge(sg_host);
+ newContainer->net_elm = sg_host->p_netcard;
if(!newContainer->net_elm) xbt_die("Element '%s' not found",name);
break;
case INSTR_ROUTER:
host->extension_set(SIMIX_HOST_LEVEL, nullptr);
}
-// ========== RoutingEdge ============
-surf_NetCard *sg_host_edge(sg_host_t host) {
- return (surf_NetCard*) host->extension(ROUTING_HOST_LEVEL);
-}
-void sg_host_edge_set(sg_host_t host, surf_NetCard *edge) {
- host->extension_set(ROUTING_HOST_LEVEL, edge);
-}
-void sg_host_edge_destroy(sg_host_t host, int do_callback) {
- host->extension_set(ROUTING_HOST_LEVEL, nullptr, do_callback);
-}
-
// =========== user-level functions ===============
// ================================================
double sg_host_get_speed(sg_host_t host){
action = surf_host_execute(host_list[0],flops_amount[0]);
} else if ((host_nb == 1)
&& (cost_or_zero(flops_amount, 0) == 0.0)) {
- action = surf_network_model->communicate(sg_host_edge(host_list[0]),
- sg_host_edge(host_list[0]),
+ action = surf_network_model->communicate(host_list[0]->p_netcard,
+ host_list[0]->p_netcard,
bytes_amount[0], rate);
} else if ((host_nb == 2)
&& (cost_or_zero(flops_amount, 0) == 0.0)
}
}
if (nb == 1){
- action = surf_network_model->communicate(sg_host_edge(host_list[0]),
- sg_host_edge(host_list[1]),
+ action = surf_network_model->communicate(host_list[0]->p_netcard,
+ host_list[1]->p_netcard,
value, rate);
}
} else
xbt_dict_t ptask_parallel_task_link_set = xbt_dict_new_homogeneous(NULL);
- this->p_edgeList->reserve(host_nb);
+ this->p_netcardList->reserve(host_nb);
for (int i = 0; i<host_nb; i++)
- this->p_edgeList->push_back(sg_host_edge(host_list[i]));
+ this->p_netcardList->push_back(host_list[i]->p_netcard);
/* Compute the number of affected resources... */
for (int i = 0; i < host_nb; i++) {
void *_link;
LinkL07 *link;
- routing_platf->getRouteAndLatency((*this->p_edgeList)[i], (*this->p_edgeList)[j],
+ routing_platf->getRouteAndLatency((*this->p_netcardList)[i], (*this->p_netcardList)[j],
&route, &lat);
latency = MAX(latency, lat);
if (bytes_amount[i * host_nb + j] == 0.0)
continue;
- routing_platf->getRouteAndLatency((*this->p_edgeList)[i], (*this->p_edgeList)[j],
+ routing_platf->getRouteAndLatency((*this->p_netcardList)[i], (*this->p_netcardList)[j],
&route, NULL);
xbt_dynar_foreach(route, cpt, _link) {
double lat_bound = -1.0;
int i, j;
- int hostNb = p_edgeList->size();
+ int hostNb = p_netcardList->size();
for (i = 0; i < hostNb; i++) {
for (j = 0; j < hostNb; j++) {
if (p_communicationAmount[i * hostNb + j] > 0) {
double lat = 0.0;
- routing_platf->getRouteAndLatency((*p_edgeList)[i], (*p_edgeList)[j],
+ routing_platf->getRouteAndLatency((*p_netcardList)[i], (*p_netcardList)[j],
&route, &lat);
lat_current = MAX(lat_current, lat * p_communicationAmount[i * hostNb + j]);
void setPriority(double priority) override;
double getRemains() override;
- std::vector<NetCard*> * p_edgeList = new std::vector<NetCard*>();
+ std::vector<NetCard*> * p_netcardList = new std::vector<NetCard*>();
double *p_computationAmount;
double *p_communicationAmount;
double m_latency;
"Reading a router, processing unit \"%s\" already exists",
router->id);
- simgrid::surf::NetCard *info = new simgrid::surf::RoutingEdgeImpl(
+ simgrid::surf::NetCard *info = new simgrid::surf::NetCardImpl(
xbt_strdup(router->id), -1, SURF_NETWORK_ELEMENT_ROUTER, current_routing);
info->setId(current_routing->parsePU(info));
xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, (void *) info);
}
surf_action_t surf_network_model_communicate(surf_network_model_t model, sg_host_t src, sg_host_t dst, double size, double rate){
- return model->communicate(sg_host_edge(src), sg_host_edge(dst), size, rate);
+ return model->communicate(src->p_netcard, dst->p_netcard, size, rate);
}
const char *surf_resource_name(surf_cpp_resource_t resource){
get_casted_host(host)->setParams(params);
}
-void surf_vm_destroy(sg_host_t resource){
- /* We deregister objects from host_lib, without invoking the freeing callback
- * of each level.
- *
- * Do not call xbt_lib_remove() here. It deletes all levels of the key,
- * including MSG_HOST_LEVEL and others. We should unregister only what we know.
- */
- resource->p_cpu = nullptr; // FIXME: memleaking?
- sg_host_edge_destroy(resource,1);
- resource->extension_set<simgrid::surf::Host>(nullptr);
-
- /* TODO: comment out when VM storage is implemented. */
- // host->extension_set(SURF_STORAGE_LEVEL, nullptr);
+void surf_vm_destroy(sg_host_t vm){
+ vm->p_cpu = nullptr;
+ delete vm->p_netcard;
}
void surf_vm_suspend(sg_host_t vm){
static xbt_dict_t random_value = NULL;
-/** @brief Retrieve a routing edge from its name
+/** @brief Retrieve a netcard from its name
*
- * Routing edges are either host and routers, whatever
+ * Netcards are the thing that connect host or routers to the network
*/
-simgrid::surf::NetCard *sg_routing_edge_by_name_or_null(const char *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: sg_host_edge(h);
+ simgrid::surf::NetCard *net_elm = h==NULL?NULL: h->p_netcard;
if (!net_elm)
net_elm = (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
return net_elm;
return current_routing;
}
-// static void routing_parse_Srandom(void); /* random bypass */
-
static void routing_parse_postparse(void);
/* this lines are only for replace use like index in the model table */
};
/**
- * \brief Add a "host_link" to the network element list
+ * \brief Add a netcard connecting an host to the network element list
+ * FIXME: integrate into host constructor
*/
-void sg_platf_new_host_link(sg_platf_host_link_cbarg_t host)
+void sg_platf_new_netcard(sg_platf_host_link_cbarg_t netcard)
{
- simgrid::surf::NetCard *info = sg_host_edge(sg_host_by_name(host->id));
- xbt_assert(info, "Host '%s' not found!", host->id);
+ simgrid::surf::NetCard *info = sg_host_by_name(netcard->id)->p_netcard;
+ xbt_assert(info, "Host '%s' not found!", netcard->id);
xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] ||
current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI],
"You have to be in model Cluster to use tag host_link!");
s_surf_parsing_link_up_down_t link_up_down;
- link_up_down.link_up = Link::byName(host->link_up);
- link_up_down.link_down = Link::byName(host->link_down);
+ link_up_down.link_up = Link::byName(netcard->link_up);
+ link_up_down.link_down = Link::byName(netcard->link_down);
- xbt_assert(link_up_down.link_up, "Link '%s' not found!",host->link_up);
- xbt_assert(link_up_down.link_down, "Link '%s' not found!",host->link_down);
+ xbt_assert(link_up_down.link_up, "Link '%s' not found!",netcard->link_up);
+ xbt_assert(link_up_down.link_down, "Link '%s' not found!",netcard->link_down);
if(!current_routing->p_linkUpDownList)
current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
- // If dynar is is greater than edge id and if the host_link is already defined
+ // If dynar is is greater than netcard id and if the host_link is already defined
if((int)xbt_dynar_length(current_routing->p_linkUpDownList) > info->getId() &&
xbt_dynar_get_as(current_routing->p_linkUpDownList, info->getId(), void*))
- surf_parse_error("Host_link for '%s' is already defined!",host->id);
+ surf_parse_error("Host_link for '%s' is already defined!",netcard->id);
XBT_DEBUG("Push Host_link for host '%s' to position %d", info->getName(), info->getId());
xbt_dynar_set_as(current_routing->p_linkUpDownList, info->getId(), s_surf_parsing_link_up_down_t, link_up_down);
xbt_assert(!sg_host_by_name(host->id),
"Reading a host, processing unit \"%s\" already exists", host->id);
- simgrid::surf::NetCard *routingEdge =
- new simgrid::surf::RoutingEdgeImpl(xbt_strdup(host->id),
+ simgrid::surf::NetCard *netcard =
+ new simgrid::surf::NetCardImpl(xbt_strdup(host->id),
-1,
SURF_NETWORK_ELEMENT_HOST,
current_routing);
- routingEdge->setId(current_routing->parsePU(routingEdge));
+ netcard->setId(current_routing->parsePU(netcard));
sg_host_t h = sg_host_by_name_or_create(host->id);
- sg_host_edge_set(h, routingEdge);
- XBT_DEBUG("Having set name '%s' id '%d'", host->id, routingEdge->getId());
- simgrid::surf::routingEdgeCreatedCallbacks(routingEdge);
+ h->p_netcard = netcard;
+ XBT_DEBUG("Having set name '%s' id '%d'", host->id, netcard->getId());
+ simgrid::surf::routingEdgeCreatedCallbacks(netcard);
if(mount_list){
xbt_lib_set(storage_lib, host->id, ROUTING_STORAGE_HOST_LEVEL, (void *) mount_list);
XBT_DEBUG("Having set host coordinates for '%s'",host->id);
}
- return routingEdge;
+ return netcard;
}
/**
new_as->p_name = xbt_strdup(AS->id);
simgrid::surf::NetCard *info =
- new simgrid::surf::RoutingEdgeImpl(xbt_strdup(new_as->p_name),
+ new simgrid::surf::NetCardImpl(xbt_strdup(new_as->p_name),
-1,
SURF_NETWORK_ELEMENT_AS,
current_routing);
return platf->p_root;
}
-e_surf_network_element_type_t surf_routing_edge_get_rc_type(sg_netcard_t edge){
- return edge->getRcType();
+e_surf_network_element_type_t surf_routing_edge_get_rc_type(sg_netcard_t netcard){
+ return netcard->getRcType();
}
namespace simgrid {
* \pre route!=NULL
*
* walk through the routing components tree and find a route between hosts
- * by calling the differents "get_route" functions in each routing component.
+ * by calling each "get_route" function in each routing component.
*/
void RoutingPlatf::getRouteAndLatency(
simgrid::surf::NetCard *src, simgrid::surf::NetCard *dst,
e_surf_network_element_type_t routing_get_network_element_type(const char *name)
{
- simgrid::surf::NetCard *rc = sg_routing_edge_by_name_or_null(name);
+ simgrid::surf::NetCard *rc = sg_netcard_by_name_or_null(name);
if (rc)
return rc->getRcType();
host_link.id = host_id;
host_link.link_up = link_up;
host_link.link_down = link_down;
- sg_platf_new_host_link(&host_link);
+ sg_platf_new_netcard(&host_link);
free(host_id);
free(link_id);
host_link.id = host_id;
host_link.link_up = link_up;
host_link.link_down = link_down;
- sg_platf_new_host_link(&host_link);
+ sg_platf_new_netcard(&host_link);
XBT_DEBUG("<router id=\"%s\"/>", router_id);
s_sg_platf_router_cbarg_t router = SG_PLATF_ROUTER_INITIALIZER;
xbt_lib_foreach(storage_lib, cursor, key, data) {
if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
- host_elm = sg_routing_edge_by_name_or_null(storage->p_attach);
+ host_elm = sg_netcard_by_name_or_null(storage->p_attach);
if(!host_elm)
surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
}
virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0;
};
-struct XBT_PRIVATE RoutingEdgeImpl : public NetCard {
+struct XBT_PRIVATE NetCardImpl : public NetCard {
public:
- RoutingEdgeImpl(char *name, int id, e_surf_network_element_type_t rcType, As *rcComponent)
+ NetCardImpl(char *name, int id, e_surf_network_element_type_t rcType, As *rcComponent)
: p_rcComponent(rcComponent), p_rcType(rcType), m_id(id), p_name(name) {}
- ~RoutingEdgeImpl() { xbt_free(p_name);};
+ ~NetCardImpl() { xbt_free(p_name);};
int getId() {return m_id;}
int *getIdPtr() {return &m_id;}
NetCard *src_net_elm, *dst_net_elm;
- src_net_elm = sg_routing_edge_by_name_or_null(src);
- dst_net_elm = sg_routing_edge_by_name_or_null(dst);
+ src_net_elm = sg_netcard_by_name_or_null(src);
+ dst_net_elm = sg_netcard_by_name_or_null(dst);
xbt_assert(src_net_elm, "Network elements %s not found", src);
xbt_assert(dst_net_elm, "Network elements %s not found", dst);
int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
NetCard *src_net_elm, *dst_net_elm;
- src_net_elm = sg_routing_edge_by_name_or_null(src);
- dst_net_elm = sg_routing_edge_by_name_or_null(dst);
+ src_net_elm = sg_netcard_by_name_or_null(src);
+ dst_net_elm = sg_netcard_by_name_or_null(dst);
xbt_assert(src_net_elm, "Network elements %s not found", src);
xbt_assert(dst_net_elm, "Network elements %s not found", dst);
char *src = (char*)(route->src);
char *dst = (char*)(route->dst);
NetCard *src_net_elm, *dst_net_elm;
- src_net_elm = sg_routing_edge_by_name_or_null(src);
- dst_net_elm = sg_routing_edge_by_name_or_null(dst);
+ src_net_elm = sg_netcard_by_name_or_null(src);
+ dst_net_elm = sg_netcard_by_name_or_null(dst);
xbt_assert(src_net_elm, "Network elements %s not found", src);
xbt_assert(dst_net_elm, "Network elements %s not found", dst);
As *AsGeneric::processingUnitsExist(char *element)
{
- As *element_as = sg_host_edge(sg_host_by_name(element)) ->getRcComponent();
+ As *element_as = sg_host_by_name(element)->p_netcard ->getRcComponent();
if (element_as == this)
return element_as;
return asExist(element_as);
host_link.id = A_surfxml_host___link_id;
host_link.link_up = A_surfxml_host___link_up;
host_link.link_down = A_surfxml_host___link_down;
- sg_platf_new_host_link(&host_link);
+ sg_platf_new_netcard(&host_link);
}
void STag_surfxml_router(void){
ASroute.src = A_surfxml_ASroute_src;
ASroute.dst = A_surfxml_ASroute_dst;
- ASroute.gw_src = sg_routing_edge_by_name_or_null(A_surfxml_ASroute_gw___src);
- ASroute.gw_dst = sg_routing_edge_by_name_or_null(A_surfxml_ASroute_gw___dst);
+ ASroute.gw_src = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___src);
+ ASroute.gw_dst = sg_netcard_by_name_or_null(A_surfxml_ASroute_gw___dst);
if (A_surfxml_ASroute_gw___src && !ASroute.gw_src)
surf_parse_error("gw_src=\"%s\" not found for ASroute from \"%s\" to \"%s\"",
ASroute.link_list = parsed_link_list;
ASroute.symmetrical = FALSE;
- ASroute.gw_src = sg_routing_edge_by_name_or_null(A_surfxml_bypassASroute_gw___src);
- ASroute.gw_dst = sg_routing_edge_by_name_or_null(A_surfxml_bypassASroute_gw___dst);
+ ASroute.gw_src = sg_netcard_by_name_or_null(A_surfxml_bypassASroute_gw___src);
+ ASroute.gw_dst = sg_netcard_by_name_or_null(A_surfxml_bypassASroute_gw___dst);
sg_platf_new_bypassASroute(&ASroute);
parsed_link_list = NULL;
* from the VM name, we have to make sure that the system does not call the
* free callback for the network resource object. The network resource object
* is still used by the physical machine. */
- p_netElm = new RoutingEdgeWrapper(sg_host_edge(host_PM));
+ p_netElm = new RoutingEdgeWrapper(host_PM->p_netcard);
sg_host_t host = sg_host_by_name_or_create(name);
- sg_host_edge_set(host, p_netElm);
+ host->p_netcard = p_netElm;
p_currentState = SURF_VM_STATE_CREATED;
/* update net_elm with that of the destination physical host */
NetCard *old_net_elm = p_netElm;
- NetCard *new_net_elm = new RoutingEdgeWrapper(sg_host_edge(sg_host_by_name(pm_name_dst)));
+ NetCard *new_net_elm = new RoutingEdgeWrapper(sg_host_by_name(pm_name_dst)->p_netcard);
xbt_assert(new_net_elm);
/* Unregister the current net_elm from host_lib. Do not call the free callback. */
- sg_host_edge_destroy(sg_host_by_name(vm_name), 0);
+ sg_host_by_name(vm_name)->p_netcard = nullptr;
/* Then, resister the new one. */
p_netElm = new_net_elm;
- sg_host_edge_set(sg_host_by_name(vm_name), p_netElm);
+ sg_host_by_name(vm_name)->p_netcard = p_netElm;
p_hostPM = host_dest;
add_executable(basic_parsing_test basic_parsing_test.c)
add_executable(is_router_test is_router_test.c)
-add_executable(flatifier flatifier.c)
+add_executable(flatifier flatifier.cpp)
add_executable(basic_tracing basic_tracing.c)
add_executable(basic_link_test basic_link_test.c)
int main(int argc, char **argv)
{
char *platformFile = NULL;
- int totalHosts, totalLinks;
+ unsigned int totalHosts, totalLinks;
int timings=0;
int downgrade = 0;
int version = 3;
// Routers
xbt_lib_foreach(as_router_lib, cursor_src, key, value1) {
- if(surf_routing_edge_get_rc_type(xbt_lib_get_or_null(as_router_lib, key,
+ if(surf_routing_edge_get_rc_type((sg_netcard_t)xbt_lib_get_or_null(as_router_lib, key,
ROUTING_ASR_LEVEL)) == SURF_NETWORK_ELEMENT_ROUTER)
{
printf(" <router id=\"%s\"/>\n",key);
sg_host_t host1, host2;
xbt_dict_foreach(host_list, cursor_src, src, host1) // Routes from host
{
- value1 = sg_host_edge(sg_host_by_name(src));
+ value1 = sg_host_by_name(src)->p_netcard;
xbt_dict_foreach(host_list, cursor_dst, dst, host2) //to host
{
printf(" <route src=\"%s\" dst=\"%s\">\n "
,src
,dst);
xbt_dynar_t route=NULL;
- value2 = sg_host_edge(sg_host_by_name(dst));
+ value2 = sg_host_by_name(dst)->p_netcard;
routing_get_route_and_latency(value1, value2, &route,NULL);
for(i=0;i<xbt_dynar_length(route) ;i++)
{
void *link = xbt_dynar_get_as(route,i,void *);
- char *link_name = xbt_strdup(surf_resource_name(link));
+ char *link_name = xbt_strdup(surf_resource_name((surf_cpp_resource_t)link));
printf("<%s id=\"%s\"/>",link_ctn,link_name);
free(link_name);
}
,src
,dst);
xbt_dynar_t route=NULL;
- value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
+ value2 = (sg_netcard_t)xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
for(i=0;i<xbt_dynar_length(route) ;i++)
{
void *link = xbt_dynar_get_as(route,i,void *);
- char *link_name = xbt_strdup(surf_resource_name(link));
+ char *link_name = xbt_strdup(surf_resource_name((surf_cpp_resource_t)link));
printf("<%s id=\"%s\"/>",link_ctn,link_name);
free(link_name);
}
xbt_lib_foreach(as_router_lib, cursor_src, src, value1) // Routes from router
{
- value1 = xbt_lib_get_or_null(as_router_lib,src,ROUTING_ASR_LEVEL);
+ value1 = (sg_netcard_t)xbt_lib_get_or_null(as_router_lib,src,ROUTING_ASR_LEVEL);
if(routing_get_network_element_type(src) == SURF_NETWORK_ELEMENT_ROUTER){
xbt_lib_foreach(as_router_lib, cursor_dst, dst, value2) //to router
{
,src
,dst);
xbt_dynar_t route=NULL;
- value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
+ value2 = (sg_netcard_t)xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
for(i=0;i<xbt_dynar_length(route) ;i++)
{
void *link = xbt_dynar_get_as(route,i,void *);
- char *link_name = xbt_strdup(surf_resource_name(link));
+ char *link_name = xbt_strdup(surf_resource_name((surf_cpp_resource_t)link));
printf("<%s id=\"%s\"/>",link_ctn,link_name);
free(link_name);
}
printf(" <route src=\"%s\" dst=\"%s\">\n "
,src, dst);
xbt_dynar_t route=NULL;
- value2 = sg_host_edge(sg_host_by_name(dst));
+ value2 = sg_host_by_name(dst)->p_netcard;
routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL);
for(i=0;i<xbt_dynar_length(route) ;i++)
{
void *link = xbt_dynar_get_as(route,i,void *);
- char *link_name = xbt_strdup(surf_resource_name(link));
+ char *link_name = xbt_strdup(surf_resource_name((surf_cpp_resource_t)link));
printf("<%s id=\"%s\"/>",link_ctn,link_name);
free(link_name);
}