A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cosmetics
[simgrid.git]
/
tools
/
simgrid_update_xml.pl
diff --git
a/tools/simgrid_update_xml.pl
b/tools/simgrid_update_xml.pl
index
8419bd7
..
006c1d7
100755
(executable)
--- 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.
# This script updates the simgrid XML file passed as argument (modification in place)
# It is built to do the conversion incrementally.
-# Copyright (c) 2006-201
4
. The SimGrid Team.
+# Copyright (c) 2006-201
6
. The SimGrid Team.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
@@
-41,7
+41,7
@@
changes in each version.
=item
=item
-The version attribute of platform were added to allow file version
n
ing.
+The version attribute of platform were added to allow file versioning.
=item
=item
@@
-71,7
+71,7
@@
Several tags were renamed:
=item
=item
-The AS tag were introduced. Every plaform should now contain an englobing AS
+The AS tag were introduced. Every pla
t
form should now contain an englobing AS
tag.
=item
tag.
=item
@@
-87,7
+87,7
@@
Several tags were renamed (for sake of XML sanity):
=back
=back
-=item B<Version 4:> Introduced in SimGrid 3.13
(this is the current version)
+=item B<Version 4:> Introduced in SimGrid 3.13
=over 4
=over 4
@@
-123,6
+123,21
@@
Units are now mandatory in attributes. USE THE SCRIPT sg_xml_unit_converter.py T
=back
=back
+=item B<Version 4.1:> 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
+
=back
=head1 AUTHORS
=back
=head1 AUTHORS
@@
-142,7
+157,7
@@
under the terms of GNU LGPL (v2.1) license.
use strict;
my $fromversion=-1;
use strict;
my $fromversion=-1;
-my $toversion=4;
+my $toversion=4
.1
;
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";
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";
@@
-164,10
+179,10
@@
while (defined($line = <INPUT>)) {
$fromversion = 0;
print "$filename was using version 0\n";
next if !$line =~ /\S/;
$fromversion = 0;
print "$filename was using version 0\n";
next if !$line =~ /\S/;
- } elsif ($line =~ s/<platform.*version=["
]*([0-9.])["
]*>//) {
+ } elsif ($line =~ s/<platform.*version=["
']*([0-9.]*)["'
]*>//) {
$fromversion = $1;
if ($fromversion == $toversion) {
$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";
}
if ($fromversion > $toversion) {
die "Input platform file $filename is more recent than this script (file version: $fromversion; script version: $toversion)\n";
@@
-225,6
+240,12
@@
while (defined($line = <INPUT>)) {
$line =~ s/\bpower\b/speed/g;
$line =~ s/\bkind="POWER"/kind="SPEED"/g;
}
$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;
+ }
$output_string .= "$line\n";
}
$output_string .= "$line\n";
}