X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6ee7e9c2e455536ab817ae0136acfbb53822eecd..7989355dfec335e1c7abea0ea90a85dab4a51513:/testsuite/surf/surf_usage.c diff --git a/testsuite/surf/surf_usage.c b/testsuite/surf/surf_usage.c index f69a9cf047..e95bd142d2 100644 --- a/testsuite/surf/surf_usage.c +++ b/testsuite/surf/surf_usage.c @@ -12,6 +12,7 @@ #include #include "surf/surf.h" +#include "surf/surf_resource.h" #include "surf/surfxml_parse.h" // for reset callback #include "xbt/log.h" @@ -47,20 +48,18 @@ void test(char *platform) surf_action_t actionA = NULL; surf_action_t actionB = NULL; surf_action_t actionC = NULL; - surf_action_t commAB = NULL; e_surf_action_state_t stateActionA; 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(_surf_cfg_set, "cpu/model:Cas01"); + xbt_cfg_set_parse(_surf_cfg_set, "network/model:CM02"); parse_platform_file(platform); /*********************** CPU ***********************************/ XBT_DEBUG("%p", surf_cpu_model); - cpuA = surf_model_resource_by_name(surf_cpu_model, "Cpu A"); - cpuB = surf_model_resource_by_name(surf_cpu_model, "Cpu B"); + cpuA = surf_cpu_resource_by_name("Cpu A"); + cpuB = surf_cpu_resource_by_name("Cpu B"); /* Let's check that those two processors exist */ XBT_DEBUG("%s : %p", surf_resource_name(cpuA), cpuA); @@ -83,17 +82,16 @@ void test(char *platform) /*********************** Network *******************************/ XBT_DEBUG("%p", surf_network_model); - cardA = surf_model_resource_by_name(surf_network_model, "Cpu A"); - cardB = surf_model_resource_by_name(surf_network_model, "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 */ - commAB = - surf_network_model->extension.network.communicate("Cpu A", "Cpu B", - 150.0, -1.0); + surf_network_model->extension.network.communicate(cardA, cardB, + 150.0, -1.0); surf_solve(-1.0); /* Takes traces into account. Returns 0.0 */ do {