Skip to content

Commit

Permalink
make_data_files_load.py added
Browse files Browse the repository at this point in the history
  • Loading branch information
anhaas committed Sep 23, 2013
1 parent ddf9c7a commit 05e6168
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 18 deletions.
49 changes: 31 additions & 18 deletions tools/ah_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,24 @@
, 'tsatomicarray' : 'tsstack -atomic_clock -array -init_threshold'
, 'tshwlist' : 'tsstack -hw_clock -list -init_threshold'
, 'tshwarray' : 'tsstack -hw_clock -array -init_threshold'
, 'tshw2ts' : 'tsstack -hw_clock -2ts -init_threshold -delay 3000'
, 'tshw2ts' : 'tsstack -hw_clock -2ts -init_threshold -delay 7500' #250: 20000 2000: 7500
, 'tsqueuestutter' : 'tsqueue -stutter_clock -list'
, 'tsqueueatomic' : 'tsqueue -atomic_clock -list'
, 'tsqueuehw' : 'tsqueue -hw_clock -list'
, 'tsqueue2ts' : 'tsqueue -hw_clock -2ts -delay 3000'
, 'tsqueue2ts' : 'tsqueue -hw_clock -2ts -delay 17500' #250: 12500 2000: 17500
, 'tsdequestutter' : 'tsdeque -list -stutter_clock -init_threshold'
, 'tsdequeatomic' : 'tsdeque -list -atomic_clock -init_threshold'
, 'tsdequehw' : 'tsdeque -list -hw_clock -init_threshold'
, 'tsdequehw2ts' : 'tsdeque -2ts -hw_clock -init_threshold'
, 'tsdequestutternt' : 'tsdeque -list -stutter_clock -noinit_threshold'
, 'tsdequeatomicnt' : 'tsdeque -list -atomic_clock -noinit_threshold'
, 'tsdequehwnt' : 'tsdeque -list -hw_clock -noinit_threshold'
, 'tsdequehw2tsnt' : 'tsdeque -2ts -hw_clock -noinit_threshold'
, 'tsdequeshw' : 'tsdeque -list -hw_clock -init_threshold'
, 'tsdequeshw2ts' : 'tsdeque -2ts -hw_clock -init_threshold'
, 'tsdequeqhw' : 'tsdeque -list -hw_clock -init_threshold'
, 'tsdequeqhw2ts' : 'tsdeque -2ts -hw_clock -init_threshold'
, 'tsdequedhw' : 'tsdeque -list -hw_clock -init_threshold'
, 'tsdequedhw2ts' : 'tsdeque -2ts -hw_clock -init_threshold'
, 'tsdequehw2ts' : 'tsdeque -2ts -hw_clock -init_threshold -delay 15000' #250: 17500 2000: 15000
, 'tsdequeshw' : 'tsdeques -list -hw_clock -init_threshold'
, 'tsdequeshw2ts' : 'tsdeques -2ts -hw_clock -init_threshold -delay 10000' #250: 15000 2000: 10000
, 'tsdequeqhw' : 'tsdequeq -list -hw_clock -init_threshold'
, 'tsdequeqhw2ts' : 'tsdequeq -2ts -hw_clock -init_threshold -delay 25000' #250: 25000 2000: 25000
, 'tsdequeqstutter' : 'tsdequeq -list -stutter_clock -init_threshold'
, 'tsdequeqatomic' : 'tsdequeq -list -atomic_clock -init_threshold'
, 'tsdequedhw' : 'tsdequed -list -hw_clock -init_threshold'
, 'tsdequedhw2ts' : 'tsdequed -2ts -hw_clock -init_threshold -delay 15000' #250: 25000 2000: 15000
, 'lcrq': 'lcrq -noreuse_memory'
}

