Mercurial > pygar
comparison 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 |
comparison
equal
deleted
inserted
replaced
66:6bd9397cd591 | 67:0ede0715dbd6 |
---|---|
1 #!/usr/bin/env perl | |
2 | |
3 | |
4 use File::Basename; | |
5 use Getopt::Long; | |
6 use File::Copy; | |
7 | |
8 sub Usage(); | |
9 | |
10 my $music = undef; | |
11 my $network = undef; | |
12 my $from = undef; | |
13 my $to = undef; | |
14 my $command = undef; | |
15 | |
16 | |
17 # | |
18 # Parse the command line switches | |
19 # | |
20 if (! GetOptions('music=s' => \$music, | |
21 'network=s' => \$network, | |
22 )) { | |
23 Usage(); | |
24 } | |
25 | |
26 print "\n\n*********************\n\nRLM:\n"; | |
27 print "music is: $music\nnetwork is: $network\n"; | |
28 | |
29 | |
30 my $bmark = $ARGV[0]; | |
31 my $destination = $ARGV[1]; | |
32 my $origin = "$bmark/.."; | |
33 | |
34 | |
35 | |
36 print "Origin: $origin\n"; | |
37 print "Destination: $destination\n"; | |
38 | |
39 print "\nCopying Files:\n"; | |
40 | |
41 | |
42 | |
43 $from = $bmark."/run-sim.bmark"; | |
44 $to = $destination."/run"; | |
45 print "Copying $from to $to\n"; | |
46 copy($from,$to) or die "Copy failed: $!"; | |
47 $command = "chmod 777 $to"; | |
48 `$command`; | |
49 | |
50 | |
51 | |
52 print "\nGenerating Placeholder Voices:\n"; | |
53 | |
54 for my $num(0..11) | |
55 { | |
56 $command = "cp $origin/music/null/null0.wav $destination/input$num.wav\n"; | |
57 print $command; | |
58 `$command`; | |
59 } | |
60 | |
61 print "\nCopying Voices\n"; | |
62 $command = "cp $origin/music/$music/*.wav $destination"; | |
63 print "$command\n"; | |
64 | |
65 | |
66 print "\nGenerating Placeholder Programs:\n"; | |
67 $command = "mkdir $destination/programs\n"; | |
68 print $command; | |
69 `$command`; | |
70 | |
71 for my $num(0..11) | |
72 { | |
73 $command = "cp $origin/programs/identity.vmh $destination/programs/program$num.vmh\n"; | |
74 print $command; | |
75 `$command`; | |
76 } | |
77 | |
78 print "\nCreating Network:\n\n"; | |
79 print "Open $origin/networks/$network :\n"; | |
80 open (NET, "<$origin/networks/$network") or die $!; | |
81 | |
82 for (<NET>) | |
83 { | |
84 @link = eval($_); | |
85 | |
86 print "Voice $link[0] will be run through $link[1]\n"; | |
87 | |
88 $command = "cp $origin/programs/$link[1] $destination/programs/program$link[0].vmh\n"; | |
89 print $command; | |
90 `$command`; | |
91 | |
92 | |
93 } | |
94 | |
95 | |
96 | |
97 | |
98 print "\n***********************\n"; | |
99 | |
100 |