#!/usr/local/bin/perl
print "\n";
print "Enter test name: ";
$name_ = <STDIN>;
print "Enter test type <LAN/WAN/Inet>: ";
$ttype = <STDIN>;
print "\n";
chop($name_);
chop($ttype);
$outfile = "barrier_" . $ttype . "_" . $name_ . ".data";
$numhosts = 2;
open(GPLOT, ">$outfile");
while ($numhosts <= 12) {
    $count = 0;
    $total = 0;
    $ave = 0.0;

    $name = $name_ ."_" . $ttype . "." . $numhosts . ".out";
    open(TDATA,$name);
    while ($time_ = <TDATA>) {
	$count++;
	chop($time_);
	$total += $time_;
    }
    close(TDATA);
    if ($count != 0) {
	$ave = $total / $count;
        write GPLOT;
    }
    $numhosts++;
}
close(GPLOT);
printf "Contents of $outfile:\n";
system "cat $outfile";
print "\n";

format GPLOT =
@<<  @<<<<<
$numhosts, $ave
.



