X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f89671e0bd7450461d70d5ced6079123e73c2a63..bfe580c9acb43ca1ca658f9111d4cd6f5951bbdc:/examples/platforms/optorsim/transform_optorsim_platform.pl diff --git a/examples/platforms/optorsim/transform_optorsim_platform.pl b/examples/platforms/optorsim/transform_optorsim_platform.pl index 8273b04cbe..d7f11bce0f 100644 --- a/examples/platforms/optorsim/transform_optorsim_platform.pl +++ b/examples/platforms/optorsim/transform_optorsim_platform.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# Copyright (c) 2011-2019. The SimGrid Team. +# Copyright (c) 2011-2023. The SimGrid Team. # All rights reserved. # This program is free software; you can redistribute it and/or modify it @@ -80,23 +80,23 @@ while(defined($line=)){ push @hosts, " radical=\"1-$nb_host\" power=\"1000000000\" bw=\"125000000\" lat=\"5E-5\"\n"; push @hosts, " router_id=\"cluster$src-router\"/>\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"){ + { + #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($is_router[$src] && $is_router[$dst]) { if(@list_of_name){ push @routes_router, " "; @@ -107,9 +107,9 @@ while(defined($line=)){ push @routes_router, " "; push @routes_router, " \n"; } - + #Create the route between cluster and cluster - elsif(!$is_router[$src] && !$is_router[$dst]) + elsif(!$is_router[$src] && !$is_router[$dst]) { if(@list_of_name){ push @routes_cluster, " )){ } push @routes_cluster, " \n"; push @routes_cluster, " \n"; - } + } else { push @routes, " )){ {push @routes, "src=\"AS_intern\" gw_src=\"$list_of_name[$src]\" ";} else #cluster {push @routes, "src=\"$list_of_name[$src]\" gw_src=\"$list_of_name[$src]-router\" ";} - - + + if($is_router[$dst]) #router {push @routes, "dst=\"AS_intern\" gw_dst=\"$list_of_name[$dst]\">\n";} else #cluster @@ -142,8 +142,8 @@ while(defined($line=)){ {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 @@ -151,10 +151,10 @@ while(defined($line=)){ } push @routes, " \n"; push @routes, " \n"; - + } - - $num_link++; + + $num_link++; } } $dst++; @@ -174,7 +174,7 @@ print @routers; print @links_router; print @routes_router; print " \n"; -print "\n"; +print "\n"; print @hosts; print @routes_cluster; print "\n";