-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkloadmixer.pl
55 lines (37 loc) · 1.28 KB
/
workloadmixer.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/local/bin/perl
use warnings;
use Cwd;
use File::Spec;
use Algorithm::Combinatorics qw(combinations);
#PRINT WELCOME MESSAGE
print "\nMacSim Workload List Generator v1\n\n";
#PRINT DATE & TIME
@months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
@weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime();
$year = 1900 + $yearOffset;
$theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$month] $dayOfMonth, $year";
print $theTime;
print "\n\n";
$workload = "workload.lst";
open(WORKLOAD, ">", $workload) or die "can't open the file!";
my $abs_dir = "../CSE620-2/macsim.UCP";
my $rel_dir = File::Spec->abs2rel($abs_dir, cwd);
print WORKLOAD "TEST ", $abs_dir, " ", $rel_dir;
close(WORKLOAD);
my $dir = '../CSE620-2/macsim.UCP/trace/x86/spec2006/trace_simpoint';
my @workloads;
opendir(DIR, $dir) or die $!;
while (my $file = readdir(DIR)) {
# Use a regular expression to ignore files beginning with a period
next if ($file =~ m/^\./);
print "$file\n";
push(@workloads, $file);
}
closedir(DIR);
my $iter = combinations(\@workloads, 15);
my $number=0;
#scalar context gives an iterator
while (my $p = $iter->next) {
print "@$p\n";
}