comparison scripts/cannabalise___extract_all_loops.pl @ 17:2021f42cc672

scheduling consequence graph construction script
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Fri, 10 Feb 2012 16:15:55 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c985e9dc5496
1 #!/usr/bin/perl
2
3 # perl script that calls loop extraction on every trace in the
4 # standard location for full traces
5 # For each trace,
6 # create a directory to hold the extracted loops,
7 # gunzip the trace and pipe it to the java statement that runs
8 # runs the extraction program, passing it the just-created
9 # directory to put the extracted loops into
10
11 $BAADRootDir = $ARGV[0];
12
13 print "$BAADRootDir\n";
14
15 #Set where the extraction program directory is
16 $extractorDir = "$BAADRootDir/1__Development/0__Code_Dev/".
17 "2__DepQ_loop_paper/LoopExtractor/dist";
18
19 # String used to run extractor
20 $extractCmd = "java -jar $extractorDir/LoopExtractor.jar";
21
22 $tracesBaseDir = "$BAADRootDir/1__Development/2__Traces_and_Runs".
23 "/8__Traces_shared/full_traces_Fmt4";
24
25 $loopsBaseDir = "$BAADRootDir/1__Development/".
26 "2__Traces_and_Runs/8__Traces_shared/loop_files/full_loop_traces";
27
28
29
30 # grab all file names in current directory
31 # Expecting to be in the directory with all the trace files to be
32 # processed
33 print "tracesDir: $tracesBaseDir\n";
34 print "loopsDir: $loopsBaseDir\n";
35 $dired = `ls $tracesBaseDir`;
36 @fileNames = split("\n", $dired);
37
38 @fileNames = ("","");
39
40 # filter filenames so have only trace files
41 # then extract benchmark name and architecture name from file name
42 foreach $fileName (@fileNames)
43 { print "filename: $fileName\n";
44 if ($fileName =~ /trace_(\w+)_X0_(\w+)\.gz/)
45 { $traceName = $fileName;
46 $benchName = $1;
47 print "benchmark: $benchName\n";
48 $tracePath = "$tracesBaseDir/$fileName";
49
50 # make directory to hold extracted loops
51 $loopDir = "$loopsBaseDir/$benchName";
52 print "loopDir: $loopDir\n";
53 `mkdir -p $loopDir`;
54
55 # run the extraction program
56 print `zcat $tracePath | $extractCmd $loopDir`;
57 `gzip $loopDir/*.trace`;
58 }
59 }
60