Changeset 8e64cb4


Ignore:
Timestamp:
Dec 19, 2022, 9:37:47 PM (19 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
1afda5a2
Parents:
fd6e3a4
Message:

added single run mode and added sample for single run to data

Location:
benchmark/convoy
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • benchmark/convoy/genConvoyStats.py

    rfd6e3a4 r8e64cb4  
     1#!/usr/bin/env python3
     2
    13import os
    24import sys
     
    1517parser.add_argument("-o", "--OutputFile", default='', help="File to write output to")
    1618parser.add_argument("-v", "--Verbose", help="Verbose output. Will print per run stats alongside aggregates", action='count', default=0)
     19parser.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)
    1720
    1821args = parser.parse_args()
     
    185188    expected.append(expectedConvoy)
    186189
    187     if args.Verbose:
     190    if args.Verbose or args.Single:
    188191        output('Convoying bounds: {:.2f}%-{:.2f}%, Expected convoying: {:.2f}%'.format(lowerBoundConvoy,upperBoundConvoy, expectedConvoy))
    189192
    190193
    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()
     194if args.Single:
     195    output("N: " + str(args.MaxThreads))
     196    goToLineByStartingChars(str(args.MaxThreads)+' ')
     197    readInMatrix(int(args.MaxThreads))
     198    analyzeRun()
     199    reset()
     200else:
     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()
    204214
    205215readFile.close()
Note: See TracChangeset for help on using the changeset viewer.