Skip to content

Commit

Permalink
waaaaaaaaaaaaaahhhhhhhhhhhh
Browse files Browse the repository at this point in the history
  • Loading branch information
dpzmick committed Apr 5, 2016
1 parent 0080d01 commit 1560a46
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src_java/com/dpzmick/auto_parallel_java/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected void setUp() throws Exception {
public void timeFibFJ(int reps) {
for (int i = 0; i < reps; i++) {
ForkJoinPool pool = new ForkJoinPool();
FibTask f = new FibTask(n, 31);
FibTask f = new FibTask(n, 35);
Integer res = pool.invoke(f);
System.out.println(res);
}
Expand Down
52 changes: 49 additions & 3 deletions vis/dir2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,47 @@ def handle_single_spec(trial_dir, spec_name):
args_line = filter(lambda l: l.startswith("running"), lines)[0]
args = re.findall('\((.*)\)', args_line)[0]

variance_lines = filter(lambda l: "variance" in l.lower(), lines)
if len(variance_lines) != 0:
vline = variance_lines[0]
if "severely" in vline.lower():
print("ignored ", trial_dir, spec_name, file=stderr)
return None

return (spec_name, mean_time, args.split(' '))

def java_trial(input_dir, trial_name):
# trial is in log.bench
lines = []
with open(os.path.join(input_dir, trial_name, "log.bench")) as bench:
lines = bench.readlines()

unit_line = filter(lambda l: "runtime" in l.lower(), lines)[0]
unit = unit_line.split()[1]

# need to get the serial time and the FJ time
fj_line = filter(lambda l: "FibFJ" in l, lines)[1]
fj_time = to_micros(float(fj_line.split()[1]), unit)

serial_line = filter(lambda l: "FibSerial" in l, lines)[1]
serial_time = to_micros(float(serial_line.split()[1]), unit)

m1 = {
'spec-name': 'fib.fj_java',
'mean-runtime': fj_time,
'args0': None,
'date': None
}

m2 = {
'spec-name': 'fib.serial_java',
'mean-runtime': serial_time,
'args0': None,
'date': None
}

return [m1, m2]


def handle_trial(input_dir, trial_name):
print("trial: ", trial_name, file=stderr)
Expand Down Expand Up @@ -92,7 +131,11 @@ def handle_trial(input_dir, trial_name):
if f == 'log' or f == 'env':
continue

children_data.append(handle_single_spec(path, f))
d = handle_single_spec(path, f)
if d == None:
return []

children_data.append(d)

my_data = []
for name, time, args in children_data:
Expand Down Expand Up @@ -144,7 +187,10 @@ def handle_host(host_dir):

trials = []
for path in listdir(bdir):
trials.extend(handle_trial(bdir, path))
if 'is_java' in listdir(os.path.join(bdir, path)):
trials.extend(java_trial(bdir, path))
else:
trials.extend(handle_trial(bdir, path))

for t in trials:
t['platform'] = plaform
Expand All @@ -168,7 +214,7 @@ def handle_host(host_dir):

ds = []
for path in listdir(input_dir):
if path == ".git":
if path == ".git" or path == "archive":
continue

ds.extend(handle_host(os.path.join(input_dir, path)))
Expand Down

0 comments on commit 1560a46

Please sign in to comment.