X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5b3677b425b9cc6949c1573d59ac772540cbf4b2..872ebddf3297a212a6cf6c2b2ed816be9d5e9c51:/tools/MSG_visualization/trace2fig.pl diff --git a/tools/MSG_visualization/trace2fig.pl b/tools/MSG_visualization/trace2fig.pl index cd23d39cec..bac9cedbae 100755 --- a/tools/MSG_visualization/trace2fig.pl +++ b/tools/MSG_visualization/trace2fig.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl # Copyright (c) 2006-2007, 2014. The SimGrid Team. # All rights reserved. @@ -7,13 +7,14 @@ # under the terms of the license (GNU LGPL) which comes with this package. use strict; +use warnings; + #use Data::Dumper; use XFig; use POSIX; my($grid_Y_size)=225; -my($grid_X_size)=100550; # Can be changed to improve readability in - # function of the total execution time +my($grid_X_size)=100550; # Can be changed to improve readability in function of the total execution time my($color_suspended)=1; my($color_compute)=2; @@ -23,9 +24,6 @@ my($color_communicate)=4; # Determine the order of the colors in the legend my(@color_list)=($color_compute,$color_communicate,$color_wait_for_recpt,$color_suspended); - - - sub read_cat { my(%Cat); my($filename)=@_; @@ -49,7 +47,6 @@ sub read_cat { return \%Cat; } - sub read_event { my($filename,$Cat)=@_; my($line); @@ -99,7 +96,6 @@ sub read_link { return \%link; } - sub build_cat_tree { my($root,$Cat)=@_; my(@childs)=(); @@ -111,7 +107,6 @@ sub build_cat_tree { } # print "$$Cat{$cat}{name}\t\t $Cat{$cat}{father}\n"; } - return [$root,@childs]; } @@ -128,7 +123,6 @@ sub build_cat_list { unshift @$tree, $root; } - sub cat_sorting_function { my($cat1,$cat2,$Cat)=@_; if (!defined($$Cat{$cat1}{state})) { @@ -225,8 +219,7 @@ sub draw_cat { my($max_date)=0; foreach $cat (keys %$Cat) { - next unless (defined($$Cat{$cat}{Y_min}) && - defined($$Cat{$cat}{Y_max})); + next unless (defined($$Cat{$cat}{Y_min}) && defined($$Cat{$cat}{Y_max})); my(@states)=(); my($e); foreach $e (@{$$Cat{$cat}{state}}) { @@ -242,8 +235,7 @@ sub draw_cat { $state = $$old_event[1]; # LM: I added the next line because of "undefined values"... -# normally, I think that this should not happen, but this part of code -# is a bit too cryptic to me +# normally, I think that this should not happen, but this part of code is a bit too cryptic to me next unless (defined($state)); my($line) = new XFig ('polyline'); @@ -289,10 +281,7 @@ sub draw_cat { $fig->add ($line); } - - # Host visualization - my($max_Y)= 0; my($index_fill)=0; @@ -301,8 +290,7 @@ sub draw_cat { my($host_text_x)= $min_x_for_host + 200; foreach $cat (keys %$Cat) { - next unless (defined($$Cat{$cat}{Y_min_host}) && - defined($$Cat{$cat}{Y_max_host})); + next unless (defined($$Cat{$cat}{Y_min_host}) && defined($$Cat{$cat}{Y_max_host})); my($line) = new XFig ('polyline'); $line->{'depth'} = 150; @@ -376,7 +364,6 @@ sub draw_cat { } # Time axis - my($line) = new XFig ('polyline'); $line->{'depth'} = 0; $line->{'subtype'} = 1; # line @@ -422,7 +409,6 @@ sub draw_cat { $line->{'thickness'} = 0; $line->{'points'} = [ [0,0],[0, -400] ]; $fig->add ($line); - } sub main { @@ -438,7 +424,6 @@ sub main { shift @$cat_list; # print "@$cat_list \n"; set_cat_position($Cat,$cat_list); - my($fig)=create_fig("toto.fig"); draw_cat($fig,$Cat,$Link);