diff options
Diffstat (limited to 'ghc/utils/parallel/grs2gr.pl')
-rw-r--r-- | ghc/utils/parallel/grs2gr.pl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ghc/utils/parallel/grs2gr.pl b/ghc/utils/parallel/grs2gr.pl index d30c7777ce..ab398a53d9 100644 --- a/ghc/utils/parallel/grs2gr.pl +++ b/ghc/utils/parallel/grs2gr.pl @@ -1,3 +1,5 @@ +#!/usr/local/bin/perl + # # Convert several .gr files (from the same GUM run) into a single # .gr file with all times adjusted relative to the earliest start @@ -9,13 +11,14 @@ $count = 0; foreach $i (@ARGV) { open(GR, $i) || die "Can't read $i\n"; $cmd = <GR>; + $dateline = <GR>; $start = <GR>; ($pe, $timestamp) = ($start =~ /PE\s+(\d+) \[(\d+)\]/); die "PE $pe too high\n" if $pe > $#ARGV; $proc[$count++] = $pe; $prog[$pe] = $cmd; $time[$pe] = $timestamp; - close(GR) || die "Can't close $i\n"; + close(GR); } $basetime = 0; @@ -28,16 +31,18 @@ for($i = 0; $i < $count; $i++) { } print $cmd; +print $dateline; for($i = 0; $i < $count; $i++) { $pe = $proc[$i]; $delta = $time[$pe] - $basetime; open(GR, $ARGV[$i]) || die "Can't read $ARGV[i]\n"; $cmd = <GR>; + $dateline = <GR>; $start = <GR>; while(<GR>) { /PE\s+(\d+) \[(\d+)\]/; printf "PE %2u [%lu]%s", $1, $2 + $delta, $'; } - close(GR) || die "Can't close $ARGV[$i]\n"; + close(GR); } |