- We removed support for writing your simulation in Lua; you can use
the Java bindings.
-
+ XML platforms:
+ * Switch to platform v4 format.
+ - Rename (power->speed) the attributes describing the amount of flop
+ that a <host>, <peer>, <cluster> or <cabinet> can deliver per second.
+ - In <trace_connect>, attribute kind="POWER" is now kind="SPEED".
+ - The DOCTYPE points to the right URL (this file):
+ http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd
+ - A warning is emitted for unit-less values (they are still accepted).
+ - speed. Default: 'f' or 'flops'. Also defined:
+ 'Yf', 'Zf', 'Ef', 'Pf', 'Tf', 'Gf', 'Mf', 'kf'
+ 'yottaflops', 'zettaflops', 'exaflops', 'petaflops', 'teraflops', 'gigaflops', 'megaflops', 'kiloflops'
+ - bandwidth. Default: 'Bps' bytes per second (or 'bps' for bits but 1 Bps = 8 bps)
+ Also defined in bytes: 'TiBps', 'GiBps', 'MiBps', 'KiBps', 'TBps', 'GBps', 'MBps', 'kBps', 'Bps'
+ And the same in bits: 'Tibps', 'Gibps', 'Mibps', 'Kibps', 'Tbps', 'Gbps', 'Mbps', 'kbps', 'bps'
+ - latency. Default: 's' second. Also defined:
+ 'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond
+ * Use the tool simgrid_update_xml to upgrade your files. It does not
+ convert the unit-less values. Use tools/sg_xml_unit_converter.py
+ for that (or live with the warnings).
+
S4U
* s4u::Host is now the prefered public interface to the Host features.
sg_host_* functions are C bindings to the exact same behavior
typedef enum {
SURF_TRACE_CONNECT_KIND_HOST_AVAIL = 4,
- SURF_TRACE_CONNECT_KIND_POWER = 3,
+ SURF_TRACE_CONNECT_KIND_SPEED = 3,
SURF_TRACE_CONNECT_KIND_LINK_AVAIL = 2,
SURF_TRACE_CONNECT_KIND_BANDWIDTH = 1,
SURF_TRACE_CONNECT_KIND_LATENCY = 0
XBT_PUBLIC(void) surf_parse_warn(const char *msg,...) XBT_ATTRIB_PRINTF(1,2);
XBT_PUBLIC(double) surf_parse_get_double(const char *string);
XBT_PUBLIC(int) surf_parse_get_int(const char *string);
-XBT_PUBLIC(double) surf_parse_get_time(const char *string);
-XBT_PUBLIC(double) surf_parse_get_size(const char *string);
-XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string);
-XBT_PUBLIC(double) surf_parse_get_speed(const char *string);
+XBT_PUBLIC(double) surf_parse_get_time(const char *string, const char *entity_kind, const char *name);
+XBT_PUBLIC(double) surf_parse_get_size(const char *string, const char *entity_kind, const char *name);
+XBT_PUBLIC(double) surf_parse_get_bandwidth(const char *string, const char *entity_kind, const char *name);
+XBT_PUBLIC(double) surf_parse_get_speed(const char *string, const char *entity_kind, const char *name);
/* Prototypes of the functions offered by flex */
XBT_PUBLIC(int) surf_parse_lex(void);
if (type != LUA_TSTRING && type != LUA_TNUMBER) {
XBT_ERROR("Attribute 'bandwidth' must be specified for backbone and must either be a string (in the right format; see docs) or a number.");
}
- link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1));
+ link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1),"bandwidth of backbone",link.id);
lua_pop(L, 1);
lua_pushstring(L, "lat");
if (type != LUA_TSTRING && type != LUA_TNUMBER) {
XBT_ERROR("Attribute 'lat' must be specified for backbone and must either be a string (in the right format; see docs) or a number.");
}
- link.latency = surf_parse_get_time(lua_tostring(L, -1));
+ link.latency = surf_parse_get_time(lua_tostring(L, -1),"latency of backbone",link.id);
lua_pop(L, 1);
link.initiallyOn = 1;
// get Id Value
lua_pushstring(L, "id");
type = lua_gettable(L, -2);
- if (type != LUA_TSTRING && type != LUA_TNUMBER) {
+ if (type != LUA_TSTRING) {
XBT_ERROR("Attribute 'id' must be specified for any host and must be a string.");
}
host.id = lua_tostring(L, -1);
XBT_ERROR("Attribute 'speed' must be specified for host and must either be a string (in the correct format; check documentation) or a number.");
}
host.speed_peak = xbt_dynar_new(sizeof(double), NULL);
- xbt_dynar_push_as(host.speed_peak, double, parse_cpu_speed(lua_tostring(L, -1)));
+ if (type == LUA_TNUMBER)
+ xbt_dynar_push_as(host.speed_peak, double, lua_tointeger(L, -1));
+ else // LUA_TSTRING
+ xbt_dynar_push_as(host.speed_peak, double, surf_parse_get_speed(lua_tostring(L, -1), "speed of host", host.id));
lua_pop(L, 1);
// get core
if (type != LUA_TSTRING && type != LUA_TNUMBER) {
XBT_ERROR("Attribute 'bandwidth' must be specified for any link and must either be either a string (in the right format; see docs) or a number.");
}
- link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1));
+ if (type == LUA_TNUMBER)
+ link.bandwidth = lua_tonumber(L, -1);
+ else // LUA_TSTRING
+ link.bandwidth = surf_parse_get_bandwidth(lua_tostring(L, -1),"bandwidth of link", link.id);
lua_pop(L, 1);
//get latency value
if (type != LUA_TSTRING && type != LUA_TNUMBER) {
XBT_ERROR("Attribute 'lat' must be specified for any link and must either be a string (in the right format; see docs) or a number.");
}
- link.latency = surf_parse_get_time(lua_tostring(L, -1));
+ if (type == LUA_TNUMBER)
+ link.latency = lua_tonumber(L, -1);
+ else // LUA_TSTRING
+ link.latency = surf_parse_get_time(lua_tostring(L, -1),"latency of link", link.id);
lua_pop(L, 1);
/*Optional Arguments */
/* For the trace and trace:connect tag (store their content till the end of the parsing) */
XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
-XBT_PUBLIC(double) parse_cpu_speed(const char *str_speed);
-
XBT_PUBLIC(xbt_dict_t) get_as_router_properties(const char* name);
/*
SIMGRID_VERSION="@SIMGRID_VERSION_STRING@"
SIMGRID_GITHASH="@SIMGRID_GITHASH@"
-DEFAULT_LOOPBACK_BANDWIDTH="498000000"
-DEFAULT_LOOPBACK_LATENCY="0.000004"
-DEFAULT_NETWORK_BANDWIDTH="$((26 * 1024 * 1024))"
-DEFAULT_NETWORK_LATENCY="0.000005"
+DEFAULT_LOOPBACK_BANDWIDTH="498000000Bps"
+DEFAULT_LOOPBACK_LATENCY="0.000004s"
+DEFAULT_NETWORK_BANDWIDTH="$((26 * 1024 * 1024))Bps"
+DEFAULT_NETWORK_LATENCY="0.000005s"
DEFAULT_NUMPROCS="4"
-DEFAULT_POWER="100"
+DEFAULT_SPEED="100flops"
LOOPBACK_BANDWIDTH="${DEFAULT_LOOPBACK_BANDWIDTH}"
LOOPBACK_LATENCY="${DEFAULT_LOOPBACK_LATENCY}"
NETWORK_BANDWIDTH="${DEFAULT_NETWORK_BANDWIDTH}"
NETWORK_LATENCY="${DEFAULT_NETWORK_LATENCY}"
-POWER="${DEFAULT_POWER}"
+SPEED="${DEFAULT_SPEED}"
SIMOPTS="--cfg=surf/precision:1e-9 --cfg=network/model:SMPI --cfg=network/TCP_gamma:4194304"
cat > ${PLATFORMTMP} <<PLATFORMHEAD
<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4">
<AS id="AS0" routing="Full">
PLATFORMHEAD
i=${NUMPROCS}
while [ $i -gt 0 ]; do
- echo " <host id=\"host$i\" power=\"${POWER}\"/>" >> ${PLATFORMTMP}
+ echo " <host id=\"host$i\" speed=\"${SPEED}\"/>" >> ${PLATFORMTMP}
echo " <link id=\"loop$i\" bandwidth=\"${LOOPBACK_BANDWIDTH}\" latency=\"${LOOPBACK_LATENCY}\"/>" >> ${PLATFORMTMP}
echo " <link id=\"link$i\" bandwidth=\"${NETWORK_BANDWIDTH}\" latency=\"${NETWORK_LATENCY}\"/>" >> ${PLATFORMTMP}
i=$((i - 1))
cat > ${APPLICATIONTMP} <<APPLICATIONHEAD
<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
-<platform version="3">
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
+<platform version="4">
APPLICATIONHEAD
##---- cache hostnames of hostfile---------------
-<!-- Small DTD for SURF based tools. -->
+<!--
+ DTD of SimGrid platform and deployment files.
+
+More info: http://simgrid.gforge.inria.fr/simgrid/latest/doc/platform.html
+To upgrade your files, use the tool simgrid_update_xml
+
+* New in DTD version 4 (in SimGrid 3.13):
+ - Rename (power->speed) the attributes describing the amount of flop
+ that a <host>, <peer>, <cluster> or <cabinet> can deliver per second.
+
+ - In <trace_connect>, attribute kind="POWER" is now kind="SPEED".
+
+ - The DOCTYPE points to the right URL (this file):
+ http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd
+
+ - A warning is emited for unit-less values (they are still accepted).
+
+ - speed. Default: 'f' or 'flops'. Also defined:
+ 'Yf', 'Zf', 'Ef', 'Pf', 'Tf', 'Gf', 'Mf', 'kf'
+ 'yottaflops', 'zettaflops', 'exaflops', 'petaflops', 'teraflops', 'gigaflops', 'megaflops', 'kiloflops'
+
+ - bandwidth. Default: 'Bps' bytes per second (or 'bps' for bits but 1 Bps = 8 bps)
+ Also defined in bytes: 'TiBps', 'GiBps', 'MiBps', 'KiBps', 'TBps', 'GBps', 'MBps', 'kBps', 'Bps'
+ And the same in bits: 'Tibps', 'Gibps', 'Mibps', 'Kibps', 'Tbps', 'Gbps', 'Mbps', 'kbps', 'bps'
+
+ - latency. Default: 's' second. Also defined:
+ 'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond
+
+* New in DTD version 3 (in SimGrid 3.5):
+ - The AS tag were introduced. Every platform should now
+ contain an englobing AS tag.
+ - Routes are now symmetric by default.
+ - Renamed tags (for sake of XML sanity):
+ - LINK:CTN -> LINK_CTN
+ - TRACE:CONNECT -> TRACE_CONNECT
+
+* New in DTD version 2 (in SimGrid 3.4):
+ - Renamed tags:
+ - CPU -> HOST
+ - NETWORK_LINK -> LINK
+ - ROUTE_ELEMENT -> LINK:CTN (changed again in v3)
+ - PLATFORM_DESCRIPTION -> PLATFORM
+
+* New in DTD version 1 (in SimGrid 3.3):
+ - DTD is now versionned with the version attribute of platform
+ - Unit change:
+ - Link bandwidth: from Mb/s to b/s
+ - CPU speed: from MFlop/s to Flop/s
+
+-->
+
<!ELEMENT platform ((config|random)*,(include|cluster|cabinet|peer|AS|trace|trace_connect)*,(process)*)>
<!ATTLIST platform version CDATA "0.0">
<!ATTLIST random generator (DRAND48|RAND|RNGSTREAM|NONE) "DRAND48">
<!ELEMENT trace_connect EMPTY>
-<!ATTLIST trace_connect kind (HOST_AVAIL|POWER|LINK_AVAIL|BANDWIDTH|LATENCY) "HOST_AVAIL">
+<!ATTLIST trace_connect kind (HOST_AVAIL|SPEED|LINK_AVAIL|BANDWIDTH|LATENCY) "HOST_AVAIL">
<!ATTLIST trace_connect trace CDATA #REQUIRED>
<!ATTLIST trace_connect element CDATA #REQUIRED>
<!ELEMENT host (prop|mount|mstorage)*>
<!ATTLIST host id CDATA #REQUIRED>
-<!ATTLIST host power CDATA #REQUIRED>
+<!ATTLIST host speed CDATA #REQUIRED>
<!ATTLIST host core CDATA "1">
<!ATTLIST host availability CDATA "1.0">
<!ATTLIST host availability_file CDATA "">
<!ATTLIST cluster prefix CDATA #REQUIRED>
<!ATTLIST cluster suffix CDATA #REQUIRED>
<!ATTLIST cluster radical CDATA #REQUIRED>
-<!ATTLIST cluster power CDATA #REQUIRED>
+<!ATTLIST cluster speed CDATA #REQUIRED>
<!ATTLIST cluster core CDATA "1">
<!ATTLIST cluster bw CDATA #REQUIRED>
<!ATTLIST cluster lat CDATA #REQUIRED>
<!ATTLIST cluster topology (FLAT|TORUS|FAT_TREE) "FLAT">
<!ATTLIST cluster topo_parameters CDATA "">
<!ATTLIST cluster bb_bw CDATA "">
-<!ATTLIST cluster bb_lat CDATA "">
+<!ATTLIST cluster bb_lat CDATA "0s">
<!ATTLIST cluster bb_sharing_policy (SHARED|FATPIPE) "SHARED">
<!ATTLIST cluster availability_file CDATA "">
<!ATTLIST cluster state_file CDATA "">
<!ATTLIST cabinet prefix CDATA #REQUIRED>
<!ATTLIST cabinet suffix CDATA #REQUIRED>
<!ATTLIST cabinet radical CDATA #REQUIRED>
-<!ATTLIST cabinet power CDATA #REQUIRED>
+<!ATTLIST cabinet speed CDATA #REQUIRED>
<!ATTLIST cabinet bw CDATA #REQUIRED>
<!ATTLIST cabinet lat CDATA #REQUIRED>
<!ELEMENT peer EMPTY>
<!ATTLIST peer id CDATA #REQUIRED>
-<!ATTLIST peer power CDATA #REQUIRED>
+<!ATTLIST peer speed CDATA #REQUIRED>
<!ATTLIST peer bw_in CDATA #REQUIRED>
<!ATTLIST peer bw_out CDATA #REQUIRED>
<!ATTLIST peer lat CDATA #REQUIRED>
<!ATTLIST link id CDATA #REQUIRED>
<!ATTLIST link bandwidth CDATA #REQUIRED>
<!ATTLIST link bandwidth_file CDATA "">
-<!ATTLIST link latency CDATA "0.0">
+<!ATTLIST link latency CDATA "0">
<!ATTLIST link latency_file CDATA "">
<!ATTLIST link state (ON|OFF) "ON">
<!ATTLIST link state_file CDATA "">
storage_type_t storage_type = (storage_type_t) xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL);
- double Bread = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bread"));
- double Bwrite = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bwrite"));
- double Bconnection = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bconnection"));
+ double Bread = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bread"),
+ "property Bread, storage",type_id);
+ double Bwrite = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bwrite"),
+ "property Bwrite, storage",type_id);
+ double Bconnection = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bconnection"),
+ "property Bconnection, storage",type_id);
Storage *storage = new StorageN11(this, id, properties, p_maxminSystem,
Bread, Bwrite, Bconnection, type_id, (char *)content_name,
double scale;
};
-/* Note: field `unit' for the last element of parametre `units' should be
+/* Note: field `unit' for the last element of parameter `units' should be
* NULL. */
-static double surf_parse_get_value_with_unit(const char *string,
- const struct unit_scale *units)
+static double surf_parse_get_value_with_unit(const char *string, const struct unit_scale *units,
+ const char *entity_kind, const char *name,
+ const char *error_msg, const char *default_unit)
{
char* ptr;
double res;
surf_parse_error("value out of range: %s", string);
if (ptr == string)
surf_parse_error("cannot parse number: %s", string);
+ if (ptr[0] == '\0') {
+ if (res == 0)
+ return res; // Ok, 0 can be unit-less
+
+ XBT_WARN("Deprecated unit-less value '%s' for %s %s. %s",string, entity_kind, name, error_msg);
+ ptr = (char*)default_unit;
+ }
for (i = 0; units[i].unit != NULL && strcmp(ptr, units[i].unit) != 0; i++) {
}
if (units[i].unit != NULL)
return res;
}
-double surf_parse_get_time(const char *string)
+double surf_parse_get_time(const char *string, const char *entity_kind, const char *name)
{
const struct unit_scale units[] = {
{ "w", 7 * 24 * 60 * 60 },
{ "h", 60 * 60 },
{ "m", 60 },
{ "s", 1.0 },
- { "", 1.0 }, /* default unit is seconds */
{ "ms", 1e-3 },
{ "us", 1e-6 },
{ "ns", 1e-9 },
{ "ps", 1e-12 },
{ NULL, 0 }
};
- return surf_parse_get_value_with_unit(string, units);
+ return surf_parse_get_value_with_unit(string, units, entity_kind, name,
+ "Append 's' to your time to get seconds", "s");
}
-double surf_parse_get_size(const char *string)
+double surf_parse_get_size(const char *string, const char *entity_kind, const char *name)
{
const struct unit_scale units[] = {
{ "TiB", pow(1024, 4) },
{ "MB", 1e6 },
{ "kB", 1e3 },
{ "B", 1.0 },
- { "", 1.0 }, /* default unit is bytes*/
{ "Tib", 0.125 * pow(1024, 4) },
{ "Gib", 0.125 * pow(1024, 3) },
{ "Mib", 0.125 * pow(1024, 2) },
{ "b", 0.125 },
{ NULL, 0 }
};
- return surf_parse_get_value_with_unit(string, units);
+ return surf_parse_get_value_with_unit(string, units, entity_kind, name,
+ "Append 'B' to get bytes (or 'b' for bits but 1B = 8b).", "B");
}
-double surf_parse_get_bandwidth(const char *string)
+double surf_parse_get_bandwidth(const char *string, const char *entity_kind, const char *name)
{
const struct unit_scale units[] = {
{ "TiBps", pow(1024, 4) },
{ "MBps", 1e6 },
{ "kBps", 1e3 },
{ "Bps", 1.0 },
- { "", 1.0 }, /* default unit is bytes per second */
{ "Tibps", 0.125 * pow(1024, 4) },
{ "Gibps", 0.125 * pow(1024, 3) },
{ "Mibps", 0.125 * pow(1024, 2) },
{ "bps", 0.125 },
{ NULL, 0 }
};
- return surf_parse_get_value_with_unit(string, units);
+ return surf_parse_get_value_with_unit(string, units, entity_kind, name,
+ "Append 'Bps' to get bytes per second (or 'bps' for bits but 1Bps = 8bps)", "Bps");
}
-double surf_parse_get_speed(const char *string)
+double surf_parse_get_speed(const char *string, const char *entity_kind, const char *name)
{
const struct unit_scale units[] = {
{ "yottaflops", 1e24 },
{ "kf", 1e3 },
{ "flops", 1.0 },
{ "f", 1.0 },
- { "", 1.0 }, /* default unit is flops */
{ NULL, 0 }
};
- return surf_parse_get_value_with_unit(string, units);
+ return surf_parse_get_value_with_unit(string, units, entity_kind, name,
+ "Append 'f' or 'flops' to your speed to get flop per second", "f");
}
/*
storage_type.model = A_surfxml_storage___type_model;
storage_type.properties = current_property_set;
storage_type.model_properties = current_model_property_set;
- storage_type.size = surf_parse_get_size(A_surfxml_storage___type_size);
+ storage_type.size = surf_parse_get_size(A_surfxml_storage___type_size,
+ "size of storage type", storage_type.id);
sg_platf_new_storage_type(&storage_type);
current_property_set = NULL;
current_model_property_set = NULL;
"Use simgrid_update_xml to update your file automatically. "
"This program is installed automatically with SimGrid, or "
"available in the tools/ directory of the source archive.");
+ xbt_assert((version >= 4.0), "******* FILE %s IS TOO OLD (v:%.1f) *********\n "
+ "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"
+ " - 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. "
+ "This program is installed automatically with SimGrid, or "
+ "available in the tools/ directory of the source archive.",surf_parsed_filename, version);
sg_platf_begin();
}
host.id = A_surfxml_host_id;
- buf = A_surfxml_host_power;
+ buf = A_surfxml_host_speed;
XBT_DEBUG("Buffer: %s", buf);
host.speed_peak = xbt_dynar_new(sizeof(double), NULL);
if (strchr(buf, ',') == NULL){
- double speed = parse_cpu_speed(A_surfxml_host_power);
+ double speed = surf_parse_get_speed(A_surfxml_host_speed,"speed of host", host.id);
xbt_dynar_push_as(host.speed_peak,double, speed);
}
else {
xbt_dynar_get_cpy(pstate_list, i, &speed_str);
xbt_str_trim(speed_str, NULL);
- speed = parse_cpu_speed(speed_str);
+ speed = surf_parse_get_speed(speed_str,"speed of host", host.id);
xbt_dynar_push_as(host.speed_peak, double, speed);
XBT_DEBUG("Speed value: %f", speed);
}
cluster.prefix = A_surfxml_cluster_prefix;
cluster.suffix = A_surfxml_cluster_suffix;
cluster.radical = A_surfxml_cluster_radical;
- cluster.speed = surf_parse_get_speed(A_surfxml_cluster_power);
+ cluster.speed = surf_parse_get_speed(A_surfxml_cluster_speed, "speed of cluster", cluster.id);
cluster.core_amount = surf_parse_get_int(A_surfxml_cluster_core);
- cluster.bw = surf_parse_get_bandwidth(A_surfxml_cluster_bw);
- cluster.lat = surf_parse_get_time(A_surfxml_cluster_lat);
+ cluster.bw = surf_parse_get_bandwidth(A_surfxml_cluster_bw, "bw of cluster", cluster.id);
+ cluster.lat = surf_parse_get_time(A_surfxml_cluster_lat, "lat of cluster", cluster.id);
if(strcmp(A_surfxml_cluster_bb___bw,""))
- cluster.bb_bw = surf_parse_get_bandwidth(A_surfxml_cluster_bb___bw);
+ cluster.bb_bw = surf_parse_get_bandwidth(A_surfxml_cluster_bb___bw, "bb_bw of cluster", cluster.id);
if(strcmp(A_surfxml_cluster_bb___lat,""))
- cluster.bb_lat = surf_parse_get_time(A_surfxml_cluster_bb___lat);
+ cluster.bb_lat = surf_parse_get_time(A_surfxml_cluster_bb___lat, "bb_lat of cluster", cluster.id);
if(strcmp(A_surfxml_cluster_limiter___link,""))
cluster.limiter_link = surf_parse_get_double(A_surfxml_cluster_limiter___link);
if(strcmp(A_surfxml_cluster_loopback___bw,""))
- cluster.loopback_bw = surf_parse_get_bandwidth(A_surfxml_cluster_loopback___bw);
+ cluster.loopback_bw = surf_parse_get_bandwidth(A_surfxml_cluster_loopback___bw, "loopback_bw of cluster", cluster.id);
if(strcmp(A_surfxml_cluster_loopback___lat,""))
- cluster.loopback_lat = surf_parse_get_time(A_surfxml_cluster_loopback___lat);
+ cluster.loopback_lat = surf_parse_get_time(A_surfxml_cluster_loopback___lat, "loopback_lat of cluster", cluster.id);
switch(AX_surfxml_cluster_topology){
case A_surfxml_cluster_topology_FLAT:
cabinet.id = A_surfxml_cabinet_id;
cabinet.prefix = A_surfxml_cabinet_prefix;
cabinet.suffix = A_surfxml_cabinet_suffix;
- cabinet.speed = surf_parse_get_speed(A_surfxml_cabinet_power);
- cabinet.bw = surf_parse_get_bandwidth(A_surfxml_cabinet_bw);
- cabinet.lat = surf_parse_get_time(A_surfxml_cabinet_lat);
+ cabinet.speed = surf_parse_get_speed(A_surfxml_cabinet_speed, "speed of cabinet", cabinet.id);
+ cabinet.bw = surf_parse_get_bandwidth(A_surfxml_cabinet_bw, "bw of cabinet", cabinet.id);
+ cabinet.lat = surf_parse_get_time(A_surfxml_cabinet_lat, "lat of cabinet", cabinet.id);
cabinet.radical = A_surfxml_cabinet_radical;
sg_platf_new_cabinet(&cabinet);
s_sg_platf_peer_cbarg_t peer = SG_PLATF_PEER_INITIALIZER;
memset(&peer,0,sizeof(peer));
peer.id = A_surfxml_peer_id;
- peer.speed = surf_parse_get_speed(A_surfxml_peer_power);
- peer.bw_in = surf_parse_get_bandwidth(A_surfxml_peer_bw___in);
- peer.bw_out = surf_parse_get_bandwidth(A_surfxml_peer_bw___out);
- peer.lat = surf_parse_get_time(A_surfxml_peer_lat);
+ peer.speed = surf_parse_get_speed(A_surfxml_peer_speed, "speed of peer", peer.id);
+ peer.bw_in = surf_parse_get_bandwidth(A_surfxml_peer_bw___in, "bw_in of peer", peer.id);
+ peer.bw_out = surf_parse_get_bandwidth(A_surfxml_peer_bw___out, "bw_out of peer", peer.id);
+ peer.lat = surf_parse_get_time(A_surfxml_peer_lat, "lat of peer", peer.id);
peer.coord = A_surfxml_peer_coordinates;
peer.availability_trace = tmgr_trace_new_from_file(A_surfxml_peer_availability___file);
peer.state_trace = tmgr_trace_new_from_file(A_surfxml_peer_state___file);
link.properties = current_property_set;
link.id = A_surfxml_link_id;
- link.bandwidth = surf_parse_get_bandwidth(A_surfxml_link_bandwidth);
+ link.bandwidth = surf_parse_get_bandwidth(A_surfxml_link_bandwidth, "bandwidth of link", link.id);
//printf("Link bandwidth [%g]\n", link.bandwidth);
link.bandwidth_trace = tmgr_trace_new_from_file(A_surfxml_link_bandwidth___file);
- link.latency = surf_parse_get_time(A_surfxml_link_latency);
+ link.latency = surf_parse_get_time(A_surfxml_link_latency, "latency of link", link.id);
//printf("Link latency [%g]\n", link.latency);
link.latency_trace = tmgr_trace_new_from_file(A_surfxml_link_latency___file);
link.properties = NULL;
link.id = A_surfxml_backbone_id;
- link.bandwidth = surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth);
- link.latency = surf_parse_get_time(A_surfxml_backbone_latency);
+ link.bandwidth = surf_parse_get_bandwidth(A_surfxml_backbone_bandwidth, "bandwidth of backbone", link.id);
+ link.latency = surf_parse_get_time(A_surfxml_backbone_latency, "latency of backbone", link.id);
link.initiallyOn = 1;
link.policy = SURF_LINK_SHARED;
switch (A_surfxml_trace___connect_kind) {
case AU_surfxml_trace___connect_kind:
- case A_surfxml_trace___connect_kind_POWER:
- trace_connect.kind = SURF_TRACE_CONNECT_KIND_POWER;
+ case A_surfxml_trace___connect_kind_SPEED:
+ trace_connect.kind = SURF_TRACE_CONNECT_KIND_SPEED;
break;
case A_surfxml_trace___connect_kind_BANDWIDTH:
trace_connect.kind = SURF_TRACE_CONNECT_KIND_BANDWIDTH;
/**
* With XML parser
*/
-
-double parse_cpu_speed(const char *str_speed)
-{ // FIXME deadcode
- return surf_parse_get_speed(str_speed);
-}
-
xbt_dict_t get_as_router_properties(const char* name)
{
return (xbt_dict_t)xbt_lib_get_or_null(as_router_lib, name, ROUTING_PROP_ASR_LEVEL);
trace_connect->trace,
xbt_strdup(trace_connect->element), NULL);
break;
- case SURF_TRACE_CONNECT_KIND_POWER:
+ case SURF_TRACE_CONNECT_KIND_SPEED:
xbt_dict_set(trace_connect_list_host_speed, trace_connect->trace,
xbt_strdup(trace_connect->element), NULL);
break;
${CMAKE_HOME_DIRECTORY}/src/simdag/dax.dtd
#${CMAKE_HOME_DIRECTORY}/src/surf/simgrid_dtd.l: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
- COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid.dtd -S src/surf/simgrid_dtd.l -L src/surf/simgrid.dtd
+ COMMAND ${FLEXML_EXE} --root-tags platform -b 1000000 -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -S src/surf/simgrid_dtd.l -L src/surf/simgrid.dtd
COMMAND ${SED_EXE} -i ${string14} src/surf/simgrid_dtd.l
COMMAND ${CMAKE_COMMAND} -E echo "src/surf/simgrid_dtd.l"
#${CMAKE_HOME_DIRECTORY}/include/surf/simgrid_dtd.h: ${CMAKE_HOME_DIRECTORY}/src/surf/simgrid.dtd
COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_HOME_DIRECTORY}/include/surf/simgrid.h
- COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid.dtd -H include/surf/simgrid_dtd.h -L src/surf/simgrid.dtd
+ COMMAND ${FLEXML_EXE} --root-tags platform -P surfxml --sysid=http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd -H include/surf/simgrid_dtd.h -L src/surf/simgrid.dtd
COMMAND ${SED_EXE} -i ${string1} include/surf/simgrid_dtd.h
COMMAND ${SED_EXE} -i ${string2} include/surf/simgrid_dtd.h
COMMAND ${SED_EXE} -i ${string14} include/surf/simgrid_dtd.h
before running the script.
In SimGrid XML files, the standard version is indicated in the version
-attribute of the platform tag. Current version is 3. Here is a list of major
+attribute of the platform tag. Current version is 4. Here is a list of major
changes in each version.
=over 4
=back
-=item B<Version 3:> Introduced in SimGrid 3.5 (this is the current version)
+=item B<Version 3:> Introduced in SimGrid 3.5
=over 4
=back
+=item B<Version 4:> Introduced in SimGrid 3.13 (this is the current version)
+
+=over 4
+
+=item
+
+Rename the attributes describing the amount of flop that a host / peer / cluster / cabinet can deliver per second.
+
+ <host power=...> -> <host speed=...>
+
+=item
+
+In <trace_connect>, attribute kind="POWER" is now kind="SPEED".
+
+=item
+
+The DOCTYPE points to the right URL: http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd
+
+=item
+
+Units are now mandatory in attributes. USE THE SCRIPT sg_xml_unit_converter.py TO CONVERT THIS
+
+ - speed. Old default: 'f' or 'flops'. Also defined:
+ 'Yf', 'Zf', 'Ef', 'Pf', 'Tf', 'Gf', 'Mf', 'kf'
+ 'yottaflops', 'zettaflops', 'exaflops', 'petaflops', 'teraflops', 'gigaflops', 'megaflops', 'kiloflops'
+
+ - bandwidth. Old default: 'Bps' bytes per second (or 'bps' but 1 Bps = 8 bps)
+ Also defined in bytes: 'TiBps', 'GiBps', 'MiBps', 'KiBps', 'TBps', 'GBps', 'MBps', 'kBps', 'Bps'
+ And the same in bits: 'Tibps', 'Gibps', 'Mibps', 'Kibps', 'Tbps', 'Gbps', 'Mbps', 'kbps', 'bps'
+
+ - latency. Old default: 's' second. Also defined:
+ 'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond
+
+
+=back
+
=back
=head1 AUTHORS
=head1 COPYRIGHT AND LICENSE
-Copyright (c) 2006-2014. The SimGrid Team. All rights reserved.
+Copyright (c) 2006-2016. The SimGrid Team. All rights reserved.
This program is free software; you may redistribute it and/or modify it
under the terms of GNU LGPL (v2.1) license.
use strict;
my $fromversion=-1;
-my $toversion=3;
+my $toversion=4;
my($output_string);
-$ARGV[0] or die "simgrid_update_xml.pl <platform.xml>\n";
-open INPUT, "$ARGV[0]" or die "Cannot open input file $ARGV[0]: $!\n";
+my $filename = $ARGV[0] or die "simgrid_update_xml.pl <platform.xml>\n";
+open INPUT, "$filename" or die "Cannot open input file $filename: $!\n";
$output_string = "<?xml version='1.0'?>\n".
- "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n".
+ "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">\n".
"<platform version=\"$toversion\">\n";
if ($line =~ s/<platform(_description)? *>//) {
$fromversion = 0;
- print "version 0\n";
+ print "$filename was using version 0\n";
next if !$line =~ /\S/;
} elsif ($line =~ s/<platform.*version=["]*([0-9.])["]*>//) {
$fromversion = $1;
- print "version $fromversion\n";
if ($fromversion == $toversion) {
- die "Input platform file version is already $fromversion. This should be a no-op.\n";
+ die "Input platform file $filename is already conformant to version $fromversion. This should be a no-op.\n";
}
if ($fromversion > $toversion) {
- die "Input platform file version is more recent than this script (file version: $fromversion; script version: $toversion)\n";
+ die "Input platform file $filename is more recent than this script (file version: $fromversion; script version: $toversion)\n";
}
next if !$line =~ /\S/;
+ print "$filename was using version $fromversion\n";
}
if ($fromversion == 0) {
$output_string .= " <AS id=\"AS0\" routing=\"Full\">\n";
$AS_opened=1;
}
- }
if($line=~/<route /){$line =~ s/\<route/\<route symmetrical=\"NO\"/g;}
+ }
+ if ($fromversion < 4) {
+ $line =~ s/\bpower\b/speed/g;
+ $line =~ s/\bkind="POWER"/kind="SPEED"/g;
+ }
+
$output_string .= "$line\n";
}
close INPUT;
if ($fromversion == -1) {
- die "Cannot retrieve the platform version\n";
+ die "Cannot retrieve the platform version of $filename\n";
}
-open OUTPUT, "> $ARGV[0]";
+open OUTPUT, "> $filename";
print OUTPUT $output_string;
close OUTPUT;