示例#1
0
文件: gd_plots.py 项目: gkchai/garud
    exp = 'plain'
    samples = 1000
    prior = 99
    sched_range = ['SCHED_FIFO', 'SCHED_RR', 'SCHED_OTHER']
    nants = 4

    stats = {}
    for sched in sched_range:
        obj = utils.read_pickle('../dump/gstat_exp%s_samp%d_prior%d_sched%s_nant%d_nproc%d'%(exp, samples, prior,sched,nants, nprocs))
        stats[sched] = astat(obj.proc['slack'])


    fig = plt.figure(figsize=(4*1.5, 3*1.5))
    ax = plt.gca()
    bins = np.linspace(-500, 2000, 1000)
    plt.plot(bins, stats['SCHED_FIFO'].get_cdf(bins), linewidth=4, label='FIFO')
    plt.plot(bins, stats['SCHED_RR'].get_cdf(bins), linewidth=4, label='RR', color='#999fff')
    plt.plot(bins, stats['SCHED_OTHER'].get_cdf(bins), linewidth=4, label='OTHER', color='black')

    # ax.set_yticks(np.arange(0,6,1))
    plt.xlabel('Slack (us)')
    plt.ylabel('CDF')
    plt.ylim(0,1)
    nospines(ax)
    plt.grid()
    pp = PdfPages('plot/cdf_slack_sched.pdf')
    pp.savefig( bbox_inches='tight', dpi=300)
    pp.close()
    plt.close(fig)

示例#2
0
            z.append(ress[exp_str][2])
        y1.append(y[:])
        y11.append(z[:])

       #############
        # plot 1
        # fig = plt.figure(figsize=(4*1.7, 3*1.7))
        fig = plt.figure(figsize=(8*1.7, 3*1.7))
        ax = plt.gca()

        # for ix, exp in enumerate(exp_range):
        for ix, exp in enumerate(exp_range_str):
            # plt.plot(rtt_range, y1[ix], ls[ix], color=colors_e[ix], mfc='none', label=exp_range_str[ix], ms=14, mec=colors_e[ix], linewidth=4, markeredgewidth=4)

            # if exp == 'static' or exp == 'static2':
            plt.plot(rtt_range, y1[ix], ls[ix], color=colors_e[ix], mfc='none', label=exp_range_str[ix], linewidth=4)

        # plt.grid()
        ax.set_yscale('log')
        plt.xlabel('RTT/2 (us)')
        # plt.xlabel('MCS')
        plt.ylabel('Deadline miss rate')
        plt.ylim(0.001,1.1)
        plt.xlim(350, 600)
        nospines(ax)

        # lg=ax.legend(loc='lower right',numpoints=1, fontsize=20)
        lg=ax.legend(loc='upper left',numpoints=1, fontsize=20)
        if lg is not None:
            lg.draw_frame(False)