Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add some peer traces.
[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 my $line;
19
20 open SITES_LIGNE, $ARGV[0] or die "Unable to open $ARGV[1]\n";
21 while(defined($line=<SITES_LIGNE>))
22 {
23         #278 7.2 -9.4 h 2.3 
24                 if($line =~ /^(.*) (.*) (.*) h (.*)$/)
25                 {
26                 print "\t\t<peer id=\"peer-$1\" coordinates=\"$2 $3 $4\" power=\"730000000.0\"\n";
27                 print "\t\tbw_in=\"13380000\" bw_out=\"1024000\" lat=\"5E-4\" />\n\n";
28                 }
29 }
30 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";               
31                         
32 print "\t</AS>\n";
33 print "</platform>";
34
35 print " \n";