from rsf.proj import *
Flow('rand',None,
'spike n1=524288 | noise rep=y type=n seed=2012')
prog = Program('sorting.c')
sort = 'slow'
Flow('movie','rand %s' % prog[0],
'''
window n1=200 |
./${SOURCES[1]} movie=$TARGET type=%s
''' % sort,stdout=0)
Plot('movie',
'''
graph symbol=o title="%s Sort" wantaxis=n symbolsz=5
''' % sort.capitalize(),view=1)
na = 8192
costs = []
for n in range(5):
na *= 2
cost = 'cost%d' % n
Flow(cost,'rand %s' % prog[0],
'''
window n1=%d |
./${SOURCES[1]} type=%s
''' % (na,sort))
costs.append(cost)
Flow('cost',costs,
'cat axis=1 ${SOURCES[1:5]} | put o1=14 d1=1 unit1=')
Result('cost',
'''
math output="log(input)/log(2)" |
graph title=Cost
label1="log(N)" label2="log(CPU Cycles)"
''')
End() |