source: CIVL/mods/dev.civl.com/scripts/scale/runBenchScale.pl@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

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