X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/14dbe48f4f9623cf72fc207b7c2041b9f611972a..1ffd336de7f3917df1d0cbbacc0e077b4b5c1363:/tools/simgrid_update_xml.pl diff --git a/tools/simgrid_update_xml.pl b/tools/simgrid_update_xml.pl index da3df3f190..31dd44d414 100755 --- a/tools/simgrid_update_xml.pl +++ b/tools/simgrid_update_xml.pl @@ -5,7 +5,7 @@ eval 'exec perl -S $0 ${1+"$@"}' # This script updates the simgrid XML file passed as argument (modification in place) # It is built to do the conversion incrementally. -# Copyright (c) 2006-2014. The SimGrid Team. +# Copyright (c) 2006-2019. The SimGrid Team. # All rights reserved. # # This program is free software; you can redistribute it and/or modify it @@ -16,11 +16,11 @@ eval 'exec perl -S $0 ${1+"$@"}' =head1 NAME simgrid_update_xml - updates simgrid XML files to latest version - + =head1 SYNOPSIS B I - + =head1 DESCRIPTION simgrid_update_xml updates the simgrid XML file passed as argument. The file @@ -39,9 +39,9 @@ changes in each version. =over 4 -=item +=item -The version attribute of platform were added to allow file versionning. +The version attribute of platform were added to allow file versioning. =item @@ -52,13 +52,13 @@ from MFlop/s to Flop/s =item B Introduced in SimGrid 3.4 -=over +=over -=item +=item -Several tags were renamed: +Several tags were renamed: - CPU -> HOST + CPU -> HOST NETWORK_LINK -> LINK ROUTE_ELEMENT -> LINK_CTN PLATFORM_DESCRIPTION -> PLATFORM @@ -71,10 +71,10 @@ Several tags were renamed: =item -The AS tag were introduced. Every plaform should now contain an englobing AS +The AS tag were introduced. Every platform should now contain an englobing AS tag. -=item +=item Routes are now symmetric by default. @@ -87,7 +87,7 @@ Several tags were renamed (for sake of XML sanity): =back -=item B Introduced in SimGrid 3.13 (this is the current version) +=item B Introduced in SimGrid 3.13 =over 4 @@ -103,23 +103,52 @@ In , attribute kind="POWER" is now kind="SPEED". =item -The DOCTYPE points to the right URL: http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd +The DOCTYPE points to the right URL. =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' + - 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' - + 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 + 'w' week, 'd' day, 'h' hour, 'm' minute, 'ms' millisecond, 'us' microsecond, 'ns' nanosecond, 'ps' picosecond + + +=back + +=item B Introduced in SimGrid 3.16 (this is the current version). + +=over 4 + +=item + +Rename a few tags, but in a backward-compatible manner: the old names are still accepted. + + AS -> zone + ASroute -> zoneRoute + bypassAsRoute -> bypassZoneRoute + process -> actor + +=back + +=item Other backward-compatible changes (old syntax is still accepted) for which we did not bump the DTD version: + +=over 4 + +=item + +Rename the FULLDUPLEX sharing into SPLITDUPLEX. + +=item +In and , rename the 'availability_file' atribute into 'speed_file'. =back @@ -128,32 +157,29 @@ Units are now mandatory in attributes. USE THE SCRIPT sg_xml_unit_converter.py T =head1 AUTHORS The SimGrid team (simgrid-devel@lists.gforge.inria.fr) - + =head1 COPYRIGHT AND LICENSE -Copyright (c) 2006-2016. The SimGrid Team. All rights reserved. - +Copyright (c) 2006-2019. 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. - + =cut use strict; my $fromversion=-1; -my $toversion=4; +my $toversion=4.1; -my($output_string); - -my $filename = $ARGV[0] or die "simgrid_update_xml.pl \n"; +my $filename = $ARGV[0] or die "Usage: simgrid_update_xml.pl file_to_convert.xml\nPlease provide an XML to convert as a parameter.\n"; open INPUT, "$filename" or die "Cannot open input file $filename: $!\n"; -$output_string = "\n". - "\n". +my $output_string = "\n". + "\n". "\n"; - my($AS_opened)=0; my $line; @@ -162,15 +188,15 @@ while (defined($line = )) { # eat the header, whatever form it has next if ($line =~ s/<\?xml[^>]*>// && ! $line =~ /\S/); # just in case several tags are on the same line next if ($line =~ s/]*>// && ! $line =~ /\S/); - + if ($line =~ s///) { $fromversion = 0; print "$filename was using version 0\n"; next if !$line =~ /\S/; - } elsif ($line =~ s///) { + } elsif ($line =~ s///) { $fromversion = $1; if ($fromversion == $toversion) { - die "Input platform file $filename is already conformant to version $fromversion. This should be a no-op.\n"; + warn "Input platform file $filename is already conformant to version $fromversion. This should be a no-op.\n"; } if ($fromversion > $toversion) { die "Input platform file $filename is more recent than this script (file version: $fromversion; script version: $toversion)\n"; @@ -178,7 +204,7 @@ while (defined($line = )) { next if !$line =~ /\S/; print "$filename was using version $fromversion\n"; } - + if ($fromversion == 0) { while ($line =~ m|^(.*?))) { $line =~ s/\bnetwork_link\b/link/g; $line =~ s/\broute_element\b/link:ctn/g; } - + if ($fromversion < 3) { $line =~ s/\blink:ctn\b/link_ctn/g; $line =~ s/\btrace:connect\b/trace_connect/g; @@ -228,6 +254,14 @@ while (defined($line = )) { $line =~ s/\bpower\b/speed/g; $line =~ s/\bkind="POWER"/kind="SPEED"/g; } + if ($fromversion < 4.1) { + $line =~ s/\bAS\b/zone/g; + $line =~ s/\bASroute\b/zoneRoute/g; + $line =~ s/\bbypassAsRoute\b/bypassZoneRoute/g; + $line =~ s/\bprocess\b/actor/g; + } + $line =~ s/\bFULLDUPLEX\b/SPLITDUPLEX/g; + $line =~ s/\bavailability_file\b/speed_file/g; $output_string .= "$line\n"; }