From: navarro Date: Tue, 27 Mar 2012 11:59:17 +0000 (+0200) Subject: Fix surf_storage execution X-Git-Tag: v3_7~197 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8d64537fa596db23d4c097caf2119b666784cce0?hp=f21a7cf435a721c0fac22ef3d10bf7e3dd529aac Fix surf_storage execution --- diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 9566b4c81e..7ec4c48892 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -335,7 +335,9 @@ static inline void *surf_workstation_resource_by_name(const char *name){ return xbt_lib_get_or_null(host_lib, name, SURF_WKS_LEVEL); } static inline void *surf_network_resource_by_name(const char *name){ - return xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL); + network_element_t net_elm = xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL); + if(!net_elm) net_elm = xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL); + return net_elm; } static inline void *surf_storage_resource_by_name(const char *name){ return xbt_lib_get_or_null(storage_lib, name, SURF_STORAGE_LEVEL); diff --git a/testsuite/surf/surf_usage.c b/testsuite/surf/surf_usage.c index 3886c51887..2e8c31af48 100644 --- a/testsuite/surf/surf_usage.c +++ b/testsuite/surf/surf_usage.c @@ -90,7 +90,7 @@ void test(char *platform) XBT_DEBUG("%s : %p", surf_resource_name(cardB), cardB); /* Let's do something on it */ - surf_network_model->extension.network.communicate(cpuA, cpuB, + surf_network_model->extension.network.communicate(cardA, cardB, 150.0, -1.0); surf_solve(-1.0); /* Takes traces into account. Returns 0.0 */