From: Arnaud Giersch Date: Tue, 7 May 2013 07:40:12 +0000 (+0200) Subject: Also handle IEC binary prefixes for bandwidth. X-Git-Tag: v3_9_90~397 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d950afcf1affbcec73b9529b5d3c663064c2a8d8 Also handle IEC binary prefixes for bandwidth. --- diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 2cff0983c1..96c995ea58 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -112,12 +112,20 @@ double surf_parse_get_time(const char *string) double surf_parse_get_bandwidth(const char *string) { const struct unit_scale units[] = { + { "TiBps", pow(1024, 4) }, + { "GiBps", pow(1024, 3) }, + { "MiBps", pow(1024, 2) }, + { "KiBps", 1024 }, { "TBps", 1e12 }, { "GBps", 1e9 }, { "MBps", 1e6 }, { "kBps", 1e3 }, { "Bps", 1.0 }, { "", 1.0 }, /* default unit is bytes ber second */ + { "Tibps", 0.125 * pow(1024, 4) }, + { "Gibps", 0.125 * pow(1024, 3) }, + { "Mibps", 0.125 * pow(1024, 2) }, + { "Kibps", 0.125 * 1024 }, { "Tbps", 0.125 * 1e12 }, { "Gbps", 0.125 * 1e9 }, { "Mbps", 0.125 * 1e6 },