Skip to content

Commit

Permalink
added game of life and jacobi to the cost model suite
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Feb 23, 2016
1 parent 289de48 commit 6ab5dc1
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions suites/fuse_paper_cost_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ def fuse_cache(value):
ret[env] = value
return ret

scripts_cpu = [
('Game of Life', 'gameoflife', '--size=10000*10000*10*2'),
]

scripts_cpu_jacobi = [
('Jacobi Solver', 'jacobi', '--size=14000*10'),
]

scripts_cpu_alain = [
('Alain Example', 'alain', '--size=100000000*10'),
]
Expand All @@ -21,10 +29,18 @@ def fuse_cache(value):
('Alain Counterexample', 'alain_counterexample', '--size=50000000*10'),
]

def Jacobi_fixed_fusion(Iterations):
s = "%(i)d:0+1,%(i)d:0+4,%(i)d:0+7,%(i)d:0+10,%(i)d:0+13,%(i)d:0+14,%(i)d:0+17,%(i)d:28+29,%(i)d:28+35,%(i)d:28+47,"
ret = s%{'i':2}
s = "%(i)d:2+3,%(i)d:2+6,%(i)d:2+9,%(i)d:2+12,%(i)d:2+15,%(i)d:2+16,%(i)d:2+19,%(i)d:30+31,%(i)d:30+37,%(i)d:30+49,"
for i in xrange(4,(Iterations+1)*2,2):
ret += s%{'i':i}
return ret[:-1]

def MaxShare_fixed_fusion(Iterations):
ret = ""
for i in xrange(Iterations):
ret += "2:1+2,%(i)d:6+7,%(i)d:8+9,%(i)d:10+11,%(i)d:12+13,%(i)d:5+6,%(i)d:5+8,%(i)d:5+10,"%{'i':i+2}
ret += "%(i)d:1+2,%(i)d:6+7,%(i)d:8+9,%(i)d:10+11,%(i)d:12+13,%(i)d:5+6,%(i)d:5+8,%(i)d:5+10,"%{'i':i+2}
return ret[:-1]

def TmpElem_fixed_fusion(Iterations):
Expand All @@ -51,6 +67,15 @@ def TmpElem_fixed_fusion(Iterations):
[('pricer', 'pricer', None)],
[('cpu', 'cpu', {"BH_CPU_JIT_LEVEL": "3", "OMP_NUM_THREADS":"4"})],
]
stack_cpu_jacobi = copy.deepcopy(stack_cpu)
stack_cpu_jacobi[2] =\
[
('UniqueViews', 'bcexp', {'BH_PRICE_MODEL':'unique_views'}),
('TmpElem', 'bcexp', {'BH_PRICE_MODEL':'temp_elemination'}),
('MaxShare', 'bcexp', {'BH_PRICE_MODEL':'max_share'}),
('AmosRobinson','bcexp', {'BH_PRICE_MODEL':'amos',
'BH_FUSER_OPTIMAL_MERGE':Jacobi_fixed_fusion(10)}),
]
stack_cpu_alain_fixed = copy.deepcopy(stack_cpu)
stack_cpu_alain_fixed[2] =\
[
Expand All @@ -60,12 +85,22 @@ def TmpElem_fixed_fusion(Iterations):
('MaxShare', 'bcexp', {'BH_PRICE_MODEL':'max_share',
'BH_FUSER_OPTIMAL_MERGE':MaxShare_fixed_fusion(10)}),
('AmosRobinson','bcexp', {'BH_PRICE_MODEL':'amos',
'BH_FUSER_OPTIMAL_MERGE':MaxShare_fixed_fusion(10)}),
'BH_FUSER_OPTIMAL_MERGE':TmpElem_fixed_fusion(10)}),
]
stack_cpu_alain_fixed[3][0] = ('Optimal','optimal', {'BH_OPTIMAL_CACHE_PATH':"/tmp/bh_fixed_fuse_cache"})

stack_cpu_calain = copy.deepcopy(stack_cpu)

suite_cpu = {
'scripts': scripts_cpu,
'launchers': [python_bohrium],
'bohrium': stack_cpu
}
suite_cpu_jacobi = {
'scripts': scripts_cpu_jacobi,
'launchers': [python_bohrium],
'bohrium': stack_cpu_jacobi
}
suite_cpu_alain = {
'scripts': scripts_cpu_alain,
'launchers': [python_bohrium],
Expand All @@ -83,6 +118,8 @@ def TmpElem_fixed_fusion(Iterations):
}

suites = [
suite_cpu,
suite_cpu_jacobi,
suite_cpu_alain,
suite_cpu_alain_fixed,
suite_cpu_calain,
Expand Down

0 comments on commit 6ab5dc1

Please sign in to comment.