diff pygar-benchmarks/setup/sim-benchmark-setup.pl @ 67:0ede0715dbd6 pygar svn.68

[svn r68] added sensible benchmarks
author rlm
date Tue, 11 May 2010 23:23:21 -0400
parents
children 8bd0e4d37ad2
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/pygar-benchmarks/setup/sim-benchmark-setup.pl	Tue May 11 23:23:21 2010 -0400
     1.3 @@ -0,0 +1,100 @@
     1.4 +#!/usr/bin/env perl
     1.5 +
     1.6 +
     1.7 +use File::Basename;
     1.8 +use Getopt::Long;
     1.9 +use File::Copy;
    1.10 +
    1.11 +sub Usage();
    1.12 +
    1.13 +my $music = undef;
    1.14 +my $network = undef;
    1.15 +my $from = undef;
    1.16 +my $to = undef;
    1.17 +my $command = undef;
    1.18 +
    1.19 + 
    1.20 +#
    1.21 +# Parse the command line switches
    1.22 +#
    1.23 +if (! GetOptions('music=s' => \$music,
    1.24 +                 'network=s' => \$network,
    1.25 +    )) {
    1.26 +    Usage();
    1.27 +}
    1.28 +
    1.29 +print "\n\n*********************\n\nRLM:\n";
    1.30 +print "music is: $music\nnetwork is: $network\n";
    1.31 +
    1.32 +
    1.33 +my $bmark = $ARGV[0];
    1.34 +my $destination = $ARGV[1];
    1.35 +my $origin = "$bmark/..";
    1.36 +
    1.37 +
    1.38 +
    1.39 +print "Origin: $origin\n";
    1.40 +print "Destination: $destination\n";
    1.41 +
    1.42 +print "\nCopying Files:\n";
    1.43 +
    1.44 +
    1.45 +
    1.46 +$from = $bmark."/run-sim.bmark";
    1.47 +$to = $destination."/run";
    1.48 +print "Copying $from to $to\n";
    1.49 +copy($from,$to) or die "Copy failed: $!";
    1.50 +$command = "chmod 777 $to";
    1.51 +`$command`;
    1.52 +
    1.53 +
    1.54 +
    1.55 +print "\nGenerating Placeholder Voices:\n";
    1.56 +
    1.57 +for my $num(0..11)
    1.58 +{
    1.59 +    $command = "cp $origin/music/null/null0.wav  $destination/input$num.wav\n";
    1.60 +    print $command;
    1.61 +    `$command`;
    1.62 +}
    1.63 +
    1.64 +print "\nCopying Voices\n";
    1.65 +$command = "cp $origin/music/$music/*.wav  $destination";
    1.66 +print "$command\n";
    1.67 +
    1.68 +
    1.69 +print "\nGenerating Placeholder Programs:\n";
    1.70 +$command = "mkdir  $destination/programs\n";
    1.71 +print $command;
    1.72 +`$command`;
    1.73 +
    1.74 +for my $num(0..11)
    1.75 +{
    1.76 +    $command = "cp $origin/programs/identity.vmh  $destination/programs/program$num.vmh\n";
    1.77 +    print $command;
    1.78 +    `$command`;
    1.79 +}
    1.80 +
    1.81 +print "\nCreating Network:\n\n";
    1.82 +print "Open $origin/networks/$network :\n";
    1.83 +open (NET, "<$origin/networks/$network") or die $!;
    1.84 +
    1.85 +for (<NET>)
    1.86 +{
    1.87 +    @link  = eval($_);
    1.88 +        
    1.89 +    print "Voice $link[0] will be run through $link[1]\n";
    1.90 +
    1.91 +    $command = "cp $origin/programs/$link[1]  $destination/programs/program$link[0].vmh\n";
    1.92 +    print $command;
    1.93 +    `$command`;
    1.94 +    
    1.95 +
    1.96 +}
    1.97 +
    1.98 +
    1.99 +
   1.100 +
   1.101 +print "\n***********************\n";
   1.102 +
   1.103 +