source: CIVL/scripts/scale/run.pl@ 950f705

1.23 2.0 main test-branch
Last change on this file since 950f705 was 66ace0d, checked in by Manchun Zheng <zmanchun@…>, 11 years ago

minor correction of gnuplot script

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

  • Property mode set to 100755
File size: 1.7 KB
RevLine 
[2138309]1#!/usr/bin/perl
[c55ef7f]2use Path::Class;
3use File::Basename;
4use autodie;
5use strict;
6use warnings;
7use File::Path qw(make_path);
[2138309]8
9my $civlDir="."; # directory to civl
10my $numArgs = scalar(@ARGV);
[c55ef7f]11my $datOut = ".";
[2138309]12my $benchOut = "bench.scale.out";
[e805cd7]13my $hasCivlDir=0;
[c55ef7f]14my $datDir;
[2138309]15
16for(my $i=0; $i < $numArgs; $i++){
17 my $arg = $ARGV[$i];
18
19 if($arg =~ /^\-d(.*)$/){
20 $civlDir=$1;
[e805cd7]21 $hasCivlDir=1;
[2138309]22 }elsif ($arg =~ /^\-o(.*)$/){
[c55ef7f]23 $datOut = $1;
24 #if(!($datOut =~ /\.pdf$/)){
25 #warn "$out is not a pdf file name, $out.pdf will be used for output file instead.\n";
26 # $out="$out.pdf";
27 # }
[2138309]28 }else{
29 warn "Arguments should start with -d or -o, invalid argument $arg would be ignored.\n";
30 }
31}
32
[e805cd7]33if($hasCivlDir == 0){
34 warn "no civl directory is provided, current directory will be used as the civl directory.\n";
35}
36
[c55ef7f]37unless (-d $datOut) {
38 mkdir $datOut;
39}
40$benchOut="$datOut/$benchOut";
41
[2138309]42my $scriptPrefix="$civlDir/scripts/scale";
43
44print "running scale benchmarks...\n";
45my $cmd = `$scriptPrefix/runBenchScale.pl $civlDir -o$benchOut`;
[c55ef7f]46print "scale benchmarks finished, now generating .dat file in $datOut...\n";
47$cmd = `$scriptPrefix/parseScale.pl $benchOut $datOut`;
[2138309]48print ".dat file finished, now generating figure...\n";
49
[c55ef7f]50$datDir=dir("$datOut");
51while(my $datFile = $datDir->next){
52 next unless ($datFile =~ /\.dat$/);
53 my $benchmark;
54
55 $datFile = basename($datFile, "");
56 ($benchmark) = ($datFile =~ /(.*)\.dat/);
[66ace0d]57 if($benchmark eq "Diningphilosopher"){
58 $benchmark="Dining philosopher";
59 }
[c55ef7f]60 print "plotting figure for benchmark $benchmark...\n";
[4723002]61 $cmd = `gnuplot -e "TITLE='$benchmark'" -e "DAT_FILE='$datOut/$datFile'" -e "OUT_FILE='$datOut/$benchmark.pdf'" $scriptPrefix/plotBench.plg`;
[c55ef7f]62}
[4723002]63print "scaling figures is successfully generated in $datOut\n";
Note: See TracBrowser for help on using the repository browser.