Changeset b1a2c4a


Ignore:
Timestamp:
Jul 7, 2021, 6:09:19 PM (13 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation
Children:
a953c2e3, c86ee4c
Parents:
47e413b
Message:

Added first attempt at processing array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/perf/process_stat_array.py

    r47e413b rb1a2c4a  
    3131                with open(os.path.join(root, filename), 'r') as file:
    3232                        for line in file:
    33                                 data = [int(x.strip()) for x in line.split(',')]
     33                                # data = [int(x.strip()) for x in line.split(',')]
     34                                data = [int(line.strip())]
    3435                                data = [me, *data]
    3536                                merged.append(data)
     
    5354
    5455# merge the data
    55 for (me, time, value) in merged:
     56# for (me, time, value) in merged:
     57for (me, value) in merged:
    5658        # check now much this changes
    5759        old = counters[me]
     
    6163        # add change to the current
    6264        curr = curr + change
    63         single.append( (time, curr) )
     65        single.append( value )
    6466
    6567        pass
    6668
     69print(single)
     70
     71# single = sorted(single)[:len(single)-100]
     72# ms = max(single)
     73# single = [float(x) / 2500.0 for x in single]
     74
    6775#print
    68 for t, v in single:
    69         print([t, v])
     76# for t, v in single:
     77#       print([t, v])
     78# print(len(single))
     79# print(max(single))
     80# print(min(single))
     81
     82# bins = [0, 5.37751600e+04, 1.06903320e+05, 1.60031480e+05, 2.13159640e+05, 2.66287800e+05, 3.19415960e+05, 3.72544120e+05, 4.25672280e+05, 4.78800440e+05, 5.31928600e+05, 5.85056760e+05, 6.38184920e+05, 6.91313080e+05, 7.44441240e+05, 7.97569400e+05, 8.50697560e+05, 9.03825720e+05, 9.56953880e+05, 1.01008204e+06, 1.06321020e+06, 1.11633836e+06, 1.16946652e+06, 1.22259468e+06, 1.27572284e+06, 1.32885100e+06, 1.38197916e+06, 1.43510732e+06, 1.48823548e+06, 1.54136364e+06, 1.59449180e+06, 1.64761996e+06, 1.70074812e+06, 1.75387628e+06, 1.80700444e+06, 1.86013260e+06, 1.91326076e+06, 1.96638892e+06, 2.01951708e+06, 2.07264524e+06, 2.12577340e+06, 2.17890156e+06, 2.23202972e+06, 2.28515788e+06, 2.33828604e+06, 2.39141420e+06, 2.44454236e+06, 2.49767052e+06, 2.55079868e+06, 2.60392684e+06, 3.0e+06]
     83# # bins = [float(x) / 2500.0 for x in bins]
     84# # print([round(b, 2) for b in bins])
     85
     86# import numpy
     87# # hist1, _ = numpy.histogram(single, density=True, bins=50)
     88# hist2, _ = numpy.histogram(single, density=True, bins=bins)
     89# # print(hist1)
     90# print([1000.0 * h for h in hist2])
     91# # for v in single:
     92# #     print([v])
Note: See TracChangeset for help on using the changeset viewer.