Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This perl script generate a platform with n peer (arg0)
[simgrid.git] / buildtools / Cmake / generate_peer_platform.pl
1 #!/usr/bin/perl -w
2 use strict;
3
4 my $toversion=3;
5 my $nb_peer = $ARGV[0];
6 my $i;
7
8 print "<?xml version='1.0'?>\n";
9 print "<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n";
10 print "<platform version=\"$toversion\">\n";
11
12 print "\n<config id=\"General\">\n";
13 print "\t<prop id=\"coordinates\" value=\"yes\"></prop>\n";
14 print "</config>\n\n";
15
16 print "\t<AS  id=\"AS0\"  routing=\"Vivaldi\">\n";
17
18 for($i=0 ; $i<$nb_peer ; $i++){
19                 print "\t\t<peer id=\"$i\" coordinates=\"-12.7 -9.9 2.1\" power=\"730000000.0\"\n";
20                 print "\t\tbw_in=\"2250000000\" bw_out=\"2250000000\" lat=\"5E-4\" />\n\n";
21 }
22
23 print "\t\t<ASroute src=\"(.*)\"\n\t\t\tdst=\"(.*)\"\n\t\t\tgw_src=\"router_\$1src\"\n\t\t\tgw_dst=\"router_\$1dst\">\n\t\t</ASroute>\n";               
24                         
25 print "\t</AS>\n";
26 print "</platform>";
27
28 print " \n";