Exemplo n.º 1
0
def load_serverevents(pathdir):
    # sess handle -> lane id
    with tempfile.NamedTemporaryFile() as f:
        server_output = pathdir/'server.output'
        sp.check_call(['grep', 'lane_assigned', str(server_output)], stdout=f)
        f.flush()
        df = cm.load_generic(f.name, event_filters=['lane_assigned'])
    df = df.drop(['evt', 'level', 'loc', 'thread', 'type'], axis=1)

    # sess handles are unique
    assert len(df.Sess.unique()) == len(df.Sess)

    # make Sess as index so we can lookup
    df = df.set_index('Sess')

    # add a new column
    df['Model'] = None

    # model name -> sess handle
    ptn = re.compile('Created session with handle (?P<sess>.+)$')
    for fpath in pathdir.glob('*.*.*.*.output'):
        with fpath.open() as f:
            for line in f:
                m = ptn.search(line)
                if m:
                    df.loc[m.group('sess'), 'Model'] = fpath.name.rstrip('.output')

    # reset index so we can use that later
    df = df.reset_index()
    return df
Exemplo n.º 2
0
def load_allocmemmap(path):
    df = load_generic(path, event_filters=['alloc', 'dealloc'])
    df = df.drop(['level', 'loc', 'thread', 'type'], axis=1)

    if 'Memmap' in df:
        df['MemMap'] = df['Memmap']
    return df
Exemplo n.º 3
0
def load_refine(pathdir):
    # load preempt select events
    with tempfile.NamedTemporaryFile() as f:
        server_output = pathdir/'server.output'
        sp.check_call(['grep', 'preempt_select_sess', str(server_output)], stdout=f)
        f.flush()
        df = cm.load_generic(f.name, event_filters=['preempt_select_sess'])
    df = df.drop(['evt', 'level', 'loc', 'thread', 'type'], axis=1)

    # convert UTC from server to local
    df['timestamp'] = df.timestamp.dt.tz_localize('UTC').dt.tz_convert('US/Eastern').dt.tz_localize(None)

    sess2Model = {}
    # model name -> sess handle
    ptn = re.compile('Created session with handle (?P<sess>.+)$')
    for fpath in pathdir.glob('*.*.*.*.output'):
        with fpath.open() as f:
            for line in f:
                m = ptn.search(line)
                if m:
                    sess2Model[m.group('sess')] = fpath.name.rstrip('.output')

    # add model name info to it
    df['Model'] = df.Sess.map(sess2Model)

    # make sure every session is covered
    assert df.Model.isnull().sum() == 0

    # for convinent
    df['No'] = pd.to_numeric(df['Model'].str.rpartition('.')[2])

    return df
Exemplo n.º 4
0
def paper_card233(path):
    path = Path(path)
    times = cm.load_generic(path/'card233'/'salus'/'fair'/'perf.output',
                            event_filters=['sess_add_time'])
    
    plt.style.use(['seaborn-paper', 'mypaper'])
    ax = plot_used(times, linewidth=1)
    #pu.axhlines(0.0, ax=ax, color='r', linestyle='--', linewidth=.5)
    
    ax.set_ylim(0, 350)
    #ax.set_xlabel('Workloads')
    #ax.set_ylabel('Normalized Per Iteration\nTraining Time')
    
    #ax.tick_params(axis='x', labelsize=7)
    
    ax.figure.set_size_inches(3.25, 2.35, forward=True)
    ax.figure.tight_layout()
    ax.figure.savefig('/tmp/workspace/card233.pdf', dpi=300)