X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/66b0686fe441796325c3b5738b1b880d15ce1ea6..fde9407d1baff5065d23b005144b324a1407edbf:/testsuite/surf/surf_usage.c diff --git a/testsuite/surf/surf_usage.c b/testsuite/surf/surf_usage.c index a3dc2cabf5..1224959352 100644 --- a/testsuite/surf/surf_usage.c +++ b/testsuite/surf/surf_usage.c @@ -11,7 +11,9 @@ #endif #include +#include "simgrid/sg_config.h" #include "surf/surf.h" +#include "surf/surf_resource.h" #include "surf/surfxml_parse.h" // for reset callback #include "xbt/log.h" @@ -51,9 +53,8 @@ void test(char *platform) e_surf_action_state_t stateActionB; e_surf_action_state_t stateActionC; double now = -1.0; - surf_parse_reset_callbacks(); - surf_cpu_model_init_Cas01(platform); /* Now it is possible to use CPUs */ - surf_network_model_init_CM02(platform); /* Now it is possible to use eth0 */ + xbt_cfg_set_parse(_sg_cfg_set, "cpu/model:Cas01"); + xbt_cfg_set_parse(_sg_cfg_set, "network/model:CM02"); parse_platform_file(platform); /*********************** CPU ***********************************/ @@ -82,15 +83,15 @@ void test(char *platform) /*********************** Network *******************************/ XBT_DEBUG("%p", surf_network_model); - cardA = surf_network_resource_by_name("Cpu A"); - cardB = surf_network_resource_by_name("Cpu B"); + cardA = sg_routing_edge_by_name_or_null("Cpu A"); + cardB = sg_routing_edge_by_name_or_null("Cpu B"); /* Let's check that those two processors exist */ XBT_DEBUG("%s : %p", surf_resource_name(cardA), cardA); XBT_DEBUG("%s : %p", surf_resource_name(cardB), cardB); /* Let's do something on it */ - surf_network_model->extension.network.communicate("Cpu A", "Cpu B", + surf_network_model->extension.network.communicate(cardA, cardB, 150.0, -1.0); surf_solve(-1.0); /* Takes traces into account. Returns 0.0 */