1.23
2.0
main
test-branch
| Rev | Line | |
|---|
| [948e320] | 1 | #!/usr/bin/perl
|
|---|
| 2 | use Path::Class;
|
|---|
| 3 | use File::Basename;
|
|---|
| 4 | use autodie;
|
|---|
| 5 | use strict;
|
|---|
| 6 | use warnings;
|
|---|
| 7 |
|
|---|
| 8 | #my $civlDir="/Users/zmanchun/civl";
|
|---|
| 9 | my $civlDir=".";
|
|---|
| 10 | my $numArgs = scalar(@ARGV);
|
|---|
| 11 | my $outfile="";
|
|---|
| 12 | my $out;
|
|---|
| 13 | my $hasCivlDir=0;
|
|---|
| 14 |
|
|---|
| 15 | if($numArgs > 2){
|
|---|
| 16 | warn "At most ONE argument is needed for this script. Additional arguments will be ignored.\n";
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | if($numArgs > 0){
|
|---|
| 20 | for(my $i=0; $i < 2; $i++){
|
|---|
| 21 | # print "$ARGV[$i]\n";
|
|---|
| 22 | my $arg=$ARGV[$i];
|
|---|
| 23 |
|
|---|
| 24 | if($arg =~ /^\-o(.*)$/){
|
|---|
| 25 | #$outfile=($arg =~ /\-o(\S+)$/);
|
|---|
| 26 | $outfile=$1;
|
|---|
| 27 | # print "outfile is $outfile\n";
|
|---|
| 28 | $out = *STDOUT unless open($out , '>', $outfile );
|
|---|
| 29 | # print "out is $out\n";
|
|---|
| 30 | }else{
|
|---|
| 31 | $civlDir=$arg;
|
|---|
| 32 | $hasCivlDir = 1;
|
|---|
| 33 | }
|
|---|
| 34 | }
|
|---|
| 35 | }
|
|---|
| 36 | if($hasCivlDir==0){
|
|---|
| 37 | warn "No civl directory is provided, the current directory will be used as the civl directory.\n"
|
|---|
| 38 | }
|
|---|
| 39 | if(!defined($out)){
|
|---|
| 40 | # print "use stdout.\n";
|
|---|
| 41 | $out=*STDOUT;
|
|---|
| 42 | }
|
|---|
| 43 | # print "CIVL directory: $civlDir\n";
|
|---|
| 44 | # print "output: $out\n";
|
|---|
| 45 |
|
|---|
| 46 | my $benchPrefix="edu.udel.cis.vsl.civl.bench.scale.";
|
|---|
| 47 | my $benchSuffix="BenchmarkScale";
|
|---|
| 48 | my @benchmarks=($benchPrefix."Adder".$benchSuffix,
|
|---|
| 49 | $benchPrefix."Barrier".$benchSuffix,
|
|---|
| 50 | $benchPrefix."BlockAdder".$benchSuffix,
|
|---|
| 51 | $benchPrefix."DiningPhilosopher".$benchSuffix,
|
|---|
| 52 | $benchPrefix."MessagePassing".$benchSuffix);
|
|---|
| 53 | my $cmdStart="java -classpath $civlDir/civl.jar:$civlDir/bin ";
|
|---|
| 54 |
|
|---|
| 55 | foreach my $benchmark (@benchmarks){
|
|---|
| 56 | my $result = `$cmdStart $benchmark $civlDir`;
|
|---|
| 57 | print $out $result;
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | print "Scale benchmarks finished.\n"
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.