mirror of
https://github.com/RustyRaptor/parallel-programming.git
synced 2026-12-03 15:55:15 -07:00
copied code over and completed fig7 shared mem test
This commit is contained in:
1 parent
4bfbe6f874
commit
7aaa53565c
24 files changed
+6090
No files matched your search
@@ -0,0 +1,39 @@
|
||||
"""
|
||||
This simple program is to quickly parse out the outputs so we can get the average
|
||||
times of the runs. outs.txt must contain the raw console outputs
|
||||
|
||||
"""
|
||||
|
||||
from statistics import mean
|
||||
par = []
|
||||
ser = []
|
||||
|
||||
avgp = []
|
||||
avgs = []
|
||||
|
||||
threads = 0
|
||||
vals = 0
|
||||
|
||||
|
||||
with open('./outs.txt') as reader:
|
||||
lines = reader.readlines()
|
||||
|
||||
for line in lines:
|
||||
if vals == 5:
|
||||
avgp.append(mean(par))
|
||||
avgs.append(mean(ser))
|
||||
par=[]
|
||||
ser=[]
|
||||
vals = 0
|
||||
threads += 1
|
||||
word = line.split(' ')
|
||||
if 'parallel:' in word:
|
||||
par.append(int(word[2]))
|
||||
if 'serial:' in word:
|
||||
ser.append(int(word[4]))
|
||||
vals += 1
|
||||
|
||||
print("ser: ", avgs, "par: ", avgp, threads)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user