- sg_host_t hostA = NULL;
- sg_host_t hostB = NULL;
- surf_action_t actionA = NULL;
- surf_action_t actionB = NULL;
- surf_action_t actionC = NULL;
- e_surf_action_state_t stateActionA;
- e_surf_action_state_t stateActionB;
- e_surf_action_state_t stateActionC;
- double now = -1.0;
- 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 ***********************************/
- XBT_DEBUG("%p", surf_cpu_model_pm);
- hostA = sg_host_by_name("Cpu A");
- hostB = sg_host_by_name("Cpu B");
-
- /* Let's check that those two processors exist */
- XBT_DEBUG("%s : %p", sg_host_get_name(hostA), hostA);
- XBT_DEBUG("%s : %p", sg_host_get_name(hostB), hostB);
+ surf_init(&argc, argv); /* Initialize some common structures */
+ simgrid::config::set_parse("cpu/model:Cas01");
+ simgrid::config::set_parse("network/model:CM02");
+
+ xbt_assert(argc > 1, "Usage: %s platform.xml\n", argv[0]);
+ parse_platform_file(argv[1]);
+
+ XBT_DEBUG("CPU model: %p", surf_cpu_model_pm);
+ XBT_DEBUG("Network model: %p", surf_network_model);
+ simgrid::s4u::Host* hostA = sg_host_by_name("Cpu A");
+ simgrid::s4u::Host* hostB = sg_host_by_name("Cpu B");