/usr/bin/tau_treemerge is in tau 2.16.4-1.5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | #!/usr/bin/env perl
use strict;
use File::Basename;
use Cwd qw(realpath);
my $break = 250;
if (@ARGV >= 1) {
if ($ARGV[0] ne "-n" || @ARGV != 2) {
die "usage: $0 [-n <break amount> ]\n";
}
$break = $ARGV[1];
if ($break < 2) {
die "nice try, can't use break < 2\n";
}
print "Using breakpoint of $break traces per merge\n";
}
my @traces; # trace files for the next merge
my @edfs; # edf files for the next merge
my $numtraces = 0; # how many we have in the two arrays so far
my $pattern = "tautrace.*.*.*";
my $level = 0; # current tree level
my $done = 0; # done or not
my @out; # output from tau_merge
my $tau_merge = "tau_merge";
my $check_ex = realpath(dirname($0))."/$tau_merge";
if(-x $check_ex) {
$tau_merge = $check_ex;
}
system("/bin/rm -f intermediate.*");
while ($done == 0) {
my $count = 0;
my $neednext = 0;
while ( defined(my $filename = glob($pattern)) ) {
# printf "filename = $filename\n";
@traces[$numtraces] = $filename;
if ($filename =~ /tautrace/) {
my $node = $filename;
$node =~ s/tautrace\.([0-9]*)\.([0-9]*)\.([0-9]*)\.trc/$1/;
@edfs[$numtraces] = "events.$node.edf";
} else {
my ($a, $b);
$a = $filename;
$b = $filename;
$a =~ s/intermediate\.([0-9]*)\.([0-9]*)\.trc/$1/;
$b =~ s/intermediate\.([0-9]*)\.([0-9]*)\.trc/$2/;
@edfs[$numtraces] = "intermediate.$a.$b.edf";
}
$numtraces++;
if ($numtraces >= $break) {
$neednext = 1;
my $basename = "intermediate.$level.$count";
print "$tau_merge -m $basename.edf -e @edfs @traces $basename.trc\n";
@out = `$tau_merge -m $basename.edf -e @edfs @traces $basename.trc`;
$numtraces = 0;
@traces = ();
@edfs = ();
$count++;
}
}
if ($neednext == 0) {
print "$tau_merge -m tau.edf -e @edfs @traces tau.trc\n";
@out = `$tau_merge -m tau.edf -e @edfs @traces tau.trc`;
$done = 1;
}
# set the next patten and move to the next level
$pattern = "intermediate.$level.*.trc";
$level++;
}
# clean up
system("/bin/rm -f intermediate.*");
|