Changeset 8e64cb4 for benchmark/convoy
- Timestamp:
- Dec 19, 2022, 9:37:47 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 1afda5a2
- Parents:
- fd6e3a4
- Location:
- benchmark/convoy
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/convoy/genConvoyStats.py
rfd6e3a4 r8e64cb4 1 #!/usr/bin/env python3 2 1 3 import os 2 4 import sys … … 15 17 parser.add_argument("-o", "--OutputFile", default='', help="File to write output to") 16 18 parser.add_argument("-v", "--Verbose", help="Verbose output. Will print per run stats alongside aggregates", action='count', default=0) 19 parser.add_argument("-s", "--Single", help="Indicates that input only contains a single run. Assumes the number of threads is the value passed to -m", action='count', default=0) 17 20 18 21 args = parser.parse_args() … … 185 188 expected.append(expectedConvoy) 186 189 187 if args.Verbose :190 if args.Verbose or args.Single: 188 191 output('Convoying bounds: {:.2f}%-{:.2f}%, Expected convoying: {:.2f}%'.format(lowerBoundConvoy,upperBoundConvoy, expectedConvoy)) 189 192 190 193 191 for i in range(args.MaxThreads): 192 output("N: " + str(i+1)) 193 194 goToLineByStartingChars(str(i+1)+' ') 195 for j in range(args.RunsPerNumThds): 196 readInMatrix(i+1) 197 analyzeRun() 198 reset() 199 200 output('Mean convoying bounds: {:.2f}%-{:.2f}%, Mean expected convoying: {:.2f}%'.format(st.mean(minBound), st.mean(maxBound),st.mean(expected))) 201 output('Median convoying bounds: {:.2f}%-{:.2f}%, Median expected convoying: {:.2f}%'.format(st.median(minBound), st.median(maxBound),st.median(expected))) 202 output('') 203 thdReset() 194 if args.Single: 195 output("N: " + str(args.MaxThreads)) 196 goToLineByStartingChars(str(args.MaxThreads)+' ') 197 readInMatrix(int(args.MaxThreads)) 198 analyzeRun() 199 reset() 200 else: 201 for i in range(args.MaxThreads): 202 output("N: " + str(i+1)) 203 204 goToLineByStartingChars(str(i+1)+' ') 205 for j in range(args.RunsPerNumThds): 206 readInMatrix(i+1) 207 analyzeRun() 208 reset() 209 210 output('Mean convoying bounds: {:.2f}%-{:.2f}%, Mean expected convoying: {:.2f}%'.format(st.mean(minBound), st.mean(maxBound),st.mean(expected))) 211 output('Median convoying bounds: {:.2f}%-{:.2f}%, Median expected convoying: {:.2f}%'.format(st.median(minBound), st.median(maxBound),st.median(expected))) 212 output('') 213 thdReset() 204 214 205 215 readFile.close()
Note: See TracChangeset
for help on using the changeset viewer.