Ignore:
Timestamp:
Mar 30, 2023, 9:48:06 PM (13 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master
Children:
0b66ef9
Parents:
70056ed (diff), 6e83384 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/colby_parsons_MMAth/benchmarks/channels/plotData.py

    r70056ed reb47a80  
    3636    procs.append(int(val))
    3737
    38 # 3rd line has num locks args
    39 line = readfile.readline()
    40 locks = []
    41 for val in line.split():
    42     locks.append(int(val))
    43 
    44 # 4th line has number of variants
     38# 3rd line has number of variants
    4539line = readfile.readline()
    4640names = line.split()
     
    5044lines = (line for line in lines if line) # Non-blank lines
    5145
     46class Bench(Enum):
     47    Unset = 0
     48    Contend = 1
     49    Zero = 2
     50    Barrier = 3
     51    Churn = 4
     52    Daisy_Chain = 5
     53    Hot_Potato = 6
     54    Pub_Sub = 7
     55
    5256nameSet = False
    53 currLocks = -1 # default val
     57currBench = Bench.Unset # default val
    5458count = 0
    5559procCount = 0
    5660currVariant = 0
    57 name = "Aggregate Lock"
     61name = ""
    5862var_name = ""
    5963sendData = [0.0 for j in range(numVariants)]
     
    6468    # print(line)
    6569   
    66     if currLocks == -1:
    67         lineArr = line.split()
    68         currLocks = lineArr[-1]
     70    if currBench == Bench.Unset:
     71        if line == "contend:":
     72            name = "Contend"
     73            currBench = Bench.Contend
     74        elif line == "zero:":
     75            name = "Zero"
     76            currBench = Bench.Zero
     77        elif line == "barrier:":
     78            name = "Barrier"
     79            currBench = Bench.Barrier
     80        elif line == "churn:":
     81            name = "Churn"
     82            currBench = Bench.Churn
     83        elif line == "daisy_chain:":
     84            name = "Daisy_Chain"
     85            currBench = Bench.Daisy_Chain
     86        elif line == "hot_potato:":
     87            name = "Hot_Potato"
     88            currBench = Bench.Hot_Potato
     89        elif line == "pub_sub:":
     90            name = "Pub_Sub"
     91            currBench = Bench.Pub_Sub
     92        else:
     93            print("Expected benchmark name")
     94            print("Line: " + line)
     95            sys.exit()
    6996        continue
    7097
     
    95122            if currVariant == numVariants:
    96123                fig, ax = plt.subplots()
    97                 plt.title(name + " Benchmark: " + str(currLocks) + " Locks")
    98                 plt.ylabel("Throughput (entries)")
     124                plt.title(name + " Benchmark")
     125                plt.ylabel("Throughput (channel operations)")
    99126                plt.xlabel("Cores")
    100127                for idx, arr in enumerate(data):
    101128                    plt.errorbar( procs, arr, [bars[idx][0], bars[idx][1]], capsize=2, marker='o' )
     129               
    102130                plt.yscale("log")
     131                # plt.ylim(1, None)
     132                # ax.get_yaxis().set_major_formatter(ticks.ScalarFormatter())
     133                # else:
     134                #     plt.ylim(0, None)
    103135                plt.xticks(procs)
    104136                ax.legend(names)
    105                 # fig.savefig("plots/" + machineName + "Aggregate_Lock_" + str(currLocks) + ".png")
    106                 plt.savefig("plots/" + machineName + "Aggregate_Lock_" + str(currLocks) + ".pgf")
     137                # fig.savefig("plots/" + machineName + name + ".png")
     138                plt.savefig("plots/" + machineName + name + ".pgf")
    107139                fig.clf()
    108140
    109141                # reset
    110                 currLocks = -1
     142                currBench = Bench.Unset
    111143                currVariant = 0
Note: See TracChangeset for help on using the changeset viewer.