#hasPartials = ['scal2random', 'scalrr', 'uskfifo', 'bskfifo', 'scal1random', 'scaltlrr', 'sq', 'rd']
Expand Down Expand Up @@ -121,22 +120,30 @@
# have the same placeholders.
templates = {
'prodcon': '@../prodcon-{exe} -producers {thread} '
+ '-consumers {thread} -operations 10000 -c {work} -prealloc_size 500m '
+ '-consumers {thread} -operations 1000000 -c {work} -prealloc_size 500m '
+ '{partials_param} {partials} {perfParam} -noset_rt_priority '
+ '> {filename}'

, 'delay250': '@../prodcon-{exe} -producers {thread} -consumers {thread} '
+ '-operations 1000000 -c 250 {partials_param} {partials} -delay {work} '
+ '{perfParam} -noset_rt_priority -prealloc_size 1g > {filename}'

, 'delay2000': '@../prodcon-{exe} -producers {thread} -consumers {thread} '
+ '-operations 1000000 -c 2000 {partials_param} {partials} -delay {work} '
+ '{perfParam} -noset_rt_priority -prealloc_size 1g > {filename}'

, 'enq': '@../prodcon-{exe} -producers {thread} -consumers 0 '
+ '-operations 10000 -c {work} {partials_param} {partials} '
+ '{perfParam} -noset_rt_priority -prealloc_size 250m > {filename}'
+ '-operations 1000000 -c {work} {partials_param} {partials} '
+ '{perfParam} -noset_rt_priority -prealloc_size 1g > {filename}'

, 'infprod': '@../prodcon-{exe} -producers {thread} -consumers {thread} '
+ '-operations 150000 -measure_at 10000 -c {work} '
+ '{partials_param} {partials} '
+ '{perfParam} -noset_rt_priority -prealloc_size 1g > {filename}'

, 'deq': '@../prodcon-{exe} -producers {thread} -consumers {thread} '
+ '-operations 10000 -c {work} {partials_param} {partials} -barrier '
+ '{perfParam} -noset_rt_priority -prealloc_size 500m > {filename}'
+ '-operations 1000000 -c {work} {partials_param} {partials} -barrier '
+ '{perfParam} -noset_rt_priority -prealloc_size 1g > {filename}'

, 'seqalt' : '@../seqalt-{exe} -allow_empty_returns -threads {thread} '
+ '-elements 10000 -c {work} {partials_param} {partials} {perfParam} '
Expand All @@ -154,6 +161,12 @@
, 'enq': '@{directory}{queue}-t{thread}{partials_param}{partials}'
+ '-c{work}.txt'

, 'delay250': '@{directory}{queue}-t{thread}{partials_param}{partials}'
+ '-c{work}.txt'

, 'delay2000': '@{directory}{queue}-t{thread}{partials_param}{partials}'
+ '-c{work}.txt'

, 'infprod': '@{directory}{queue}-t{thread}{partials_param}{partials}'
+ '-c{work}.txt'

Expand Down
44 changes: 44 additions & 0 deletions tools/make_data_files_load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os;
import sys;

def makeDataFiles(directory):

if (not os.path.exists(directory)) or not os.path.isdir(directory):
print ("The directory {directory} does not exist.".format(directory = directory))
return

filenames = os.listdir(directory)
queues = {}

for filename in filenames:

if os.path.isfile(os.path.join(directory, filename)) :
parts = filename.replace('.txt', '').split('-c')

if len(parts) >= 2 :
if not parts[0] in queues:
queues[parts[0]] = []

queues[parts[0]].append((int(parts[1]), filename))

for queue in queues:
queues[queue] = sorted(queues[queue])

resultFilename = os.path.join(directory, queue + '-all.txt')

print (resultFilename)
if os.path.exists(resultFilename) :
os.remove(resultFilename)

resultFile = open(resultFilename, 'w')

for parts in queues[queue]:
data = open(os.path.join(directory, parts[1]), 'r')
resultFile.write("" + str(parts[0]) + " " + data.read())

resultFile.close()

if len(sys.argv) < 2:
print ("python make_data_files.py <directory>")
else :
makeDataFiles(sys.argv[1])

0 comments on commit 05e6168

Please sign in to comment.