-/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2019. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
"Changes introduced in SimGrid 3.13:\n"
" - 'power' attribute of hosts (and others) got renamed to 'speed'.\n"
" - In <trace_connect>, attribute kind=\"POWER\" is now kind=\"SPEED\".\n"
- " - DOCTYPE now point to the rignt URL: http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\n"
+ " - DOCTYPE now point to the rignt URL.\n"
" - speed, bandwidth and latency attributes now MUST have an explicit unit (f, Bps, s by default)"
"\n\n"
"Use simgrid_update_xml to update your file automatically. "
XBT_DEBUG("pstate: %s", A_surfxml_host_pstate);
host.core_amount = surf_parse_get_int(A_surfxml_host_core);
- host.speed_trace = A_surfxml_host_availability___file[0] ? tmgr_trace_new_from_file(A_surfxml_host_availability___file) : nullptr;
- host.state_trace = A_surfxml_host_state___file[0] ? tmgr_trace_new_from_file(A_surfxml_host_state___file) : nullptr;
+ host.speed_trace = A_surfxml_host_availability___file[0]
+ ? simgrid::kernel::profile::Profile::from_file(A_surfxml_host_availability___file)
+ : nullptr;
+ host.state_trace = A_surfxml_host_state___file[0]
+ ? simgrid::kernel::profile::Profile::from_file(A_surfxml_host_state___file)
+ : nullptr;
host.pstate = surf_parse_get_int(A_surfxml_host_pstate);
host.coord = A_surfxml_host_coordinates;
peer.bw_in = surf_parse_get_bandwidth(A_surfxml_peer_bw___in, "bw_in of peer", peer.id.c_str());
peer.bw_out = surf_parse_get_bandwidth(A_surfxml_peer_bw___out, "bw_out of peer", peer.id.c_str());
peer.coord = A_surfxml_peer_coordinates;
- peer.speed_trace = A_surfxml_peer_availability___file[0] ? tmgr_trace_new_from_file(A_surfxml_peer_availability___file) : nullptr;
- peer.state_trace = A_surfxml_peer_state___file[0] ? tmgr_trace_new_from_file(A_surfxml_peer_state___file) : nullptr;
+ peer.speed_trace = A_surfxml_peer_availability___file[0]
+ ? simgrid::kernel::profile::Profile::from_file(A_surfxml_peer_availability___file)
+ : nullptr;
+ peer.state_trace = A_surfxml_peer_state___file[0]
+ ? simgrid::kernel::profile::Profile::from_file(A_surfxml_peer_state___file)
+ : nullptr;
if (A_surfxml_peer_lat[0] != '\0')
XBT_WARN("The latency parameter in <peer> is now deprecated. Use the z coordinate instead of '%s'.",
link.id = std::string(A_surfxml_link_id);
link.bandwidth = surf_parse_get_bandwidth(A_surfxml_link_bandwidth, "bandwidth of link", link.id.c_str());
- link.bandwidth_trace = A_surfxml_link_bandwidth___file[0] ? tmgr_trace_new_from_file(A_surfxml_link_bandwidth___file) : nullptr;
+ link.bandwidth_trace = A_surfxml_link_bandwidth___file[0]
+ ? simgrid::kernel::profile::Profile::from_file(A_surfxml_link_bandwidth___file)
+ : nullptr;
link.latency = surf_parse_get_time(A_surfxml_link_latency, "latency of link", link.id.c_str());
- link.latency_trace = A_surfxml_link_latency___file[0] ? tmgr_trace_new_from_file(A_surfxml_link_latency___file) : nullptr;
- link.state_trace = A_surfxml_link_state___file[0] ? tmgr_trace_new_from_file(A_surfxml_link_state___file):nullptr;
+ link.latency_trace = A_surfxml_link_latency___file[0]
+ ? simgrid::kernel::profile::Profile::from_file(A_surfxml_link_latency___file)
+ : nullptr;
+ link.state_trace = A_surfxml_link_state___file[0]
+ ? simgrid::kernel::profile::Profile::from_file(A_surfxml_link_state___file)
+ : nullptr;
switch (A_surfxml_link_sharing___policy) {
case A_surfxml_link_sharing___policy_SHARED:
}
void ETag_surfxml_trace(){
- simgrid::kernel::routing::TraceCreationArgs trace;
+ simgrid::kernel::routing::ProfileCreationArgs trace;
trace.id = A_surfxml_trace_id;
trace.file = A_surfxml_trace_file;
surf_parsed_filename = file;
std::string dir = simgrid::xbt::Path(file).get_dir_name();
surf_path.push_back(dir);
+ std::string cwd = simgrid::xbt::Path().get_dir_name();
surf_file_to_parse = surf_fopen(file, "r");
if (surf_file_to_parse == nullptr)
- xbt_die("Unable to open '%s'\n", file.c_str());
+ xbt_die("Unable to open '%s' from '%s'\n", file.c_str(), cwd.c_str());
surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, YY_BUF_SIZE);
surf_parse__switch_to_buffer(surf_input_buffer);
surf_parse_lineno = 1;