X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c0d83ee051e1069634759e6287bbb6ae1662b7a4..e81846a5c24b984edf79ccfbe4300c0e5fa4484a:/examples/platforms/conf/transform_optorsim_platform.pl diff --git a/examples/platforms/conf/transform_optorsim_platform.pl b/examples/platforms/conf/transform_optorsim_platform.pl deleted file mode 100644 index 7f9e93fa98..0000000000 --- a/examples/platforms/conf/transform_optorsim_platform.pl +++ /dev/null @@ -1,187 +0,0 @@ -#!/usr/bin/env perl - -# Copyright (c) 2011, 2014, 2016. The SimGrid Team. -# All rights reserved. - -# This program is free software; you can redistribute it and/or modify it -# under the terms of the license (GNU LGPL) which comes with this package. - -use strict; -use warnings; - -if($#ARGV!=0) { - die "Usage: perl transfrom_optorsim_platform.pl \n"; -} - -my($conf_file)=$ARGV[0]; - -open FILE, $conf_file or die "Unable to open $conf_file"; - -print "\n\n"; - -print "\n"; -print "\n"; -print "\n"; -print "\n"; - -my $line; -my @tokens; -my $token; -my $dst = 0; -my $src = 0; -my @list_of_name; -my $num_link = 0; - -my @links = (); -my @links_router = (); -my @routers = (); -my @hosts = (); -my @is_router = (); -my @routes = (); -my @routes_router = (); -my @routes_cluster = (); -my $nb_host; -while(defined($line=)){ - if($line =~ /^#(.*)\)(.*)$/) - { - print "\n"; - push @list_of_name, $2; - } - elsif($line =~ /^([0-9]*) ([0-9]*) ([0-9]*) (.*)$/) - { - if($1 == "0"){ - push @is_router, 1; - if(@list_of_name){ - push @routers, " \n"; - } - else{ - push @routers, " \n"; - } - } - else{ - push @is_router, 0; - $nb_host = $1; - if(@list_of_name){ - push @hosts, " \n"; - } - else{ - push @hosts, " \n"; - } - } - my $table = $4; - @tokens = split(/ /,$table); - foreach $token (@tokens) { - if($src >= $dst){ - if($token != "0") #if there is a link between src and dst - { - #Create a link - if($1 == "0"){ - push @links_router, " \n"; - } - else{ - push @links, " \n"; - } - - #Create the route between router and router - if($is_router[$src] && $is_router[$dst]) - { - if(@list_of_name){ - push @routes_router, " "; - } - else{ - push @routes_router, " "; - } - push @routes_router, " "; - push @routes_router, " \n"; - } - - #Create the route between cluster and cluster - elsif(!$is_router[$src] && !$is_router[$dst]) - { - if(@list_of_name){ - push @routes_cluster, " \n"; - } - else{ - push @routes_cluster, " \n"; - } - push @routes_cluster, " \n"; - push @routes_cluster, " \n"; - } - else - { - push @routes, " \n";} - else #cluster - {push @routes, "dst=\"$list_of_name[$dst]\" gw_dst=\"$list_of_name[$dst]-router\">\n";} - } - else{ - if($is_router[$src]) #router - {push @routes, "src=\"AS_intern\" gw_src=\"router$src\" ";} - else #cluster - {push @routes, "src=\"cluster$src\" gw_src=\"cluster$src-router\" ";} - - - if($is_router[$dst]) #router - {push @routes, "dst=\"AS_intern\" gw_dst=\"router$dst\">\n";} - else #cluster - {push @routes, "dst=\"cluster$dst\" gw_dst=\"cluster$dst-router\">\n";} - } - push @routes, " \n"; - push @routes, " \n"; - - } - - $num_link++; - } - } - $dst++; - } - $src++; - $dst = 0; - } - else - { - die; - } -} -close(FILE); - -print " \n"; -print @routers; -print @links_router; -print @routes_router; -print " \n"; -print "\n"; -print @hosts; -print @routes_cluster; -print "\n"; - -print @links; -print "\n"; -print @routes; -print "\n"; -print ""; -print " \n";